summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2hg <devnull@localhost>2001-10-19 14:06:30 +0000
committercvs2hg <devnull@localhost>2001-10-19 14:06:30 +0000
commit490bc7abd625e195541237ed9deccfe219215b07 (patch)
tree5b873cbecd64bc398ed46078ee1200abf0906326
parent643084489edac66337634edd8e1d74db5eecc830 (diff)
downloadnss-hg-490bc7abd625e195541237ed9deccfe219215b07.tar.gz
fixup commit for tag 'MOTIF_LAST_RITES'MOTIF_LAST_RITES
-rw-r--r--dbm/include/hash.h2
-rw-r--r--dbm/include/mcom_db.h150
-rw-r--r--dbm/macbuild/DBMConfig.h2
-rw-r--r--dbm/src/Makefile.win2
-rw-r--r--dbm/src/hash.c2
-rw-r--r--dbm/src/snprintf.c6
6 files changed, 89 insertions, 75 deletions
diff --git a/dbm/include/hash.h b/dbm/include/hash.h
index 454a8ec42..32930f279 100644
--- a/dbm/include/hash.h
+++ b/dbm/include/hash.h
@@ -93,7 +93,7 @@ typedef struct hashhdr { /* Disk resident portion */
int32 ffactor; /* Fill factor */
int32 nkeys; /* Number of keys in hash table */
int32 hdrpages; /* Size of table header */
- uint32 h_charkey; /* value of hash(CHARKEY) */
+ int32 h_charkey; /* value of hash(CHARKEY) */
#define NCACHED 32 /* number of bit maps and spare
* points */
int32 spares[NCACHED];/* spare pages for overflow */
diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h
index 973e8e320..e3dc08bd1 100644
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -74,22 +74,15 @@
#ifndef _DB_H_
#define _DB_H_
-#ifndef macintosh
-#include <sys/types.h>
-#endif
-#include "prtypes.h"
-
-#include <limits.h>
-
-#ifdef __DBINTERFACE_PRIVATE
-
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#else
+#ifndef HAVE_SYS_CDEFS_H
#include "cdefs.h"
+#else
+#include <sys/cdefs.h>
#endif
+#include "prtypes.h"
#ifdef HAVE_SYS_BYTEORDER_H
+#include <sys/types.h>
#include <sys/byteorder.h>
#endif
@@ -106,6 +99,7 @@
#define BYTE_ORDER BIG_ENDIAN
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
+#define __BIT_TYPES_DEFINED__
#endif
#ifdef __sun
@@ -142,32 +136,6 @@
#endif /* !BYTE_ORDER */
#endif /* __sun */
-#if defined(__hpux) || defined(__hppa)
-#define BYTE_ORDER BIG_ENDIAN
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
-#endif
-
-#if defined(AIXV3) || defined(AIX)
-/* BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN are all defined here */
-#include <sys/machine.h>
-#endif
-
-/* Digital Unix */
-#ifdef __osf__
-#include <machine/endian.h>
-#endif
-
-#ifdef __alpha
-#ifndef WIN32
-#else
-/* Alpha NT */
-#define BYTE_ORDER LITTLE_ENDIAN
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-#endif
-#endif
-
#ifdef NCR
#include <sys/endian.h>
#endif
@@ -178,6 +146,11 @@
#define BYTE_ORDER LITTLE_ENDIAN
#endif
+#ifdef SCO
+#include <sys/bitypes.h>
+#define MAXPATHLEN 1024
+#endif
+
#ifdef SNI
/* #include <sys/hetero.h> */
#define BYTE_ORDER BIG_ENDIAN
@@ -185,28 +158,6 @@
#define LITTLE_ENDIAN 1234
#endif
-#if defined(_WINDOWS) || defined(XP_OS2)
-#ifdef BYTE_ORDER
-#undef BYTE_ORDER
-#endif
-
-#define BYTE_ORDER LITTLE_ENDIAN
-#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
-#define BIG_ENDIAN 4321
-#endif
-
-#ifdef macintosh
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-#define BYTE_ORDER BIG_ENDIAN
-#endif
-
-#endif /* __DBINTERFACE_PRIVATE */
-
-#ifdef SCO
-#define MAXPATHLEN 1024
-#endif
-
#ifdef macintosh
#include <unix.h>
#else
@@ -216,6 +167,7 @@
#if defined(_WINDOWS) || defined(XP_OS2)
#include <stdio.h>
#include <io.h>
+#include <limits.h>
#ifndef XP_OS2
#define MAXPATHLEN 1024
@@ -234,11 +186,28 @@
#ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#endif
+
+#ifdef BYTE_ORDER
+#undef BYTE_ORDER
+#endif
+
+#define BYTE_ORDER LITTLE_ENDIAN
+#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
+#define BIG_ENDIAN 4321
#endif
+#if defined(_WINDOWS) && !defined(_WIN32)
+/* 16 bit windows defines */
+#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
+#endif
+
+
#ifdef macintosh
#include <stdio.h>
#include "xp_mcom.h"
+#define BIG_ENDIAN 4321
+#define LITTLE_ENDIAN 1234
+#define BYTE_ORDER BIG_ENDIAN
#define O_ACCMODE 3 /* Mask for file access modes */
#define EFTYPE 2000
XP_BEGIN_PROTOS
@@ -246,20 +215,34 @@ int mkstemp(const char *path);
XP_END_PROTOS
#endif /* MACINTOSH */
+#if defined(XP_OS2)
+/* #include <xp_mcom.h> */
+/* XP_BEGIN_PROTOS */
+/* int mkstemp(char *path); */
+/* XP_END_PROTOS */
+#endif
+
+#ifndef macintosh
+#include <sys/types.h>
+#endif
+
#if !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
#include <sys/stat.h>
#include <errno.h>
#endif
-/* define EFTYPE since most don't */
-#ifndef EFTYPE
-#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
+#ifndef _WINDOWS /* included above to prevent spurious warnings chouck 12-Sep-95 */
+#include <limits.h>
#endif
#define RET_ERROR -1 /* Return values. */
#define RET_SUCCESS 0
#define RET_SPECIAL 1
+#if defined(__386BSD__) || defined(SCO)
+#define __BIT_TYPES_DEFINED__
+#endif
+
#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
#ifndef __sgi
@@ -271,6 +254,11 @@ typedef uint16 indx_t;
#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
typedef uint32 recno_t;
+/* define EFTYPE since most don't */
+#ifndef EFTYPE
+#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
+#endif
+
/* Key/data structure -- a Data-Base Thang. */
typedef struct {
void *data; /* data */
@@ -376,7 +364,7 @@ typedef struct {
char *bfname; /* btree file name */
} RECNOINFO;
-#ifdef __DBINTERFACE_PRIVATE
+/* #ifdef __DBINTERFACE_PRIVATE */
/*
* Little endian <==> big endian 32-bit swap macros.
* M_32_SWAP swap a memory location
@@ -424,9 +412,9 @@ typedef struct {
((char *)&(b))[0] = ((char *)&(a))[1]; \
((char *)&(b))[1] = ((char *)&(a))[0]; \
}
-#endif
+/* #endif */
-PR_BEGIN_EXTERN_C
+__BEGIN_DECLS
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
extern DB *
#else
@@ -439,13 +427,39 @@ dbopen (const char *, int, int, DBTYPE, const void *);
*/
void dbSetOrClearDBLock(DBLockFlagEnum type);
-#ifdef __DBINTERFACE_PRIVATE
+/* #ifdef __DBINTERFACE_PRIVATE */
DB *__bt_open (const char *, int, int, const BTREEINFO *, int);
DB *__hash_open (const char *, int, int, const HASHINFO *, int);
DB *__rec_open (const char *, int, int, const RECNOINFO *, int);
void __dbpanic (DB *dbp);
+/* #endif */
+
+__END_DECLS
+
+#if defined(__hpux) || defined(__hppa)
+#define BYTE_ORDER BIG_ENDIAN
+#define BIG_ENDIAN 4321
+#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
#endif
-PR_END_EXTERN_C
+#if defined(AIXV3) || defined(AIX)
+/* BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN are all defined here */
+#include <sys/machine.h>
+#endif
+
+/* Digital Unix */
+#ifdef __osf__
+#include <machine/endian.h>
+#endif
+
+#ifdef __alpha
+#ifndef WIN32
+#else
+/* Alpha NT */
+#define BYTE_ORDER LITTLE_ENDIAN
+#define BIG_ENDIAN 4321
+#define LITTLE_ENDIAN 1234
+#endif
+#endif
#endif /* !_DB_H_ */
diff --git a/dbm/macbuild/DBMConfig.h b/dbm/macbuild/DBMConfig.h
index e7ec911c6..6493d254f 100644
--- a/dbm/macbuild/DBMConfig.h
+++ b/dbm/macbuild/DBMConfig.h
@@ -20,4 +20,4 @@
* Contributor(s):
*/
-#define __DBINTERFACE_PRIVATE 1
+/* Nothing to do here. If you need DBM-specific defines, put them here */
diff --git a/dbm/src/Makefile.win b/dbm/src/Makefile.win
index 060a8c48b..1d49e5f91 100644
--- a/dbm/src/Makefile.win
+++ b/dbm/src/Makefile.win
@@ -88,7 +88,7 @@ LINCS = -I..\include
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
-CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT -D__DBINTERFACE_PRIVATE
+CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
diff --git a/dbm/src/hash.c b/dbm/src/hash.c
index cd2e01db5..8be75721b 100644
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -239,7 +239,7 @@ __hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dfl
if (hashp->VERSION != HASHVERSION &&
hashp->VERSION != OLDHASHVERSION)
RETURN_ERROR(EFTYPE, error1);
- if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
+ if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != (unsigned)hashp->H_CHARKEY)
RETURN_ERROR(EFTYPE, error1);
if (hashp->NKEYS < 0) {
/*
diff --git a/dbm/src/snprintf.c b/dbm/src/snprintf.c
index 498778572..b5036f818 100644
--- a/dbm/src/snprintf.c
+++ b/dbm/src/snprintf.c
@@ -5,10 +5,10 @@
#include <stddef.h>
#include <stdio.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#else
+#ifndef HAVE_SYS_CDEFS_H
#include "cdefs.h"
+#else
+#include <sys/cdefs.h>
#endif
#include "prtypes.h"