summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-06-03 21:38:51 +0000
committerChristopher R. Hertel <crh@samba.org>1998-06-03 21:38:51 +0000
commit52c69766ea495f08a907c6ca76b1cef8df8c5d7c (patch)
tree995f70cd33cc73cacbea54125d48a6959df7607d
parentc435955b02c7fc227b9475ff73c62e080d34a1af (diff)
downloadsamba-52c69766ea495f08a907c6ca76b1cef8df8c5d7c.tar.gz
samba-52c69766ea495f08a907c6ca76b1cef8df8c5d7c.tar.bz2
samba-52c69766ea495f08a907c6ca76b1cef8df8c5d7c.zip
It occurred to me that the samba includes.h file should be included in the
header files used by the ubiqx modules, instead of being hidden in the .c files. This would ensure that anything in includes.h would be "seen" by the ubiqx headers. I also had to put an #ifdef around the includes for ubi_SplayTree.h and ubi_Cache.h in includes.h to prevent the header of the descendant type from being included before its parent type. Chris -)----- (This used to be commit e30a7e023b7491c01e052ae3dbd1788f84075413)
-rw-r--r--source3/include/includes.h5
-rw-r--r--source3/ubiqx/ubi_BinTree.c17
-rw-r--r--source3/ubiqx/ubi_BinTree.h24
-rw-r--r--source3/ubiqx/ubi_Cache.c9
-rw-r--r--source3/ubiqx/ubi_Cache.h4
-rw-r--r--source3/ubiqx/ubi_SplayTree.c38
-rw-r--r--source3/ubiqx/ubi_SplayTree.h23
-rw-r--r--source3/ubiqx/ubi_dLinkList.c5
-rw-r--r--source3/ubiqx/ubi_dLinkList.h5
-rw-r--r--source3/ubiqx/ubi_sLinkList.c5
-rw-r--r--source3/ubiqx/ubi_sLinkList.h5
11 files changed, 120 insertions, 20 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 00f4e7ee0f..5054c2ee5b 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -1386,11 +1386,14 @@ extern int errno;
/* -------------------------------------------------------------------------- **
- * Lists, trees, and caches...
+ * Lists, trees, and caching...
*/
#include "ubiqx/ubi_sLinkList.h"
#include "ubiqx/ubi_dLinkList.h"
+
+#ifndef UBI_BINTREE_H
#include "ubiqx/ubi_SplayTree.h"
#include "ubiqx/ubi_Cache.h"
+#endif /* UBI_BINTREE_H */
#endif /* _INCLUDES_H */
diff --git a/source3/ubiqx/ubi_BinTree.c b/source3/ubiqx/ubi_BinTree.c
index 7786910632..11fe6fae8a 100644
--- a/source3/ubiqx/ubi_BinTree.c
+++ b/source3/ubiqx/ubi_BinTree.c
@@ -27,6 +27,18 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_BinTree.c,v
+ * Revision 4.4 1998/06/03 17:42:46 crh
+ * Further fiddling with sys_include.h. It's now in ubi_BinTree.h which is
+ * included by all of the binary tree files.
+ *
+ * Reminder: Some of the ubi_tr* macros in ubi_BinTree.h are redefined in
+ * ubi_AVLtree.h and ubi_SplayTree.h. This allows easy swapping
+ * of tree types by simply changing a header. Unfortunately, the
+ * macro redefinitions in ubi_AVLtree.h and ubi_SplayTree.h will
+ * conflict if used together. You must either choose a single tree
+ * type, or use the underlying function calls directly. Compare
+ * the two header files for more information.
+ *
* Revision 4.3 1998/06/02 01:28:43 crh
* Changed ubi_null.h to sys_include.h to make it more generic.
*
@@ -132,7 +144,6 @@
* ========================================================================== **
*/
-#include "sys_include.h" /* System-specific includes. */
#include "ubi_BinTree.h" /* Header for this module. */
/* ========================================================================== **
@@ -140,8 +151,8 @@
*/
static char ModuleID[] = "ubi_BinTree\n\
-\tRevision: 4.3 \n\
-\tDate: 1998/06/02 01:28:43 \n\
+\tRevision: 4.4 \n\
+\tDate: 1998/06/03 17:42:46 \n\
\tAuthor: crh \n";
/* ========================================================================== **
diff --git a/source3/ubiqx/ubi_BinTree.h b/source3/ubiqx/ubi_BinTree.h
index 19494d32ff..15b22df707 100644
--- a/source3/ubiqx/ubi_BinTree.h
+++ b/source3/ubiqx/ubi_BinTree.h
@@ -1,5 +1,5 @@
-#ifndef ubi_BinTree_H
-#define ubi_BinTree_H
+#ifndef UBI_BINTREE_H
+#define UBI_BINTREE_H
/* ========================================================================== **
* ubi_BinTree.h
*
@@ -29,6 +29,18 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_BinTree.h,v
+ * Revision 4.4 1998/06/03 17:42:46 crh
+ * Further fiddling with sys_include.h. It's now in ubi_BinTree.h which is
+ * included by all of the binary tree files.
+ *
+ * Reminder: Some of the ubi_tr* macros in ubi_BinTree.h are redefined in
+ * ubi_AVLtree.h and ubi_SplayTree.h. This allows easy swapping
+ * of tree types by simply changing a header. Unfortunately, the
+ * macro redefinitions in ubi_AVLtree.h and ubi_SplayTree.h will
+ * conflict if used together. You must either choose a single tree
+ * type, or use the underlying function calls directly. Compare
+ * the two header files for more information.
+ *
* Revision 4.3 1998/06/02 01:28:43 crh
* Changed ubi_null.h to sys_include.h to make it more generic.
*
@@ -134,6 +146,12 @@
* ========================================================================== **
*/
+#include "sys_include.h" /* Global include file, used to adapt the ubiqx
+ * modules to the host environment and the project
+ * with which the modules will be used. See
+ * sys_include.h for more info.
+ */
+
/* -------------------------------------------------------------------------- **
* Macros and constants.
*
@@ -775,4 +793,4 @@ int ubi_btModuleID( int size, char *list[] );
#define ubi_trModuleID( s, l ) ubi_btModuleID( s, l )
/* ========================================================================== */
-#endif /* ubi_BinTree_H */
+#endif /* UBI_BINTREE_H */
diff --git a/source3/ubiqx/ubi_Cache.c b/source3/ubiqx/ubi_Cache.c
index 38eeaa61e4..f6081374ef 100644
--- a/source3/ubiqx/ubi_Cache.c
+++ b/source3/ubiqx/ubi_Cache.c
@@ -91,6 +91,10 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_Cache.c,v
+ * Revision 0.3 1998/06/03 18:00:15 crh
+ * Further fiddling with sys_include.h, which is no longer explicitly
+ * included by this module since it is inherited from ubi_BinTree.h.
+ *
* Revision 0.2 1998/06/02 01:36:18 crh
* Changed include name from ubi_null.h to sys_include.h to make it
* more generic.
@@ -104,7 +108,6 @@
* ========================================================================== **
*/
-#include "sys_include.h" /* System-specific includes. */
#include "ubi_Cache.h" /* Header for *this* module. */
/* -------------------------------------------------------------------------- **
@@ -114,8 +117,8 @@
/* commented out until I make use of it...
static char ModuleID[] =
"ubi_Cache\n\
-\tRevision: 0.2 \n\
-\tDate: 1998/06/02 01:36:18 \n\
+\tRevision: 0.3 \n\
+\tDate: 1998/06/03 18:00:15 \n\
\tAuthor: crh \n";
*/
diff --git a/source3/ubiqx/ubi_Cache.h b/source3/ubiqx/ubi_Cache.h
index 4b177b0570..76aab3172e 100644
--- a/source3/ubiqx/ubi_Cache.h
+++ b/source3/ubiqx/ubi_Cache.h
@@ -93,6 +93,10 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_Cache.h,v
+ * Revision 0.3 1998/06/03 18:00:15 crh
+ * Further fiddling with sys_include.h, which is no longer explicitly
+ * included by this module since it is inherited from ubi_BinTree.h.
+ *
* Revision 0.2 1998/06/02 01:36:18 crh
* Changed include name from ubi_null.h to sys_include.h to make it
* more generic.
diff --git a/source3/ubiqx/ubi_SplayTree.c b/source3/ubiqx/ubi_SplayTree.c
index 8641ae3340..d790ff58d1 100644
--- a/source3/ubiqx/ubi_SplayTree.c
+++ b/source3/ubiqx/ubi_SplayTree.c
@@ -37,6 +37,29 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_SplayTree.c,v
+ * Revision 4.3 1998/06/03 17:45:05 crh
+ * Further fiddling with sys_include.h. It's now in ubi_BinTree.h which is
+ * included by all of the binary tree files.
+ *
+ * Also fixed some warnings produced by lint on Irix 6.2, which doesn't seem
+ * to like syntax like this:
+ *
+ * if( (a = b) )
+ *
+ * The fix was to change lines like the above to:
+ *
+ * if( 0 != (a=b) )
+ *
+ * Which means the same thing.
+ *
+ * Reminder: Some of the ubi_tr* macros in ubi_BinTree.h are redefined in
+ * ubi_AVLtree.h and ubi_SplayTree.h. This allows easy swapping
+ * of tree types by simply changing a header. Unfortunately, the
+ * macro redefinitions in ubi_AVLtree.h and ubi_SplayTree.h will
+ * conflict if used together. You must either choose a single tree
+ * type, or use the underlying function calls directly. Compare
+ * the two header files for more information.
+ *
* Revision 4.2 1998/06/02 01:29:14 crh
* Changed ubi_null.h to sys_include.h to make it more generic.
*
@@ -129,7 +152,6 @@
* ========================================================================== **
*/
-#include "sys_include.h" /* System-specific includes. */
#include "ubi_SplayTree.h" /* Header for THIS module. */
/* ========================================================================== **
@@ -137,8 +159,8 @@
*/
static char ModuleID[] = "ubi_SplayTree\n\
-\tRevision: 4.2 \n\
-\tDate: 1998/06/02 01:29:14 \n\
+\tRevision: 4.3 \n\
+\tDate: 1998/06/03 17:45:05 \n\
\tAuthor: crh \n";
@@ -207,7 +229,7 @@ static ubi_btNodePtr Splay( ubi_btNodePtr SplayWithMe )
{
ubi_btNodePtr parent;
- while( (parent = SplayWithMe->Link[ubi_trPARENT]) )
+ while( NULL != (parent = SplayWithMe->Link[ubi_trPARENT]) )
{
if( parent->gender == SplayWithMe->gender ) /* Zig-Zig */
Rotate( parent );
@@ -309,8 +331,8 @@ ubi_btNodePtr ubi_sptRemove( ubi_btRootPtr RootPtr, ubi_btNodePtr DeadNode )
ubi_btNodePtr p;
(void)Splay( DeadNode ); /* Move dead node to root. */
- if( (p = DeadNode->Link[ubi_trLEFT]) ) /* If left subtree exists... */
- {
+ if( NULL != (p = DeadNode->Link[ubi_trLEFT]) )
+ { /* If left subtree exists... */
ubi_btNodePtr q = DeadNode->Link[ubi_trRIGHT];
p->Link[ubi_trPARENT] = NULL; /* Left subtree node becomes root.*/
@@ -323,8 +345,8 @@ ubi_btNodePtr ubi_sptRemove( ubi_btRootPtr RootPtr, ubi_btNodePtr DeadNode )
}
else
{
- if( (p = DeadNode->Link[ubi_trRIGHT]) ) /* No left, but right subtree... */
- { /* ...exists... */
+ if( NULL != (p = DeadNode->Link[ubi_trRIGHT]) )
+ { /* No left, but right subtree exists... */
p->Link[ubi_trPARENT] = NULL; /* Right subtree root becomes... */
p->gender = ubi_trPARENT; /* ...overall tree root. */
RootPtr->root = p;
diff --git a/source3/ubiqx/ubi_SplayTree.h b/source3/ubiqx/ubi_SplayTree.h
index 327996d740..156980ceb7 100644
--- a/source3/ubiqx/ubi_SplayTree.h
+++ b/source3/ubiqx/ubi_SplayTree.h
@@ -39,6 +39,29 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_SplayTree.h,v
+ * Revision 4.3 1998/06/03 17:45:05 crh
+ * Further fiddling with sys_include.h. It's now in ubi_BinTree.h which is
+ * included by all of the binary tree files.
+ *
+ * Also fixed some warnings produced by lint on Irix 6.2, which doesn't seem
+ * to like syntax like this:
+ *
+ * if( (a = b) )
+ *
+ * The fix was to change lines like the above to:
+ *
+ * if( 0 != (a=b) )
+ *
+ * Which means the same thing.
+ *
+ * Reminder: Some of the ubi_tr* macros in ubi_BinTree.h are redefined in
+ * ubi_AVLtree.h and ubi_SplayTree.h. This allows easy swapping
+ * of tree types by simply changing a header. Unfortunately, the
+ * macro redefinitions in ubi_AVLtree.h and ubi_SplayTree.h will
+ * conflict if used together. You must either choose a single tree
+ * type, or use the underlying function calls directly. Compare
+ * the two header files for more information.
+ *
* Revision 4.2 1998/06/02 01:29:14 crh
* Changed ubi_null.h to sys_include.h to make it more generic.
*
diff --git a/source3/ubiqx/ubi_dLinkList.c b/source3/ubiqx/ubi_dLinkList.c
index b70198fc2a..587ac3ef8f 100644
--- a/source3/ubiqx/ubi_dLinkList.c
+++ b/source3/ubiqx/ubi_dLinkList.c
@@ -25,6 +25,10 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_dLinkList.c,v
+ * Revision 0.8 1998/06/03 18:06:03 crh
+ * Further fiddling with sys_include.h, which has been moved from the .c file
+ * to the .h file.
+ *
* Revision 0.7 1998/06/02 01:38:47 crh
* Changed include file name from ubi_null.h to sys_include.h to make it
* more generic.
@@ -59,7 +63,6 @@
* ========================================================================== **
*/
-#include "sys_include.h" /* System-specific includes. */
#include "ubi_dLinkList.h" /* Header for *this* module. */
/* ========================================================================== **
diff --git a/source3/ubiqx/ubi_dLinkList.h b/source3/ubiqx/ubi_dLinkList.h
index a038ac7f29..d1a773b9cd 100644
--- a/source3/ubiqx/ubi_dLinkList.h
+++ b/source3/ubiqx/ubi_dLinkList.h
@@ -27,6 +27,10 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_dLinkList.h,v
+ * Revision 0.8 1998/06/03 18:06:03 crh
+ * Further fiddling with sys_include.h, which has been moved from the .c file
+ * to the .h file.
+ *
* Revision 0.7 1998/06/02 01:38:47 crh
* Changed include file name from ubi_null.h to sys_include.h to make it
* more generic.
@@ -61,6 +65,7 @@
* ========================================================================== **
*/
+#include "sys_include.h" /* System-specific includes. */
/* ========================================================================== **
* Typedefs...
diff --git a/source3/ubiqx/ubi_sLinkList.c b/source3/ubiqx/ubi_sLinkList.c
index 591b00ac96..0800f00ab7 100644
--- a/source3/ubiqx/ubi_sLinkList.c
+++ b/source3/ubiqx/ubi_sLinkList.c
@@ -25,6 +25,10 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_sLinkList.c,v
+ * Revision 0.7 1998/06/03 18:06:03 crh
+ * Further fiddling with sys_include.h, which has been moved from the .c file
+ * to the .h file.
+ *
* Revision 0.6 1998/06/02 01:38:47 crh
* Changed include file name from ubi_null.h to sys_include.h to make it
* more generic.
@@ -79,7 +83,6 @@
* ========================================================================== **
*/
-#include "sys_include.h" /* System-specific includes. */
#include "ubi_sLinkList.h" /* Header for *this* module. */
/* ========================================================================== **
diff --git a/source3/ubiqx/ubi_sLinkList.h b/source3/ubiqx/ubi_sLinkList.h
index 977a014d6b..8487118ca2 100644
--- a/source3/ubiqx/ubi_sLinkList.h
+++ b/source3/ubiqx/ubi_sLinkList.h
@@ -27,6 +27,10 @@
* -------------------------------------------------------------------------- **
*
* Log: ubi_sLinkList.h,v
+ * Revision 0.7 1998/06/03 18:06:03 crh
+ * Further fiddling with sys_include.h, which has been moved from the .c file
+ * to the .h file.
+ *
* Revision 0.6 1998/06/02 01:38:47 crh
* Changed include file name from ubi_null.h to sys_include.h to make it
* more generic.
@@ -81,6 +85,7 @@
* ========================================================================== **
*/
+#include "sys_include.h" /* System-specific includes. */
/* ========================================================================== **
* Typedefs...