Skip to content

Commit 0d1c6db

Browse files
committed
Fix compiler warnings with clang
1 parent 2939f8b commit 0d1c6db

File tree

6 files changed

+21
-25
lines changed

6 files changed

+21
-25
lines changed

mapcontext.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ int msLoadMapContextLayer(mapObj *map, CPLXMLNode *psLayer, int nVersion,
835835
/* Status */
836836
pszValue = (char*)CPLGetXMLValue(psLayer, "hidden", "1");
837837
if((pszValue != NULL) && (atoi(pszValue) == 0 &&
838-
!strcasecmp(pszValue, "true") == 0))
838+
strcasecmp(pszValue, "true") != 0))
839839
layer->status = MS_ON;
840840
else
841841
layer->status = MS_OFF;

mapfile.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -4363,7 +4363,7 @@ int loadLayer(layerObj *layer, mapObj *map)
43634363
if(getString(&layer->encoding) == MS_FAILURE) return(-1);
43644364
break;
43654365
case(END):
4366-
if(layer->type == -1) {
4366+
if((int)layer->type == -1) {
43674367
msSetError(MS_MISCERR, "Layer type not set.", "loadLayer()");
43684368
return(-1);
43694369
}
@@ -4382,7 +4382,7 @@ int loadLayer(layerObj *layer, mapObj *map)
43824382
break;
43834383
}
43844384
case(FEATURE):
4385-
if(layer->type == -1) {
4385+
if((int)layer->type == -1) {
43864386
msSetError(MS_MISCERR, "Layer type must be set before defining inline features.", "loadLayer()");
43874387
return(-1);
43884388
}
@@ -6611,7 +6611,7 @@ static int loadMapInternal(mapObj *map)
66116611
if((map->transparent = getSymbol(2, MS_ON,MS_OFF)) == -1) return MS_FAILURE;
66126612
break;
66136613
case(UNITS):
6614-
if((map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) return MS_FAILURE;
6614+
if((int)(map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) return MS_FAILURE;
66156615
break;
66166616
case(WEB):
66176617
if(loadWeb(&(map->web), map) == -1) return MS_FAILURE;
@@ -7030,7 +7030,7 @@ int msUpdateMapFromURL(mapObj *map, char *variable, char *string)
70307030
msyystring = string;
70317031
msyylex();
70327032

7033-
if((map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) break;
7033+
if((int)(map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) break;
70347034
break;
70357035
case(WEB):
70367036
return msUpdateWebFromString(&(map->web), string, MS_TRUE);

maplayer.c

+11-13
Original file line numberDiff line numberDiff line change
@@ -1319,16 +1319,14 @@ makeTimeFilter(layerObj *lp,
13191319
msFreeExpression(&lp->filter);
13201320
*/
13211321

1322-
if (&lp->filter) {
1323-
/* if the filter is set and it's a sting type, concatenate it with
1324-
the time. If not just free it */
1325-
if (lp->filter.string && lp->filter.type == MS_STRING) {
1326-
pszBuffer = msStringConcatenate(pszBuffer, "((");
1327-
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
1328-
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
1329-
} else {
1330-
msFreeExpression(&lp->filter);
1331-
}
1322+
/* if the filter is set and it's a sting type, concatenate it with
1323+
the time. If not just free it */
1324+
if (lp->filter.string && lp->filter.type == MS_STRING) {
1325+
pszBuffer = msStringConcatenate(pszBuffer, "((");
1326+
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
1327+
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
1328+
} else {
1329+
msFreeExpression(&lp->filter);
13321330
}
13331331

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

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

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

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

15031501
/* load the string to the filter */
15041502
if (pszBuffer && strlen(pszBuffer) > 0) {
1505-
if(&lp->filter && lp->filter.string && lp->filter.type == MS_STRING)
1503+
if(lp->filter.string && lp->filter.type == MS_STRING)
15061504
pszBuffer = msStringConcatenate(pszBuffer, ")");
15071505
/*
15081506
if(lp->filteritem)

mapogcsld.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4133,8 +4133,8 @@ char *msSLDGenerateTextSLD(classObj *psClass, layerObj *psLayer, int nVersion)
41334133
snprintf(szTmp, sizeof(szTmp), "<%sFill>\n", sNameSpace );
41344134
pszSLD = msStringConcatenate(pszSLD, szTmp);
41354135

4136-
sprintf(szHexColor,"%02hhx%02hhx%02hhx",nColorRed,
4137-
nColorGreen, nColorBlue);
4136+
sprintf(szHexColor,"%02hhx%02hhx%02hhx",(unsigned char)nColorRed,
4137+
(unsigned char)nColorGreen, (unsigned char)nColorBlue);
41384138

41394139
snprintf(szTmp, sizeof(szTmp),
41404140
"<%s name=\"fill\">#%s</%s>\n",

mapogcsos.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -1924,10 +1924,8 @@ this request. Check sos/ows_enable_request settings.", "msSOSGetObservation()",
19241924
/* HACK END */
19251925

19261926
pszBuffer = NULL;
1927-
if (&lp->filter) {
1928-
if (lp->filter.string && strlen(lp->filter.string) > 0)
1929-
msFreeExpression(&lp->filter);
1930-
}
1927+
if (lp->filter.string && strlen(lp->filter.string) > 0)
1928+
msFreeExpression(&lp->filter);
19311929

19321930
/*The filter should reflect the underlying db*/
19331931
/*for ogr add a where clause */

mapscale.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ imageObj *msDrawScalebar(mapObj *map)
169169
strokeStyle.patternlength=0;
170170
initTextSymbol(&ts);
171171

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

0 commit comments

Comments
 (0)