@@ -177,7 +177,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
177177 bool mgo = (GetTypeID (topt->type ) == TAB_MONGO);
178178 PCSZ level = GetStringTableOption (g, topt, " Level" , NULL );
179179
180- if (level = GetStringTableOption (g, topt, " Depth" , level)) {
180+ if (( level = GetStringTableOption (g, topt, " Depth" , level) )) {
181181lvl = atoi (level);
182182 lvl = (lvl > 16 ) ? 16 : lvl;
183183 } else
@@ -254,12 +254,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
254254
255255 jsp = (tjsp->GetDoc ()) ? tjsp->GetDoc ()->GetValue (0 ) : NULL ;
256256 } else {
257- if (!(tdp->Lrecl = GetIntegerTableOption (g, topt, " Lrecl" , 0 )))
258- if (!mgo) {
259- sprintf (g->Message , " LRECL must be specified for pretty=%d" , tdp->Pretty );
260- return 0 ;
261- } else
262- tdp->Lrecl = 8192 ; // Should be enough
257+ if (!((tdp->Lrecl = GetIntegerTableOption (g, topt, " Lrecl" , 0 )))) {
258+ if (!mgo) {
259+ sprintf (g->Message , " LRECL must be specified for pretty=%d" , tdp->Pretty );
260+ return 0 ;
261+ } else
262+ tdp->Lrecl = 8192 ; // Should be enough
263+
264+ } // endif Lrecl
263265
264266 tdp->Ending = GetIntegerTableOption (g, topt, " Ending" , CRLF);
265267
@@ -1329,7 +1331,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
13291331{
13301332 char *p, *p1 = NULL , *p2 = NULL , *pbuf = NULL ;
13311333 int i;
1332- bool a, mul = false ;
1334+ bool a;
13331335
13341336 if (Parsed)
13351337 return false ; // Already done
@@ -1487,8 +1489,8 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp)
14871489 strcpy (g->Message , " Cannot make Json for a numeric column" );
14881490 Value->Reset ();
14891491} else if (Value->GetType () == TYPE_BIN) {
1490- if (Value->GetClen () >= sizeof (BSON)) {
1491- ULONG len = Tjp->Lrecl ? Tjp->Lrecl : 500 ;
1492+ if (( unsigned ) Value->GetClen () >= sizeof (BSON)) {
1493+ ulong len = Tjp->Lrecl ? Tjp->Lrecl : 500 ;
14921494PBSON bsp = JbinAlloc (g, NULL , len, jsp);
14931495
14941496strcat (bsp->Msg , " column" );
@@ -1570,7 +1572,6 @@ void JSONCOL::ReadColumn(PGLOBAL g)
15701572PVAL JSONCOL::GetColumnValue (PGLOBAL g, PJSON row, int i)
15711573 {
15721574 int n = Nod - 1 ;
1573- bool expd = false ;
15741575 PJAR arp;
15751576 PJVAL val = NULL ;
15761577
@@ -2130,13 +2131,15 @@ int TDBJSON::Cardinality(PGLOBAL g)
21302131 {
21312132 if (!g)
21322133 return (Xcol || Multiple) ? 0 : 1 ;
2133- else if (Cardinal < 0 )
2134- if (!Multiple) {
2135- if (MakeDocument (g) == RC_OK)
2136- Cardinal = Doc->size ();
2134+ else if (Cardinal < 0 ) {
2135+ if (!Multiple) {
2136+ if (MakeDocument (g) == RC_OK)
2137+ Cardinal = Doc->size ();
21372138
2138- } else
2139- return 10 ;
2139+ } else
2140+ return 10 ;
2141+
2142+ } // endif Cardinal
21402143
21412144 return Cardinal;
21422145 } // end of Cardinality
0 commit comments