Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/Assert.rux
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Std {
String::From(file) + ":" + Format("{}", line) + ":" + Format("{}", column) +
"\n in function " + String::From(function) + "\n";
Print(output);
Exit(2);
Exit(2u32);
}
}
}
6 changes: 3 additions & 3 deletions Src/Char16.rux
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ module Std {
let cp = value as uint;
if cp < 0x80 {
buf[0] = cp as char8;
return String::From(buf.data, 1);
return String::From(buf.data, 1u);
}
if cp < 0x800 {
buf[0] = (0xC0 | (cp >> 6)) as char8;
buf[1] = (0x80 | (cp & 0x3F)) as char8;
return String::From(buf.data, 2);
return String::From(buf.data, 2u);
}
buf[0] = (0xE0 | (cp >> 12)) as char8;
buf[1] = (0x80 | ((cp >> 6) & 0x3F)) as char8;
buf[2] = (0x80 | (cp & 0x3F)) as char8;
return String::From(buf.data, 3);
return String::From(buf.data, 3u);
}

extend char16 : Display {
Expand Down
8 changes: 4 additions & 4 deletions Src/Char32.rux
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ module Std {
let cp = value as uint;
if cp < 0x80 {
buf[0] = cp as char8;
return String::From(buf.data, 1);
return String::From(buf.data, 1u);
}
if cp < 0x800 {
buf[0] = (0xC0 | (cp >> 6)) as char8;
buf[1] = (0x80 | (cp & 0x3F)) as char8;
return String::From(buf.data, 2);
return String::From(buf.data, 2u);
}
if cp < 0x10000 {
buf[0] = (0xE0 | (cp >> 12)) as char8;
buf[1] = (0x80 | ((cp >> 6) & 0x3F)) as char8;
buf[2] = (0x80 | (cp & 0x3F)) as char8;
return String::From(buf.data, 3);
return String::From(buf.data, 3u);
}
buf[0] = (0xF0 | (cp >> 18)) as char8;
buf[1] = (0x80 | ((cp >> 12) & 0x3F)) as char8;
buf[2] = (0x80 | ((cp >> 6) & 0x3F)) as char8;
buf[3] = (0x80 | (cp & 0x3F)) as char8;
return String::From(buf.data, 4);
return String::From(buf.data, 4u);
}

extend char32 : Display {
Expand Down
2 changes: 1 addition & 1 deletion Src/Char8.rux
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Std {
func ToString(value: char8) -> String {
var buf: char8[1];
buf[0] = value;
return String::From(buf.data, 1);
return String::From(buf.data, 1u);
}

extend char8 : Display {
Expand Down
2 changes: 1 addition & 1 deletion Src/Fatal.rux
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ module Std {
String::From(file) + ":" + Format("{}", line) + ":" + Format("{}", column) +
"\n in function " + String::From(function) + "\n";
Print(output);
Exit(1);
Exit(1u32);
}
}
16 changes: 8 additions & 8 deletions Src/Memory.rux
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module Std::Memory {
@[Target("MacOS")]
func Alloc(size: uint) -> *opaque {
let total = size + HeaderSize;
let mapping = HeapAlloc(GetProcessHeap(), 0, total);
let mapping = HeapAlloc(GetProcessHeap(), 0u32, total);
if mapping == null || (mapping as int64) == -1i64 {
return null;
}
Expand All @@ -112,7 +112,7 @@ module Std::Memory {

@[Target("Windows")]
func Alloc(size: uint) -> *opaque {
return HeapAlloc(GetProcessHeap(), 0, size);
return HeapAlloc(GetProcessHeap(), 0u32, size);
}

@[Target("BSD")]
Expand Down Expand Up @@ -209,7 +209,7 @@ module Std::Memory {

@[Target("Windows")]
func Realloc(ptr: *opaque, size: uint) -> *opaque {
return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
return HeapReAlloc(GetProcessHeap(), 0u32, ptr, size);
}

@[Target("BSD")]
Expand Down Expand Up @@ -254,7 +254,7 @@ module Std::Memory {

@[Target("Windows")]
func Free(ptr: *opaque) {
HeapFree(GetProcessHeap(), 0, ptr);
HeapFree(GetProcessHeap(), 0u32, ptr);
}

@[Target("BSD")]
Expand Down Expand Up @@ -304,22 +304,22 @@ module Std::Memory {

@[Target("BSD")]
func Zero(ptr: *opaque, size: uint) {
Set(ptr, size, 0);
Set(ptr, size, 0i32);
}

@[Target("Illumos")]
func Zero(ptr: *opaque, size: uint) {
Set(ptr, size, 0);
Set(ptr, size, 0i32);
}

@[Target("Linux")]
func Zero(ptr: *opaque, size: uint) {
Set(ptr, size, 0);
Set(ptr, size, 0i32);
}

@[Target("MacOS")]
func Zero(ptr: *opaque, size: uint) {
Set(ptr, size, 0);
Set(ptr, size, 0i32);
}

@[Target("Windows")]
Expand Down
2 changes: 1 addition & 1 deletion Src/Print.rux
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ module Std::Io {
Fatal("string is too long to print");
}
var wideBuf: char16[MaxLength];
let wideLen = MultiByteToWideChar(CodePage::Utf8 as uint32, 0, string, length as int32, wideBuf.data, wideBuf.length as int32);
let wideLen = MultiByteToWideChar(CodePage::Utf8 as uint32, 0u32, string, length as int32, wideBuf.data, wideBuf.length as int32);
Print(wideBuf.data, wideLen as uint);
}

Expand Down
3 changes: 1 addition & 2 deletions Src/String.rux
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module Std {
}

extend String {

func New() -> String {
return String { data: null, length: 0 };
}
Expand Down Expand Up @@ -162,7 +161,7 @@ module Std {

if first == self.length {
return String {
data: Alloc(0) as *char8,
data: Alloc(0u) as *char8,
length: 0
};
}
Expand Down