Skip to content

Commit

Permalink
PR review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
moticless committed Jul 11, 2024
1 parent 89d6e50 commit 009a227
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* in the README.md file as an introduction to this file implementation.
*/

#include <endian.h>
#include <inttypes.h>
#include <assert.h>
#include <stdarg.h>
#include <string.h>
Expand Down Expand Up @@ -1698,7 +1698,7 @@ RdbStatus elementHash(RdbParser *p) {
case ST_HASH_HEADER:
if (p->currOpcode == RDB_TYPE_HASH_METADATA) {
/* digest min HFE expiration time. No need to pass it to handlers
each field goanna report its expiration time anyway */
as each field will report its own expiration time anyway */
BulkInfo *binfoExpire;
IF_NOT_OK_RETURN(rdbLoad(p, 8, RQ_ALLOC, NULL, &binfoExpire));
}
Expand Down Expand Up @@ -1770,7 +1770,7 @@ RdbStatus elementHashLPEx(RdbParser *p) {

if (p->currOpcode != RDB_TYPE_HASH_LISTPACK_EX_PRE_GA) {
/* digest min HFE expiration time. No need to pass it to handlers
each field goanna report its expiration time anyway */
as each field will report its own expiration time anyway */
BulkInfo *binfoExpire;
IF_NOT_OK_RETURN(rdbLoad(p, 8, RQ_ALLOC, NULL, &binfoExpire));
}
Expand Down Expand Up @@ -2666,8 +2666,8 @@ RdbStatus rdbLoadString(RdbParser *p, AllocTypeRq type, char *refBuf, BulkInfo *
return rdbLoadLzfString(p, type, refBuf, binfo);
default:
RDB_reportError(p, RDB_ERR_STRING_UNKNOWN_ENCODING_TYPE,
"rdbLoadString(): Unknown RDB string encoding type: %lu (0x%lx)",
len, len);
"rdbLoadString(): Unknown RDB string encoding type: %"
PRIu64 " (0x%" PRIx64 ")", len, len);
return RDB_STATUS_ERROR;
}
}
Expand Down
16 changes: 7 additions & 9 deletions src/lib/parserRaw.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
* expects structured data, whereas LEVEL0 is a dump of raw data that its main purpose
* is to use it along with RESTORE command to play it against live Redis server.
*/

#include <inttypes.h>
#include <assert.h>
#include <string.h>
#include "../../deps/redis/lzf.h"
#include "bulkAlloc.h"
#include "parser.h"
#include "defines.h"
#include "../../deps/redis/endianconv.h"
#include "../../deps/redis/util.h"
#include "../../deps/redis/listpack.h"
#include "../../deps/redis/ziplist.h"
Expand Down Expand Up @@ -318,8 +317,8 @@ RdbStatus elementRawString(RdbParser *p) {
break;
default:
RDB_reportError(p, RDB_ERR_STRING_UNKNOWN_ENCODING_TYPE,
"elementRawString(): Unknown RDB string encoding type: %lu (0x%lx)",
strCtx->len, strCtx->len);
"elementRawString(): Unknown RDB string encoding type: %"
PRIu64 " (0x%" PRIx64 ")", strCtx->len, strCtx->len);
return RDB_STATUS_ERROR;
}
}
Expand Down Expand Up @@ -423,8 +422,8 @@ RdbStatus elementRawString(RdbParser *p) {
}

RDB_reportError(p, RDB_ERR_STRING_UNKNOWN_ENCODING_TYPE,
"elementRawString(): Unknown RDB string encoding type: %lu (0x%lx)",
strCtx->encoding, strCtx->encoding);
"elementRawString(): Unknown RDB string encoding type: %"
PRIu64 " (0x%" PRIx64 ")", strCtx->encoding, strCtx->encoding);
return RDB_STATUS_ERROR;
}

Expand Down Expand Up @@ -464,10 +463,9 @@ RdbStatus elementRawHash(RdbParser *p) {
case ST_RAW_HASH_HEADER:
offset = processedBytes = 0;

aggMakeRoom(p, 20); /* > optional 8 bytes + worse case 9 bytes for len */
aggMakeRoom(p, 8 /*optional*/ + LONG_STR_SIZE);
if (p->currOpcode == RDB_TYPE_HASH_METADATA) {
/* load min expiration time. Do nothing with it since each field
* goanna report anyway its expiration time */
/* Load min expiration time */
IF_NOT_OK_RETURN(rdbLoad(p, 8, RQ_ALLOC_REF, rawCtx->at, &binfo));
offset = processedBytes = 8;
}
Expand Down

0 comments on commit 009a227

Please sign in to comment.