-
Notifications
You must be signed in to change notification settings - Fork 757
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
libsndfile: use a macro instead of redefining the struct #5761
Conversation
ae836a9
to
3907231
Compare
server/plugins/DiskIO_UGens.cpp
Outdated
@@ -126,17 +126,17 @@ void DiskIOMsg::Perform() { | |||
memset(buf->data + mPos * buf->channels, 0, mFrames * buf->channels * sizeof(float)); | |||
goto leave; | |||
} | |||
count = sf_readf_float(buf->sndfile, buf->data + mPos * buf->channels, mFrames); | |||
count = sf_readf_float(GetSndFile(buf), buf->data + mPos * buf->channels, mFrames); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may not matter, but I wonder if it is cleaner to store the result of GetSndFile(but) into a variable and pass that around, rather than calling GetSndFile over and over again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's fine because GetSndFile
is just a getter macro and not a real function call. I find it quite readable. After all, it's just 3 characters longer than the original code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dyfer - I think this mostly is fine, but the readability of the change feels a little off to me. that being said, if you feel ok with it, I can go with it as well.
I think in other places, macros use all upper case? Maybe that would help this from looking like a method / class call? GETSNDFILE instead?
Let me know what you think. This is a stylistic question more than a functional one.
It depends. For example, the macros in Anyway, |
I also wasn't convinced by the readability. I'll change it to all caps. |
3907231
to
70ee9a8
Compare
Co-Authored-By: Christof Ressi <info@christofressi.com>
70ee9a8
to
e93a0c8
Compare
Purpose and Motivation
Fixes compatibility with
libsndfile
>=1.1.0Fixes #5756
See #5756 (comment) for previous discussion.
Thanks @Spacechild1 for providing this fix.
I also had to add additional Windows includes in
SC_HiddenWorld.h
, similarly toSC_SndFileHelpers.hpp
.Please review carefully, as I have limited experience with this aspect of the project.
Types of changes
To-do list