[CF-Devel] python setquantity()
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Tue Aug 3 17:15:01 CDT 2004
Yann Chachkoff wrote:
>
Le mercredi 21 Juillet 2004 03:43, Todd Mitchell a écrit :
>
I have to admit that I don't remember anymore why I put an arbitrary limit -
>
probably that was just a workaround for an obscure bug involving large
>
quantities of a single object.
There are probably other arbitrary limits in the ocde.
>
>
The clean way to correct it is to:
>
>
- Include <limits.h> system header (you can do it in the plugin.h specific
>
plugin header. Since it is theorically part of the ANSI-C definition, it
>
should exist on Win32 as well);
>
>
- Test value against INT_MAX, which holds the maximum acceptable value for the
>
integer type.
Only useful if the value in question is a long (64 bit value). Otherwise,
you've already overflowed the value you are testing against, which probably
doesn't get you the results you want.
_______________________________________________
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