Fix compiler warnings#23
Merged
Merged
Conversation
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.
The build produced >100 warnings across the tree, dominated by undefined-behavior
casts, K&R-style function declarations, and a deprecated X11 API. This PR fixed that:
Pointer/int casts (
-Wpointer-to-int-cast,-Wvoid-pointer-to-int-cast)FSBrowser.c,FSPathView.c: drop bogusassert((int)ptr)casts thattruncate on 64-bit; the assertion only needs the pointer.
FSBrowser.c,FSFinder.c,FSPanel.c,extnInspector.c: routeWMGetNotificationClientData(...)throughintptr_tbefore narrowing toint.Switch coverage (
-Wswitch)FSBrowser.c,FSPathView.c: addWSDecrementWheel/WSIncrementWheelcases (no-op, matching the existing
WSKnobSlot/WSNoPartarm).FSFileView.c: handleFileLinkinFSUpdateFileViewPath; treated likeFileCopysince it introduces a new entry into the view.Missing prototypes (
-Wdeprecated-non-prototype)FSUtils.h: giveFSUpdateFileViewa real prototype (was()).magic.c,regexp/regexp.c,regexp/regsub.c,regexp/regerror.c,regexp/regexp.h: convert all K&R declarations and definitions to ANSIprototypes. Pure mechanical rewrite; no behavior change.
Misc
FSFileView.c: drop extraneous parens inif ((x == y))(
-Wparentheses-equality).FSUtils.c: replaceWMColor*with anRColorliteral in the call toWMCreateBlendedPixmapFromFile, which actually takesconst RColor*(
-Wincompatible-pointer-types).FSPanel.c: replaceif (txt != ICONDIR)pointer-literal compare with anexplicit "allocated" flag (
-Wstring-compare).xmodifier.c: replace deprecatedXKeycodeToKeysymwithXkbKeycodeToKeysym(-Wdeprecated-declarations).