[CF-Devel] Some warning cleaning

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Tue Mar 2 02:03:27 CST 2004


>
     
       Well, I don't think most of these warnings were that big an issue.
     
     >
     
     
     >
     
       The biggest issue with changing signed/unsigned might be any 
     
     >
     
      variables.  For example, you could have something like:
     
     >
     
     
     >
     
       unsigned u;
     
     >
     
       signed s;
     
     >
     
     
     >
     
       ... where s is set to some positive value ...
     
     >
     
     
     >
     
       u = s;
     
     >
     
     
     >
     
       ... other code where s may now be assigned negative values ..
     
     >
     
     
     >
     
       So if s was changed to unsigned, that could break some code.
     
     >
     
     
     >
     
       Which means to fix those up, the code has to be properly examined to 
     
     >
     
      see if there are any side effects.
     
     
Yes, that's the trouble. In some cases, overflows/invalid 
signed/unsigned casts may happen, but with big values only. So far, 
Crossfire doesn't use high values - stats are capped to 30, stuff like 
that - so that's not an issue. So probably fixing all those isn't that 
useful.

>
     
       no compelling reason.  When was the 'const' keyword added to the C 
     
     >
     
      spec?  Very possible that code predates that code.
     
     
Then I'll change that to const, if only because there's no need for'em 
to be char*. Also I think it'll be safer, just in case...

Nicolas 'Ryo'

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list