Author: turnstep
Date: Wed Jun 17 09:33:07 2009
New Revision: 12857
Modified:
DBD-Pg/trunk/dbdimp.c
DBD-Pg/trunk/quote.c
Log:
Minor compiler-be-happier tweaks.
Modified: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c (original)
+++ DBD-Pg/trunk/dbdimp.c Wed Jun 17 09:33:07 2009
@@ -780,7 +780,7 @@
unsigned int newval = SvTRUE(valuesv);
int retval = 0;
- if (TSTART) TRC(DBILOGFP, "%sBegin dbd_db_STORE (key: %s newval: %d kl:%d)\n", THEADER, key, newval);
+ if (TSTART) TRC(DBILOGFP, "%sBegin dbd_db_STORE (key: %s newval: %d kl:%d)\n", THEADER, key, newval, kl);
switch (kl) {
@@ -1572,7 +1572,7 @@
imp_sth->seg->segment = NULL;
}
if (TRACE6) TRC(DBILOGFP, "%sdirect split = (%s) length=(%d)\n",
- THEADER, imp_sth->seg->segment, imp_sth->totalsize);
+ THEADER, imp_sth->seg->segment, (int)imp_sth->totalsize);
if (TEND) TRC(DBILOGFP, "%sEnd pg_st_split_statement (direct)\n", THEADER);
return;
}
@@ -1990,7 +1990,7 @@
TRC(DBILOGFP, "%sPlaceholder number, fooname, id:\n", THEADER);
for (xlen=1,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,xlen++) {
TRC(DBILOGFP, "%s#%d FOONAME: (%s)\n",
- THEADER, xlen, currph->fooname);
+ THEADER, (int)xlen, currph->fooname);
}
}
@@ -2363,7 +2363,7 @@
TRC (DBILOGFP,
"%sPlaceholder (%s) bound as type (%s) (type_id=%d), length %d, value of (%s)\n",
THEADER, name, currph->bind_type->type_name,
- currph->bind_type->type_id, currph->valuelen,
+ currph->bind_type->type_id, (int)currph->valuelen,
PG_BYTEA==currph->bind_type->type_id ? "(binary, not shown)" : value_string);
if (TEND) TRC(DBILOGFP, "%sEnd dbd_bind_ph\n", THEADER);
@@ -3008,7 +3008,7 @@
if (TRACE7) {
for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,x++) {
- TRC(DBILOGFP, "%sPQexecPrepared item #%d\n", THEADER, x);
+ TRC(DBILOGFP, "%sPQexecPrepared item #%d\n", THEADER, (int)x);
TRC(DBILOGFP, "%s-> Value: (%s)\n",
THEADER, (imp_sth->PQfmts && imp_sth->PQfmts[x]==1) ? "(binary, not shown)"
: imp_sth->PQvals[x]);
@@ -3022,7 +3022,7 @@
if (TSQL) {
TRC(DBILOGFP, "EXECUTE %s (\n", imp_sth->prepare_name);
for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,x++) {
- TRC(DBILOGFP, "$%d: %s\n", x+1, imp_sth->PQvals[x]);
+ TRC(DBILOGFP, "$%d: %s\n", (int)x+1, imp_sth->PQvals[x]);
}
TRC(DBILOGFP, ");\n\n");
}
@@ -3089,7 +3089,7 @@
if (TRACE7) {
for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,x++) {
- TRC(DBILOGFP, "%sPQexecParams item #%d\n", THEADER, x);
+ TRC(DBILOGFP, "%sPQexecParams item #%d\n", THEADER, (int)x);
TRC(DBILOGFP, "%s-> Type: (%d)\n", THEADER, imp_sth->PQoids[x]);
TRC(DBILOGFP, "%s-> Value: (%s)\n", THEADER, imp_sth->PQvals[x]);
TRC(DBILOGFP, "%s-> Length: (%d)\n", THEADER, imp_sth->PQlens ? imp_sth->PQlens[x] : 0);
@@ -3100,7 +3100,7 @@
if (TSQL) {
TRC(DBILOGFP, "EXECUTE %s (\n", statement);
for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,x++) {
- TRC(DBILOGFP, "$%d: %s\n", x+1, imp_sth->PQvals[x]);
+ TRC(DBILOGFP, "$%d: %s\n", (int)x+1, imp_sth->PQvals[x]);
}
TRC(DBILOGFP, ");\n\n");
}
@@ -4229,7 +4229,7 @@
D_imp_dbh(dbh);
if (TSTART) TRC(DBILOGFP, "%sBegin pg_db_lo_read (fd: %d length: %d)\n",
- THEADER, fd, len);
+ THEADER, fd, (int)len);
if (DBIc_has(imp_dbh, DBIcf_AutoCommit)) {
croak("Cannot call pg_lo_read when AutoCommit is on");
@@ -4254,7 +4254,7 @@
D_imp_dbh(dbh);
if (TSTART) TRC(DBILOGFP, "%sBegin pg_db_lo_write (fd: %d length: %d)\n",
- THEADER, fd, len);
+ THEADER, fd, (int)len);
if (DBIc_has(imp_dbh, DBIcf_AutoCommit)) {
croak("Cannot call pg_lo_write when AutoCommit is on");
Modified: DBD-Pg/trunk/quote.c
==============================================================================
--- DBD-Pg/trunk/quote.c (original)
+++ DBD-Pg/trunk/quote.c Wed Jun 17 09:33:07 2009
@@ -482,23 +482,23 @@
{
int max_keyword_length = 17;
- STRLEN len;
+ int keyword_len;
int i;
char word[64];
- len = strlen(string);
- if (len > max_keyword_length || len > 64) {
+ keyword_len = (int)strlen(string);
+ if (keyword_len > max_keyword_length || keyword_len > 64) {
return DBDPG_FALSE;
}
/* Because of locale issues, we manually downcase A-Z only */
- for (i = 0; i < len; i++) {
+ for (i = 0; i < keyword_len; i++) {
char ch = string[i];
if (ch >= 'A' && ch <= 'Z')
ch += 'a' - 'A';
word[i] = ch;
}
- word[len] = '\0';
+ word[keyword_len] = '\0';
/* Check for each reserved word */
if (0==strcmp(word, "abort")) return DBDPG_TRUE;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.