Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Unsigned number problem

Unsigned number problem

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Zeno   USA  (2,871 posts)  Bio
Date Fri 18 Jul 2003 01:25 AM (UTC)

Amended on Fri 18 Jul 2003 01:30 AM (UTC) by Zeno

Message
I made a variable in mud.h that is unsigned long long, and displayed it with %llu. Now when I do a copyover, and the number is above 2 billion (or whatever the last number was) it changes to another number, seemingly a random one, like 18446744072414584320. Could anyone help me with this?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Tue 22 Jul 2003 04:17 AM (UTC)
Message
Ok, I know what it is, kinda. I'm getting a overflow whenever a copyover is done. If the variable is below 2bil (int) then it doesn't overflow. But I don't know how to fix it. I'm still looking into it, but if someone could reply, it'd save me time.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 22 Jul 2003 04:58 AM (UTC)
Message
I haven't used copyover so I can't help, sorry. How does the player data get saved and restored after a copyover? Is there a temporary variable that is only an int, for instance?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Tue 22 Jul 2003 05:48 AM (UTC)
Message
Actually it happens also with a reboot, so its not copyover.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #4 on Tue 22 Jul 2003 05:52 AM (UTC)
Message
Check how the variable is read in - the read routine is probably not designed for long long.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Tue 22 Jul 2003 04:26 PM (UTC)
Message
Err, where would I find that?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Tue 22 Jul 2003 11:02 PM (UTC)
Message
You said you made a variable - where do you save it, and where do you read it in on a restart? If you don't know that, then it probably isn't read in anyway. Try searching for the variable name in all the .c files.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Wed 23 Jul 2003 07:42 PM (UTC)

Amended on Wed 23 Jul 2003 08:56 PM (UTC) by Zeno

Message
My bad. I just had to change fread_number to unsigned long long.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,186 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.