unit conversions and sign ...

From: Tomas Frydrych (tomasfrydrych_at_yahoo.co.uk)
Date: Mon Nov 17 2003 - 12:37:33 EST

  • Next message: Tomas Frydrych: "commit (HEAD): fix sign of character width measuring"

    I have just spent a better part of two hours chasing a really stupid
    bug caused by mixing uints and sints. The code in question was
    scaling a sint value using the get*Resolution() functions, doing sint
    * uint / uint, which resulted in loss of the sign (I noted the same
    type of code in the ftlu()).

    I do not know if that is standard C behaviour or just MSVC quirk, but
    please when mixing ints of different sing, cast explicitely
    everything to sint.

    Tomas



    This archive was generated by hypermail 2.1.4 : Mon Nov 17 2003 - 12:39:12 EST