mirror of
https://github.com/faye/websocket-driver-ruby.git
synced 2025-11-01 13:59:38 +00:00
Use PRIu64 to print uint64_t.
This commit is contained in:
@@ -46,7 +46,7 @@ int wsd_Parser_parse(wsd_Parser *parser, uint64_t length, uint8_t *data)
|
||||
|
||||
pushed = wsd_ReadBuffer_push(parser->buffer, length, data);
|
||||
if (pushed != length) {
|
||||
wsd_Parser_error(parser, WSD_UNEXPECTED_CONDITION, "Failed to push chunk[%llu] to read buffer", length);
|
||||
wsd_Parser_error(parser, WSD_UNEXPECTED_CONDITION, "Failed to push chunk[%" PRIu64 "] to read buffer", length);
|
||||
}
|
||||
|
||||
chunk = calloc(8, sizeof(uint8_t));
|
||||
@@ -148,7 +148,7 @@ uint64_t wsd_Parser_parse_payload(wsd_Parser *parser)
|
||||
|
||||
frame->payload = calloc(n, sizeof(uint8_t));
|
||||
if (frame->payload == NULL) {
|
||||
wsd_Parser_error(parser, WSD_UNEXPECTED_CONDITION, "Failed to allocate frame payload[%llu]", n);
|
||||
wsd_Parser_error(parser, WSD_UNEXPECTED_CONDITION, "Failed to allocate frame payload[%" PRIu64 "]", n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _wsd_parser_h
|
||||
#define _wsd_parser_h
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@ void wsd_WebSocketParser_on_frame(VALUE self, wsd_Frame *frame)
|
||||
char *msg = NULL;
|
||||
|
||||
printf("------------------------------------------------------------------------\n");
|
||||
printf(" final: %d, rsv: [%d,%d,%d], opcode: %d, masked: %d, length: %llu\n",
|
||||
printf(" final: %d, rsv: [%d,%d,%d], opcode: %d, masked: %d, length: %" PRIu64 "\n",
|
||||
frame->final, frame->rsv1, frame->rsv2, frame->rsv3,
|
||||
frame->opcode, frame->masked, frame->length);
|
||||
printf("------------------------------------------------------------------------\n");
|
||||
|
||||
Reference in New Issue
Block a user