Commit d4138e7e authored by Olivier Bertrand's avatar Olivier Bertrand

Fix compile error in tabjson.cpp (ULONG -> ulong)

parent 307258c8
...@@ -177,7 +177,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) ...@@ -177,7 +177,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
bool mgo = (GetTypeID(topt->type) == TAB_MONGO); bool mgo = (GetTypeID(topt->type) == TAB_MONGO);
PCSZ level = GetStringTableOption(g, topt, "Level", NULL); PCSZ level = GetStringTableOption(g, topt, "Level", NULL);
if (level = GetStringTableOption(g, topt, "Depth", level)) { if ((level = GetStringTableOption(g, topt, "Depth", level))) {
lvl = atoi(level); lvl = atoi(level);
lvl = (lvl > 16) ? 16 : lvl; lvl = (lvl > 16) ? 16 : lvl;
} else } else
...@@ -254,12 +254,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) ...@@ -254,12 +254,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL; jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
} else { } else {
if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0))) if (!((tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))) {
if (!mgo) { if (!mgo) {
sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty); sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
return 0; return 0;
} else } else
tdp->Lrecl = 8192; // Should be enough tdp->Lrecl = 8192; // Should be enough
} // endif Lrecl
tdp->Ending = GetIntegerTableOption(g, topt, "Ending", CRLF); tdp->Ending = GetIntegerTableOption(g, topt, "Ending", CRLF);
...@@ -1329,7 +1331,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g) ...@@ -1329,7 +1331,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
{ {
char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL; char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL;
int i; int i;
bool a, mul = false; bool a;
if (Parsed) if (Parsed)
return false; // Already done return false; // Already done
...@@ -1487,8 +1489,8 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp) ...@@ -1487,8 +1489,8 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp)
strcpy(g->Message, "Cannot make Json for a numeric column"); strcpy(g->Message, "Cannot make Json for a numeric column");
Value->Reset(); Value->Reset();
} else if (Value->GetType() == TYPE_BIN) { } else if (Value->GetType() == TYPE_BIN) {
if (Value->GetClen() >= sizeof(BSON)) { if ((unsigned)Value->GetClen() >= sizeof(BSON)) {
ULONG len = Tjp->Lrecl ? Tjp->Lrecl : 500; ulong len = Tjp->Lrecl ? Tjp->Lrecl : 500;
PBSON bsp = JbinAlloc(g, NULL, len, jsp); PBSON bsp = JbinAlloc(g, NULL, len, jsp);
strcat(bsp->Msg, " column"); strcat(bsp->Msg, " column");
...@@ -1570,7 +1572,6 @@ void JSONCOL::ReadColumn(PGLOBAL g) ...@@ -1570,7 +1572,6 @@ void JSONCOL::ReadColumn(PGLOBAL g)
PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i) PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i)
{ {
int n = Nod - 1; int n = Nod - 1;
bool expd = false;
PJAR arp; PJAR arp;
PJVAL val = NULL; PJVAL val = NULL;
...@@ -2130,13 +2131,15 @@ int TDBJSON::Cardinality(PGLOBAL g) ...@@ -2130,13 +2131,15 @@ int TDBJSON::Cardinality(PGLOBAL g)
{ {
if (!g) if (!g)
return (Xcol || Multiple) ? 0 : 1; return (Xcol || Multiple) ? 0 : 1;
else if (Cardinal < 0) else if (Cardinal < 0) {
if (!Multiple) { if (!Multiple) {
if (MakeDocument(g) == RC_OK) if (MakeDocument(g) == RC_OK)
Cardinal = Doc->size(); Cardinal = Doc->size();
} else } else
return 10; return 10;
} // endif Cardinal
return Cardinal; return Cardinal;
} // end of Cardinality } // end of Cardinality
......
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