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
8 changes: 4 additions & 4 deletions libc-gen/go/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ func strtoll(s, endptr sptr_t, base int32) int64 {
return strtoll_helper(s, endptr, base, 64)
}

func strtoull(s, endptr sptr_t, base int32) uint64 {
return strtoull_helper(s, endptr, base, 64)
func strtoull(s, endptr sptr_t, base int32) int64 {
return int64(strtoull_helper(s, endptr, base, 64))
}

func strtol(s, endptr sptr_t, base int32) int32 {
return int32(strtoll_helper(s, endptr, base, 32))
}

func strtoul(s, endptr sptr_t, base int32) uint32 {
return uint32(strtoull_helper(s, endptr, base, 32))
func strtoul(s, endptr sptr_t, base int32) int32 {
return int32(strtoull_helper(s, endptr, base, 32))
}

func strtod_helper(s, endptr sptr_t, bitSize int) float64 {
Expand Down
4 changes: 2 additions & 2 deletions libc-gen/go/stdlib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func Test_strtoul(t *testing.T) {
store32(memory, cptr_t(endptr), 0)

got := strtoul(start, endptr, tc.base)
if got != tc.want {
t.Fatalf("got %v, want %v", got, tc.want)
if uint32(got) != tc.want {
t.Fatalf("got %v, want %v", uint32(got), tc.want)
}

end := sptr_t(load32(memory, cptr_t(endptr)))
Expand Down
Loading