Commit a7b6943e authored by Sergei Golubchik's avatar Sergei Golubchik

CONNECT: compiler warnings

parent bbbe7e78
...@@ -599,10 +599,12 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp) ...@@ -599,10 +599,12 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp)
/* Converting STRING to DATE can be done according to date format. */ /* Converting STRING to DATE can be done according to date format. */
/*********************************************************************/ /*********************************************************************/
if (Type == TYPE_DATE && ovblp->GetType() == TYPE_STRING && vp) if (Type == TYPE_DATE && ovblp->GetType() == TYPE_STRING && vp)
{
if (((DTVAL*)Value)->SetFormat(g, vp)) if (((DTVAL*)Value)->SetFormat(g, vp))
return TYPE_ERROR; return TYPE_ERROR;
else else
b = true; // Sort the new array on date internal values b = true; // Sort the new array on date internal values
}
/*********************************************************************/ /*********************************************************************/
/* Do the actual conversion. */ /* Do the actual conversion. */
......
...@@ -79,7 +79,7 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp) ...@@ -79,7 +79,7 @@ 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);
...@@ -88,6 +88,7 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp) ...@@ -88,6 +88,7 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp)
colp->Next = this; colp->Next = this;
} // endelse } // endelse
}
} // end of COLBLK copy constructor } // end of COLBLK copy constructor
......
...@@ -147,7 +147,6 @@ static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, PCSZ fn, PCSZ entry, char *buf) ...@@ -147,7 +147,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 */
...@@ -155,6 +154,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) ...@@ -155,6 +154,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
strcpy(filename, pat); strcpy(filename, pat);
#if defined(__WIN__) #if defined(__WIN__)
int rc;
char drive[_MAX_DRIVE], direc[_MAX_DIR]; char drive[_MAX_DRIVE], direc[_MAX_DIR];
WIN32_FIND_DATA FileData; WIN32_FIND_DATA FileData;
HANDLE hSearch; HANDLE hSearch;
...@@ -1207,7 +1207,7 @@ int UZDFAM::Cardinality(PGLOBAL g) ...@@ -1207,7 +1207,7 @@ int UZDFAM::Cardinality(PGLOBAL g)
return 1; return 1;
int card = -1; int card = -1;
int len = GetFileLength(g); GetFileLength(g);
card = Records; card = Records;
......
...@@ -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
......
...@@ -311,12 +311,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info) ...@@ -311,12 +311,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
} else if (*p == q) { } else if (*p == q) {
if (phase == 0) { if (phase == 0) {
if (blank) if (blank) {
if (++nerr > mxr) { if (++nerr > mxr) {
sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read); sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read);
goto err; goto err;
} else } else
goto skip; goto skip;
}
n = 0; n = 0;
phase = digit = 1; phase = digit = 1;
...@@ -341,12 +342,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info) ...@@ -341,12 +342,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
goto skip; goto skip;
} else { } else {
if (phase == 2) if (phase == 2) {
if (++nerr > mxr) { if (++nerr > mxr) {
sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read); sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read);
goto err; goto err;
} else } else
goto skip; goto skip;
}
// isdigit cannot be used here because of debug assert // isdigit cannot be used here because of debug assert
if (!strchr("0123456789", *p)) { if (!strchr("0123456789", *p)) {
...@@ -362,12 +364,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info) ...@@ -362,12 +364,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
blank = 1; blank = 1;
} // endif's *p } // endif's *p
if (phase == 1) if (phase == 1) {
if (++nerr > mxr) { if (++nerr > mxr) {
sprintf(g->Message, MSG(UNBALANCE_QUOTE), num_read); sprintf(g->Message, MSG(UNBALANCE_QUOTE), num_read);
goto err; goto err;
} else } else
goto skip; goto skip;
}
if (n) { if (n) {
len[i] = MY_MAX(len[i], n); len[i] = MY_MAX(len[i], n);
...@@ -741,7 +744,7 @@ bool TDBCSV::OpenDB(PGLOBAL g) ...@@ -741,7 +744,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
int i, len; int i, len;
PCSVCOL colp; PCSVCOL colp;
if (!Fields) // May have been set in TABFMT::OpenDB if (!Fields) { // May have been set in TABFMT::OpenDB
if (Mode != MODE_UPDATE && Mode != MODE_INSERT) { if (Mode != MODE_UPDATE && Mode != MODE_INSERT) {
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next) for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
if (!colp->IsSpecial() && !colp->IsVirtual()) if (!colp->IsSpecial() && !colp->IsVirtual())
...@@ -754,6 +757,7 @@ bool TDBCSV::OpenDB(PGLOBAL g) ...@@ -754,6 +757,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext()) for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
if (!cdp->IsSpecial() && !cdp->IsVirtual()) if (!cdp->IsSpecial() && !cdp->IsVirtual())
Fields++; Fields++;
}
Offset = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields); Offset = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields);
Fldlen = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields); Fldlen = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields);
...@@ -774,7 +778,7 @@ bool TDBCSV::OpenDB(PGLOBAL g) ...@@ -774,7 +778,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
} // endfor i } // endfor i
if (Field) if (Field) {
// Prepare writing fields // Prepare writing fields
if (Mode != MODE_UPDATE) { if (Mode != MODE_UPDATE) {
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next) for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
...@@ -797,6 +801,7 @@ bool TDBCSV::OpenDB(PGLOBAL g) ...@@ -797,6 +801,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
Fldlen[i] = len; Fldlen[i] = len;
Fldtyp[i] = IsTypeNum(cdp->GetType()); Fldtyp[i] = IsTypeNum(cdp->GetType());
} // endif cdp } // endif cdp
}
} // endif Use } // endif Use
...@@ -1046,7 +1051,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) ...@@ -1046,7 +1051,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
if (i) if (i)
strcat(To_Line, sep); strcat(To_Line, sep);
if (Field[i]) if (Field[i]) {
if (!strlen(Field[i])) { if (!strlen(Field[i])) {
// Generally null fields are not quoted // Generally null fields are not quoted
if (Quoted > 2) if (Quoted > 2)
...@@ -1054,7 +1059,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) ...@@ -1054,7 +1059,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
strcat(strcat(To_Line, qot), qot); strcat(strcat(To_Line, qot), qot);
} else if (Qot && (strchr(Field[i], Sep) || *Field[i] == Qot } else if (Qot && (strchr(Field[i], Sep) || *Field[i] == Qot
|| Quoted > 1 || (Quoted == 1 && !Fldtyp[i]))) || Quoted > 1 || (Quoted == 1 && !Fldtyp[i]))) {
if (strchr(Field[i], Qot)) { if (strchr(Field[i], Qot)) {
// Field contains quotes that must be doubled // Field contains quotes that must be doubled
int j, k = strlen(To_Line), n = strlen(Field[i]); int j, k = strlen(To_Line), n = strlen(Field[i]);
...@@ -1072,9 +1077,11 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) ...@@ -1072,9 +1077,11 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
To_Line[k] = '\0'; To_Line[k] = '\0';
} else } else
strcat(strcat(strcat(To_Line, qot), Field[i]), qot); strcat(strcat(strcat(To_Line, qot), Field[i]), qot);
}
else else
strcat(To_Line, Field[i]); strcat(To_Line, Field[i]);
}
} // endfor i } // endfor i
......
...@@ -168,13 +168,13 @@ int TDBVIR::TestFilter(PFIL filp, bool nop) ...@@ -168,13 +168,13 @@ int TDBVIR::TestFilter(PFIL filp, bool nop)
} // endswitch op } // endswitch op
if (!nop) switch (op) { if (!nop) switch (op) {
case OP_LT: l1--; case OP_LT: l1--; /* fall through */
case OP_LE: limit = l1; break; case OP_LE: limit = l1; break;
default: ok = false; default: ok = false;
} // endswitch op } // endswitch op
else switch (op) { else switch (op) {
case OP_GE: l1--; case OP_GE: l1--; /* fall through */
case OP_GT: limit = l1; break; case OP_GT: limit = l1; break;
default: ok = false; default: ok = false;
} // endswitch op } // endswitch op
......
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