Changeset: abfc7013ebbb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=abfc7013ebbb
Modified Files:
gdk/gdk_aggr.c
gdk/gdk_calc.c
gdk/gdk_join.c
gdk/gdk_ssort.c
gdk/gdk_ssort_impl.h
Branch: Oct2014
Log Message:
Remove some unreachable code.
Since oids are now more often treated as int/lng, we don't need
special code for oid in various places. Same holds for wrd.
diffs (truncated from 499 to 300 lines):
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -1943,9 +1943,6 @@ do_groupmin(oid *oids, BAT *b, const oid
case TYPE_int:
AGGR_CMP(int, LT);
break;
- case TYPE_oid:
- AGGR_CMP(oid, LT);
- break;
case TYPE_lng:
AGGR_CMP(lng, LT);
break;
@@ -1963,6 +1960,8 @@ do_groupmin(oid *oids, BAT *b, const oid
}
/* fall through */
default:
+ assert(b->ttype != TYPE_oid);
+ assert(b->ttype != TYPE_wrd);
bi = bat_iterator(b);
if (gdense) {
@@ -2081,9 +2080,6 @@ do_groupmax(oid *oids, BAT *b, const oid
case TYPE_int:
AGGR_CMP(int, GT);
break;
- case TYPE_oid:
- AGGR_CMP(oid, GT);
- break;
case TYPE_lng:
AGGR_CMP(lng, GT);
break;
@@ -2101,6 +2097,8 @@ do_groupmax(oid *oids, BAT *b, const oid
}
/* fall through */
default:
+ assert(b->ttype != TYPE_oid);
+ assert(b->ttype != TYPE_wrd);
bi = bat_iterator(b);
if (gdense) {
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -8414,15 +8414,9 @@ BATcalcbetween_intern(const void *src, i
BETWEEN_LOOP_TYPE(sht);
break;
case TYPE_int:
-#if SIZEOF_WRD == SIZEOF_INT
- case TYPE_wrd:
-#endif
BETWEEN_LOOP_TYPE(int);
break;
case TYPE_lng:
-#if SIZEOF_WRD == SIZEOF_LNG
- case TYPE_wrd:
-#endif
BETWEEN_LOOP_TYPE(lng);
break;
case TYPE_flt:
@@ -8432,6 +8426,8 @@ BATcalcbetween_intern(const void *src, i
BETWEEN_LOOP_TYPE(dbl);
break;
default:
+ assert(tp != TYPE_oid);
+ assert(tp != TYPE_wrd);
if (!BATatoms[tp].linear ||
(atomcmp = ATOMcompare(tp)) == NULL) {
BBPunfix(bn->batCacheid);
@@ -9344,9 +9340,6 @@ convert_void_any(oid seq, BUN cnt, BAT *
}
break;
case TYPE_int:
-#if SIZEOF_OID == SIZEOF_INT
- case TYPE_oid:
-#endif
CANDLOOP((int *) dst, i, int_nil, 0, start);
for (i = start; i < end; i++, seq++) {
CHECKCAND((int *) dst, i, candoff, int_nil);
@@ -9354,9 +9347,6 @@ convert_void_any(oid seq, BUN cnt, BAT *
}
break;
case TYPE_lng:
-#if SIZEOF_OID == SIZEOF_LNG
- case TYPE_oid:
-#endif
CANDLOOP((lng *) dst, i, lng_nil, 0, start);
for (i = start; i < end; i++, seq++) {
CHECKCAND((lng *) dst, i, candoff, lng_nil);
@@ -9419,10 +9409,6 @@ convert_void_any(oid seq, BUN cnt, BAT *
for (; i < cnt; i++)
((lng *) dst)[i] = lng_nil;
break;
- case TYPE_oid:
- for (; i < cnt; i++)
- ((oid *) dst)[i] = oid_nil;
- break;
case TYPE_flt:
for (; i < cnt; i++)
((flt *) dst)[i] = flt_nil;
@@ -9473,18 +9459,27 @@ convert_typeswitchloop(const void *src,
start, end, cand,
candend, candoff);
case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+ if (dtp == TYPE_oid)
+ return convert_bte_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_bte_int(src, dst, cnt,
start, end, cand,
candend, candoff);
case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+ if (dtp == TYPE_oid)
+ return convert_bte_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_bte_lng(src, dst, cnt,
start, end, cand,
candend, candoff);
- case TYPE_oid:
- return convert_bte_oid(src, dst, cnt,
- start, end, cand,
- candend, candoff,
- abort_on_error);
case TYPE_flt:
return convert_bte_flt(src, dst, cnt,
start, end, cand,
@@ -9512,18 +9507,27 @@ convert_typeswitchloop(const void *src,
start, end, cand,
candend, candoff);
case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+ if (dtp == TYPE_oid)
+ return convert_sht_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_sht_int(src, dst, cnt,
start, end, cand,
candend, candoff);
case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+ if (dtp == TYPE_oid)
+ return convert_sht_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_sht_lng(src, dst, cnt,
start, end, cand,
candend, candoff);
- case TYPE_oid:
- return convert_sht_oid(src, dst, cnt,
- start, end, cand,
- candend, candoff,
- abort_on_error);
case TYPE_flt:
return convert_sht_flt(src, dst, cnt,
start, end, cand,
@@ -9536,9 +9540,6 @@ convert_typeswitchloop(const void *src,
return BUN_NONE + 1;
}
case TYPE_int:
-#if SIZEOF_OID == SIZEOF_INT
- case TYPE_oid:
-#endif
switch (BASETYPE(dtp)) {
case TYPE_bte:
if (dtp == TYPE_bit) {
@@ -9556,18 +9557,27 @@ convert_typeswitchloop(const void *src,
candend, candoff,
abort_on_error);
case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+ if (dtp == TYPE_oid)
+ return convert_int_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_int_int(src, dst, cnt,
start, end, cand,
candend, candoff);
case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+ if (dtp == TYPE_oid)
+ return convert_int_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_int_lng(src, dst, cnt,
start, end, cand,
candend, candoff);
- case TYPE_oid:
- return convert_int_oid(src, dst, cnt,
- start, end, cand,
- candend, candoff,
- abort_on_error);
case TYPE_flt:
return convert_int_flt(src, dst, cnt,
start, end, cand,
@@ -9580,9 +9590,6 @@ convert_typeswitchloop(const void *src,
return BUN_NONE + 1;
}
case TYPE_lng:
-#if SIZEOF_OID == SIZEOF_LNG
- case TYPE_oid:
-#endif
switch (BASETYPE(dtp)) {
case TYPE_bte:
if (dtp == TYPE_bit) {
@@ -9600,19 +9607,28 @@ convert_typeswitchloop(const void *src,
candend, candoff,
abort_on_error);
case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+ if (dtp == TYPE_oid)
+ return convert_lng_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_lng_int(src, dst, cnt,
start, end, cand,
candend, candoff,
abort_on_error);
case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+ if (dtp == TYPE_oid)
+ return convert_lng_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_lng_lng(src, dst, cnt,
start, end, cand,
candend, candoff);
- case TYPE_oid:
- return convert_lng_oid(src, dst, cnt,
- start, end, cand,
- candend, candoff,
- abort_on_error);
case TYPE_flt:
return convert_lng_flt(src, dst, cnt,
start, end, cand,
@@ -9642,20 +9658,29 @@ convert_typeswitchloop(const void *src,
candend, candoff,
abort_on_error);
case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+ if (dtp == TYPE_oid)
+ return convert_flt_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_flt_int(src, dst, cnt,
start, end, cand,
candend, candoff,
abort_on_error);
case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+ if (dtp == TYPE_oid)
+ return convert_flt_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_flt_lng(src, dst, cnt,
start, end, cand,
candend, candoff,
abort_on_error);
- case TYPE_oid:
- return convert_flt_oid(src, dst, cnt,
- start, end, cand,
- candend, candoff,
- abort_on_error);
case TYPE_flt:
return convert_flt_flt(src, dst, cnt,
start, end, cand,
@@ -9685,20 +9710,29 @@ convert_typeswitchloop(const void *src,
candend, candoff,
abort_on_error);
case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+ if (dtp == TYPE_oid)
+ return convert_dbl_oid(src, dst, cnt,
+ start, end, cand,
+ candend, candoff,
+ abort_on_error);
+#endif
return convert_dbl_int(src, dst, cnt,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list