From 36b2dec1141f04479d4805e068bd549248c4c4c7 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 31 Aug 2017 01:22:50 +0200 Subject: - Set MONGO_ENABLED modified: storage/connect/CMakeLists.txt - Avoid gcc warnings for "fall through" modified: storage/connect/array.cpp modified: storage/connect/filamdbf.cpp modified: storage/connect/filamfix.cpp modified: storage/connect/filamtxt.cpp modified: storage/connect/filamvct.cpp modified: storage/connect/filamzip.cpp modified: storage/connect/filter.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp modified: storage/connect/plgdbutl.cpp modified: storage/connect/reldef.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/xobject.cpp --- storage/connect/CMakeLists.txt | 2 +- storage/connect/array.cpp | 2 ++ storage/connect/filamdbf.cpp | 4 +++- storage/connect/filamfix.cpp | 3 ++- storage/connect/filamtxt.cpp | 1 + storage/connect/filamvct.cpp | 3 +++ storage/connect/filamzip.cpp | 2 +- storage/connect/filter.cpp | 5 ++--- storage/connect/ha_connect.cc | 5 +---- storage/connect/jsonudf.cpp | 2 +- storage/connect/plgdbutl.cpp | 4 ++-- storage/connect/reldef.cpp | 1 + storage/connect/tabdos.cpp | 1 + storage/connect/tabjson.cpp | 2 +- storage/connect/xobject.cpp | 2 +- 15 files changed, 23 insertions(+), 16 deletions(-) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index c23598323a3..d9bef33a835 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -270,7 +270,7 @@ IF(CONNECT_WITH_JDBC) jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp jmgfam.h jmgoconn.h mongo.h tabjmg.h Mongo2Interface.java Mongo3Interface.java) - add_definitions(-DMONGO_SUPPORT) + add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=1) ENDIF() ELSE() SET(JDBC_LIBRARY "") diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index 285469462fa..639edf63a1a 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -155,6 +155,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec) switch (type) { case TYPE_STRING: Len = length; + /* fall through */ case TYPE_SHORT: case TYPE_INT: case TYPE_DOUBLE: @@ -592,6 +593,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp) switch (Type) { case TYPE_DOUBLE: prec = 2; + /* fall through */ case TYPE_SHORT: case TYPE_INT: case TYPE_DATE: diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 8878f2c922b..44abd962c56 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -503,7 +503,8 @@ bool DBFFAM::OpenTableFile(PGLOBAL g) break; } // endif - // Selective delete, pass thru + // Selective delete + /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); strcpy(opmode, (UseTemp) ? "rb" : "r+b"); @@ -623,6 +624,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) case 'L': // Large (big) integer case 'T': // Tiny integer c = 'N'; // Numeric + /* fall through */ case 'N': // Numeric (integer) case 'F': // Float (double) descp->Decimals = (uchar)cdp->F.Prec; diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp index 962a4516bf2..1d6194b154d 100644 --- a/storage/connect/filamfix.cpp +++ b/storage/connect/filamfix.cpp @@ -920,7 +920,8 @@ bool BGXFAM::OpenTableFile(PGLOBAL g) break; } // endif - // Selective delete, pass thru + // Selective delete + /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); oflag |= (UseTemp) ? O_RDONLY : O_RDWR; diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index 382af51aae4..c456ee9e9b7 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -574,6 +574,7 @@ bool DOSFAM::OpenTableFile(PGLOBAL g) // Selective delete, pass thru Bin = true; + /* fall through */ case MODE_UPDATE: if ((UseTemp = Tdbp->IsUsingTemp(g))) { strcpy(opmode, "r"); diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 62577009766..871613cb4b4 100755 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -440,6 +440,7 @@ bool VCTFAM::OpenTableFile(PGLOBAL g) } // endif // Selective delete, pass thru + /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); strcpy(opmode, (UseTemp) ? "rb" : "r+b"); @@ -1918,6 +1919,7 @@ bool VECFAM::OpenTableFile(PGLOBAL g) } // endif filter // Selective delete, pass thru + /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); strcpy(opmode, (UseTemp) ? "rb": "r+b"); @@ -3585,6 +3587,7 @@ bool BGVFAM::OpenTableFile(PGLOBAL g) } // endif // Selective delete, pass thru + /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); oflag = (UseTemp) ? O_RDONLY : O_RDWR; diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index c40c5fb1b47..dfd9343af76 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -344,7 +344,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn, bool append) bool ZIPUTIL::addEntry(PGLOBAL g, PCSZ entry) { //?? we dont need the stinking time - zip_fileinfo zi = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + zip_fileinfo zi = { {0, 0, 0, 0, 0, 0}, 0, 0, 0 }; getTime(zi.tmz_date); target = entry; diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp index 2fd88b6674e..6a96240c469 100644 --- a/storage/connect/filter.cpp +++ b/storage/connect/filter.cpp @@ -1193,7 +1193,7 @@ bool FILTER::Convert(PGLOBAL g, bool having) Arg(0) = pXVOID; } // endif void - // pass thru + // fall through case OP_IN: // For IN operator do optimize if operand is an array if (GetArgType(1) != TYPE_ARRAY) @@ -1260,6 +1260,7 @@ bool FILTER::Eval(PGLOBAL g) } // endif Opm // For modified operators, pass thru + /* fall through */ case OP_IN: case OP_EXIST: // For IN operations, special processing is done here @@ -1798,8 +1799,6 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having) if (trace) htrc(" returning filp=%p\n", filp); -//if (filp) -// filp->Print(g, debug, 0); return filp; } // end of PrepareFilter diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 6dd5131c238..5b542882f28 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -182,10 +182,7 @@ extern "C" { #if defined(NEW_MAR) #define stored_in_db stored_in_db() -#define MONGO_ENABLED 1 -#else // !NEW_MAR -#define MONGO_ENABLED 0 -#endif // !NEW_MAR) +#endif // NEW_MAR) #if defined(XMAP) my_bool xmap= false; diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 6acf18cd323..4f0978cb548 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -537,7 +537,7 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n) SetJsonValue(g, MulVal, jvp, n); if (!MulVal->IsNull()) { - switch (op) { + switch (op) { case OP_CNC: if (Nodes[n].CncVal) { val[0] = Nodes[n].CncVal; diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index 0943ce9f222..25da3162516 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -95,7 +95,7 @@ extern pthread_mutex_t parmut; //#endif // !__WIN__ // The debug trace used by the main thread - FILE *pfile = NULL; +FILE *pfile = NULL; MBLOCK Nmblk = {NULL, false, 0, false, NULL}; // Used to init MBLOCK's @@ -912,7 +912,7 @@ int PlugCloseFile(PGLOBAL g, PFBLOCK fp, bool all) fp->Memory = NULL; fp->Mode = MODE_ANY; - // Passthru + // fall through case TYPE_FB_HANDLE: if (fp->Handle && fp->Handle != INVALID_HANDLE_VALUE) if (CloseFileHandle(fp->Handle)) diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 718da35c7ce..95069baf76e 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -129,6 +129,7 @@ int RELDEF::GetSizeCatInfo(PCSZ what, PCSZ sdef) switch (toupper(c)) { case 'M': n *= 1024; + // fall through case 'K': n *= 1024; } // endswitch c diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index e192ef202a9..5b9667a6c84 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -1311,6 +1311,7 @@ PBF TDBDOS::InitBlockFilter(PGLOBAL g, PFIL filp) } // endif !opm // if opm, pass thru + // fall through case OP_IN: if (filp->GetArgType(0) == TYPE_COLBLK && filp->GetArgType(1) == TYPE_ARRAY) { diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 1b7ab8ca952..76a3d5e9988 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -1810,7 +1810,7 @@ void JSONCOL::WriteColumn(PGLOBAL g) break; } // endif Op - // Passthru + // fall through case TYPE_DATE: case TYPE_INT: case TYPE_TINY: diff --git a/storage/connect/xobject.cpp b/storage/connect/xobject.cpp index eca60561b92..02d3e974dcc 100644 --- a/storage/connect/xobject.cpp +++ b/storage/connect/xobject.cpp @@ -408,7 +408,7 @@ bool STRING::Append_quoted(PCSZ s) case '\r': case '\b': case '\f': b |= Append('\\'); - // passthru + // fall through default: b |= Append(*p); break; -- cgit v1.2.1