Merge: Nitsmell : Adding new code smells and print console updated
[nit.git] / lib / core / kernel.nit
index fa7b6f4..6a07060 100644 (file)
@@ -1045,17 +1045,21 @@ universal Char
        #
        #     assert 'A'.is_whitespace  == false
        #     assert ','.is_whitespace  == false
-       #     assert ' '.is_whitespace  == true
+       #     assert ' '.is_whitespace  == true # space
+       #     assert ' '.is_whitespace  == true # non-breaking space
        #     assert '\t'.is_whitespace == true
        fun is_whitespace: Bool
        do
                var i = code_point
-               return i <= 0x20 or i == 0x7F
+               return i <= 0x20 or i == 0x7F or i == 0xA0
        end
 end
 
 # Pointer classes are used to manipulate extern C structures.
 extern class Pointer
+       # C `NULL` pointer
+       new nul `{ return NULL; `}
+
        # Is the address behind this Object at NULL?
        fun address_is_null: Bool `{ return self == NULL; `}
 
@@ -1063,7 +1067,7 @@ extern class Pointer
        fun free `{ free(self); `}
 
        # Use the address value
-       redef fun hash `{ return (long)self; `}
+       redef fun hash `{ return (long)(intptr_t)self; `}
 
        # Is equal to any instance pointing to the same address
        redef fun ==(o) do return o isa Pointer and native_equals(o)