-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reading settings option list (getSettingInfo) fails using C if no option names set #377
Comments
Just swappig the |
Yep that should work, I'm happy to create a PR. |
Now, if the option names are not supplied (as they are optional), the Honestly, I'd just shove -static inline char **toStrArray(const std::vector<std::string> &strs, size_t *length)
-{
- auto out = callocArrayType<char *>(strs.size());
+static inline char **toStrArray(const std::vector<std::string> &strs, size_t *length, size_t minLength = 0)
+{
+ auto out = callocArrayType<char *>(std::max(minLength, strs.size())); What do you think? |
Good point and a nice fix indeed. PR if you like. |
Another way would be to copy options into optionNames when the |
… provided This prevents clients from reading junk values, as the optionNames array is also optional. See: pothosware#377 (comment)
This prevents clients from reading junk values, as the optionNames array is also optional. pothosware#377 (comment)
This prevents clients from reading junk values, as the optionNames array is also optional. pothosware#377 (comment)
if the settings optionNames is not populated this
SoapySDR/lib/TypeHelpers.hpp
Line 140 in f8c1783
resets the numOptions to 0 so the C api cannot see the options.
the lime driver has an example of not setting optionNames
https://github.com/myriadrf/LimeSuite/blob/e829d3ede6222c1c0fc0e90dcd2050e50569e33d/SoapyLMS7/Settings.cpp#L802-L807
The text was updated successfully, but these errors were encountered: