diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index 641f01adf5b085c6f6af8326c45dc441710d9688..af185d533b95908cb8a51639231f56a58e327de2 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -178,8 +178,8 @@ deccopy(decimal *src, decimal *target) static char * ecpg_strndup(const char *str, size_t len) { - int real_len = strlen(str); - int use_len = (real_len > len) ? (int) len : real_len; + size_t real_len = strlen(str); + int use_len = (int) ((real_len > len) ? len : real_len); char *new = malloc(use_len + 1); @@ -983,24 +983,33 @@ ldchar(char *src, int len, char *dest) int rgetmsg(int msgnum, char *s, int maxsize) { + (void) msgnum; /* keep the compiler quiet */ + (void) s; /* keep the compiler quiet */ + (void) maxsize; /* keep the compiler quiet */ return 0; } int rtypalign(int offset, int type) { + (void) offset; /* keep the compiler quiet */ + (void) type; /* keep the compiler quiet */ return 0; } int rtypmsize(int type, int len) { + (void) type; /* keep the compiler quiet */ + (void) len; /* keep the compiler quiet */ return 0; } int rtypwidth(int sqltype, int sqllen) { + (void) sqltype; /* keep the compiler quiet */ + (void) sqllen; /* keep the compiler quiet */ return 0; } diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index 0091b5dc98f68c389860a515c378a06dbd01535c..3bd6614e72381f358e2e239ec02718365eabf292 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -214,9 +214,9 @@ ECPGnoticeReceiver(void *arg, const PGresult *result) char *sqlstate = PQresultErrorField(result, PG_DIAG_SQLSTATE); char *message = PQresultErrorField(result, PG_DIAG_MESSAGE_PRIMARY); struct sqlca_t *sqlca = ECPGget_sqlca(); - int sqlcode; + (void) arg; /* keep the compiler quiet */ if (sqlstate == NULL) sqlstate = ECPG_SQLSTATE_ECPG_INTERNAL_ERROR; diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h index 2d9636d798b2bd5c94ede44e04f7a4dca63641d1..0d55102d0da3d279261b2ba2489836c48323f4ad 100644 --- a/src/interfaces/ecpg/ecpglib/extern.h +++ b/src/interfaces/ecpg/ecpglib/extern.h @@ -76,7 +76,7 @@ struct connection { char *name; PGconn *connection; - int autocommit; + bool autocommit; struct ECPGtype_information_cache *cache_head; struct prepared_statement *prep_stmts; struct connection *next; diff --git a/src/interfaces/ecpg/ecpglib/memory.c b/src/interfaces/ecpg/ecpglib/memory.c index 94414b5e992378f75d56600ed7e12299314026cd..542bfc0c7d5bc9629b521f117cf06e53798c7da1 100644 --- a/src/interfaces/ecpg/ecpglib/memory.c +++ b/src/interfaces/ecpg/ecpglib/memory.c @@ -75,6 +75,7 @@ static pthread_once_t auto_mem_once = PTHREAD_ONCE_INIT; static void auto_mem_destructor(void *arg) { + (void) arg; /* keep the compiler quiet */ ECPGfree_auto_mem(); } diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c index c2725a231ab9cb8ed8c55784320467350e76fa53..90288d343bf409241f1567655955f96f8188ce7f 100644 --- a/src/interfaces/ecpg/ecpglib/prepare.c +++ b/src/interfaces/ecpg/ecpglib/prepare.c @@ -100,7 +100,7 @@ replace_variables(char **text, int lineno) } static bool -prepare_common(int lineno, struct connection * con, const bool questionmarks, const char *name, const char *variable) +prepare_common(int lineno, struct connection * con, const char *name, const char *variable) { struct statement *stmt; struct prepared_statement *this; @@ -156,7 +156,7 @@ prepare_common(int lineno, struct connection * con, const bool questionmarks, co } /* handle the EXEC SQL PREPARE statement */ -/* questionmarks is not needed but remians in there for the time being to not change the API */ +/* questionmarks is not needed but remains in there for the time being to not change the API */ bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable) { @@ -164,6 +164,7 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, c struct prepared_statement *this, *prev; + (void) questionmarks; /* quiet the compiler */ con = ecpg_get_connection(connection_name); if (!ecpg_init(con, connection_name, lineno)) @@ -174,7 +175,7 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, c if (this && !deallocate_one(lineno, ECPG_COMPAT_PGSQL, con, prev, this)) return false; - return prepare_common(lineno, con, questionmarks, name, variable); + return prepare_common(lineno, con, name, variable); } struct prepared_statement * @@ -304,6 +305,7 @@ ecpg_prepared(const char *name, struct connection * con) char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno) { + (void)lineno; /* keep the compiler quiet */ return ecpg_prepared(name, ecpg_get_connection(connection_name)); } @@ -484,7 +486,7 @@ ecpg_auto_prepare(int lineno, const char *connection_name, const int compat, cha con = ecpg_get_connection(connection_name); prep = ecpg_find_prepared_statement(stmtID, con, NULL); /* This prepared name doesn't exist on this connection. */ - if (!prep && !prepare_common(lineno, con, 0, stmtID, query)) + if (!prep && !prepare_common(lineno, con, stmtID, query)) return (false); *name = ecpg_strdup(stmtID, lineno); diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index df1ddfd818f517c1697c00ed28eaa369651e3f8c..917200abd0baf895b4f9d3944e5cc6bfde30343f 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -11,8 +11,8 @@ #include "extern.h" -int ret_value = 0, - autocommit = false, +int ret_value = 0; +bool autocommit = false, auto_create_c = false, system_includes = false, force_indicator = true, @@ -126,9 +126,9 @@ main(int argc, char *const argv[]) int fnr, c, - verbose = false, - header_mode = false, out_option = 0; + bool verbose = false, + header_mode = false; struct _include_path *ip; const char *progname; char my_exec_path[MAXPGPATH]; diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 2ef6c3618e8aaa4316fe34e75a7ef586cdd1e61a..2eaef25c534e3d363b6a08a53c698bf00fa44b49 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -270,7 +270,7 @@ prepared_name: name { $$ = $1; else /* not quoted => convert to lowercase */ { - int i; + size_t i; for (i = 0; i< strlen($1); i++) $1[i] = tolower((unsigned char) $1[i]); diff --git a/src/interfaces/ecpg/preproc/extern.h b/src/interfaces/ecpg/preproc/extern.h index 202baacc3d81efa676dda7baed2cbd6a39fd494d..e9d5b7e83c0a6cccd8339a59fef386fc7cfe31d3 100644 --- a/src/interfaces/ecpg/preproc/extern.h +++ b/src/interfaces/ecpg/preproc/extern.h @@ -18,17 +18,17 @@ /* variables */ -extern int braces_open, - autocommit, +extern bool autocommit, auto_create_c, system_includes, force_indicator, questionmarks, - ret_value, - struct_level, - ecpg_internal_var, regression_mode, auto_prepare; +extern int braces_open, + ret_value, + struct_level, + ecpg_internal_var; extern char *current_function; extern char *descriptor_index; extern char *descriptor_name;