Declare platform-independent byteswapping functions QINLINE #869
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.
In addition to enabling inlining for these very simple functions,
this suppresses warnings from gcc 6:
The travis-ci tests on my branch demonstrate this building successfully on g++ and clang, but it would be good if someone could try this on MSVC before merging (hopefully the Appveyor builds do that for us automatically).
static QINLINEprovokes warnings from clang (becauseQINLINEalready containsstaticfor clang), but that isn't a regression: there's a lot of that already. As a follow-up change, it would be good if the OpenJK maintainers could choose one of these options:QINLINEtoinlineor__inline(whichever is supported) on all compilers, the same asID_INLINEin ioquake3; make sure that every C-style function that is declaredQINLINEisstatic QINLINE(this resembles what is done in ioquake3)inlineto__inlineif the compiler doesn't support theinlinekeyword, and replace allQINLINEorstatic QINLINEwithstatic inline(this resembles what is commonly done in Unix-centric open source projects like GLib)QINLINEtostatic inlineorstatic __inline(whichever is supported) on all compilers; make sure that every C-style function that is declaredQINLINEis notstatic QINLINEMy vote would be the first one, since OpenJK seems to be 90% of the way to it already.