Skip to content

Commit

Permalink
Issue #290: Fix cppcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
za-arthur committed Oct 18, 2023
1 parent 6263dd5 commit 157f53d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/pg_repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize)
{
if (errbuf)
snprintf(errbuf, errsize,
"internal error: bad parameters count: %i instead of %zi",
"internal error: bad parameters count: %i instead of %zu",
iparam, num_params);
goto cleanup;
}
Expand Down
1 change: 0 additions & 1 deletion bin/pgut/pgut-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ pgut_setopt(pgut_option *opt, const char *optarg, pgut_optsrc src)
message = "a 32bit signed integer";
break;
case 'l':
message = "a List";
simple_string_list_append(opt->var, optarg);
return;
case 'u':
Expand Down
2 changes: 1 addition & 1 deletion bin/pgut/pgut.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ pgut_atexit_push(pgut_atexit_callback callback, void *userdata)
}

void
pgut_atexit_pop(pgut_atexit_callback callback, void *userdata)
pgut_atexit_pop(const pgut_atexit_callback callback, const void *userdata)
{
pgut_atexit_item *item;
pgut_atexit_item **prev;
Expand Down
2 changes: 1 addition & 1 deletion bin/pgut/pgut.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern bool pgut_echo;

extern void pgut_init(int argc, char **argv);
extern void pgut_atexit_push(pgut_atexit_callback callback, void *userdata);
extern void pgut_atexit_pop(pgut_atexit_callback callback, void *userdata);
extern void pgut_atexit_pop(const pgut_atexit_callback callback, const void *userdata);
extern void pgut_putenv(const char *key, const char *value);

/*
Expand Down
7 changes: 4 additions & 3 deletions lib/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ parse_indexdef(IndexDef *stmt, Oid index, Oid table)
/* (columns) */
if ((sql = strchr(sql, '(')) == NULL)
parse_error(index);
sql++;
else
sql++;
stmt->columns = sql;
if ((sql = skip_until(index, sql, ')')) == NULL)
parse_error(index);
Expand Down Expand Up @@ -962,7 +963,8 @@ repack_swap(PG_FUNCTION_ARGS)
RENAME_INDEX(reltoastidxid1, name);
CommandCounterIncrement();
}
else if (reltoastrelid1 != InvalidOid)
/* reltoastrelid1 != InvalidOid */
else
{
char name[NAMEDATALEN];
int pid = getpid();
Expand Down Expand Up @@ -1104,7 +1106,6 @@ repack_drop(PG_FUNCTION_ARGS)
SPI_OK_UTILITY,
"DROP TABLE IF EXISTS repack.table_%u CASCADE",
oid);
--numobj;
}

SPI_finish();
Expand Down

0 comments on commit 157f53d

Please sign in to comment.