fixup commit for tag 'MOTIF_LAST_RITES' OTIS_TEST_BRANCH MOTIF_LAST_RITES
authorcvs2hg
Fri, 19 Oct 2001 14:06:30 +0000
branchOTIS_TEST_BRANCH
changeset 2173 b2a5f6e25984d204a39ce33e5e3d4e6d0b4a71fa
parent 2172 b4c20512a0ec6eaec0584270c6448bbc12de0aef
child 2199 7b0505c91cbbe93cd3ed5437e809481377b7dd5a
push idunknown
push userunknown
push dateunknown
fixup commit for tag 'MOTIF_LAST_RITES'
dbm/include/hash.h
dbm/include/mcom_db.h
dbm/macbuild/DBMConfig.h
dbm/src/Makefile.win
dbm/src/hash.c
dbm/src/snprintf.c
--- a/dbm/include/hash.h
+++ b/dbm/include/hash.h
@@ -88,17 +88,17 @@ typedef struct hashhdr {		/* Disk reside
 	int32		last_freed;	/* Last overflow page freed */
 	int32		max_bucket;	/* ID of Maximum bucket in use */
 	int32		high_mask;	/* Mask to modulo into entire table */
 	int32		low_mask;	/* Mask to modulo into lower half of 
 					 * table */
 	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 */
 	uint16		bitmaps[NCACHED];	/* address of overflow page 
 						 * bitmaps */
 } HASHHDR;
 
 typedef struct htab	 {		/* Memory resident data structure */
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -69,48 +69,42 @@
  * SUCH DAMAGE.
  *
  *	@(#)db.h	8.7 (Berkeley) 6/16/94
  */
 
 #ifndef _DB_H_
 #define	_DB_H_
 
-#ifndef macintosh
-#include <sys/types.h>
+#ifndef HAVE_SYS_CDEFS_H
+#include "cdefs.h"
+#else
+#include <sys/cdefs.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
 
 #if defined(__linux) || defined(__BEOS__)
 #include <endian.h>
 #ifndef BYTE_ORDER
 #define BYTE_ORDER    __BYTE_ORDER
 #define BIG_ENDIAN    __BIG_ENDIAN
 #define LITTLE_ENDIAN __LITTLE_ENDIAN
 #endif
 #endif /* __linux */
 
 #ifdef __sgi
 #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
 #define BIG_ENDIAN      4321
 #define LITTLE_ENDIAN   1234            /* LSB first: i386, vax, all NT risc */
 
 #ifdef HAVE_COMPAT_H
 #include <compat.h>
@@ -137,90 +131,48 @@
 #define BYTE_ORDER BIG_ENDIAN
 #else
 #define BYTE_ORDER LITTLE_ENDIAN
 #endif
 
 #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
 
 #ifdef __QNX__
 #define LITTLE_ENDIAN	1234
 #define BIG_ENDIAN	4321
 #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
 #define BIG_ENDIAN      4321
 #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
 #include <fcntl.h>
 #endif
 
 #if defined(_WINDOWS) || defined(XP_OS2)
 #include <stdio.h>
 #include <io.h>
+#include <limits.h>
 
 #ifndef XP_OS2 
 #define MAXPATHLEN 	1024               
 #else
 #include <dirent.h>
 #endif
 
 #define	EFTYPE		EINVAL		/* POSIX 1003.1 format errno. */
@@ -229,53 +181,89 @@
 #define	STDIN_FILENO	0		/* ANSI C #defines */
 #define	STDOUT_FILENO	1
 #define	STDERR_FILENO	2
 #endif
 
 #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
 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
 typedef uint32	pgno_t;
 #endif
 
 #define	MAX_PAGE_OFFSET	65535		/* >= # of bytes in a page */
 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 */
 	size_t	 size;			/* data length */
 } DBT;
 
 /* Routine flags. */
 #define	R_CURSOR	1		/* del, put, seq */
@@ -371,17 +359,17 @@ typedef struct {
 	uint	cachesize;	/* bytes to cache */
 	uint	psize;		/* page size */
 	int	lorder;		/* byte order */
 	size_t	reclen;		/* record length (fixed-length records) */
 	uint8	bval;		/* delimiting byte (variable-length records */
 	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
  *	P_32_SWAP	swap a referenced memory location
  *	P_32_COPY	swap from one location to another
  */
 #define	M_32_SWAP(a) {							\
 	uint32 _tmp = a;						\
@@ -419,33 +407,59 @@ typedef struct {
 	uint16 _tmp = *(uint16 *)a;				\
 	((char *)a)[0] = ((char *)&_tmp)[1];				\
 	((char *)a)[1] = ((char *)&_tmp)[0];				\
 }
 #define	P_16_COPY(a, b) {						\
 	((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
 PR_EXTERN(DB *)
 #endif
 dbopen (const char *, int, int, DBTYPE, const void *);
 
 /* set or unset a global lock flag to disable the
  * opening of any DBM file
  */
 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
 
-PR_END_EXTERN_C
+/* 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_ */
--- a/dbm/macbuild/DBMConfig.h
+++ b/dbm/macbuild/DBMConfig.h
@@ -15,9 +15,9 @@
  * The Initial Developer of the Original Code is Netscape
  * Communications Corporation.  Portions created by Netscape are
  * Copyright (C) 1998 Netscape Communications Corporation. All
  * Rights Reserved.
  *
  * Contributor(s): 
  */
 
-#define __DBINTERFACE_PRIVATE 1
+/* Nothing to do here. If you need DBM-specific defines, put them here */
--- a/dbm/src/Makefile.win
+++ b/dbm/src/Makefile.win
@@ -83,14 +83,14 @@ LINCS = -I..\include
 
 #//------------------------------------------------------------------------
 #//
 #// Include the common makefile rules
 #//
 #//------------------------------------------------------------------------
 include <$(DEPTH)/config/rules.mak>
 
-CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT -D__DBINTERFACE_PRIVATE
+CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
 
 install:: $(LIBRARY)
     $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
 
 
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -234,17 +234,17 @@ extern DB *
 			RETURN_ERROR(EFTYPE, error1);
 		/* Verify file type, versions and hash function */
 		if (hashp->MAGIC != HASHMAGIC)
 			RETURN_ERROR(EFTYPE, error1);
 #define	OLDHASHVERSION	1
 		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) {
 		    /*
 		    ** OOPS. Old bad database from previously busted
 		    ** code. Blow it away.
 		    */
 		    close(hashp->fp);
 		    if (remove(file) < 0) {
--- a/dbm/src/snprintf.c
+++ b/dbm/src/snprintf.c
@@ -1,19 +1,19 @@
 #ifndef HAVE_SNPRINTF
 
 #include "watcomfx.h"
 #include <sys/types.h>
 #include <stddef.h>
 #include <stdio.h>
 
-#ifdef HAVE_SYS_CDEFS_H
+#ifndef HAVE_SYS_CDEFS_H
+#include "cdefs.h"
+#else
 #include <sys/cdefs.h>
-#else
-#include "cdefs.h"
 #endif
 
 #include "prtypes.h"
 
 #include <ncompat.h>
 
 /* The OS/2 VAC compiler doesn't appear to define __STDC__ and won't let us define it either */
 #if defined(__STDC__) || defined(XP_OS2_VACPP)