Skip to content

Conversation

@Un1q32
Copy link
Contributor

@Un1q32 Un1q32 commented Dec 22, 2025

m_minIdxDirty is uint16_t and cannot hold INT_MAX, compiler truncates it to UINT16_MAX, changed it to use UINT16_MAX explicitly.

Added parenthesis to silence assignment warn.

Explicitly handled all enum cases in switch statements in a bunch of places.

Cast NSInteger to long before using in a printf-like function, also updated the format to expect long instead of int.

Used FLT_{MIN,MAX} macros instead of INT_{MIN,MAX} for maximum float value.

Disabled depricated-declarations warns for iOS.

Disabled all warns for stb_vorbis, nothing we can do about those cuz its a submodule.

Fixed incorrect heap allocation syntax.

Every warn that is not fixed by this PR (for the iOS build at least):

source/world/tile/TorchTile.cpp:162:10: warning: enumeration value 'DOWN' not handled in switch [-Wswitch]
  162 |         switch (face)
      |                 ^~~~

This looks like an actual bug, since the underside of torches are invisible ingame, I don't wanna silence the warn without fixing the bug, which is beyond the scope of this PR.

SynchedEntityData.cpp:23:21: warning: implicit conversion from 'int' to
'DataID' (aka 'unsigned short') changes value from 2147483647 to 65535
[-Wconstant-conversion]
   23 |     m_minIdxDirty = INT_MAX;
      |                   ~ ^~~~~~~
/usr/lib/clang/21/include/limits.h:50:19: note: expanded from macro
'INT_MAX'
   50 | #define INT_MAX   __INT_MAX__
      |                   ^~~~~~~~~~~
<built-in>:78:21: note: expanded from macro '__INT_MAX__'
   78 | #define __INT_MAX__ 2147483647
      |                     ^~~~~~~~~~
ServerSideNetworkHandler.cpp:102:19: warning: using the result of an
assignment as a condition without parentheses [-Wparentheses]
  102 |         else if (pPlayer = getPendingPlayerByGUID(guid))
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/uniq/devel/mcpe/source/server/ServerSideNetworkHandler.cpp:102:19:
note: place parentheses around the assignment to silence this warning
  102 |         else if (pPlayer = getPendingPlayerByGUID(guid))
      |                          ^
      |                  (                                     )
/home/uniq/devel/mcpe/source/server/ServerSideNetworkHandler.cpp:102:19:
note: use '==' to turn this assignment into an equality comparison
  102 |         else if (pPlayer = getPendingPlayerByGUID(guid))
      |                          ^
      |                          ==
ClientSideNetworkHandler.cpp:100:10: warning: enumeration value
'STATUS_SUCCESS' not handled in switch [-Wswitch]
  100 |         switch (pPacket->m_loginStatus)
      |                 ^~~~~~~~~~~~~~~~~~~~~~
TntTile.cpp:25:10: warning: 4 enumeration values not handled in switch:
'NORTH', 'SOUTH', 'WEST'... [-Wswitch]
   25 |         switch (face)
      |                 ^~~~
SandStoneTile.cpp:18:10: warning: 4 enumeration values not handled in
switch: 'NORTH', 'SOUTH', 'WEST'... [-Wswitch]
   18 |         switch (face)
      |                 ^~~~
minecraftpeViewController.mm:300:54: warning: values of type 'NSInteger'
should not be used as format arguments; add an explicit cast to 'long'
instead [-Wformat]
  300 |         NSLog(@"Set animationFrameInterval to %d\n",
animationFrameInterval);
      |                                               ~~
^~~~~~~~~~~~~~~~~~~~~~
      |                                               %ld
static_cast<long>(    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants