summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2hg <devnull@localhost>2001-10-19 14:06:29 +0000
committercvs2hg <devnull@localhost>2001-10-19 14:06:29 +0000
commit643084489edac66337634edd8e1d74db5eecc830 (patch)
tree251b31565f99514715c774a6f30e96741f7720ac
parent994014a5ec9128814add9599797a481551946af3 (diff)
downloadnss-hg-OTIS_TEST_BASE.tar.gz
fixup commit for branch 'OTIS_TEST_BRANCH'OTIS_TEST_BASE
-rw-r--r--dbm/include/cdefs.h19
-rw-r--r--dbm/include/hash.h4
-rw-r--r--dbm/include/mcom_db.h154
-rw-r--r--dbm/include/nsres.h1
-rw-r--r--dbm/macbuild/DBMConfig.h2
-rw-r--r--dbm/src/Makefile.win2
-rw-r--r--dbm/src/h_bigkey.c4
-rw-r--r--dbm/src/h_page.c2
-rw-r--r--dbm/src/hash.c2
-rw-r--r--dbm/src/snprintf.c6
10 files changed, 80 insertions, 116 deletions
diff --git a/dbm/include/cdefs.h b/dbm/include/cdefs.h
index 45bfbd58f..63c2f624a 100644
--- a/dbm/include/cdefs.h
+++ b/dbm/include/cdefs.h
@@ -77,13 +77,6 @@
#ifndef _CDEFS_H_
#define _CDEFS_H_
-#ifdef __BEGIN_DECLS
-#undef __BEGIN_DECLS
-#endif
-#ifdef __END_DECLS
-#undef __END_DECLS
-#endif
-
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
@@ -99,15 +92,12 @@
* in between its arguments. __CONCAT can also concatenate double-quoted
* strings produced by the __STRING macro, but this only works with ANSI C.
*/
-#undef __P
-#undef __CONCAT
-#undef __STRING
-
#if defined(__STDC__) || defined(__cplusplus) || defined(_WINDOWS) || defined(XP_OS2)
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT(x,y) x ## y
#define __STRING(x) #x
+/* On HP-UX 11.00, <sys/stdsyms.h> defines __const. */
#ifndef __const
#define __const const /* define reserved names to standard */
#endif /* __const */
@@ -172,11 +162,4 @@
#define __pure
#endif
-#ifdef AIXV3
-/* Wont compile without const. Need a cleaner way to handle this. */
-#ifdef const
-#undef const
-#endif
-#endif
-
#endif /* !_CDEFS_H_ */
diff --git a/dbm/include/hash.h b/dbm/include/hash.h
index 30ca297a1..454a8ec42 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 */
- int32 h_charkey; /* value of hash(CHARKEY) */
+ uint32 h_charkey; /* value of hash(CHARKEY) */
#define NCACHED 32 /* number of bit maps and spare
* points */
int32 spares[NCACHED];/* spare pages for overflow */
@@ -131,7 +131,7 @@ typedef struct htab { /* Memory resident data structure */
SEGMENT *dir; /* Hash Bucket directory */
off_t file_size; /* in bytes */
char is_temp; /* unlink file on close */
- char updateEOF; /* close and reopen on flush */
+ char updateEOF; /* force EOF update on flush */
} HTAB;
/*
diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h
index 191393d62..973e8e320 100644
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -74,15 +74,22 @@
#ifndef _DB_H_
#define _DB_H_
-#ifndef HAVE_SYS_CDEFS_H
-#include "cdefs.h"
-#else
-#include <cdefs.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
+#include "cdefs.h"
+#endif
+
#ifdef HAVE_SYS_BYTEORDER_H
-#include <sys/types.h>
#include <sys/byteorder.h>
#endif
@@ -99,7 +106,6 @@
#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
@@ -136,6 +142,32 @@
#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
@@ -146,11 +178,6 @@
#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
@@ -158,6 +185,28 @@
#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
@@ -167,7 +216,6 @@
#if defined(_WINDOWS) || defined(XP_OS2)
#include <stdio.h>
#include <io.h>
-#include <limits.h>
#ifndef XP_OS2
#define MAXPATHLEN 1024
@@ -186,28 +234,11 @@
#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
@@ -215,38 +246,20 @@ 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
-#ifndef HAVE_SYS_CDEFS_H
-#include "cdefs.h"
-#endif
-
-#ifndef _WINDOWS /* included above to prevent spurious warnings chouck 12-Sep-95 */
-#include <limits.h>
+/* define EFTYPE since most don't */
+#ifndef EFTYPE
+#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
#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
@@ -258,11 +271,6 @@ 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 */
@@ -368,7 +376,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
@@ -416,9 +424,9 @@ typedef struct {
((char *)&(b))[0] = ((char *)&(a))[1]; \
((char *)&(b))[1] = ((char *)&(a))[0]; \
}
-/* #endif */
+#endif
-__BEGIN_DECLS
+PR_BEGIN_EXTERN_C
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
extern DB *
#else
@@ -431,39 +439,13 @@ 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
-#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
+PR_END_EXTERN_C
#endif /* !_DB_H_ */
diff --git a/dbm/include/nsres.h b/dbm/include/nsres.h
index 17f16647a..f3f4e2d1a 100644
--- a/dbm/include/nsres.h
+++ b/dbm/include/nsres.h
@@ -1,6 +1,5 @@
#ifndef NSRES_H
#define NSRES_H
-#include "cdefs.h"
#include "mcom_db.h"
__BEGIN_DECLS
diff --git a/dbm/macbuild/DBMConfig.h b/dbm/macbuild/DBMConfig.h
index 6493d254f..e7ec911c6 100644
--- a/dbm/macbuild/DBMConfig.h
+++ b/dbm/macbuild/DBMConfig.h
@@ -20,4 +20,4 @@
* Contributor(s):
*/
-/* Nothing to do here. If you need DBM-specific defines, put them here */
+#define __DBINTERFACE_PRIVATE 1
diff --git a/dbm/src/Makefile.win b/dbm/src/Makefile.win
index 1d49e5f91..060a8c48b 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
+CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT -D__DBINTERFACE_PRIVATE
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
diff --git a/dbm/src/h_bigkey.c b/dbm/src/h_bigkey.c
index fe5d8f800..53a1a00f3 100644
--- a/dbm/src/h_bigkey.c
+++ b/dbm/src/h_bigkey.c
@@ -429,7 +429,7 @@ __big_return(
}
val->size = collect_data(hashp, bufp, (int)len, set_current);
- if ((val->size + 1) == 0) /* unsigned ints are not really negative */
+ if (val->size == (size_t)-1)
return (-1);
if (save_p->addr != save_addr) {
/* We are pretty short on buffers. */
@@ -515,7 +515,7 @@ __big_keydata(
int set)
{
key->size = collect_key(hashp, bufp, 0, val, set);
- if ((key->size + 1) == 0) /* same compile warning about comparing signed and unsigned */
+ if (key->size == (size_t)-1)
return (-1);
key->data = (uint8 *)hashp->tmp_key;
return (0);
diff --git a/dbm/src/h_page.c b/dbm/src/h_page.c
index 2c4b50f87..ed8231665 100644
--- a/dbm/src/h_page.c
+++ b/dbm/src/h_page.c
@@ -1166,7 +1166,7 @@ open_temp(HTAB *hashp)
sigset_t set, oset;
#endif
char * tmpdir;
- int len;
+ size_t len;
static const char namestr[] = "/_hashXXXXXX";
char filename[1024];
char last;
diff --git a/dbm/src/hash.c b/dbm/src/hash.c
index 8be75721b..cd2e01db5 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)) != (unsigned)hashp->H_CHARKEY)
+ if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
RETURN_ERROR(EFTYPE, error1);
if (hashp->NKEYS < 0) {
/*
diff --git a/dbm/src/snprintf.c b/dbm/src/snprintf.c
index 7a6b2005c..498778572 100644
--- a/dbm/src/snprintf.c
+++ b/dbm/src/snprintf.c
@@ -5,10 +5,10 @@
#include <stddef.h>
#include <stdio.h>
-#if defined(_WINDOWS) || defined(SOLARIS) || defined(AIXV3) || defined(AIX) || defined(OSF1) || defined(NEC) || !defined(HAVE_SYS_CDEFS_H)
-#include "cdefs.h"
-#elif !defined(HPUX) && !defined(UNIXWARE) && !defined(SNI)
+#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
+#else
+#include "cdefs.h"
#endif
#include "prtypes.h"