Commit 66c1665e authored by Alexander Barkov's avatar Alexander Barkov

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
parent 63446440
......@@ -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)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment