@@ -22,11 +22,14 @@ static bool res = false;
2222/*
2323 * Depending on type of PGS_DATA_TYPES, compare current query and cached query.
2424 * If query cache and current query are equal, set ref to true.
25- */
26- #define GQ_MEMCMP ( type ) do { \
27- if ( keytype == PGS_TYPE_##type ){ \
28- if ( memcmp ( (void*)cquery , (void*)query , sizeof( type ) ) == 0 ) res = true; \
29- } \
25+ */
26+ #define GQ_MEMCMP (type ) \
27+ do \
28+ { \
29+ if (keytype == PGS_TYPE_##type) \
30+ { \
31+ if (memcmp((void *) cquery, (void *) query, sizeof(type)) == 0) res = true; \
32+ } \
3033} while(0);
3134
3235bool
@@ -60,16 +63,18 @@ gq_cache_get_value(unsigned pgstype, const void *query, int32 **key)
6063 case PGS_TYPE_SPATH :
6164 if (keytype == pgstype && ((SPATH * ) query )-> npts == npts )
6265 {
63- if (memcmp ((void * ) cquery , (void * ) & ((SPATH * ) query )-> p ,
64- ((SPATH * ) query )-> size ) == 0 )
66+ if (memcmp ((void * ) cquery ,
67+ (void * ) & ((SPATH * ) query )-> p ,
68+ ((SPATH * ) query )-> size ) == 0 )
6569 res = true;
6670 }
6771 break ;
6872 case PGS_TYPE_SPOLY :
6973 if (keytype == pgstype && ((SPOLY * ) query )-> npts == npts )
7074 {
71- if (memcmp ((void * ) cquery , (void * ) & ((SPOLY * ) query )-> p ,
72- ((SPOLY * ) query )-> size ) == 0 )
75+ if (memcmp ((void * ) cquery ,
76+ (void * ) & ((SPOLY * ) query )-> p ,
77+ ((SPOLY * ) query )-> size ) == 0 )
7378 res = true;
7479 }
7580 break ;
@@ -90,9 +95,11 @@ gq_cache_get_value(unsigned pgstype, const void *query, int32 **key)
9095/*
9196 * Depending on type of PGS_DATA_TYPES, copy current query to cache.
9297 */
93- #define GQ_MEMCPY ( type ) do { \
94- cquery = ( void *) malloc ( sizeof( type ) ); \
95- memcpy( (void*)cquery , (void*)query , sizeof( type ) ); \
98+ #define GQ_MEMCPY (type ) \
99+ do \
100+ { \
101+ cquery = (void *) malloc(sizeof(type)); \
102+ memcpy((void *) cquery, (void *) query, sizeof(type)); \
96103} while(0);
97104
98105
@@ -127,14 +134,16 @@ gq_cache_set_value(unsigned pgstype, const void *query, const int32 *key)
127134 case PGS_TYPE_SPATH :
128135 cquery = (void * ) malloc (((SPATH * ) query )-> size );
129136 npts = ((SPATH * ) query )-> npts ;
130- memcpy ((void * ) cquery , (void * ) & ((SPATH * ) query )-> p ,
131- ((SPATH * ) query )-> size );
137+ memcpy ((void * ) cquery ,
138+ (void * ) & ((SPATH * ) query )-> p ,
139+ ((SPATH * ) query )-> size );
132140 break ;
133141 case PGS_TYPE_SPOLY :
134142 cquery = (void * ) malloc (((SPOLY * ) query )-> size );
135143 npts = ((SPOLY * ) query )-> npts ;
136- memcpy ((void * ) cquery , (void * ) & ((SPOLY * ) query )-> p ,
137- ((SPOLY * ) query )-> size );
144+ memcpy ((void * ) cquery ,
145+ (void * ) & ((SPOLY * ) query )-> p ,
146+ ((SPOLY * ) query )-> size );
138147 break ;
139148 default :
140149 keytype = 0 ;
0 commit comments