[Gtkradiant] [Bug 1109] New: Wrong calculation of BEZIERCURVETREE_MAX_INDEX

bugzilla-daemon at zerowing.idsoftware.com bugzilla-daemon at zerowing.idsoftware.com
Mon Sep 11 07:12:39 CDT 2006


           Summary: Wrong calculation of BEZIERCURVETREE_MAX_INDEX
           Product: GtkRadiant
           Version: 1.5
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: editor
        AssignedTo: gtkradiant at zerowing.idsoftware.com
        ReportedBy: ondrej at svetlik.info

This probably shows only on 64bit architecture, but it is critical.

const std::size_t BEZIERCURVETREE_MAX_INDEX = 1 << ((sizeof(std::size_t) * 8) - 1);

Compiler warns about this:
radiant/patch.h:118: warning: left shift count >= width of type

To fix this, you have to cast the constant (1) properly:
const std::size_t BEZIERCURVETREE_MAX_INDEX = ((std::size_t) 1) <<
((sizeof(std::size_t) * 8) - 1);

Current version results to 0.
Fixed version results to 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