[Gtkradiant] [Bug 1109] Wrong calculation of BEZIERCURVETREE_MAX_INDEX

bugzilla-daemon at zerowing.idsoftware.com bugzilla-daemon at zerowing.idsoftware.com
Tue Sep 12 07:18:30 CDT 2006


http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1109





------- Additional Comments From ondrej at svetlik.info  2006-09-12 07:18 -------
> should do the same on 64 Bit archs

they don't as the whole expression is calculated as 32 bit (cast by the first
part of the expression - 32 bit constant 1)

I agree, that the whole expression is ugly.

Your way produces the same result:
> cat size_t.cpp
#include <iostream>
#include <limits>

int main(void) {
  std::cout << (1 << ((sizeof(std::size_t) * 8) - 1)) << std::endl;
  std::cout << (((std::size_t) 1) << ((sizeof(std::size_t) * 8) - 1)) << std::endl;
  std::cout << (std::numeric_limits<size_t>::max() / 2 + 1) << std::endl;
}
> g++ -o size_t size_t.cpp size_t.cpp: In function ‘int main()’:
size_t.cpp:5: warning: left shift count >= width of type
> ./size_t
0
9223372036854775808
9223372036854775808
>


-- 
Configure bugmail: http://zerowing.idsoftware.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Gtkradiant mailing list