Menu

#4 signed 0x80000000 results in -0

open-fixed
None
7
2011-05-05
2011-05-02
No

entering signed 0x80000000 results in -0, which is wrong.
signed 0x80000000 is -2147483648

Discussion

  • Danny Schneider

    Danny Schneider - 2011-05-02

    screenshot

     
  • Danny Schneider

    Danny Schneider - 2011-05-02
    • priority: 5 --> 7
    • assigned_to: nobody --> omnium
     
  • Ryan Harkin

    Ryan Harkin - 2011-05-05
    • status: open --> open-accepted
     
  • Ryan Harkin

    Ryan Harkin - 2011-05-05

    Thanks Danny, and well spotted.
    But wow! Someone other than me uses hextool ;-)

     
  • Ryan Harkin

    Ryan Harkin - 2011-05-05

    From version 1.7.0.0, I changed updatedisplay.c, function UpdateDisplay.

    Line 205 was:

    case NUMBITS_32: SetDlgItemInt ( hDlg, IDC_DECIMAL, (int) value, TRUE ); break;

    But I've changed it to this:

    case NUMBITS_32:
    {
    char text [16];
    wsprintf(text, "%d", value);
    SetDlgItemText ( hDlg, IDC_DECIMAL, text);
    }
    break;

    It seems that if I call SetDlgItemInt with 0x80000000 and set the value as a signed number, Windows decides to print -0.

    I've fixed it here and it works well. If you need a fix urgently, you can patch it yourself and rebuild it.

    I'll make a release at some point soon and upload it either way...

    Thanks again for reporting the problem!

     
  • Ryan Harkin

    Ryan Harkin - 2011-05-05

    OK, I managed to create a release quite easily in the end up... so I've marked it as fixed now.

    Please feel free to test and let me know if it doesn't work for you.

     
  • Ryan Harkin

    Ryan Harkin - 2011-05-05
    • status: open-accepted --> open-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB