Jump to content
  • 0

How to fix possible loss of data error


kalabasa

Question


  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

this is my 2nd encounter this kind of errors i get this when i try to play with the src's codes to try out things and recieving errors though i revert it back to the original state  like this

========== Build: 11 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========    <---

the error wont disappear though it is running fine i dont know if there's an impact upon not removing this error below is what i am getting now

i just want to remove these warning errors when building

Severity    Code    Description    Project    File    Line    Suppression State
Warning    C4244    'initializing': conversion from 'double' to 'const int', possible loss of data    map-server    c:\users\user\documents\ra pre-re\rathena\src\map\instance.cpp    728    
Warning    C4244    'initializing': conversion from 'double' to 'int', possible loss of data    map-server    c:\users\user\documents\ra pre-re\rathena\src\map\instance.cpp    727    
Warning    C4244    'initializing': conversion from 'double' to 'const int', possible loss of data    map-server    c:\users\user\documents\ra pre-re\rathena\src\map\instance.cpp    727    
Warning    C4244    'initializing': conversion from 'double' to 'int', possible loss of data    map-server    c:\users\user\documents\ra pre-re\rathena\src\map\instance.cpp    728    
 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

this happens because there are data types that can make your variable loss some data..
you must learn what are data types first and what are their scopes.. needless to say, the warning already told you the error.. a 'double' data type can store decimal number while an 'int' type can only store integers(whole number).. So with that in mind, you cannot convert '10.5' into an integer because if you do so, it will result into a whole number '10' leaving the '.5' behind which will cause a loss of data..
to fix things like this.. you simply need to make sure that you are passing a data to it's correct data type..

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

might read that to have some glimpse onto it but i havent touch that part i was tinkering on battle.cpp that time wondering how i got error on that file

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  224
  • Reputation:   4
  • Joined:  02/09/12
  • Last Seen:  

Even In clean rathena git im having this error

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

I just took a look at the latest rAthena and yes this shows error due to the pull of instance mapname.. you just need to edit pow() to (int)pow();

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...