From: Sandro Santilli Date: Tue, 2 Jan 2018 15:11:08 +0000 (+0000) Subject: ISO C90 forbids mixed declarations and code, fix corresponding warning X-Git-Tag: 2.5.0alpha~234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6864f4e5114e093957fe9be677ad0485030879a;p=postgis ISO C90 forbids mixed declarations and code, fix corresponding warning git-svn-id: http://svn.osgeo.org/postgis/trunk@16215 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c index 082d52ae7..2bf2bfd39 100644 --- a/extensions/address_standardizer/std_pg_hash.c +++ b/extensions/address_standardizer/std_pg_hash.c @@ -364,6 +364,9 @@ AddToStdPortalCache(StdPortalCache *STDCache, char *lextab, char *gaztab, char * MemoryContext STDMemoryContext; MemoryContext old_context; STANDARDIZER *std = NULL; +#if POSTGIS_PGSQL_VERSION >= 96 + MemoryContextCallback *callback; +#endif DBG("Enter: AddToStdPortalCache"); std = CreateStd(lextab, gaztab, rultab); @@ -396,7 +399,7 @@ AddToStdPortalCache(StdPortalCache *STDCache, char *lextab, char *gaztab, char * /* PgSQL comments suggest allocating callback in the context */ /* being managed, so that the callback object gets cleaned along with */ /* the context */ - MemoryContextCallback *callback = MemoryContextAlloc(STDMemoryContext, sizeof(MemoryContextCallback)); + callback = MemoryContextAlloc(STDMemoryContext, sizeof(MemoryContextCallback)); callback->arg = (void*)(STDMemoryContext); callback->func = StdCacheDelete; MemoryContextRegisterResetCallback(STDMemoryContext, callback);