Changeset: 44dea058bacd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=44dea058bacd
Modified Files:
gdk/gdk.h
gdk/gdk_atoms.c
gdk/gdk_atoms.h
gdk/gdk_cast.c
gdk/gdk_cbp.c
gdk/gdk_col.c
gdk/gdk_colop.c
gdk/gdk_heap.c
gdk/gdk_private.h
gdk/gdk_qsort.c
gdk/gdk_qsort_impl.h
gdk/gdk_rangejoin.c
gdk/gdk_search.c
gdk/gdk_search.h
gdk/gdk_ssort.c
gdk/gdk_ssort_impl.h
gdk/gdk_value.c
monetdb5/mal/mal.c
monetdb5/mal/mal_atom.c
monetdb5/mal/mal_builder.c
monetdb5/mal/mal_builder.h
monetdb5/mal/mal_function.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_recycle.c
monetdb5/mal/mal_type.c
monetdb5/modules/atoms/color.c
monetdb5/modules/atoms/str.c
monetdb5/modules/atoms/str.h
monetdb5/modules/atoms/str.mal
monetdb5/modules/kernel/algebra.c.mx
monetdb5/modules/kernel/algebra.mal.mx
monetdb5/modules/kernel/calc.c.mx
monetdb5/modules/kernel/calc.h.mx
monetdb5/modules/kernel/calc.mal.mx
monetdb5/modules/kernel/colcalc.c.mx
monetdb5/modules/kernel/colcalc.mal.mx
monetdb5/modules/kernel/colcast.c
monetdb5/modules/kernel/colcast.h
monetdb5/modules/kernel/colcast.mal.mx
monetdb5/modules/kernel/colifthen.c.mx
monetdb5/modules/kernel/colifthen.h.mx
monetdb5/modules/kernel/colifthen.mal.mx
monetdb5/modules/kernel/colstr.c
monetdb5/modules/kernel/colstr.mal
monetdb5/modules/kernel/column.c.mx
monetdb5/modules/mal/inout.c
monetdb5/modules/mal/mdb.c
monetdb5/modules/mal/mkey.c
monetdb5/modules/mal/mkey.mal
monetdb5/optimizer/opt_cluster.c
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_pushranges.c
Branch: headless
Log Message:
Removed type chr.
chr didn't make much sense in the Unicode age: a single byte is not
enough to represent a single Unicode code point. And if you want to
use a single byte integer, use bte.
diffs (truncated from 3124 to 300 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -98,9 +98,6 @@
* virtual-OIDs: a densely ascending column of OIDs (takes zero-storage).
* @item bit:
* Booleans, implemented as one byte values.
- * @item chr:
- * A single character (8 bits @strong{integer}s).
- * DEPRECATED for storing text (Unicode not supported).
* @item bte:
* Tiny (1-byte) integers (8-bit @strong{integer}s).
* @item sht:
@@ -486,22 +483,20 @@
#define TYPE_void 0
#define TYPE_bit 1
-#define TYPE_chr 2
-#define TYPE_bte 3
-#define TYPE_sht 4
-#define TYPE_bat 5 /* COL id: index in CBPcache */
-#define TYPE_int 6
-#define TYPE_oid 7
-#define TYPE_wrd 8
-#define TYPE_ptr 9 /* C pointer! */
-#define TYPE_flt 10
-#define TYPE_dbl 11
-#define TYPE_lng 12
-#define TYPE_str 13
+#define TYPE_bte 2
+#define TYPE_sht 3
+#define TYPE_bat 4 /* COL id: index in CBPcache */
+#define TYPE_int 5
+#define TYPE_oid 6
+#define TYPE_wrd 7
+#define TYPE_ptr 8 /* C pointer! */
+#define TYPE_flt 9
+#define TYPE_dbl 10
+#define TYPE_lng 11
+#define TYPE_str 12
#define TYPE_any 255 /* limit types to <255! */
typedef signed char bit;
-typedef signed char chr;
typedef signed char bte;
typedef short sht;
@@ -630,8 +625,8 @@
unsigned int copied:1, /* a copy of an existing map. */
hashash:1, /* the string heap contains hash values */
forcemap:1; /* force STORE_MMAP even if heap exists */
- chr newstorage; /* new desired storage mode at re-allocation. */
- chr dirty; /* specific heap dirty marker */
+ bte newstorage; /* new desired storage mode at re-allocation. */
+ bte dirty; /* specific heap dirty marker */
bat parentid; /* cache id of VIEW parent bat */
} Heap;
@@ -718,7 +713,6 @@
sht shval;
bte btval;
wrd wval;
- chr cval[4];
flt fval;
ptr pval;
bat bval;
@@ -837,8 +831,8 @@
str id; /* label for head/tail column */
unsigned short width; /* byte-width of the atom array */
- chr type; /* type id. */
- chr shift; /* log2 of bunwidth */
+ bte type; /* type id. */
+ bte shift; /* log2 of bunwidth */
unsigned int
varsized:1, /* varsized(>0) or fixedsized(0). */
key:2, /* duplicates allowed? */
@@ -1020,7 +1014,7 @@
gdk_export COL *COLnewdensecol(oid size);
/* internal */
-gdk_export chr ATOMelmshift(int sz);
+gdk_export bte ATOMelmshift(int sz);
/*
*
@@ -1207,7 +1201,6 @@
assert((o) < (b)->capacity - (b)->first), \
(((TYPE *) COLelement((b), (b)->first))[o] = (v)))
-#define COLset_chr(b, o, v, copyall) COLset_TYPE(b, o, v, chr)
#define COLset_bte(b, o, v, copyall) COLset_TYPE(b, o, v, bte)
#define COLset_sht(b, o, v, copyall) COLset_TYPE(b, o, v, sht)
#define COLset_int(b, o, v, copyall) COLset_TYPE(b, o, v, int)
@@ -1266,7 +1259,6 @@
} while (0)
#define COLreplacevalue_str(b, o, v, copyall) COLset_str(b, o, v, copyall)
-#define COLreplacevalue_chr(b, o, v, copyall) COLset_TYPE(b, o, v, chr)
#define COLreplacevalue_bte(b, o, v, copyall) COLset_TYPE(b, o, v, bte)
#define COLreplacevalue_sht(b, o, v, copyall) COLset_TYPE(b, o, v, sht)
#define COLreplacevalue_int(b, o, v, copyall) COLset_TYPE(b, o, v, int)
@@ -1283,7 +1275,6 @@
(((TYPE *) COLelement(b, b->first))[o]))
#define COLget_bte(b, o) COLget_TYPE(b, o, bte)
-#define COLget_chr(b, o) COLget_TYPE(b, o, chr)
#define COLget_sht(b, o) COLget_TYPE(b, o, sht)
#define COLget_int(b, o) COLget_TYPE(b, o, int)
#define COLget_wrd(b, o) COLget_TYPE(b, o, wrd)
@@ -1311,7 +1302,6 @@
COLset_##TYPE((b), (o), (v), 0); \
} while (0)
#define fastins_nocheck_bte(b, o, v) fastins_nocheck_TYPE(b, o, v, bte)
-#define fastins_nocheck_chr(b, o, v) fastins_nocheck_TYPE(b, o, v, chr)
#define fastins_nocheck_sht(b, o, v) fastins_nocheck_TYPE(b, o, v, sht)
#define fastins_nocheck_int(b, o, v) fastins_nocheck_TYPE(b, o, v, int)
#define fastins_nocheck_wrd(b, o, v) fastins_nocheck_TYPE(b, o, v, wrd)
@@ -1332,7 +1322,6 @@
(b)->count++; \
} while (0)
#define bunfastins_nocheck_bte(b, o, v) bunfastins_nocheck_TYPE(b, o,
v, bte)
-#define bunfastins_nocheck_chr(b, o, v) bunfastins_nocheck_TYPE(b, o,
v, chr)
#define bunfastins_nocheck_sht(b, o, v) bunfastins_nocheck_TYPE(b, o,
v, sht)
#define bunfastins_nocheck_int(b, o, v) bunfastins_nocheck_TYPE(b, o,
v, int)
#define bunfastins_nocheck_wrd(b, o, v) bunfastins_nocheck_TYPE(b, o,
v, wrd)
@@ -1361,7 +1350,6 @@
bunfastins_nocheck_TYPE((b), (b)->count, (v), TYPE); \
} while (0)
#define bunfastins_bte(b, v) bunfastins_TYPE(b, v, bte)
-#define bunfastins_chr(b, v) bunfastins_TYPE(b, v, chr)
#define bunfastins_sht(b, v) bunfastins_TYPE(b, v, sht)
#define bunfastins_int(b, v) bunfastins_TYPE(b, v, int)
#define bunfastins_wrd(b, v) bunfastins_TYPE(b, v, wrd)
@@ -1384,7 +1372,6 @@
(o)++; \
} while (0)
#define bunfastins_nocheck_inc_bte(b, o, v) bunfastins_nocheck_inc_TYPE(b,
o, v, bte)
-#define bunfastins_nocheck_inc_chr(b, o, v) bunfastins_nocheck_inc_TYPE(b,
o, v, chr)
#define bunfastins_nocheck_inc_sht(b, o, v) bunfastins_nocheck_inc_TYPE(b,
o, v, sht)
#define bunfastins_nocheck_inc_int(b, o, v) bunfastins_nocheck_inc_TYPE(b,
o, v, int)
#define bunfastins_nocheck_inc_wrd(b, o, v) bunfastins_nocheck_inc_TYPE(b,
o, v, wrd)
@@ -2881,9 +2868,6 @@
* @item HASHloop_bit
* @tab
* (COL *b; Hash *h, size_t idx; bit *value, oid w)
- * @item HASHloop_chr
- * @tab
- * (COL *b; Hash *h, size_t idx; char *value, oid w)
* @item HASHloop_bte
* @tab
* (COL *b; Hash *h, size_t idx; bte *value, oid w)
@@ -3062,7 +3046,6 @@
if (simple_EQ(v, BUNloc(bi, hb), TYPE))
#define HASHloop_bit(bi,h,hb,v) HASHloop_TYPE(bi,h,hb,v,bte)
-#define HASHloop_chr(bi,h,hb,v) HASHloop_TYPE(bi,h,hb,v,chr)
#define HASHloop_bte(bi,h,hb,v) HASHloop_TYPE(bi,h,hb,v,bte)
#define HASHloop_sht(bi,h,hb,v) HASHloop_TYPE(bi,h,hb,v,sht)
#define HASHloop_int(bi,h,hb,v) HASHloop_TYPE(bi,h,hb,v,int)
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -39,12 +39,6 @@
#include <math.h> /* for INFINITY and NAN */
int
-chrCmp(chr *l, chr *r)
-{
- return simple_CMP(l, r, chr);
-}
-
-int
bteCmp(bte *l, bte *r)
{
return simple_CMP(l, r, bte);
@@ -85,12 +79,6 @@
* Return some positive integer derived from one atom value.
*/
oid
-chrHash(chr *v)
-{
- return (oid) *(unsigned char *) v;
-}
-
-oid
bteHash(bte *v)
{
return (oid) *(unsigned char *) v;
@@ -166,20 +154,11 @@
0, 0,
0, 0,
0, 0},
- {"bit", TYPE_chr, 1, sizeof(bit), sizeof(bit), 0, 0, (ptr) &chr_nil,
+ {"bit", TYPE_bte, 1, sizeof(bit), sizeof(bit), 0, 0, (ptr) &bte_nil,
(int (*)(str, int *, ptr *)) bitFromStr, (int (*)(str *, int *, ptr))
bitToStr,
(void *(*)(void *, stream *, size_t)) bitRead, (int (*)(void *, stream
*, size_t)) bitWrite,
- (int (*)(ptr, ptr)) chrCmp,
- (oid (*)(ptr)) chrHash, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0},
- {"chr", TYPE_chr, 1, sizeof(chr), sizeof(chr), 0, 0, (ptr) &chr_nil,
- (int (*)(str, int *, ptr *)) chrFromStr, (int (*)(str *, int *, ptr))
chrToStr,
- (void *(*)(void *, stream *, size_t)) chrRead, (int (*)(void *, stream
*, size_t)) chrWrite,
- (int (*)(ptr, ptr)) chrCmp,
- (oid (*)(ptr)) chrHash, 0,
+ (int (*)(ptr, ptr)) bteCmp,
+ (oid (*)(ptr)) bteHash, 0,
0, 0,
0, 0,
0, 0,
@@ -512,7 +491,6 @@
}
-const chr chr_nil = (chr) '\200';
const bte bte_nil = GDK_bte_min;
const sht sht_nil = GDK_sht_min;
const int int_nil = GDK_int_min;
@@ -521,7 +499,8 @@
const lng lng_nil = GDK_lng_min;
const oid oid_nil = (oid) 1 << (sizeof(oid) * 8 - 1);
const wrd wrd_nil = GDK_wrd_min;
-const char str_nil[2] = { GDK_chr_min, 0 };
+const char str_nil[2] = { '\377', 0 }; /* \377 cannot occur in a valid
+ * UTF-8 encoding (nor can \376) */
const ptr ptr_nil = NULL;
ptr
@@ -564,10 +543,6 @@
ATOMcmp(int t, ptr l, ptr r)
{
switch (ATOMstorage(t)) {
-#ifndef NOEXPAND_CHR
- case TYPE_chr:
- return simple_CMP(l, r, chr);
-#endif
#ifndef NOEXPAND_BTE
case TYPE_bte:
return simple_CMP(l, r, bte);
@@ -745,247 +720,6 @@
}
int
-chrFromStr(char *src, int *len, chr **dst)
-{
- unsigned char *p = (unsigned char *) src;
- unsigned int base = 0;
- int error = 0;
-
- atommem(chr,sizeof(chr));
-
- while (GDKisspace(*p))
- p++;
- if (p[0] == 'n' && p[1] == 'i' && p[2] == 'l') {
- base = chr_nil;
- p += 3;
- } else {
- int q = p[0] == '\'' && p[1] != 0;
-
- if (q)
- p++;
- error = 1; /* until proved otherwise */
- if ((*p & 0x80) == 0) {
- if (q && *p == '\\' && p[1] != 0) {
- /* interpret backslash escape but only in a
single-quoted string */
- p++;
- switch (*p) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- /* \ with up to three octal digits */
- base = base08(*p);
- if (num08(p[1])) {
- p++;
- base = mult08(base) +
base08(*p);
- if (num08(p[1])) {
- p++;
- base = mult08(base) +
base08(*p);
- }
- }
- error = 0;
- break;
- case 'x':
- /* \x with one or two hexadecimal
digits */
- if (num16(p[1])) {
- p++;
- base = base16(*p);
- if (num16(p[1])) {
- p++;
- base = mult16(base) +
base16(*p);
- }
- error = 0;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list