diff options
author | Alexander Barkov <bar@mariadb.org> | 2013-07-08 10:20:53 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2013-07-08 10:20:53 +0400 |
commit | 66c1665e8991fcc0eda64b63350b46e424e32861 (patch) | |
tree | 09b74cdd715165857f9b4226df3668436c244dec | |
parent | 63446440437fea4e8f6800b4676105d6617e49a1 (diff) | |
download | mariadb-git-66c1665e8991fcc0eda64b63350b46e424e32861.tar.gz |
Fixing numerous "variable is set but never used" warnings.
modified:
storage/connect/filamfix.cpp
storage/connect/filamtxt.cpp
storage/connect/filamvct.cpp
storage/connect/odbconn.cpp
storage/connect/tabodbc.cpp
storage/connect/xindex.cpp
-rw-r--r-- | storage/connect/filamfix.cpp | 4 | ||||
-rw-r--r-- | storage/connect/filamtxt.cpp | 4 | ||||
-rwxr-xr-x | storage/connect/filamvct.cpp | 28 | ||||
-rw-r--r-- | storage/connect/odbconn.cpp | 18 | ||||
-rw-r--r-- | storage/connect/tabodbc.cpp | 6 | ||||
-rwxr-xr-x | storage/connect/xindex.cpp | 3 |
6 files changed, 30 insertions, 33 deletions
diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp index b7cbc76a553..d493a2f2568 100644 --- a/storage/connect/filamfix.cpp +++ b/storage/connect/filamfix.cpp @@ -425,9 +425,9 @@ int FIXFAM::DeleteRecords(PGLOBAL g, int irc) /* for compatibility with Text files and other OS's. */ /*****************************************************************/ char filename[_MAX_PATH]; - int rc, h; + int h; - rc = PlugCloseFile(g, To_Fb); + /*rc= */PlugCloseFile(g, To_Fb); PlugSetPath(filename, To_File, Tdbp->GetPath()); if ((h= global_open(g, MSGID_OPEN_STRERROR, filename, O_WRONLY)) <= 0) diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index ed4467b6392..2291f2c2b00 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -786,10 +786,10 @@ int DOSFAM::DeleteRecords(PGLOBAL g, int irc) /* for compatibility with Text files and other OS's. */ /*****************************************************************/ char filename[_MAX_PATH]; - int h, rc; // File handle, return code + int h; // File handle, return code PlugSetPath(filename, To_File, Tdbp->GetPath()); - rc = PlugCloseFile(g, To_Fb); + /*rc=*/ PlugCloseFile(g, To_Fb); if ((h= global_open(g, MSGID_OPEN_STRERROR, filename, O_WRONLY)) <= 0) return RC_FX; diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 914d671637c..e97408f48bd 100755 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -204,7 +204,6 @@ bool VCTFAM::SetBlockInfo(PGLOBAL g) { char filename[_MAX_PATH]; bool rc = false; - int k; size_t n; VECHEADER vh; FILE *s; @@ -216,7 +215,7 @@ bool VCTFAM::SetBlockInfo(PGLOBAL g) s = Stream; if (Header == 1) - k = fseek(s, 0, SEEK_SET); + /*k =*/ fseek(s, 0, SEEK_SET); } else s= global_fopen(g, MSGID_CANNOT_OPEN, filename, "r+b"); @@ -230,7 +229,7 @@ bool VCTFAM::SetBlockInfo(PGLOBAL g) sprintf(g->Message, "Error opening header file %s", filename); return true; } else if (Header == 3) - k = fseek(s, -(int)sizeof(VECHEADER), SEEK_END); + /*k =*/ fseek(s, -(int)sizeof(VECHEADER), SEEK_END); vh.MaxRec = MaxBlk * Bsize; vh.NumRec = (Block - 1) * Nrec + Last; @@ -775,10 +774,10 @@ int VCTFAM::DeleteRecords(PGLOBAL g, int irc) /* checked for compatibility with Text files and other OS's. */ /***************************************************************/ char filename[_MAX_PATH]; - int rc, h; + int h; - rc = CleanUnusedSpace(g); // Clean last block - rc = PlugCloseFile(g, To_Fb); + /*rc =*/ CleanUnusedSpace(g); // Clean last block + /*rc =*/ PlugCloseFile(g, To_Fb); Stream = NULL; // For SetBlockInfo PlugSetPath(filename, To_File, Tdbp->GetPath()); @@ -1705,7 +1704,7 @@ int VCMFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ void VCMFAM::CloseTableFile(PGLOBAL g) { - int rc = 0, wrc = RC_OK; + int wrc = RC_OK; MODE mode = Tdbp->GetMode(); if (mode == MODE_INSERT) { @@ -1728,7 +1727,7 @@ void VCMFAM::CloseTableFile(PGLOBAL g) PlugCloseFile(g, To_Fb); if (wrc != RC_FX) - rc = ResetTableSize(g, Block, Last); + /*rc =*/ ResetTableSize(g, Block, Last); } else if (mode != MODE_DELETE) PlugCloseFile(g, To_Fb); @@ -2205,11 +2204,11 @@ int VECFAM::DeleteRecords(PGLOBAL g, int irc) /* for compatibility with other OS's. */ /*****************************************************************/ char filename[_MAX_PATH]; - int h, rc; // File handle, return code + int h; // File handle, return code for (int i = 0; i < Ncol; i++) { sprintf(filename, Colfn, i + 1); - rc = PlugCloseFile(g, To_Fbs[i]); + /*rc =*/ PlugCloseFile(g, To_Fbs[i]); if ((h= global_open(g, MSGID_OPEN_STRERROR, filename, O_WRONLY)) <= 0) return RC_FX; @@ -3118,7 +3117,6 @@ int BGVFAM::GetBlockInfo(PGLOBAL g) { char filename[_MAX_PATH]; int n; - bool b; VECHEADER vh; HANDLE h; @@ -3162,7 +3160,7 @@ int BGVFAM::GetBlockInfo(PGLOBAL g) return n; } else if (Header == 3) - b = BigSeek(g, h, -(BIGINT)sizeof(vh), true); + /*b = */ BigSeek(g, h, -(BIGINT)sizeof(vh), true); if (BigRead(g, h, &vh, sizeof(vh))) { sprintf(g->Message, "Error reading header file %s", filename); @@ -3190,7 +3188,7 @@ int BGVFAM::GetBlockInfo(PGLOBAL g) bool BGVFAM::SetBlockInfo(PGLOBAL g) { char filename[_MAX_PATH]; - bool bk, b = false, rc = false; + bool b = false, rc = false; VECHEADER vh; HANDLE h = INVALID_HANDLE_VALUE; @@ -3201,7 +3199,7 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g) h = Hfile; if (Header == 1) - bk = BigSeek(g, h, (BIGINT)0); + /*bk =*/ BigSeek(g, h, (BIGINT)0); } else b = true; @@ -3230,7 +3228,7 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g) } // endif h if (Header == 3) - bk = BigSeek(g, h, -(BIGINT)sizeof(vh), true); + /*bk =*/ BigSeek(g, h, -(BIGINT)sizeof(vh), true); vh.MaxRec = MaxBlk * Bsize; vh.NumRec = (Block - 1) * Nrec + Last; diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index b39f1c9ba5b..967d68a360c 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -954,17 +954,17 @@ int ODBConn::Open(PSZ ConnectString, DWORD options) // Allocate the HDBC and make connection try { - PSZ ver; + /*PSZ ver;*/ AllocConnect(options); - ver = GetStringInfo(SQL_ODBC_VER); + /*ver = GetStringInfo(SQL_ODBC_VER);*/ if (Connect(options)) { strcpy(g->Message, MSG(CONNECT_CANCEL)); return 0; } // endif - ver = GetStringInfo(SQL_DRIVER_ODBC_VER); + /*ver = GetStringInfo(SQL_DRIVER_ODBC_VER);*/ } catch(DBX *xp) { // strcpy(g->Message, xp->m_ErrMsg[0]); strcpy(g->Message, xp->GetErrorMessage(0)); @@ -1213,13 +1213,13 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) b = false; if (m_hstmt) { - RETCODE rc; + /*RETCODE rc;*/ // All this did not seems to make sense and was been commented out // if (IsOpen()) // Close(SQL_CLOSE); - rc = SQLFreeStmt(m_hstmt, SQL_CLOSE); + /*rc =*/ SQLFreeStmt(m_hstmt, SQL_CLOSE); hstmt = m_hstmt; m_hstmt = NULL; ThrowDBX(MSG(SEQUENCE_ERROR)); @@ -1831,7 +1831,7 @@ int ODBConn::GetCatInfo(CATPARM *cap) /***********************************************************************/ void ODBConn::Close() { - RETCODE rc; + /*RETCODE rc;*/ #if 0 // Close any open recordsets @@ -1856,13 +1856,13 @@ void ODBConn::Close() if (m_hstmt) { // Is required for multiple tables - rc = SQLFreeStmt(m_hstmt, SQL_DROP); + /*rc =*/ SQLFreeStmt(m_hstmt, SQL_DROP); m_hstmt = NULL; } // endif m_hstmt if (m_hdbc != SQL_NULL_HDBC) { - rc = SQLDisconnect(m_hdbc); - rc = SQLFreeConnect(m_hdbc); + /*rc =*/ SQLDisconnect(m_hdbc); + /*rc =*/ SQLFreeConnect(m_hdbc); m_hdbc = SQL_NULL_HDBC; // AfxLockGlobals(CRIT_ODBC); diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index 599f9c7e80f..ae6817344b8 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -324,7 +324,7 @@ char *TDBODBC::MakeSQL(PGLOBAL g, bool cnt) { char *colist, *tabname, *sql, buf[64]; LPCSTR ownp = NULL, qualp = NULL; - int rc, len, ncol = 0; + int len, ncol = 0; bool first = true; PTABLE tablep = To_Table; PCOL colp; @@ -341,7 +341,7 @@ char *TDBODBC::MakeSQL(PGLOBAL g, bool cnt) for (colp = Columns; colp; colp = colp->GetNext()) if (!colp->IsSpecial()) { // Column name can be in UTF-8 encoding - rc= Decode(colp->GetName(), buf, sizeof(buf)); + /*rc=*/ Decode(colp->GetName(), buf, sizeof(buf)); if (Quote) { if (first) { @@ -376,7 +376,7 @@ char *TDBODBC::MakeSQL(PGLOBAL g, bool cnt) } // endif cnt // Table name can be encoded in UTF-8 - rc = Decode(TableName, buf, sizeof(buf)); + /*rc = */Decode(TableName, buf, sizeof(buf)); // Put table name between identifier quotes in case in contains blanks tabname = (char*)PlugSubAlloc(g, NULL, strlen(buf) + 3); diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index 68a6bba47ec..4a0067e30be 100755 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -2368,7 +2368,6 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) } // endif Mode #else // UNIX - int rc = 0; int oflag = O_LARGEFILE; // Enable file size > 2G mode_t pmod = 0; @@ -2394,7 +2393,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) Hfile= global_open(g, MSGID_OPEN_ERROR_AND_STRERROR, filename, oflag, pmod); if (Hfile == INVALID_HANDLE_VALUE) { - rc = errno; + /*rc = errno;*/ #if defined(TRACE) printf("Open: %s\n", g->Message); #endif // TRACE |