diff --git a/examples/winapi/winapi.q b/examples/winapi/winapi.q index be63231..213f1ed 100644 --- a/examples/winapi/winapi.q +++ b/examples/winapi/winapi.q @@ -1,5 +1,5 @@ extern user32 { - MessageBoxA(window *any, text *int8, title *int8, flags uint) -> int + MessageBoxA(window *any, text *byte, title *byte, flags uint) -> int } main() { diff --git a/lib/io/io.q b/lib/io/io.q index c741271..5c66a29 100644 --- a/lib/io/io.q +++ b/lib/io/io.q @@ -6,22 +6,22 @@ const std { err 2 } -in(buffer []int8) -> int { +in(buffer []byte) -> int { return sys.read(std.in, buffer, len(buffer)) } -out(buffer []int8) -> int { +out(buffer []byte) -> int { return sys.write(std.out, buffer, len(buffer)) } -error(buffer []int8) -> int { +error(buffer []byte) -> int { return sys.write(std.err, buffer, len(buffer)) } -read(fd int, buffer []int8) -> int { +read(fd int, buffer []byte) -> int { return sys.read(fd, buffer, len(buffer)) } -write(fd int, buffer []int8) -> int { +write(fd int, buffer []byte) -> int { return sys.write(fd, buffer, len(buffer)) } \ No newline at end of file diff --git a/lib/log/number.q b/lib/log/number.q index c292167..4945f93 100644 --- a/lib/log/number.q +++ b/lib/log/number.q @@ -8,7 +8,7 @@ number(x int) { mem.free(buffer) } -itoa(x int, buffer []int8) -> (*any, int) { +itoa(x int, buffer []byte) -> (*any, int) { end := buffer + len(buffer) tmp := end digit := 0 diff --git a/lib/mem/alloc_linux.q b/lib/mem/alloc_linux.q index f7178a2..061693a 100644 --- a/lib/mem/alloc_linux.q +++ b/lib/mem/alloc_linux.q @@ -1,6 +1,6 @@ import sys -alloc(length int) -> []int8 { +alloc(length int) -> []byte { x := sys.mmap(0, length+8, prot.read|prot.write, map.private|map.anonymous) if x < 0x1000 { diff --git a/lib/mem/alloc_mac.q b/lib/mem/alloc_mac.q index fe0f500..a559240 100644 --- a/lib/mem/alloc_mac.q +++ b/lib/mem/alloc_mac.q @@ -1,6 +1,6 @@ import sys -alloc(length int) -> []int8 { +alloc(length int) -> []byte { x := sys.mmap(0, length+8, prot.read|prot.write, map.private|map.anonymous) if x < 0x1000 { diff --git a/lib/mem/alloc_windows.q b/lib/mem/alloc_windows.q index c5b74de..d48fe0a 100644 --- a/lib/mem/alloc_windows.q +++ b/lib/mem/alloc_windows.q @@ -1,6 +1,6 @@ import sys -alloc(length int) -> []int8 { +alloc(length int) -> []byte { x := sys.mmap(0, length+8, page.readwrite, mem.commit|mem.reserve) if x < 0x1000 { diff --git a/src/types/ByName.go b/src/types/ByName.go index bba1c17..c1e9d96 100644 --- a/src/types/ByName.go +++ b/src/types/ByName.go @@ -49,14 +49,16 @@ func ByName(name string, pkg string, structs map[string]*Struct) Type { return UInt16 case "uint8": return UInt8 + case "byte": + return Byte + case "bool": + return Bool case "float": return Float case "float64": return Float64 case "float32": return Float32 - case "bool": - return Bool case "any": return Any } diff --git a/src/types/Common.go b/src/types/Common.go index 87d5889..3d2a870 100644 --- a/src/types/Common.go +++ b/src/types/Common.go @@ -10,11 +10,12 @@ var ( Int8 = &Base{name: "int8", size: 1} Float64 = &Base{name: "float64", size: 8} Float32 = &Base{name: "float32", size: 4} - String = &Array{Of: Int8} + String = &Array{Of: Byte} ) var ( Bool = Int + Byte = UInt8 Int = Int64 Float = Float64 UInt = Int