Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv655/src/backends/monet5
Modified Files:
sql.mx
Log Message:
hash/xor now return wrd instead of int
U sql.mx
Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.284
retrieving revision 1.285
diff -u -d -r1.284 -r1.285
--- sql.mx 13 Sep 2008 05:56:38 -0000 1.284
+++ sql.mx 18 Sep 2008 12:13:14 -0000 1.285
@@ -324,12 +324,12 @@
The routine below are added to the calc module to
ease code generation.
@mal
-pattern calc.rotate_xor_hash(h:int, nbits:int, v:any_1) :int address
MKEYrotate_xor_hash;
-command batcalc.rotate_xor_hash(h:bat[:oid,:int], nbits:int,
b:bat[:oid,:any_1]) :bat[:oid,:int] address MKEYbulk_rotate_xor_hash;
+pattern calc.rotate_xor_hash(h:wrd, nbits:int, v:any_1) :wrd address
MKEYrotate_xor_hash;
+command batcalc.rotate_xor_hash(h:bat[:oid,:wrd], nbits:int,
b:bat[:oid,:any_1]) :bat[:oid,:int] address MKEYbulk_rotate_xor_hash;
-pattern calc.hash( v:any ) :int address hash_wrap;
+pattern calc.hash( v:any ) :wrd address hash_wrap;
-command batcalc.hash( b:bat[:oid,:any_1] ) :bat[:oid,:int]
+command batcalc.hash( b:bat[:oid,:any_1] ) :bat[:oid,:wrd]
address bathash_wrap
comment "calculate a hash value";
@@ -2103,7 +2103,7 @@
int *r, *f;
BATiter bi, dsti;
- dst = BATnew(TYPE_void,TYPE_int, BATcount(b));
+ dst = BATnew(TYPE_void, TYPE_wrd, BATcount(b));
if (!dst) {
BBPunfix(b->batCacheid);
throw(SQL, "bathash", "can not create bat");
@@ -2120,15 +2120,14 @@
BATloop(b,p,q) {
ptr v = BUNtail(bi,p);
- *r++ = (int) ((hash(v)) & 0x7FFFFFFF);
+ *r++ = hash(v);
}
} else {
char *v = BUNtail(bi,BUNfirst(b)), *e = BUNtail(bi,BUNlast(b));
int sz = Tsize(b);
- for(; v < e; v+=sz) {
- *r++ = (int) ((hash(v)) & 0x7FFFFFFF);
- }
+ for(; v < e; v+=sz)
+ *r++ = hash(v);
}
BATsetcount(dst, (BUN) (r-f));
BATkey(BATmirror(dst), 0);
@@ -2153,7 +2152,7 @@
if (b->htype == TYPE_void)
return voidbathash(res, b);
- dst= BATnew(TYPE_oid,TYPE_int, BATcount(b));
+ dst= BATnew(TYPE_oid, TYPE_wrd, BATcount(b));
if (!dst) {
BBPunfix(b->batCacheid);
throw(SQL, "bathash", "can not create bat");
@@ -2166,7 +2165,7 @@
BATloop(b,p,q){
ptr v = BUNtail(bi,p);
- int h = (int) ((hash(v)) & 0x7FFFFFFF);
+ wrd h = hash(v);
BUNins(dst, BUNhead(bi,p), &h, FALSE);
}
} else {
@@ -2174,7 +2173,7 @@
BATloop(b,p,q){
ptr v = BUNtail(bi,p);
- int h = (int) ((hash(v)) & 0x7FFFFFFF);
+ wrd h = hash(v);
BUNins(dst, BUNhead(bi,p), &h, FALSE);
}
}
@@ -2192,16 +2191,16 @@
int *res, tpe = getArgType(m,p,1);
(void) cntxt;
- res= (int *) getArgReference(s,p,0);
+ res= (wrd *) getArgReference(s,p,0);
v = getArgReference(s,p,1);
if (tpe == TYPE_bat)
return bathash_wrap(res, (int*)v);
if (ATOMextern(tpe)) /* ugh */
- *res = (int) ((ATOMhash(tpe, *(char**)v)) & 0x7FFFFFFF);
+ *res = ATOMhash(tpe, *(char**)v);
else
- *res = (int) ((ATOMhash(tpe, v)) & 0x7FFFFFFF);
+ *res = ATOMhash(tpe, v);
return NULL;
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins