Changeset: 98fcea9bc4b4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=98fcea9bc4b4
Modified Files:
        gdk/gdk.h
        gdk/gdk_search.c
        gdk/gdk_search.h
        monetdb5/mal/mal_debugger.c
Branch: default
Log Message:

renamed struct Hash members "link" & "hash" to "Link" & "Hash", respectively

This is to exploit compilers to find legacy use of them,
e.g., when merging with other branches.


diffs (95 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -652,8 +652,8 @@ typedef struct {
        BUN nil;                /* nil representation */
        BUN lim;                /* collision list size */
        BUN mask;               /* number of hash buckets-1 (power of 2) */
-       void *hash;             /* hash table */
-       void *link;             /* collision list */
+       void *Hash;             /* hash table */
+       void *Link;             /* collision list */
        Heap *heap;             /* heap where the hash is stored */
 } Hash;
 
diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -151,8 +151,8 @@ HASHnew(Heap *hp, int tpe, BUN size, BUN
        default:
                assert(0);
        }
-       h->link = (void *) hp->base;
-       h->hash = (void *) ((char *) h->link + h->lim * width);
+       h->Link = (void *) hp->base;
+       h->Hash = (void *) ((char *) h->Link + h->lim * width);
        h->type = tpe;
        h->heap = hp;
        HASHclear(h);           /* zero the mask */
diff --git a/gdk/gdk_search.h b/gdk/gdk_search.h
--- a/gdk/gdk_search.h
+++ b/gdk/gdk_search.h
@@ -36,27 +36,27 @@ gdk_export BUN HASHlist(Hash *h, BUN i);
 
 #define HASHnil(H)     H->nil
 
-/* play around with h->hash[i] and h->link[j] */
+/* play around with h->Hash[i] and h->Link[j] */
 #define HASHget(h,i)   \
-       ((BUN)  (h->width == BUN8 ? ((BUN8type*) h->hash)[i] : \
-               (h->width == BUN4 ? ((BUN4type*) h->hash)[i] : \
-               (h->width == BUN2 ? ((BUN2type*) h->hash)[i] : \
-                                   ((BUN1type*) h->hash)[i] ))))
+       ((BUN)  (h->width == BUN8 ? ((BUN8type*) h->Hash)[i] : \
+               (h->width == BUN4 ? ((BUN4type*) h->Hash)[i] : \
+               (h->width == BUN2 ? ((BUN2type*) h->Hash)[i] : \
+                                   ((BUN1type*) h->Hash)[i] ))))
 #define HASHput(h,i,v) \
-       (void)  (h->width == BUN8 ? (((BUN8type*) h->hash)[i] = (BUN8type) v) : 
\
-               (h->width == BUN4 ? (((BUN4type*) h->hash)[i] = (BUN4type) v) : 
\
-               (h->width == BUN2 ? (((BUN2type*) h->hash)[i] = (BUN2type) v) : 
\
-                                   (((BUN1type*) h->hash)[i] = (BUN1type) v) 
)))
+       (void)  (h->width == BUN8 ? (((BUN8type*) h->Hash)[i] = (BUN8type) v) : 
\
+               (h->width == BUN4 ? (((BUN4type*) h->Hash)[i] = (BUN4type) v) : 
\
+               (h->width == BUN2 ? (((BUN2type*) h->Hash)[i] = (BUN2type) v) : 
\
+                                   (((BUN1type*) h->Hash)[i] = (BUN1type) v) 
)))
 #define HASHgetlink(h,i)       \
-       ((BUN)  (h->width == BUN8 ? ((BUN8type*) h->link)[i] : \
-               (h->width == BUN4 ? ((BUN4type*) h->link)[i] : \
-               (h->width == BUN2 ? ((BUN2type*) h->link)[i] : \
-                                   ((BUN1type*) h->link)[i] ))))
+       ((BUN)  (h->width == BUN8 ? ((BUN8type*) h->Link)[i] : \
+               (h->width == BUN4 ? ((BUN4type*) h->Link)[i] : \
+               (h->width == BUN2 ? ((BUN2type*) h->Link)[i] : \
+                                   ((BUN1type*) h->Link)[i] ))))
 #define HASHputlink(h,i,v)     \
-       (void)  (h->width == BUN8 ? (((BUN8type*) h->link)[i] = (BUN8type) v) : 
\
-               (h->width == BUN4 ? (((BUN4type*) h->link)[i] = (BUN4type) v) : 
\
-               (h->width == BUN2 ? (((BUN2type*) h->link)[i] = (BUN2type) v) : 
\
-                                   (((BUN1type*) h->link)[i] = (BUN1type) v) 
)))
+       (void)  (h->width == BUN8 ? (((BUN8type*) h->Link)[i] = (BUN8type) v) : 
\
+               (h->width == BUN4 ? (((BUN4type*) h->Link)[i] = (BUN4type) v) : 
\
+               (h->width == BUN2 ? (((BUN2type*) h->Link)[i] = (BUN2type) v) : 
\
+                                   (((BUN1type*) h->Link)[i] = (BUN1type) v) 
)))
 
 #define mix_sht(X)            (((X)>>7)^(X))
 #define mix_int(X)            (((X)>>7)^((X)>>13)^((X)>>21)^(X))
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -1568,13 +1568,13 @@ memProfileVector(stream *out, int cells)
                        h = b->H->hash;
                        if (h && h->mask) {
                                mnstr_printf(out, "\thhash=" PTRFMT " size=" 
SZFMT "\n", PTRFMTCAST h, sizeof(*h));
-                               mnstr_printf(out, "\thhashlink=" PTRFMT " 
size=" SZFMT "\n", PTRFMTCAST h->link,
+                               mnstr_printf(out, "\thhashlink=" PTRFMT " 
size=" SZFMT "\n", PTRFMTCAST h->Link,
                                                (h->mask + h->lim + 1) * 
sizeof(int));
                        }
                        h = b->T->hash;
                        if (h && h->mask) {
                                mnstr_printf(out, "\tthash=" PTRFMT " size=" 
SZFMT "\n", PTRFMTCAST h, sizeof(*h));
-                               mnstr_printf(out, "\tthashlink=" PTRFMT " 
size=" SZFMT "\n", PTRFMTCAST h->link,
+                               mnstr_printf(out, "\tthashlink=" PTRFMT " 
size=" SZFMT "\n", PTRFMTCAST h->Link,
                                                (h->mask + h->lim + 1) * 
sizeof(int));
                        }
                        BBPunfix(b->batCacheid);
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to