Commit 46553c25 authored by Noel Kuntze's avatar Noel Kuntze Committed by Robert Bindar

Fix compiler warnings GCC8

parent 0d5d8d2e
...@@ -79,15 +79,15 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp) ...@@ -79,15 +79,15 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp)
if (trace(2)) if (trace(2))
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this); htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);
if (tdbp) if (tdbp) {
// Attach the new column to the table block // Attach the new column to the table block
if (!tdbp->GetColumns()) if (!tdbp->GetColumns()) {
tdbp->SetColumns(this); tdbp->SetColumns(this);
else { } else {
for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ; for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ;
colp->Next = this; colp->Next = this;
} // endelse } // endelse
}
} // end of COLBLK copy constructor } // end of COLBLK copy constructor
......
...@@ -642,7 +642,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) ...@@ -642,7 +642,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
// This is a pseudo indexed sorted block optimized column // This is a pseudo indexed sorted block optimized column
// return 0; // return 0;
if (tdbp->To_Kindex) if (tdbp->To_Kindex) {
if (((XXBASE*)tdbp->To_Kindex)->GetID() == id) { if (((XXBASE*)tdbp->To_Kindex)->GetID() == id) {
tdbp->To_Kindex->Reset(); // Same index tdbp->To_Kindex->Reset(); // Same index
return (tdbp->To_Kindex->IsMul()) ? 2 : 1; return (tdbp->To_Kindex->IsMul()) ? 2 : 1;
...@@ -650,6 +650,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) ...@@ -650,6 +650,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
tdbp->To_Kindex->Close(); tdbp->To_Kindex->Close();
tdbp->To_Kindex= NULL; tdbp->To_Kindex= NULL;
} // endif colp } // endif colp
}
for (xdp= dfp->To_Indx; xdp; xdp= xdp->GetNext()) for (xdp= dfp->To_Indx; xdp; xdp= xdp->GetNext())
if (xdp->GetID() == id) if (xdp->GetID() == id)
......
...@@ -840,7 +840,7 @@ int DBFFAM::DeleteRecords(PGLOBAL g, int irc) ...@@ -840,7 +840,7 @@ int DBFFAM::DeleteRecords(PGLOBAL g, int irc)
{ {
if (irc == RC_OK) { if (irc == RC_OK) {
// T_Stream is the temporary stream or the table file stream itself // T_Stream is the temporary stream or the table file stream itself
if (!T_Stream) if (!T_Stream) {
if (UseTemp) { if (UseTemp) {
if (OpenTempFile(g)) if (OpenTempFile(g))
return RC_FX; return RC_FX;
...@@ -850,10 +850,11 @@ int DBFFAM::DeleteRecords(PGLOBAL g, int irc) ...@@ -850,10 +850,11 @@ int DBFFAM::DeleteRecords(PGLOBAL g, int irc)
} else } else
T_Stream = Stream; T_Stream = Stream;
}
*Tdbp->GetLine() = '*'; *Tdbp->GetLine() = '*';
Modif++; // Modified line in Delete mode Modif++; // Modified line in Delete mode
} // endif irc } // endif irc
return RC_OK; return RC_OK;
} // end of DeleteRecords } // end of DeleteRecords
......
...@@ -135,8 +135,6 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g) ...@@ -135,8 +135,6 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g)
// The buffer must be prepared depending on column types // The buffer must be prepared depending on column types
int n = 0; int n = 0;
bool b = false; bool b = false;
PDOSDEF defp = (PDOSDEF)Tdbp->GetDef();
// PCOLDEF cdp;
PBINCOL colp; PBINCOL colp;
// Prepare the first line of the buffer // Prepare the first line of the buffer
......
...@@ -301,7 +301,7 @@ int VCTFAM::Cardinality(PGLOBAL g) ...@@ -301,7 +301,7 @@ int VCTFAM::Cardinality(PGLOBAL g)
if (!g) if (!g)
return 1; return 1;
if (Block < 0) if (Block < 0) {
if (Split) { if (Split) {
// Separate column files and no pre setting of Block and Last // Separate column files and no pre setting of Block and Last
// This allows to see a table modified externally, but Block // This allows to see a table modified externally, but Block
...@@ -347,6 +347,7 @@ int VCTFAM::Cardinality(PGLOBAL g) ...@@ -347,6 +347,7 @@ int VCTFAM::Cardinality(PGLOBAL g)
return -1; // Error return -1; // Error
} // endif split } // endif split
}
return (Block) ? ((Block - 1) * Nrec + Last) : 0; return (Block) ? ((Block - 1) * Nrec + Last) : 0;
} // end of Cardinality } // end of Cardinality
...@@ -1163,7 +1164,6 @@ bool VCTFAM::ResetTableSize(PGLOBAL g, int block, int last) ...@@ -1163,7 +1164,6 @@ bool VCTFAM::ResetTableSize(PGLOBAL g, int block, int last)
if (!Header) { if (!Header) {
// Update catalog values for Block and Last // Update catalog values for Block and Last
PVCTDEF defp = (PVCTDEF)Tdbp->GetDef(); PVCTDEF defp = (PVCTDEF)Tdbp->GetDef();
LPCSTR name = Tdbp->GetName();
defp->SetBlock(Block); defp->SetBlock(Block);
defp->SetLast(Last); defp->SetLast(Last);
......
...@@ -91,8 +91,6 @@ static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, PCSZ fn, PCSZ entry, char *buf) ...@@ -91,8 +91,6 @@ static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, PCSZ fn, PCSZ entry, char *buf)
static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int rc;
/*********************************************************************/ /*********************************************************************/
/* pat is a multiple file name with wildcard characters */ /* pat is a multiple file name with wildcard characters */
/*********************************************************************/ /*********************************************************************/
...@@ -100,6 +98,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) ...@@ -100,6 +98,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
#if defined(__WIN__) #if defined(__WIN__)
char drive[_MAX_DRIVE], direc[_MAX_DIR]; char drive[_MAX_DRIVE], direc[_MAX_DIR];
int rc;
WIN32_FIND_DATA FileData; WIN32_FIND_DATA FileData;
HANDLE hSearch; HANDLE hSearch;
......
...@@ -1340,6 +1340,7 @@ BOOL WritePrivateProfileSection(LPCSTR section, ...@@ -1340,6 +1340,7 @@ BOOL WritePrivateProfileSection(LPCSTR section,
* Note that when the buffer is big enough then the return value may be any * Note that when the buffer is big enough then the return value may be any
* value between 1 and len-1 (or len in Win95), including len-2. * value between 1 and len-1 (or len in Win95), including len-2.
*/ */
#ifdef TEST_MODULE
static DWORD static DWORD
GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename) GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
{ {
...@@ -1361,7 +1362,6 @@ GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename) ...@@ -1361,7 +1362,6 @@ GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
/************************************************************************ /************************************************************************
* Program to test the above * Program to test the above
************************************************************************/ ************************************************************************/
#ifdef TEST_MODULE
int main(int argc, char**argv) { int main(int argc, char**argv) {
char buff[128]; char buff[128];
char *p, *inifile = "D:\\Plug\\Data\\contact.ini"; char *p, *inifile = "D:\\Plug\\Data\\contact.ini";
......
...@@ -378,7 +378,7 @@ bool LIBXMLDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped) ...@@ -378,7 +378,7 @@ bool LIBXMLDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped)
if (zipped && InitZip(g, entry)) if (zipped && InitZip(g, entry))
return true; return true;
int n = xmlKeepBlanksDefault(1); xmlKeepBlanksDefault(1);
return MakeNSlist(g); return MakeNSlist(g);
} // end of Initialize } // end of Initialize
......
...@@ -1290,9 +1290,7 @@ bool ODBConn::DriverConnect(DWORD Options) ...@@ -1290,9 +1290,7 @@ bool ODBConn::DriverConnect(DWORD Options)
HWND hWnd = (HWND)1; HWND hWnd = (HWND)1;
#endif // !__WIN__ #endif // !__WIN__
PGLOBAL& g = m_G; PGLOBAL& g = m_G;
PDBUSER dup = PlgGetUser(g);
//if (Options & noOdbcDialog || dup->Remote)
wConnectOption = SQL_DRIVER_NOPROMPT; wConnectOption = SQL_DRIVER_NOPROMPT;
//else if (Options & forceOdbcDialog) //else if (Options & forceOdbcDialog)
// wConnectOption = SQL_DRIVER_PROMPT; // wConnectOption = SQL_DRIVER_PROMPT;
...@@ -1686,7 +1684,7 @@ int ODBConn::PrepareSQL(char *sql) ...@@ -1686,7 +1684,7 @@ int ODBConn::PrepareSQL(char *sql)
b = false; b = false;
if (m_hstmt) { if (m_hstmt) {
RETCODE rc = SQLFreeStmt(m_hstmt, SQL_CLOSE); SQLFreeStmt(m_hstmt, SQL_CLOSE);
hstmt = m_hstmt; hstmt = m_hstmt;
m_hstmt = NULL; m_hstmt = NULL;
...@@ -1694,7 +1692,7 @@ int ODBConn::PrepareSQL(char *sql) ...@@ -1694,7 +1692,7 @@ int ODBConn::PrepareSQL(char *sql)
if (m_Tdb->GetAmType() != TYPE_AM_XDBC) if (m_Tdb->GetAmType() != TYPE_AM_XDBC)
ThrowDBX(MSG(SEQUENCE_ERROR)); ThrowDBX(MSG(SEQUENCE_ERROR));
} // endif m_hstmt } // endif m_hstmt
rc = SQLAllocStmt(m_hdbc, &hstmt); rc = SQLAllocStmt(m_hdbc, &hstmt);
......
...@@ -1041,11 +1041,12 @@ int TDBSDR::GetMaxSize(PGLOBAL g) ...@@ -1041,11 +1041,12 @@ int TDBSDR::GetMaxSize(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
int TDBSDR::FindInDir(PGLOBAL g) int TDBSDR::FindInDir(PGLOBAL g)
{ {
int rc, n = 0; int n = 0;
size_t m = strlen(Direc); size_t m = strlen(Direc);
// Start searching files in the target directory. // Start searching files in the target directory.
#if defined(__WIN__) #if defined(__WIN__)
int rc;
HANDLE h; HANDLE h;
#if defined(PATHMATCHSPEC) #if defined(PATHMATCHSPEC)
...@@ -1174,7 +1175,7 @@ int TDBSDR::FindInDir(PGLOBAL g) ...@@ -1174,7 +1175,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
// Look in the name sub-directory // Look in the name sub-directory
strcat(strcat(Direc, Entry->d_name), "/"); strcat(strcat(Direc, Entry->d_name), "/");
if ((k = FindInDir(g)) < 0) if ((k= FindInDir(g)) < 0)
return k; return k;
else else
n += k; n += k;
......
...@@ -202,7 +202,7 @@ bool OcrSrcCols(PGLOBAL g, PQRYRES qrp, const char *col, ...@@ -202,7 +202,7 @@ bool OcrSrcCols(PGLOBAL g, PQRYRES qrp, const char *col,
/**********************************************************************/ /**********************************************************************/
/* Replace the columns of the colist by the rank and occur columns. */ /* Replace the columns of the colist by the rank and occur columns. */
/**********************************************************************/ /**********************************************************************/
for (i = 0, pcrp = &qrp->Colresp; crp = *pcrp; ) { for (i = 0, pcrp = &qrp->Colresp; (crp = *pcrp); ) {
for (k = 0, pn = colist; k < m; k++, pn += (strlen(pn) + 1)) for (k = 0, pn = colist; k < m; k++, pn += (strlen(pn) + 1))
if (!stricmp(pn, crp->Name)) if (!stricmp(pn, crp->Name))
break; break;
...@@ -450,8 +450,9 @@ bool TDBOCCUR::OpenDB(PGLOBAL g) ...@@ -450,8 +450,9 @@ bool TDBOCCUR::OpenDB(PGLOBAL g)
N = M = 0; N = M = 0;
RowFlag = 0; RowFlag = 0;
if (Xcolp) if (Xcolp) {
Xcolp->Xreset(); Xcolp->Xreset();
}
return Tdbp->OpenDB(g); return Tdbp->OpenDB(g);
} // endif use } // endif use
......
...@@ -301,7 +301,6 @@ bool TDBODBC::MakeInsert(PGLOBAL g) ...@@ -301,7 +301,6 @@ bool TDBODBC::MakeInsert(PGLOBAL g)
char *catp = NULL, buf[NAM_LEN * 3]; char *catp = NULL, buf[NAM_LEN * 3];
int len = 0; int len = 0;
bool oom, b = false; bool oom, b = false;
PTABLE tablep = To_Table;
PCOL colp; PCOL colp;
for (colp = Columns; colp; colp = colp->GetNext()) for (colp = Columns; colp; colp = colp->GetNext())
...@@ -322,9 +321,6 @@ bool TDBODBC::MakeInsert(PGLOBAL g) ...@@ -322,9 +321,6 @@ bool TDBODBC::MakeInsert(PGLOBAL g)
if (catp) if (catp)
len += strlen(catp) + 1; len += strlen(catp) + 1;
//if (tablep->GetSchema())
// schmp = (char*)tablep->GetSchema();
//else
if (Schema && *Schema) if (Schema && *Schema)
schmp = Schema; schmp = Schema;
...@@ -557,15 +553,17 @@ bool TDBODBC::OpenDB(PGLOBAL g) ...@@ -557,15 +553,17 @@ bool TDBODBC::OpenDB(PGLOBAL g)
if (Memory < 3) { if (Memory < 3) {
// Method will depend on cursor type // Method will depend on cursor type
if ((Rbuf = Ocp->Rewind(Query->GetStr(), (PODBCCOL)Columns)) < 0) if ((Rbuf = Ocp->Rewind(Query->GetStr(), (PODBCCOL)Columns)) < 0) {
if (Mode != MODE_READX) { if (Mode != MODE_READX) {
Ocp->Close(); Ocp->Close();
return true; return true;
} else } else {
Rbuf = 0; Rbuf = 0;
}
} else }
} else {
Rbuf = Qrp->Nblin; Rbuf = Qrp->Nblin;
}
CurNum = 0; CurNum = 0;
Fpos = 0; Fpos = 0;
...@@ -1213,8 +1211,6 @@ int TDBXDBC::GetMaxSize(PGLOBAL g) ...@@ -1213,8 +1211,6 @@ int TDBXDBC::GetMaxSize(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
bool TDBXDBC::OpenDB(PGLOBAL g) bool TDBXDBC::OpenDB(PGLOBAL g)
{ {
bool rc = false;
if (trace(1)) if (trace(1))
htrc("ODBC OpenDB: tdbp=%p tdb=R%d use=%dmode=%d\n", htrc("ODBC OpenDB: tdbp=%p tdb=R%d use=%dmode=%d\n",
this, Tdb_No, Use, Mode); this, Tdb_No, Use, Mode);
......
...@@ -187,7 +187,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) ...@@ -187,7 +187,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
} // endif picol } // endif picol
// Prepare the column list // Prepare the column list
for (pcrp = &Qryp->Colresp; crp = *pcrp; ) for (pcrp = &Qryp->Colresp; (crp = *pcrp); ) {
if (SkipColumn(crp, skc)) { if (SkipColumn(crp, skc)) {
// Ignore this column // Ignore this column
*pcrp = crp->Next; *pcrp = crp->Next;
...@@ -204,7 +204,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) ...@@ -204,7 +204,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
*pcrp = crp->Next; *pcrp = crp->Next;
} else } else
pcrp = &crp->Next; pcrp = &crp->Next;
}
if (!Rblkp) { if (!Rblkp) {
strcpy(g->Message, MSG(NO_DEF_PIVOTCOL)); strcpy(g->Message, MSG(NO_DEF_PIVOTCOL));
goto err; goto err;
...@@ -340,7 +340,6 @@ int PIVAID::Qcompare(int *i1, int *i2) ...@@ -340,7 +340,6 @@ int PIVAID::Qcompare(int *i1, int *i2)
bool PIVOTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) bool PIVOTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{ {
char *p1, *p2; char *p1, *p2;
PHC hc = ((MYCAT*)Cat)->GetHandler();
if (PRXDEF::DefineAM(g, am, poff)) if (PRXDEF::DefineAM(g, am, poff))
return TRUE; return TRUE;
...@@ -748,7 +747,7 @@ int TDBPIVOT::ReadDB(PGLOBAL g) ...@@ -748,7 +747,7 @@ int TDBPIVOT::ReadDB(PGLOBAL g)
colp->ReadColumn(g); colp->ReadColumn(g);
for (colp = Columns; colp; colp = colp->GetNext()) for (colp = Columns; colp; colp = colp->GetNext())
if (colp->GetAmType() == TYPE_AM_SRC) if (colp->GetAmType() == TYPE_AM_SRC) {
if (FileStatus) { if (FileStatus) {
if (((PSRCCOL)colp)->CompareLast()) { if (((PSRCCOL)colp)->CompareLast()) {
newrow = (RowFlag) ? TRUE : FALSE; newrow = (RowFlag) ? TRUE : FALSE;
...@@ -757,6 +756,7 @@ int TDBPIVOT::ReadDB(PGLOBAL g) ...@@ -757,6 +756,7 @@ int TDBPIVOT::ReadDB(PGLOBAL g)
} else } else
((PSRCCOL)colp)->SetColumn(); ((PSRCCOL)colp)->SetColumn();
}
FileStatus = 1; FileStatus = 1;
} // endif RowFlag } // endif RowFlag
......
...@@ -218,8 +218,8 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) ...@@ -218,8 +218,8 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
while (true) { while (true) {
if (!vp->atp && if (!vp->atp &&
!(node = (vp->nl) ? vp->nl->GetItem(g, vp->k++, tdp->Usedom ? node : NULL) !(node = (vp->nl) ? vp->nl->GetItem(g, vp->k++, tdp->Usedom ? node : NULL)
: NULL)) : NULL)) {
if (j) { if (j) {
vp = lvlp[--j]; vp = lvlp[--j];
...@@ -234,6 +234,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) ...@@ -234,6 +234,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
continue; continue;
} else } else
break; break;
}
xcol->Name[vp->n] = 0; xcol->Name[vp->n] = 0;
fmt[vp->m] = 0; fmt[vp->m] = 0;
...@@ -1268,7 +1269,7 @@ int TDBXML::ReadDB(PGLOBAL g) ...@@ -1268,7 +1269,7 @@ int TDBXML::ReadDB(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
bool TDBXML::CheckRow(PGLOBAL g, bool b) bool TDBXML::CheckRow(PGLOBAL g, bool b)
{ {
if (NewRow && Mode == MODE_INSERT) if (NewRow && Mode == MODE_INSERT) {
if (Rowname) { if (Rowname) {
TabNode->AddText(g, "\n\t"); TabNode->AddText(g, "\n\t");
RowNode = TabNode->AddChildNode(g, Rowname, RowNode); RowNode = TabNode->AddChildNode(g, Rowname, RowNode);
...@@ -1276,6 +1277,7 @@ bool TDBXML::CheckRow(PGLOBAL g, bool b) ...@@ -1276,6 +1277,7 @@ bool TDBXML::CheckRow(PGLOBAL g, bool b)
strcpy(g->Message, MSG(NO_ROW_NODE)); strcpy(g->Message, MSG(NO_ROW_NODE));
return true; return true;
} // endif Rowname } // endif Rowname
}
if (Colname && (NewRow || b)) if (Colname && (NewRow || b))
Clist = RowNode->SelectNodes(g, Colname, Clist); Clist = RowNode->SelectNodes(g, Colname, Clist);
...@@ -1522,12 +1524,13 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) ...@@ -1522,12 +1524,13 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode)
// Analyze the Xpath for this column // Analyze the Xpath for this column
for (i = 0, p = pbuf; (p2 = strchr(p, '/')); i++, p = p2 + 1) { for (i = 0, p = pbuf; (p2 = strchr(p, '/')); i++, p = p2 + 1) {
if (Tdbp->Mulnode && !strncmp(p, Tdbp->Mulnode, p2 - p)) if (Tdbp->Mulnode && !strncmp(p, Tdbp->Mulnode, p2 - p)) {
if (!Tdbp->Xpand && mode) { if (!Tdbp->Xpand && mode) {
strcpy(g->Message, MSG(CONCAT_SUBNODE)); strcpy(g->Message, MSG(CONCAT_SUBNODE));
return true; return true;
} else } else
Inod = i; // Index of multiple node Inod = i; // Index of multiple node
}
if (mode) { if (mode) {
// For Update or Insert the Xpath must be explicit // For Update or Insert the Xpath must be explicit
...@@ -1773,11 +1776,12 @@ void XMLCOL::WriteColumn(PGLOBAL g) ...@@ -1773,11 +1776,12 @@ void XMLCOL::WriteColumn(PGLOBAL g)
else else
break; break;
if (ColNode) if (ColNode) {
if (Type) if (Type)
ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp); ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);
else else
AttNode = ColNode->GetAttribute(g, Xname, Vxap); AttNode = ColNode->GetAttribute(g, Xname, Vxap);
}
if (TopNode || ValNode || AttNode) if (TopNode || ValNode || AttNode)
break; // We found the good column break; // We found the good column
...@@ -1790,7 +1794,7 @@ void XMLCOL::WriteColumn(PGLOBAL g) ...@@ -1790,7 +1794,7 @@ void XMLCOL::WriteColumn(PGLOBAL g)
/* Create missing nodes. */ /* Create missing nodes. */
/*********************************************************************/ /*********************************************************************/
if (ColNode == NULL) { if (ColNode == NULL) {
if (TopNode == NULL) if (TopNode == NULL) {
if (Tdbp->Clist) { if (Tdbp->Clist) {
Tdbp->RowNode->AddText(g, "\n\t\t"); Tdbp->RowNode->AddText(g, "\n\t\t");
ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname); ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname);
...@@ -1798,7 +1802,7 @@ void XMLCOL::WriteColumn(PGLOBAL g) ...@@ -1798,7 +1802,7 @@ void XMLCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode; TopNode = ColNode;
} else } else
TopNode = Tdbp->RowNode; TopNode = Tdbp->RowNode;
}
for (; k < Nod && TopNode; k++) { for (; k < Nod && TopNode; k++) {
if (!done) { if (!done) {
TopNode->AddText(g, "\n\t\t"); TopNode->AddText(g, "\n\t\t");
...@@ -2012,7 +2016,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) ...@@ -2012,7 +2016,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode; TopNode = ColNode;
} // endfor k } // endfor k
if (ColNode) if (ColNode) {
if (Inod == Nod) { if (Inod == Nod) {
/***************************************************************/ /***************************************************************/
/* The node value can be multiple. */ /* The node value can be multiple. */
...@@ -2034,7 +2038,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) ...@@ -2034,7 +2038,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp); ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);
else else
AttNode = ColNode->GetAttribute(g, Xname, Vxap); AttNode = ColNode->GetAttribute(g, Xname, Vxap);
}
if (TopNode || ValNode || AttNode) if (TopNode || ValNode || AttNode)
break; // We found the good column break; // We found the good column
else if (Tdbp->Clist) else if (Tdbp->Clist)
...@@ -2046,7 +2050,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) ...@@ -2046,7 +2050,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
/* Create missing nodes. */ /* Create missing nodes. */
/*********************************************************************/ /*********************************************************************/
if (ColNode == NULL) { if (ColNode == NULL) {
if (TopNode == NULL) if (TopNode == NULL) {
if (Tdbp->Clist) { if (Tdbp->Clist) {
Tdbp->RowNode->AddText(g, "\n\t\t"); Tdbp->RowNode->AddText(g, "\n\t\t");
ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname); ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname);
...@@ -2054,7 +2058,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) ...@@ -2054,7 +2058,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode; TopNode = ColNode;
} else } else
TopNode = Tdbp->RowNode; TopNode = Tdbp->RowNode;
}
for (; k < Nod && TopNode; k++) { for (; k < Nod && TopNode; k++) {
if (!done) { if (!done) {
TopNode->AddText(g, "\n\t\t"); TopNode->AddText(g, "\n\t\t");
......
...@@ -558,13 +558,14 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp) ...@@ -558,13 +558,14 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
Nk, n, Num_K, Ndif, addcolp, Tdbp->To_BlkFil, X); Nk, n, Num_K, Ndif, addcolp, Tdbp->To_BlkFil, X);
// Check whether the unique index is unique indeed // Check whether the unique index is unique indeed
if (!Mul) if (!Mul) {
if (Ndif < Num_K) { if (Ndif < Num_K) {
strcpy(g->Message, MSG(INDEX_NOT_UNIQ)); strcpy(g->Message, MSG(INDEX_NOT_UNIQ));
brc = true; brc = true;
goto err; goto err;
} else } else
PlgDBfree(Offset); // Not used anymore PlgDBfree(Offset); // Not used anymore
}
// Restore kcp list // Restore kcp list
To_LastCol->Next = addcolp; To_LastCol->Next = addcolp;
...@@ -1207,7 +1208,6 @@ bool XINDEX::MapInit(PGLOBAL g) ...@@ -1207,7 +1208,6 @@ bool XINDEX::MapInit(PGLOBAL g)
PCOL colp; PCOL colp;
PXCOL prev = NULL, kcp = NULL; PXCOL prev = NULL, kcp = NULL;
PDOSDEF defp = (PDOSDEF)Tdbp->To_Def; PDOSDEF defp = (PDOSDEF)Tdbp->To_Def;
PDBUSER dup = PlgGetUser(g);
/*********************************************************************/ /*********************************************************************/
/* Get the estimated table size. */ /* Get the estimated table size. */
...@@ -2038,12 +2038,12 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl) ...@@ -2038,12 +2038,12 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl)
kp->Valp->SetValue_pval(xp->GetValue(), !kp->Prefix); kp->Valp->SetValue_pval(xp->GetValue(), !kp->Prefix);
k = FastFind(); k = FastFind();
if (k < Num_K || Op != OP_EQ) if (k < Num_K || Op != OP_EQ) {
if (limit) if (limit)
n = (Mul) ? k : kp->Val_K; n = (Mul) ? k : kp->Val_K;
else else
n = (Mul) ? Pof[kp->Val_K + 1] - k : 1; n = (Mul) ? Pof[kp->Val_K + 1] - k : 1;
}
} else { } else {
strcpy(g->Message, MSG(RANGE_NO_JOIN)); strcpy(g->Message, MSG(RANGE_NO_JOIN));
n = -1; // Logical error n = -1; // Logical error
......
...@@ -518,16 +518,16 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f ...@@ -518,16 +518,16 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
break; break;
for (i=(int)uReadSize-3; (i--)>0;) for (i=(int)uReadSize-3; (i--)>0;) {
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
{ {
uPosFound = uReadPos+i; uPosFound = uReadPos+i;
break; break;
} }
}
if (uPosFound!=0) if (uPosFound!=0)
break; break;
} }
TRYFREE(buf); TRYFREE(buf);
return uPosFound; return uPosFound;
...@@ -1066,11 +1066,10 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, ...@@ -1066,11 +1066,10 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
uInt i; uInt i;
int err = ZIP_OK; int err = ZIP_OK;
# ifdef NOCRYPT #ifdef NOCRYPT
(crcForCrypting);
if (password != NULL) if (password != NULL)
return ZIP_PARAMERROR; return ZIP_PARAMERROR;
# endif #endif
if (file == NULL) if (file == NULL)
return ZIP_PARAMERROR; return ZIP_PARAMERROR;
......
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