Fix 64 bits: use long int in class tables
[nit.git] / src / compiling / compiling_global.nit
index 5ae0cb0..c40fcc6 100644 (file)
@@ -474,15 +474,14 @@ redef class MMSrcModule
                        print("No main")
                else
                        var sys = class_by_name(sysname).get_type
-                       var main = sys.select_method(once "init".to_symbol)
-                       if main == null then
-                               main = sys.select_method(once "main".to_symbol)
-                       end
-                       if main == null then
+                       # var initm = sys.select_method(once "init".to_symbol)
+                       var mainm = sys.select_method(once "main".to_symbol)
+                       if mainm == null then
                                print("No main")
                        else
+                               #v.add_instr("G_sys = NEW_{initm.cname}();")
                                v.add_instr("G_sys = NEW_Sys();")
-                               v.add_instr("{main.cname}(G_sys);")
+                               v.add_instr("{mainm.cname}(G_sys);")
                        end
                end
                v.add_instr("return 0;")
@@ -519,7 +518,7 @@ redef class MMSrcModule
                                                v.add_decl("#define {pg.attr_access}(recv) ATTR(recv, {pg.color_id})")
                                        end
                                end
-                               assert p isa MMSrcLocalProperty
+                               assert p isa MMConcreteProperty
                                p.compile_property_to_c(v)
                        end
                end
@@ -557,11 +556,11 @@ end
 
 class TableEltPropPos
 special LocalTableElt
-       attr _property: MMSrcLocalProperty
+       attr _property: MMConcreteProperty
        redef meth symbol do return _property.global.color_id
        redef meth value(ga) do return "{ga.color(self)} /* Property {_property} */"
 
-       init(p: MMSrcLocalProperty)
+       init(p: MMConcreteProperty)
        do
                _property = p
        end
@@ -818,7 +817,7 @@ redef class MMLocalClass
                        if e == null then
                                v.add_instr("\{0} /* Class Hole :( */,")
                        else
-                               v.add_instr("\{(int) {e.compile_to_c(v, self)}},")
+                               v.add_instr("\{(bigint) {e.compile_to_c(v, self)}},")
                        end
                end
                if clen > ctab.length then