poldek: trurlib/n_hash_new.c, trurlib/n_hash_int.h, trurlib/n_hash...

mis mis at pld-linux.org
Sat Aug 19 19:34:24 CEST 2006


Author: mis                          Date: Sat Aug 19 17:34:24 2006 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- removed stupidly added TN_HASH_INTERNAL_SELFNA

---- Files affected:
poldek/trurlib:
   n_hash_new.c (1.11 -> 1.12) , n_hash_int.h (1.8 -> 1.9) , n_hash_free.c (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: poldek/trurlib/n_hash_new.c
diff -u poldek/trurlib/n_hash_new.c:1.11 poldek/trurlib/n_hash_new.c:1.12
--- poldek/trurlib/n_hash_new.c:1.11	Wed Jul 14 20:48:44 2004
+++ poldek/trurlib/n_hash_new.c	Sat Aug 19 19:34:19 2006
@@ -59,22 +59,13 @@
 
 tn_hash *n_hash_new_na(tn_alloc *na, size_t size, void (*freefn) (void *))
 {
-    tn_hash *ht = NULL;
-    int ownna = 0;
-    
-    if (na == NULL) {
+    if (na == NULL) 
         na = n_alloc_new(16, TN_ALLOC_OBSTACK);
-        ownna = 1;
-    }
-    
-    ht = n_hash_new2(na, size, freefn);
-    if (ownna)
-        ht->flags |= TN_HASH_INTERNAL_SELFNA;
-    return ht;
+    else
+        na = n_ref(na);
     
+    return n_hash_new2(na, size, freefn);
 }
-
-
 
 # define CDB_HASHSTART 5381
 int n_hash_dohash(const tn_hash *ht, const char *s, int *slen)

================================================================
Index: poldek/trurlib/n_hash_int.h
diff -u poldek/trurlib/n_hash_int.h:1.8 poldek/trurlib/n_hash_int.h:1.9
--- poldek/trurlib/n_hash_int.h:1.8	Wed Jul 14 20:48:44 2004
+++ poldek/trurlib/n_hash_int.h	Sat Aug 19 19:34:19 2006
@@ -43,7 +43,6 @@
 };
 
 
-#define TN_HASH_INTERNAL_SELFNA (1 << 9)
 struct trurl_hash_table {
     uint16_t    _refcnt;
     uint16_t    flags;

================================================================
Index: poldek/trurlib/n_hash_free.c
diff -u poldek/trurlib/n_hash_free.c:1.6 poldek/trurlib/n_hash_free.c:1.7
--- poldek/trurlib/n_hash_free.c:1.6	Wed Jul 14 20:48:44 2004
+++ poldek/trurlib/n_hash_free.c	Sat Aug 19 19:34:19 2006
@@ -46,7 +46,6 @@
 
     if (ht->na == NULL)
         free(ht);
-        
-    else if (ht->flags & TN_HASH_INTERNAL_SELFNA)
+    else 
         n_alloc_free(ht->na);
 }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/trurlib/n_hash_new.c?r1=1.11&r2=1.12&f=u
    http://cvs.pld-linux.org/poldek/trurlib/n_hash_int.h?r1=1.8&r2=1.9&f=u
    http://cvs.pld-linux.org/poldek/trurlib/n_hash_free.c?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list