Page 1 of 1

Unsigned vars and indices for all vars

Posted: Tue Feb 19, 2008 10:20 pm
by hellhound66
Removed.

Posted: Wed Feb 20, 2008 9:25 am
by inc.
+1

Yes I also think these do really make sense.

Re: Unsigned vars and indices for all vars

Posted: Wed Feb 20, 2008 7:09 pm
by Trond
hellhound66 wrote: Fred posted, that there would be a casting problem. I say no. It is alway clear, what type a variable has, so it is clear, what castings need to be done.
Although I agree with the request, I still think there are some casting problems. What would you do about this? Convert ulong to a long or long to an ulong?

Code: Select all

ulong.ul = 4294966000
long.l = -10000
Debug ulong
Debug long

If ulong > long
  ; And we have a problem...
EndIf

Posted: Wed Feb 20, 2008 7:35 pm
by hellhound66
Removed.

Posted: Thu Feb 21, 2008 2:55 am
by Dare
Or at quad (or perhaps any level) when signed -v- unsigned comparison, check the sign of the signed var.

If this is negative then the signed var will always be less than and unequal to.

If this is positive then convert signed var to unsigned and compare.

As the compiler knows what is what at compile time it can cut the per-case code.