Jump to content
  • 0

warning: large integer implicitly truncated to unsigned type [-Woverflow]


CyberDevil

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Hello people,
I've just updated rAthena from the github repository and when I compile the server, I get these 2 WARNING:

        CXX     int_storage.cpp
int_storage.cpp: In function bool mapif_load_guild_storage(int, uint32, int, char)’:
int_storage.cpp:201:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
   WFIFOW(fd,2) = sizeof(struct s_storage)+13;
                ^
int_storage.cpp: In function void mapif_storage_data_loaded(int, uint32, char, s_storage*, bool)’:
int_storage.cpp:469:43: warning: large integer implicitly truncated to unsigned type [-Woverflow]
  uint16 size = sizeof(struct s_storage) + 10;
                                           ^

The same problem (with screenshots) has been indicated here:

https://github.com/rathena/rathena/issues/3570

but I do not know how to solve it... if I start the server I recived this specific error:

Quote

[11/Feb 10:24][Error]: s_storage size = 72024 is too big to be transmitted. (must be below 0xFFFF)

do you have any suggestions?

 

EDIT: I noticed that in the file "/src/common/mmo.hpp" if I lower the value "#define MAX_STORAGE" from my custom value 900 to the default value of 600, in this case everything works... but how do I keep the custom value of 900 without errors?

Edited by CyberDevil
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Unfortunately I'm not a good coder but I arrange with what I find around... I do not know how to apply this your suggestion (which is still for Hercules), but I have found a temporary fix that seems to work, that is this:

Quote

 

Change in /src/common/mmo.hpp:

#define MAX_ITEM_RDM_OPT 5 /// Max item random option [Napster]

from 5 to 4

> #define MAX_ITEM_RDM_OPT 4 /// Max item random option [Napster]

 

I believe that this can reduce the size of the packages to be supported by the server without having to decrease the size of the players' storage, but I do not know exactly the function of this option "MAX_ITEM_RDM_OPT" and what it means to reduce it from 5 to 4.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

1 hour ago, CyberDevil said:

Unfortunately I'm not a good coder but I arrange with what I find around... I do not know how to apply this your suggestion (which is still for Hercules), but I have found a temporary fix "that seems to work, that is this:

I believe that this can reduce the size of the packages to be supported by the server without having to decrease the size of the players' storage, but I do not know exactly the function of this option "MAX_ITEM_RDM_OPT" and what it means to reduce it from 5 to 4.

I really believe if you would do a google search on "rathena MAX_ITEM_RDM_OPT"

https://www.google.com/search?q=rathena+MAX_ITEM_RDM_OPT&oq=rathena+MAX_ITEM_RDM_OPT&aqs=chrome..69i57.2459j0j1&sourceid=chrome&ie=UTF-8

will turn out many answer which you can collect for your problem

 

I wonder if you did read the links I posted ... it said something about client packet and storage stuff which I guess you would have not read then

https://rathena.org/board/topic/118062-update-broke-my-guild-storage/?do=findComment&comment=356781

This is the line I wanted to show you instead of the links!

The current design implementation only allow saving/loading of approximately 1600 items per storage due to packet size limits.

It is said: " If you don't know anything about it look around or ask someone who really know what it is."

and one more thing source edit can have good effect or bad outcome base on how you edit it.

Edited by utofaery
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

The concept I understood very well and in fact I was also following this discussion to update the size of packages from 65k to128k that would definitely solve the problem: https://github.com/rathena/rathena/issues/1523
The posted fix is here: https://github.com/rathena/rathena/commit/ade1b171ebcb0e9b4e91f97b511fc4b8d0b99bee
But given the difficulty of implementing this complex change for me, I preferred to restore MAX_ITEM_RDM_OPT to 5 and reduce the maximum number of items that can be stored in the kafra, only intervening on the option for VIPs (from 900 slots to 800 slots ... anyway I do not have VIP in the server at the moment and that's okay)... in this way everything works without too many complications!
Thanks anyway for the information.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...