psqlodbc.git / summary / log / commit / refs

commit    cc6f739ed3c583f92d0aeee640bb12d4dce7b7d8
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Tue Dec 02 11:00:28 2014 +0000

    Misc cleanup.
    
    Fix some misc issues pointed out by clang's static analyzer, scan-build.
    Mostly dead assignments.


convert.c | 3 +-- dlg_specific.c | 2 +- dlg_specific.h | 2 -- execute.c | 10 ++++++---- info.c | 1 + results.c | 2 -- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/convert.c b/convert.c index 5070711b..dd8dd6b1 100644 --- a/convert.c +++ b/convert.c @@ -2762,7 +2762,6 @@ inolog("type=%d concur=%d\n", stmt->options.cursor_type, stmt->options.scroll_co goto cleanup; } SC_forget_unnamed(stmt); - buildPrepareStatement = FALSE; if (ci->disallow_premature) prepare_dummy_cursor = stmt->pre_executing; @@ -5007,7 +5006,7 @@ mylog("%d-%d num=%s SQL_BIT=%d\n", to, from, num, SQL_BIT); SQLLEN paramlen; int pidx; - for (prtlen = 0, mapptr = mapExpr; *mapptr; mapptr++) + for (mapptr = mapExpr; *mapptr; mapptr++) { if (*mapptr != '$') { diff --git a/dlg_specific.c b/dlg_specific.c index 07eff5a4..2555b17a 100644 --- a/dlg_specific.c +++ b/dlg_specific.c @@ -453,7 +453,7 @@ inolog("hlen=%d", hlen); { char abbrevmode[sizeof(ci->sslmode)]; - olen = snprintf(&connect_string[hlen], nlen, ";" + (void) snprintf(&connect_string[hlen], nlen, ";" ABBR_SSLMODE "=%s", abbrev_sslmode(ci->sslmode, abbrevmode)); } hlen = strlen(connect_string); diff --git a/dlg_specific.h b/dlg_specific.h index 978f848c..723cc286 100644 --- a/dlg_specific.h +++ b/dlg_specific.h @@ -288,7 +288,6 @@ LRESULT CALLBACK manage_dsnProc(HWND hdlg, LPARAM lParam); #endif /* WIN32 */ -void updateGlobals(void); int writeDriverCommoninfo(const char *fileName, const char *sectionName, const GLOBAL_VALUES *); void writeDSNinfo(const ConnInfo *ci); @@ -300,7 +299,6 @@ BOOL copyCommonAttributes(ConnInfo *ci, const char *attribute, const char *valu int getDriverNameFromDSN(const char *dsn, char *driver_name, int namelen); int getLogDir(char *dir, int dirmax); int setLogDir(const char *dir); -int changeDriverNameOfaDSN(const char *dsn, const char *driver_name, DWORD *errcode); UInt4 getExtraOptions(const ConnInfo *); BOOL setExtraOptions(ConnInfo *, const char *str, const char *format); char *extract_extra_attribute_setting(const pgNAME setting, const char *attr); diff --git a/execute.c b/execute.c index 1b52b507..44479611 100644 --- a/execute.c +++ b/execute.c @@ -1070,7 +1070,7 @@ next_param_row: /* Check for data at execution parameters */ if (apdopts->parameters[i].data_at_exec) { - mylog("The %dth parameter of %d-row is data at exec(%d)\n", i, current_row, *pcVal); + mylog("The %dth parameter of %d-row is data at exec(%d)\n", i, current_row, pcVal ? (*pcVal) : -1); if (stmt->data_at_exec < 0) stmt->data_at_exec = 1; else @@ -1479,7 +1479,7 @@ PGAPI_PutData(HSTMT hstmt, ParameterInfoClass *current_param; ParameterImplClass *current_iparam; PutDataClass *current_pdata; - char *buffer, *putbuf, *allocbuf = NULL; + char *putbuf, *allocbuf = NULL; Int2 ctype; SQLLEN putlen; BOOL lenset = FALSE, handling_lo = FALSE; @@ -1654,11 +1654,13 @@ PGAPI_PutData(HSTMT hstmt, } else { - buffer = current_pdata->EXEC_buffer; old_pos = *current_pdata->EXEC_used; if (putlen > 0) { - SQLLEN used = *current_pdata->EXEC_used + putlen, allocsize; + SQLLEN used = *current_pdata->EXEC_used + putlen; + SQLLEN allocsize; + char *buffer; + for (allocsize = (1 << 4); allocsize <= used; allocsize <<= 1) ; mylog(" cbValue = %d, old_pos = %d, *used = %d\n", putlen, old_pos, used); diff --git a/info.c b/info.c index 951ee495..171bdd77 100644 --- a/info.c +++ b/info.c @@ -914,6 +914,7 @@ mylog("CONVERT_FUNCTIONS=" FORMAT_ULEN "\n", value); case SQL_INDEX_KEYWORDS: len = 4; value = SQL_IK_NONE; + break; case SQL_INFO_SCHEMA_VIEWS: len = 4; value = 0; diff --git a/results.c b/results.c index 00521155..49d8a617 100644 --- a/results.c +++ b/results.c @@ -2651,7 +2651,6 @@ static void UndoRollback(StatementClass *stmt, QResultClass *res, BOOL partial) rollbps = rollbp = res->rb_count; for (i = 0, doubtp = 0; i < res->rb_count; i++) { - index = rollback[i].index; keys.blocknum = rollback[i].blocknum; keys.offset = rollback[i].offset; texist = tupleExists(stmt, &keys); @@ -3872,7 +3871,6 @@ irow_insert(RETCODE ret, StatementClass *stmt, StatementClass *istmt, if (0 != oid) poid = &oid; - qret = SQL_NO_DATA_FOUND; if (NULL != tres->backend_tuples && 1 == QR_get_num_cached_tuples(tres)) [parent: 8f7dce176112]