Repository navigation
Fix macOS core build warnings (and bundled addons) - #8621
Open
danzeeeman wants to merge 2 commits into
Open
danzeeeman wants to merge 2 commits into
danzeeeman wants to merge 2 commits into
Conversation
Clears the mechanical warnings reported by a clean `make Release` of libs/openFrameworks on macOS (clang, -Wall). No behavior or API changes. Core (libs/openFrameworks): - ofEvents.cpp, ofFpsCounter.cpp: reorder constructor initializer lists to match member declaration order (-Wreorder-ctor). - ofColor.h: explicit static_cast<float> in ofColor_::limit() for the integer specializations (-Wimplicit-const-int-float-conversion). The value is unchanged; the cast only makes the existing rounding explicit. - ofPixels.cpp: remove unused local `bytesPerPixel`. - ofFileUtils.cpp: remove unused static `natural()` comparator. - ofLog.h: scope a -Wformat-security suppression around ofVAArgsToString(), which intentionally forwards a caller-supplied printf format. Existing format semantics are preserved. - ofAVFoundationVideoPlayer.m: remove unused `currentSampleRate`. - ofAVEngineSoundPlayer.mm: remove an unused `error` in init; mark variables that are only used in the iOS (#ifndef TARGET_OSX) paths as [[maybe_unused]] so iOS builds are unaffected. Bundled addons: - ofxOpenCv: add using-declarations (ofBaseDraws::draw in ofxCvContourFinder, ofxCvImage::setRoiFromPixels in ofxCvFloatImage) to stop hidden overloaded virtuals (-Woverloaded-virtual). - ofxAssimp: remove unused private field mOfTexType; mark the set-but-unused bFinishedTransition [[maybe_unused]] (referenced only in commented-out logging). - ofxSvg: remove unused local bFoundValidNextChar. Intentionally not addressed here: - -Wliteral-conversion in ofAVEngineSoundPlayer.mm (dispatch_time is given float seconds, so the delay is currently 0 ns); fixing it would change interruption timing. - OpenGL deprecation warnings (CVOpenGLTexture*, NSOpenGLContext) in ofAVFoundationPlayer.mm and ofSystemUtils.cpp; no replacement exists while core renders with OpenGL. - libs/utf8 and other external libraries. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…acOS
Finishes the macOS core warning cleanup started in the previous commit.
A clean `make Release` of libs/openFrameworks now reports no warnings
outside libs/utf8.
ofAVEngineSoundPlayer.mm: dispatch_time() takes a delta in nanoseconds
(int64_t), but four call sites passed float seconds (0.033f, 0.017f,
0.3f, 0.3f). The float was truncated to 0, so these "delayed" blocks
actually ran on the next main-queue turn (-Wliteral-conversion). They
now use the intended delays via NSEC_PER_MSEC:
- 0.033f -> 33 * NSEC_PER_MSEC (interruption handling)
- 0.017f -> 17 * NSEC_PER_MSEC (restore play count)
- 0.3f -> 300 * NSEC_PER_MSEC (two play() retries while the
session is interrupted / config
change pending)
This is a real behavior change: these blocks are now actually deferred.
Audio interruption / route change / media-services-reset handling
should be exercised in the sound examples.
ofAVFoundationPlayer.mm, ofSystemUtils.cpp: the remaining
-Wdeprecated-declarations are Apple's OpenGL deprecations
(CVOpenGLTexture*, NSOpenGLContext). openFrameworks core renders with
OpenGL and there is no drop-in replacement, so wrap just those calls in
scoped `#pragma clang diagnostic push/ignored/pop` rather than disabling
the warning for the whole file or build.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
danoli3
requested changes
Oct 28, 2026
danoli3
left a comment
Member
There was a problem hiding this comment.
I will run some more analysis but yeah some changes unsure about. Generally ordering stuff is good! annoying warnings ive seen for too long.
Member
There was a problem hiding this comment.
I cant remember why but this was important
| } | ||
|
|
||
| //------------------------------------------------------------------------------------------------------------ | ||
| static bool natural(const ofFile& a, const ofFile& b) { |
| if (bSampleAudio) { | ||
| // really? | ||
| double preferredHardwareSampleRate = 44100; | ||
| double currentSampleRate = preferredHardwareSampleRate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Core (libs/openFrameworks)
Bundled addons
Behavior change: ofAVEngineSoundPlayer.mm
Four dispatch_time() calls passed float seconds (0.033f, 0.017f, 0.3f, 0.3f) where nanoseconds are expected. They were truncated to 0, so the "delayed" blocks ran on the next main-queue turn. They now use the intended delays (33 ms, 17 ms, 300 ms, 300 ms) via NSEC_PER_MSEC. This affects the audio interruption, restore-play-count and interrupted play() retry paths.