Update of /cvsroot/monetdb/sql/src/storage/bpm
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1792/src/storage/bpm
Modified Files:
bpm_storage.mx bpm_table.mx
Log Message:
Type cleanup.
Counting and indexing BUNs in a BAT is now done exclusively using the
type BUN. This means that e.g. the BATcount function now returns a
BUN instead of a size_t (with many more similar changes). It also
means that all uses of the hash_t type have been replaced by BUN.
vheaps are now exclusively indexed using the type var_t.
A few new constants have been introduced:
VAR_MAX - maximum allowed value of a value of type var_t.
BUN_MAX - maximum allowed value of a value of type BUN.
OIDFMT (existed already) - format string to print a value of type oid.
BUNFMT - format string to print a value of type BUN.
VARFMT - format string to print a value of type var_t.
U bpm_storage.mx
Index: bpm_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bpm/bpm_storage.mx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- bpm_storage.mx 22 Aug 2008 09:50:31 -0000 1.16
+++ bpm_storage.mx 25 Aug 2008 13:36:20 -0000 1.17
@@ -272,7 +272,7 @@
static void
update_val( sql_bpm *p, ssize_t rid, void *upd)
{
- sht nr = (rid)?rid/(BPM_SPLIT):0;
+ sht nr = (sht) (rid?rid/BPM_SPLIT:0);
assert(rid != -1);
@@ -336,7 +336,7 @@
l += sz;
sz = BPM_SPLIT;
while(todo > 0) {
- v = BATslice(i, l, l + sz);
+ v = BATslice(i, (BUN) l, (BUN) (l + sz));
ni = BATcopy(v, TYPE_void, v->ttype, TRUE);
ni->batDirty |= 2;
bat_destroy(v);
@@ -417,7 +417,7 @@
static void
delete_val( sql_dbpm *p, ssize_t rid )
{
- sht nr = (rid)?rid/(BPM_SPLIT):0;
+ sht nr = (sht) (rid?rid/BPM_SPLIT:0);
assert(rid != -1);
if (nr >= p->nr)
@@ -855,10 +855,10 @@
return log_destroy_dbpm(t->data);
}
-static size_t
+static BUN
clear_bpm(sql_trans *tr, sql_bpm *p)
{
- size_t sz = 0;
+ BUN sz = 0;
int i;
for (i=0; i<p->nr; i++) {
@@ -867,7 +867,7 @@
return sz;
}
-static size_t
+static BUN
clear_col(sql_trans *tr, sql_column *c)
{
if (c->data)
@@ -875,7 +875,7 @@
return 0;
}
-static size_t
+static BUN
clear_idx(sql_trans *tr, sql_idx *i)
{
if (i->data)
@@ -883,11 +883,11 @@
return 0;
}
-static size_t
+static BUN
clear_del(sql_trans *tr, sql_table *t)
{
sql_dbpm *p = t->data;
- size_t sz = 0;
+ BUN sz = 0;
int i;
for (i=0; i<p->nr; i++) {
U bpm_table.mx
Index: bpm_table.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bpm/bpm_table.mx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- bpm_table.mx 22 Aug 2008 09:50:31 -0000 1.6
+++ bpm_table.mx 25 Aug 2008 13:36:20 -0000 1.7
@@ -198,7 +198,7 @@
table_check(sql_trans *tr, sql_table *t)
{
node *n = cs_first_node(&t->columns);
- ssize_t cnt = -1;
+ BUN cnt = BUN_NONE;
(void)tr;
for (; n; n = n->next) {
@@ -206,9 +206,9 @@
sql_bpm *p = c->data;
BAT *b = temp_descriptor(p->parts[0].bid);
- if (cnt == -1) {
+ if (cnt == BUN_NONE) {
cnt = BATcount(b);
- } else if (cnt != (ssize_t)BATcount(b)) {
+ } else if (cnt != BATcount(b)) {
assert(0);
return (int)(cnt - BATcount(b));
}
-------------------------------------------------------------------------
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