Skip to content

Commit

Permalink
Merge pull request #337 from IVOES/cpp/wrong-type-format-argument
Browse files Browse the repository at this point in the history
Fix incorrect printf format specifier
  • Loading branch information
pikasTech authored Aug 15, 2024
2 parents ffaa73e + 8f7c623 commit 288465e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PikaObj.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "PikaObj.h"
#include <stdint.h>
#include <inttypes.h>
#include "BaseObj.h"
#include "PikaCompiler.h"
#include "PikaParser.h"
Expand Down Expand Up @@ -2838,7 +2839,7 @@ void pika_eventListener_registEventCallback(PikaEventListener* listener,
Arg* eventCallback) {
pika_assert(NULL != listener);
char hash_str[32] = {0};
pika_sprintf(hash_str, "C%d", eventId);
pika_sprintf(hash_str, "C%" PRIuPTR, eventId);
obj_newDirectObj(listener, hash_str, New_TinyObj);
PikaObj* oHandle = obj_getPtr(listener, hash_str);
obj_setEventCallback(oHandle, eventId, eventCallback, listener);
Expand Down Expand Up @@ -3010,7 +3011,7 @@ Arg* __eventListener_runEvent(PikaEventListener* listener,
pika_debug("event handler: %p", handler);
if (NULL == handler) {
pika_platform_printf(
"Error: can not find event handler by id: [0x%02x]\r\n", eventId);
"Error: can not find event handler by id: [0x%02" PRIxPTR "]\r\n", eventId);
return NULL;
}
Arg* eventCallBack = obj_getArg(handler, "eventCallBack");
Expand Down

0 comments on commit 288465e

Please sign in to comment.