Skip to content

Commit 157f53d

Browse files
committed
Issue #290: Fix cppcheck errors
1 parent 6263dd5 commit 157f53d

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

bin/pg_repack.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize)
871871
{
872872
if (errbuf)
873873
snprintf(errbuf, errsize,
874-
"internal error: bad parameters count: %i instead of %zi",
874+
"internal error: bad parameters count: %i instead of %zu",
875875
iparam, num_params);
876876
goto cleanup;
877877
}

bin/pgut/pgut-fe.c

-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ pgut_setopt(pgut_option *opt, const char *optarg, pgut_optsrc src)
306306
message = "a 32bit signed integer";
307307
break;
308308
case 'l':
309-
message = "a List";
310309
simple_string_list_append(opt->var, optarg);
311310
return;
312311
case 'u':

bin/pgut/pgut.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ pgut_atexit_push(pgut_atexit_callback callback, void *userdata)
12151215
}
12161216

12171217
void
1218-
pgut_atexit_pop(pgut_atexit_callback callback, void *userdata)
1218+
pgut_atexit_pop(const pgut_atexit_callback callback, const void *userdata)
12191219
{
12201220
pgut_atexit_item *item;
12211221
pgut_atexit_item **prev;

bin/pgut/pgut.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern bool pgut_echo;
5555

5656
extern void pgut_init(int argc, char **argv);
5757
extern void pgut_atexit_push(pgut_atexit_callback callback, void *userdata);
58-
extern void pgut_atexit_pop(pgut_atexit_callback callback, void *userdata);
58+
extern void pgut_atexit_pop(const pgut_atexit_callback callback, const void *userdata);
5959
extern void pgut_putenv(const char *key, const char *value);
6060

6161
/*

lib/repack.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ parse_indexdef(IndexDef *stmt, Oid index, Oid table)
578578
/* (columns) */
579579
if ((sql = strchr(sql, '(')) == NULL)
580580
parse_error(index);
581-
sql++;
581+
else
582+
sql++;
582583
stmt->columns = sql;
583584
if ((sql = skip_until(index, sql, ')')) == NULL)
584585
parse_error(index);
@@ -962,7 +963,8 @@ repack_swap(PG_FUNCTION_ARGS)
962963
RENAME_INDEX(reltoastidxid1, name);
963964
CommandCounterIncrement();
964965
}
965-
else if (reltoastrelid1 != InvalidOid)
966+
/* reltoastrelid1 != InvalidOid */
967+
else
966968
{
967969
char name[NAMEDATALEN];
968970
int pid = getpid();
@@ -1104,7 +1106,6 @@ repack_drop(PG_FUNCTION_ARGS)
11041106
SPI_OK_UTILITY,
11051107
"DROP TABLE IF EXISTS repack.table_%u CASCADE",
11061108
oid);
1107-
--numobj;
11081109
}
11091110

11101111
SPI_finish();

0 commit comments

Comments
 (0)