aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-07-15 20:32:30 +0000
committerBruce Momjian <bruce@momjian.us>1999-07-15 20:32:30 +0000
commit40a89e08b2d7bb592d940e56f696df4a6459e7a3 (patch)
tree161f97bb8733ed8eca262b9478edebc07caa1e33
parentfb38a5d8cfd05ae7890f6b319aa5983ccf12f21b (diff)
downloadpostgresql-40a89e08b2d7bb592d940e56f696df4a6459e7a3.tar.gz
postgresql-40a89e08b2d7bb592d940e56f696df4a6459e7a3.zip
Cleanups.
-rw-r--r--src/backend/storage/lmgr/lmgr.c4
-rw-r--r--src/backend/storage/lmgr/lock.c10
-rw-r--r--src/backend/storage/lmgr/multi.c4
-rw-r--r--src/include/optimizer/geqo_random.h6
-rw-r--r--src/include/storage/lock.h8
-rwxr-xr-xsrc/tools/pginclude/pgfixinclude18
-rwxr-xr-xsrc/tools/pginclude/pgnoinclude4
7 files changed, 36 insertions, 18 deletions
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index 2dce65a108a..cf7a1c86825 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.28 1999/07/15 15:19:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.29 1999/07/15 20:32:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,7 +47,7 @@
extern Oid MyDatabaseId;
-static MASK LockConflicts[] = {
+static LOCKMASK LockConflicts[] = {
(int) NULL,
/* AccessShareLock */
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index ba44c44de0d..74845dbcf87 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.56 1999/07/15 15:19:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.57 1999/07/15 20:32:27 momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
@@ -162,8 +162,8 @@ SPINLOCK LockMgrLock; /* in Shmem or created in
/* This is to simplify/speed up some bit arithmetic */
-static MASK BITS_OFF[MAX_LOCKMODES];
-static MASK BITS_ON[MAX_LOCKMODES];
+static LOCKMASK BITS_OFF[MAX_LOCKMODES];
+static LOCKMASK BITS_ON[MAX_LOCKMODES];
/* -----------------
* XXX Want to move this to this file
@@ -231,7 +231,7 @@ LockDisable(int status)
*/
static void
LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
- MASK *conflictsP,
+ LOCKMASK *conflictsP,
int *prioP,
int numModes)
{
@@ -258,7 +258,7 @@ LockMethodInit(LOCKMETHODTABLE *lockMethodTable,
*/
LOCKMETHOD
LockMethodTableInit(char *tabName,
- MASK *conflictsP,
+ LOCKMASK *conflictsP,
int *prioP,
int numModes)
{
diff --git a/src/backend/storage/lmgr/multi.c b/src/backend/storage/lmgr/multi.c
index e60ba613ee8..12c7d70e82b 100644
--- a/src/backend/storage/lmgr/multi.c
+++ b/src/backend/storage/lmgr/multi.c
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.29 1999/05/25 16:11:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.30 1999/07/15 20:32:27 momjian Exp $
*
* NOTES:
* (1) The lock.c module assumes that the caller here is doing
@@ -41,7 +41,7 @@ static bool MultiRelease(LOCKMETHOD lockmethod, LOCKTAG *tag,
* WRITE conflict between the tuple's intent lock and the relation's
* write lock.
*/
-static MASK MultiConflicts[] = {
+static LOCKMASK MultiConflicts[] = {
(int) NULL,
/* All reads and writes at any level conflict with a write lock */
(1 << WRITE_LOCK) | (1 << WRITE_INTENT) | (1 << READ_LOCK) | (1 << READ_INTENT),
diff --git a/src/include/optimizer/geqo_random.h b/src/include/optimizer/geqo_random.h
index ea5ec008b6a..450f9695439 100644
--- a/src/include/optimizer/geqo_random.h
+++ b/src/include/optimizer/geqo_random.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_random.h,v 1.4 1999/02/13 23:21:48 momjian Exp $
+ * $Id: geqo_random.h,v 1.5 1999/07/15 20:32:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,9 +25,9 @@
#include <math.h>
-#define MASK 2147483647
+#define GEQOMASK 2147483647
-#define geqo_rand() ((double)random()/MASK)
+#define geqo_rand() ((double)random()/GEQOMASK)
/* geqo_randint returns integer value
between lower and upper inclusive */
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
index 37b7b053ee8..327f57cc7d1 100644
--- a/src/include/storage/lock.h
+++ b/src/include/storage/lock.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lock.h,v 1.30 1999/06/01 09:35:39 vadim Exp $
+ * $Id: lock.h,v 1.31 1999/07/15 20:32:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -19,7 +19,7 @@
#include <utils/array.h>
extern SPINLOCK LockMgrLock;
-typedef int MASK;
+typedef int LOCKMASK;
#define INIT_TABLE_SIZE 100
#define MAX_TABLE_SIZE 1000
@@ -41,7 +41,7 @@ typedef int MASK;
typedef int LOCKMODE;
typedef int LOCKMETHOD;
-/* MAX_LOCKMODES cannot be larger than the bits in MASK */
+/* MAX_LOCKMODES cannot be larger than the bits in LOCKMASK */
#define MAX_LOCKMODES 8
/*
@@ -241,7 +241,7 @@ extern SPINLOCK LockMgrLock;
*/
extern void InitLocks(void);
extern void LockDisable(int status);
-extern LOCKMETHOD LockMethodTableInit(char *tabName, MASK *conflictsP,
+extern LOCKMETHOD LockMethodTableInit(char *tabName, LOCKMASK *conflictsP,
int *prioP, int numModes);
extern LOCKMETHOD LockMethodTableRename(LOCKMETHOD lockmethod);
extern bool LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
diff --git a/src/tools/pginclude/pgfixinclude b/src/tools/pginclude/pgfixinclude
new file mode 100755
index 00000000000..f48c96a536b
--- /dev/null
+++ b/src/tools/pginclude/pgfixinclude
@@ -0,0 +1,18 @@
+:
+trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
+find . \( -name CVS -a -prune \) -o -type f -print |
+while read FILE
+do
+ cat /tmp/$$a | grep "^#include" |
+ sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
+ while read INCLUDE
+ do
+ if [ -s /usr/include/"$INCLUDE" ]
+ then cat "$FILE" |
+ sed 's/^#include[ ]*[<"]'"$INCLUDE"'[>"]$/#include <'"$INCLUDE"'>/g' >/tmp/$$
+ else cat "$FILE" |
+ sed 's/^#include[ ]*[<"]'"$INCLUDE"'[>"]$/#include "'"$INCLUDE"'"/g' >/tmp/$$
+ fi
+ cat /tmp/$$ > "$FILE"
+ done
+done
diff --git a/src/tools/pginclude/pgnoinclude b/src/tools/pginclude/pgnoinclude
index 37ef46c85af..5fbf553a11e 100755
--- a/src/tools/pginclude/pgnoinclude
+++ b/src/tools/pginclude/pgnoinclude
@@ -14,7 +14,7 @@ do
else cat "$FILE" >/tmp/$$a
fi
cat /tmp/$$a | grep "^#include" |
- sed 's/#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
+ sed 's/^#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
while read INCLUDE
do
[ -s /usr/include/$INCLUDE ] && continue
@@ -36,7 +36,7 @@ do
if [ "$?" -eq 0 ]
then echo "$FILE $INCLUDE"
if [ "$IS_INCLUDE" = "N" ]
- then grep -v '#include[ ]*[<"]$INCLUDE[>"]' $FILE >/tmp/$$b
+ then grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' $FILE >/tmp/$$b
mv /tmp/$$b "$FILE"
fi
if [ "$1" = "-v" ]