Partial Revert "compiler: Changed types of Char to uint32_t and NativeString to unsig...
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 9 Jun 2015 14:57:00 +0000 (10:57 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 9 Jun 2015 16:56:10 +0000 (12:56 -0400)
This reverts commit 6b52ea3d5ca77dbcc6edbbf71c1aa9419a019bac.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/cpp.nit
src/nitni/nitni_base.nit

index c64ae33..a2896d3 100644 (file)
@@ -31,6 +31,6 @@ end
 redef class NativeString
        # Get `self` as a `CppString`
        fun to_cpp_string(length: Int): CppString in "C++" `{
-               return new std::string(reinterpret_cast<char*>(self), length);
+               return new std::string(self, length);
        `}
 end
index f5cccc0..23c72d8 100644 (file)
@@ -94,7 +94,7 @@ redef class MClassType
                if name == "Float" then return "double"
                if name == "Int" then return "long"
                if name == "Byte" then return "unsigned char"
-               if name == "NativeString" then return "unsigned char*"
+               if name == "NativeString" then return "char*"
                if mclass.kind == extern_kind then
                        var ctype = mclass.ctype
                        assert ctype != null
@@ -110,7 +110,7 @@ redef class MClassType
                if name == "Float" then return "double"
                if name == "Int" then return "long"
                if name == "Byte" then return "unsigned char"
-               if name == "NativeString" then return "unsigned char*"
+               if name == "NativeString" then return "char*"
                if mclass.kind == extern_kind then return "void*"
                return super
        end