diff --git a/src/compat.hh b/src/compat.hh index 4e7ac3c..7653e40 100644 --- a/src/compat.hh +++ b/src/compat.hh @@ -218,20 +218,17 @@ typedef float small_float; #pragma clang diagnostic ignored "-Wnullability-completeness" // A non-nullable pointer to the specified type. #define NONNULL_PTR(...) __VA_ARGS__* _Nonnull -// A null-terminated, read-only array of characters. Can only be used for parameters, use `NONNULL_PTR(const char)` -// elsewhere. +// A null-terminated, read-only array of characters. #define CONST_C_STR const char* _Nonnull #elif defined(_INCLUDED_SAL) // A non-nullable pointer to the specified type. #define NONNULL_PTR(...) _Notnull_ __VA_ARGS__* -// A null-terminated, read-only array of characters. Can only be used for parameters, use `NONNULL_PTR(const char)` -// elsewhere. +// A null-terminated, read-only array of characters. #define CONST_C_STR _In_z_ const char* #else // A non-nullable pointer to the specified type. #define NONNULL_PTR(...) __VA_ARGS__* -// A null-terminated, read-only array of characters. Can only be used for parameters, use `NONNULL_PTR(const char)` -// elsewhere. +// A null-terminated, read-only array of characters. #define CONST_C_STR const char* // gcc's __attribute__((nonnull)) works differently, so I can't wrap it like this. #endif diff --git a/src/input.cpp b/src/input.cpp index adaf229..f382af0 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -52,7 +52,7 @@ static constexpr const char* FLAGS_HELP = "\t--null, -z \tRead the program until null terminator instead of EOF."; namespace flag_container { -static CONSTINIT_LAMBDA std::tuple FLAGS[] = { +static CONSTINIT_LAMBDA std::tuple FLAGS[] = { { "null", 'z', [](flags& f) NOEXCEPT_T { f.null_terminated = true; } }, { "debug", 'd', [](flags& f) NOEXCEPT_T { f.debug = true; } }, { "ascii", 'a', [](flags& f) NOEXCEPT_T { f.assume_ascii = true; } }, diff --git a/src/main.cpp b/src/main.cpp index d7bd47e..8709dfd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,7 +32,7 @@ inline void execute(const std::string& prg, flags f) { #ifdef __EMSCRIPTEN__ #include -extern "C" EMSCRIPTEN_KEEPALIVE void wasm_entrypoint(CONST_C_STR program_text, int disassemble, int expand, int debug) { +extern "C" EMSCRIPTEN_KEEPALIVE void wasm_entrypoint(const char* program_text, int disassemble, int expand, int debug) { // Reset EOF from previous runs clearerr(stdin); // Input and output don't need to be synced on the web @@ -49,7 +49,7 @@ extern "C" EMSCRIPTEN_KEEPALIVE void wasm_entrypoint(CONST_C_STR program_text, i execute(program_text, f); } #else -int main(int argc, _In_reads_z_(argc) const char** argv) { +int main(int argc, const char** argv) { flags f; std::string program_text = parse_args(argc, argv, f); execute(program_text, f);