mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +03:00
Fix macros that were not properly surrounded by parens or braces.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.10 1998/02/26 04:38:23 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.11 1998/06/15 18:39:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -125,41 +125,49 @@ typedef struct portalhashent
|
||||
static HTAB *PortalHashTable = NULL;
|
||||
|
||||
#define PortalHashTableLookup(NAME, PORTAL) \
|
||||
{ PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||
sprintf(key, "%s", NAME); \
|
||||
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
|
||||
key, HASH_FIND, &found); \
|
||||
if (hentry == NULL) \
|
||||
elog(FATAL, "error in PortalHashTable"); \
|
||||
if (found) \
|
||||
PORTAL = hentry->portal; \
|
||||
else \
|
||||
PORTAL = NULL; \
|
||||
}
|
||||
do { \
|
||||
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||
\
|
||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||
sprintf(key, "%s", NAME); \
|
||||
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
|
||||
key, HASH_FIND, &found); \
|
||||
if (hentry == NULL) \
|
||||
elog(FATAL, "error in PortalHashTable"); \
|
||||
if (found) \
|
||||
PORTAL = hentry->portal; \
|
||||
else \
|
||||
PORTAL = NULL; \
|
||||
} while(0)
|
||||
|
||||
#define PortalHashTableInsert(PORTAL) \
|
||||
{ PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||
sprintf(key, "%s", PORTAL->name); \
|
||||
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
|
||||
key, HASH_ENTER, &found); \
|
||||
if (hentry == NULL) \
|
||||
elog(FATAL, "error in PortalHashTable"); \
|
||||
if (found) \
|
||||
elog(NOTICE, "trying to insert a portal name that exists."); \
|
||||
hentry->portal = PORTAL; \
|
||||
}
|
||||
do { \
|
||||
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||
\
|
||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||
sprintf(key, "%s", PORTAL->name); \
|
||||
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
|
||||
key, HASH_ENTER, &found); \
|
||||
if (hentry == NULL) \
|
||||
elog(FATAL, "error in PortalHashTable"); \
|
||||
if (found) \
|
||||
elog(NOTICE, "trying to insert a portal name that exists."); \
|
||||
hentry->portal = PORTAL; \
|
||||
} while(0)
|
||||
|
||||
#define PortalHashTableDelete(PORTAL) \
|
||||
{ PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||
sprintf(key, "%s", PORTAL->name); \
|
||||
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
|
||||
key, HASH_REMOVE, &found); \
|
||||
if (hentry == NULL) \
|
||||
elog(FATAL, "error in PortalHashTable"); \
|
||||
if (!found) \
|
||||
elog(NOTICE, "trying to delete portal name that does not exist."); \
|
||||
}
|
||||
{ \
|
||||
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||
\
|
||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||
sprintf(key, "%s", PORTAL->name); \
|
||||
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
|
||||
key, HASH_REMOVE, &found); \
|
||||
if (hentry == NULL) \
|
||||
elog(FATAL, "error in PortalHashTable"); \
|
||||
if (!found) \
|
||||
elog(NOTICE, "trying to delete portal name that does not exist."); \
|
||||
} while(0)
|
||||
|
||||
static GlobalMemory PortalMemory = NULL;
|
||||
static char PortalMemoryName[] = "Portal";
|
||||
|
||||
Reference in New Issue
Block a user