Skip to content
Permalink
Browse files
Fix compiler warnings with clang
  • Loading branch information
rouault committed Sep 5, 2019
1 parent 2939f8b commit 0d1c6db13a65a6988cf8cff041758e04c8942f4e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
@@ -835,7 +835,7 @@ int msLoadMapContextLayer(mapObj *map, CPLXMLNode *psLayer, int nVersion,
/* Status */
pszValue = (char*)CPLGetXMLValue(psLayer, "hidden", "1");
if((pszValue != NULL) && (atoi(pszValue) == 0 &&
!strcasecmp(pszValue, "true") == 0))
strcasecmp(pszValue, "true") != 0))
layer->status = MS_ON;
else
layer->status = MS_OFF;
@@ -4363,7 +4363,7 @@ int loadLayer(layerObj *layer, mapObj *map)
if(getString(&layer->encoding) == MS_FAILURE) return(-1);
break;
case(END):
if(layer->type == -1) {
if((int)layer->type == -1) {
msSetError(MS_MISCERR, "Layer type not set.", "loadLayer()");
return(-1);
}
@@ -4382,7 +4382,7 @@ int loadLayer(layerObj *layer, mapObj *map)
break;
}
case(FEATURE):
if(layer->type == -1) {
if((int)layer->type == -1) {
msSetError(MS_MISCERR, "Layer type must be set before defining inline features.", "loadLayer()");
return(-1);
}
@@ -6611,7 +6611,7 @@ static int loadMapInternal(mapObj *map)
if((map->transparent = getSymbol(2, MS_ON,MS_OFF)) == -1) return MS_FAILURE;
break;
case(UNITS):
if((map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) return MS_FAILURE;
if((int)(map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) return MS_FAILURE;
break;
case(WEB):
if(loadWeb(&(map->web), map) == -1) return MS_FAILURE;
@@ -7030,7 +7030,7 @@ int msUpdateMapFromURL(mapObj *map, char *variable, char *string)
msyystring = string;
msyylex();

if((map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) break;
if((int)(map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) break;
break;
case(WEB):
return msUpdateWebFromString(&(map->web), string, MS_TRUE);
@@ -1319,16 +1319,14 @@ makeTimeFilter(layerObj *lp,
msFreeExpression(&lp->filter);
*/

if (&lp->filter) {
/* if the filter is set and it's a sting type, concatenate it with
the time. If not just free it */
if (lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, "((");
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
} else {
msFreeExpression(&lp->filter);
}
/* if the filter is set and it's a sting type, concatenate it with
the time. If not just free it */
if (lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, "((");
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
} else {
msFreeExpression(&lp->filter);
}

pszBuffer = msStringConcatenate(pszBuffer, "(");
@@ -1359,7 +1357,7 @@ makeTimeFilter(layerObj *lp,
pszBuffer = msStringConcatenate(pszBuffer, ")");

/* if there was a filter, It was concatenate with an And ans should be closed*/
if(&lp->filter && lp->filter.string && lp->filter.type == MS_STRING) {
if(lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, ")");
}

@@ -1377,7 +1375,7 @@ makeTimeFilter(layerObj *lp,
return MS_FALSE;
}

if (&lp->filter && lp->filter.string && lp->filter.type == MS_STRING) {
if (lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, "((");
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
@@ -1502,7 +1500,7 @@ makeTimeFilter(layerObj *lp,

/* load the string to the filter */
if (pszBuffer && strlen(pszBuffer) > 0) {
if(&lp->filter && lp->filter.string && lp->filter.type == MS_STRING)
if(lp->filter.string && lp->filter.type == MS_STRING)
pszBuffer = msStringConcatenate(pszBuffer, ")");
/*
if(lp->filteritem)
@@ -4133,8 +4133,8 @@ char *msSLDGenerateTextSLD(classObj *psClass, layerObj *psLayer, int nVersion)
snprintf(szTmp, sizeof(szTmp), "<%sFill>\n", sNameSpace );
pszSLD = msStringConcatenate(pszSLD, szTmp);

sprintf(szHexColor,"%02hhx%02hhx%02hhx",nColorRed,
nColorGreen, nColorBlue);
sprintf(szHexColor,"%02hhx%02hhx%02hhx",(unsigned char)nColorRed,
(unsigned char)nColorGreen, (unsigned char)nColorBlue);

snprintf(szTmp, sizeof(szTmp),
"<%s name=\"fill\">#%s</%s>\n",
@@ -1924,10 +1924,8 @@ this request. Check sos/ows_enable_request settings.", "msSOSGetObservation()",
/* HACK END */

pszBuffer = NULL;
if (&lp->filter) {
if (lp->filter.string && strlen(lp->filter.string) > 0)
msFreeExpression(&lp->filter);
}
if (lp->filter.string && strlen(lp->filter.string) > 0)
msFreeExpression(&lp->filter);

/*The filter should reflect the underlying db*/
/*for ogr add a where clause */
@@ -169,7 +169,7 @@ imageObj *msDrawScalebar(mapObj *map)
strokeStyle.patternlength=0;
initTextSymbol(&ts);

if(map->units == -1) {
if((int)map->units == -1) {
msSetError(MS_MISCERR, "Map units not set.", "msDrawScalebar()");
return(NULL);
}

0 comments on commit 0d1c6db

Please sign in to comment.