Repository: brendanzab/gl-rs (language: rust)

Issue:
"warning: literal out of range for its type" on 32 bit systems
I think this has to do with 32 bit systems (I only get this warning on Windows):

```
src\gl\lib.rs:132:37: 132:55 warning: literal out of range for its type, #[warn(type_overflow)] on by default
src\gl\lib.rs:132 pub static TIMEOUT_IGNORED: GLenum = 0xFFFFFFFFFFFFFFFF;
                                                       ^~~~~~~~~~~~~~~~~~
```



Discussion / hints:
I get this warning on OS X too (which is 64bit). :/

Ah okay. I thought maybe this had to do with GLenum being 32 bit on 32 bit systems and 64 bit on 64 bit systems. But if GLenum is always 32 bit, than #25 should fix the warning.

I wrote I only get this warning on Windows, but just tried on Linux 64 bit again, and it's there too. I missed that, sorry.


Fix patch:
diff --git a/src/gen/main.rs b/src/gen/main.rs
index f36dc74f..499ed71a 100644
--- a/src/gen/main.rs
+++ b/src/gen/main.rs
@@ -184,7 +184,7 @@ impl<'a, W: Writer> Generator<'a, W> {
         self.write_str("\n");
     }
 
-    fn write_enum(&mut self, enm: &Enum, ty: &str) {
+    fn write_enum(&mut self, enm: &Enum) {
         let ident = if (enm.ident[0] as char).is_digit() {
             "_" + enm.ident
         } else {
@@ -193,7 +193,10 @@ impl<'a, W: Writer> Generator<'a, W> {
 
         let ty = match ident {
             ~"TRUE" | ~"FALSE" => ~"GLboolean",
-            _ => ty.to_owned(),
+            _ => match enm.ty {
+                Some(~"ull") => ~"GLuint64",
+                _ => ~"GLenum"
+            }
         };
 
         self.write_line(format!("pub static {}: {} = {};", ident, ty, enm.value))
@@ -201,7 +204,7 @@ impl<'a, W: Writer> Generator<'a, W> {
 
     fn write_enums(&mut self) {
         for e in self.registry.enum_iter() {
-            self.write_enum(e, "GLenum");
+            self.write_enum(e);
         }
     }
 
diff --git a/src/gen/registry.rs b/src/gen/registry.rs
index 77cefd4d..493fd385 100644
--- a/src/gen/registry.rs
+++ b/src/gen/registry.rs
@@ -161,6 +161,7 @@ pub struct Enum {
     ident: ~str,
     value: ~str,
     alias: Option<~str>,
+    ty: Option<~str>,
 }
 
 pub struct CmdNs {
@@ -516,6 +517,7 @@ impl<'a> RegistryBuilder {
                             ident:  trim_enum_prefix(atts.get("name"), self.ns).to_owned(),
                             value:  atts.get_clone("value"),
                             alias:  atts.find_clone("alias"),
+                            ty:     atts.find_clone("type"),
                         }
                     );
                     self.expect_end_element("enum");
diff --git a/src/gl/lib.rs b/src/gl/lib.rs
index eff5bd1a..f4775590 100644
--- a/src/gl/lib.rs
+++ b/src/gl/lib.rs
@@ -129,7 +129,7 @@ pub static NONE: GLenum = 0;
 pub static TRUE: GLboolean = 1;
 pub static ONE: GLenum = 1;
 pub static INVALID_INDEX: GLenum = 0xFFFFFFFF;
-pub static TIMEOUT_IGNORED: GLenum = 0xFFFFFFFFFFFFFFFF;
+pub static TIMEOUT_IGNORED: GLuint64 = 0xFFFFFFFFFFFFFFFF;
 pub static POINTS: GLenum = 0x0000;
 pub static LINES: GLenum = 0x0001;
 pub static LINE_LOOP: GLenum = 0x0002;


Test patch: