Skip to content

Commit

Permalink
Use macros for reading formatted strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC committed Nov 25, 2024
1 parent 661361e commit 929a1a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions cleo_plugins/DebugUtils/DebugUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ class DebugUtils
}
else // breakpoint formatted name string
{
auto format = CLEO_ReadStringOpcodeParam(thread);
name = CLEO_ReadParamsFormatted(thread, format);
OPCODE_READ_PARAM_STRING_FORMATTED(nameStr);
name = nameStr;
}

pausedScripts.emplace_back(thread, name.c_str());
Expand Down Expand Up @@ -262,8 +262,7 @@ class DebugUtils
return OR_CONTINUE;
}

auto format = CLEO_ReadStringOpcodeParam(thread);
auto message = CLEO_ReadParamsFormatted(thread, format);
OPCODE_READ_PARAM_STRING_FORMATTED(message);

CLEO_Log(eLogLevel::Debug, message);
return OR_CONTINUE;
Expand Down
3 changes: 1 addition & 2 deletions cleo_plugins/FileSystemOperations/FileSystemOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,7 @@ class FileSystemOperations
static OpcodeResult WINAPI opcode_0AD9(CRunningScript* thread)
{
OPCODE_READ_PARAM_FILE_HANDLE(handle);
OPCODE_READ_PARAM_STRING(format);
static char text[4 * MAX_STR_LEN]; CLEO_ReadParamsFormatted(thread, format, text, MAX_STR_LEN);
OPCODE_READ_PARAM_STRING_FORMATTED(text);

auto ok = File::writeString(handle, text);
if (!ok)
Expand Down

0 comments on commit 929a1a4

Please sign in to comment.