On May 26, 2020, at 12:00 PM, pd-dev-request@lists.iem.at wrote:
To Pd dev -
I'm trying to get out s 'bugfix' release 0.50-3 containing networking updates and the new code-signing step fro the latest MacOS.
I agree with IOhannes as this is definitely not a bug fix release any more. It's basically 0.51 and many of the help file updates also reflect that.
But meanwhile I can't seem to get Pd to read preferences on a macintosh any more. This is the first time I've tested using the new preferences interface for Mac, commit cc64c629a (Nov 20 2019, so newer than Pd 0.50-2).
It looks like this line:
const char *s = CFStringGetCStringPtr((CFStringRef)v, kCFStringEncodingUTF8);
is always returning null.
It seems that, in certain situations, CFStringGetCStringPtr returns NULL even if the string is valid:
https://stackoverflow.com/questions/9166291/converting-a-cfstringref-to-char https://stackoverflow.com/questions/9166291/converting-a-cfstringref-to-char
I did not see that in my testing but it could be a different strings settings you are reading as compared to mine and/or slightly different behavior between OS versions.
I can look into this later tonight.
-------- Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
This is fixed by using CFStringGetCString() instead of CFStringGetCStringPtr().
The Apple docs mention that CFStringGetCStringPtr may return NULL even if the string value is valid. It then mentions to use CFStringGetCString as a backup. In this case, we need to have our own copy so it makes sense to simply use CFStringGetCString anyway.
The relevant commit is now in the develop branch:
https://github.com/pure-data/pure-data/pull/1038/commits/241a11fa670f10ed0dc... https://github.com/pure-data/pure-data/pull/1038/commits/241a11fa670f10ed0dc8f389dd026079e1b84d39
On May 26, 2020, at 3:08 PM, Dan Wilcox danomatika@gmail.com wrote:
But meanwhile I can't seem to get Pd to read preferences on a macintosh any more. This is the first time I've tested using the new preferences interface for Mac, commit cc64c629a (Nov 20 2019, so newer than Pd 0.50-2).
It looks like this line:
const char *s = CFStringGetCStringPtr((CFStringRef)v, kCFStringEncodingUTF8);
is always returning null.
It seems that, in certain situations, CFStringGetCStringPtr returns NULL even if the string is valid:
https://stackoverflow.com/questions/9166291/converting-a-cfstringref-to-char https://stackoverflow.com/questions/9166291/converting-a-cfstringref-to-char
I did not see that in my testing but it could be a different strings settings you are reading as compared to mine and/or slightly different behavior between OS versions.
I can look into this later tonight.
-------- Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/