@@ -2176,10 +2176,6 @@ const char* FLTGetDuring(FilterEncodingNode *psFilterNode, const char** ppszTime
2176
2176
char * FLTGetSQLExpression (FilterEncodingNode * psFilterNode , layerObj * lp )
2177
2177
{
2178
2178
char * pszExpression = NULL ;
2179
- const char * pszAttribute = NULL ;
2180
- char szTmp [256 ];
2181
- char * * tokens = NULL ;
2182
- int nTokens = 0 , i = 0 , bString = 0 ;
2183
2179
2184
2180
if (psFilterNode == NULL || lp == NULL )
2185
2181
return NULL ;
@@ -2218,12 +2214,13 @@ char *FLTGetSQLExpression(FilterEncodingNode *psFilterNode, layerObj *lp)
2218
2214
} else if (psFilterNode -> eType == FILTER_NODE_TYPE_FEATUREID ) {
2219
2215
#if defined(USE_WMS_SVR ) || defined (USE_WFS_SVR ) || defined (USE_WCS_SVR ) || defined(USE_SOS_SVR )
2220
2216
if (psFilterNode -> pszValue ) {
2221
- pszAttribute = msOWSLookupMetadata (& (lp -> metadata ), "OFG" , "featureid" );
2217
+ const char * pszAttribute = msOWSLookupMetadata (& (lp -> metadata ), "OFG" , "featureid" );
2222
2218
if (pszAttribute ) {
2223
- tokens = msStringSplit (psFilterNode -> pszValue ,',' , & nTokens );
2224
- bString = 0 ;
2219
+ int nTokens = 0 ;
2220
+ char * * tokens = msStringSplit (psFilterNode -> pszValue ,',' , & nTokens );
2221
+ int bString = 0 ;
2225
2222
if (tokens && nTokens > 0 ) {
2226
- for (i = 0 ; i < nTokens ; i ++ ) {
2223
+ for (int i = 0 ; i < nTokens ; i ++ ) {
2227
2224
char * pszEscapedStr = NULL ;
2228
2225
const char * pszId = tokens [i ];
2229
2226
const char * pszDot = strchr (pszId , '.' );
@@ -2237,6 +2234,7 @@ char *FLTGetSQLExpression(FilterEncodingNode *psFilterNode, layerObj *lp)
2237
2234
bString = 1 ;
2238
2235
2239
2236
pszEscapedStr = msLayerEscapeSQLParam (lp , pszId );
2237
+ char szTmp [256 ];
2240
2238
if (bString )
2241
2239
{
2242
2240
if ( lp -> connectiontype == MS_OGR || lp -> connectiontype == MS_POSTGIS )
@@ -3128,19 +3126,14 @@ static void FLTRemoveGroupName(FilterEncodingNode *psFilterNode,
3128
3126
void FLTPreParseFilterForAliasAndGroup (FilterEncodingNode * psFilterNode ,
3129
3127
mapObj * map , int i , const char * namespaces )
3130
3128
{
3131
- layerObj * lp = NULL ;
3132
- char szTmp [256 ];
3133
- const char * pszFullName = NULL ;
3134
- int layerWasOpened = MS_FALSE ;
3135
-
3136
3129
#if defined(USE_WMS_SVR ) || defined (USE_WFS_SVR ) || defined (USE_WCS_SVR ) || defined(USE_SOS_SVR )
3137
3130
3138
3131
if (psFilterNode && map && i >=0 && i < map -> numlayers ) {
3139
3132
/*strip name spaces before hand*/
3140
3133
FLTStripNameSpacesFromPropertyName (psFilterNode );
3141
3134
3142
- lp = GET_LAYER (map , i );
3143
- layerWasOpened = msLayerIsOpen (lp );
3135
+ layerObj * lp = GET_LAYER (map , i );
3136
+ int layerWasOpened = msLayerIsOpen (lp );
3144
3137
if (msLayerOpen (lp ) == MS_SUCCESS && msLayerGetItems (lp ) == MS_SUCCESS ) {
3145
3138
3146
3139
/* Remove group names from property names if using groupname/itemname syntax */
@@ -3152,8 +3145,9 @@ void FLTPreParseFilterForAliasAndGroup(FilterEncodingNode *psFilterNode,
3152
3145
for (i = 0 ; i < lp -> numitems ; i ++ ) {
3153
3146
if (!lp -> items [i ] || strlen (lp -> items [i ]) <= 0 )
3154
3147
continue ;
3148
+ char szTmp [256 ];
3155
3149
snprintf (szTmp , sizeof (szTmp ), "%s_alias" , lp -> items [i ]);
3156
- pszFullName = msOWSLookupMetadata (& (lp -> metadata ), namespaces , szTmp );
3150
+ const char * pszFullName = msOWSLookupMetadata (& (lp -> metadata ), namespaces , szTmp );
3157
3151
if (pszFullName ) {
3158
3152
FLTReplacePropertyName (psFilterNode , pszFullName ,
3159
3153
lp -> items [i ]);
0 commit comments