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);
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;
}
}
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;
}
/* 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)
{
struct prepared_statement *this,
*prev;
+ (void) questionmarks; /* quiet the compiler */
con = ecpg_get_connection(connection_name);
if (!ecpg_init(con, connection_name, lineno))
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 *
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));
}
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);