diff --git a/c_bindings/test_answers.txt b/c_bindings/test_answers.txt index ee51443c..d24fea5a 100644 --- a/c_bindings/test_answers.txt +++ b/c_bindings/test_answers.txt @@ -23,7 +23,7 @@ hello! None ====== test voidp methods ====== - + 123 ====== test sizing and indexing ====== diff --git a/include/pocketpy/str.h b/include/pocketpy/str.h index 4cfc7e2f..ad80f5a6 100644 --- a/include/pocketpy/str.h +++ b/include/pocketpy/str.h @@ -141,7 +141,7 @@ struct SStream{ SStream& operator<<(const char*); SStream& operator<<(int); SStream& operator<<(unsigned int); - SStream& operator<<(unsigned long); + SStream& operator<<(uint64_t); SStream& operator<<(i64); SStream& operator<<(f64); SStream& operator<<(const std::string&); diff --git a/src/repl.cpp b/src/repl.cpp index 6266c844..da66c21d 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -3,7 +3,7 @@ namespace pkpy { REPL::REPL(VM* vm) : vm(vm){ vm->stdout_write("pocketpy " PK_VERSION " (" __DATE__ ", " __TIME__ ") "); - vm->stdout_write(fmt("[", (int)sizeof(void*)*8, " bit] on ", kPlatformStrings[PK_SYS_PLATFORM], "\n")); + vm->stdout_write(fmt("[", sizeof(void*)*8, " bit] on ", kPlatformStrings[PK_SYS_PLATFORM], "\n")); vm->stdout_write("https://github.com/blueloveTH/pocketpy" "\n"); vm->stdout_write("Type \"exit()\" to exit." "\n"); } diff --git a/src/str.cpp b/src/str.cpp index 6b657016..ccb0a43d 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -473,8 +473,8 @@ int utf8len(unsigned char c, bool suppress){ return (*this) << static_cast(val); } - SStream& SStream::operator<<(unsigned long val){ - // unsigned long could be out of range of `i64`, use `std::to_string` instead + SStream& SStream::operator<<(uint64_t val){ + // uint64_t could be out of range of `i64`, use `std::to_string` instead return (*this) << std::to_string(val); }