Changeset: 1db59294d827 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1db59294d827
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/mtime.h
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tablet.h
sql/backends/monet5/datacell/emitter.c
sql/backends/monet5/datacell/receptor.c
sql/backends/monet5/sql_result.c
Branch: default
Log Message:
Cleanup tablet code.
Removed various unused fields from the Column struct, don't malloc
values that we don't need to malloc, made various pointers in the
Column struct into const pointers (which escalated into some other
files), turned an external function into a static one.
diffs (truncated from 982 to 300 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1666,7 +1666,7 @@ str MTIMEdate_extract_year_bulk(int *ret
str MTIMEdate_fromstr(date *ret, str *s);
str MTIMEdate_sub_msec_interval_lng_wrap(date *ret, date *t, lng *msec);
str MTIMEdate_sub_sec_interval_wrap(date *ret, date *t, int *sec);
-str MTIMEdate_tostr(str *ret, date *d);
+str MTIMEdate_tostr(str *ret, const date *d);
str MTIMEday_from_str(int *ret, str *day);
str MTIMEday_to_str(str *ret, int *day);
str MTIMEdaytime1(daytime *ret, int *h);
@@ -1685,7 +1685,7 @@ str MTIMEdaytime_extract_seconds_bulk(in
str MTIMEdaytime_extract_sql_seconds(int *ret, daytime *v);
str MTIMEdaytime_extract_sql_seconds_bulk(int *ret, int *bid);
str MTIMEdaytime_fromstr(daytime *ret, str *s);
-str MTIMEdaytime_tostr(str *ret, daytime *d);
+str MTIMEdaytime_tostr(str *ret, const daytime *d);
str MTIMEepilogue(void);
str MTIMEepoch(timestamp *ret);
str MTIMEepoch2int(int *res, timestamp *ts);
@@ -1708,7 +1708,7 @@ str MTIMErule_extract_month(int *ret, ru
str MTIMErule_extract_weekday(int *ret, rule *r);
str MTIMErule_fromstr(rule *ret, str *s);
str MTIMErule_fromstr(rule *ret, str *s);
-str MTIMErule_tostr(str *s, rule *r);
+str MTIMErule_tostr(str *s, const rule *r);
str MTIMEsecs2daytime(daytime *ret, lng *src);
str MTIMEsql_day(lng *ret, lng *t);
str MTIMEsql_hours(int *ret, lng *t);
@@ -1727,7 +1727,7 @@ str MTIMEtimestamp_GE(bit *retval, times
str MTIMEtimestamp_GT(bit *retval, timestamp *val1, timestamp *val2);
str MTIMEtimestamp_LE(bit *retval, timestamp *val1, timestamp *val2);
str MTIMEtimestamp_LT(bit *retval, timestamp *val1, timestamp *val2);
-str MTIMEtimestamp_add(timestamp *ret, timestamp *v, lng *msecs);
+str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msecs);
str MTIMEtimestamp_add_month_interval_wrap(timestamp *ret, timestamp *t, int
*months);
str MTIMEtimestamp_create(timestamp *ret, date *d, daytime *t, tzone *z);
str MTIMEtimestamp_create_default(timestamp *ret, date *d, daytime *t);
@@ -1762,7 +1762,7 @@ str MTIMEtzone_fromstr(tzone *ret, str *
str MTIMEtzone_get_local(tzone *z);
str MTIMEtzone_isnil(bit *retval, tzone *val);
str MTIMEtzone_set_local(int res, tzone *z);
-str MTIMEtzone_tostr(str *s, tzone *ret);
+str MTIMEtzone_tostr(str *s, const tzone *ret);
str MTIMEunix_epoch(timestamp *ret);
str OCTOPUSbidding(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str OCTOPUSconnect(str *c, str *dbname);
@@ -2235,14 +2235,13 @@ str SYSmem_usage(int *ret, int *ret2, ln
str SYSsetmem_maxsize(int *ret, lng *num);
str SYSsetvm_maxsize(lng *num);
str SYSvm_usage(int *ret, int *ret2, lng *minsize);
-ptr *TABLETadt_frStr(Column *c, int type, char *s, char *e, char quote);
+void *TABLETadt_frStr(Column *c, int type, char *s, char *e, char quote);
int TABLETadt_toStr(void *extra, char **buf, int *len, int type, ptr a);
BAT **TABLETcollect(Tablet *as);
BAT **TABLETcollect_parts(Tablet *as, BUN offset);
int TABLETcreate_bats(Tablet *as, BUN est);
void TABLETdestroy_format(Tablet *as);
int TABLEToutput_file(Tablet *as, BAT *order, stream *s);
-ptr *TABLETstrFrStr(Column *c, char *s, char *e);
str TKNZRappend(oid *pos, str *tuple);
str TKNZRclose(int *r);
str TKNZRdepositFile(int *r, str *fnme);
@@ -2465,9 +2464,9 @@ int dataflowConflict(InstrPtr p);
str dataflowRef;
str dateRef;
int date_fromstr(str buf, int *len, date **d);
-int date_tostr(str *buf, int *len, date *val);
+int date_tostr(str *buf, int *len, const date *val);
int daytime_fromstr(str buf, int *len, daytime **ret);
-int daytime_tostr(str *buf, int *len, daytime *val);
+int daytime_tostr(str *buf, int *len, const daytime *val);
int daytime_tz_fromstr(str buf, int *len, daytime **ret);
str dblRef;
str deactivateCounter(str name);
@@ -2980,7 +2979,7 @@ int rowsProp;
str rpcRef;
str rsColumnRef;
int rule_fromstr(str buf, int *len, rule **d);
-int rule_tostr(str *buf, int *len, rule *r);
+int rule_tostr(str *buf, int *len, const rule *r);
str runFactory(Client cntxt, MalBlkPtr mb, MalBlkPtr mbcaller, MalStkPtr stk,
InstrPtr pci);
str runMAL(Client c, MalBlkPtr mb, MalBlkPtr mbcaller, MalStkPtr env);
str runMALDebugger(Client cntxt, Symbol s);
@@ -3121,9 +3120,9 @@ str tidRef;
str timestampRef;
int timestamp_fromstr(str buf, int *len, timestamp **ret);
timestamp *timestamp_nil;
-int timestamp_tostr(str *buf, int *len, timestamp *val);
-int timestamp_tostr(str *buf, int *len, timestamp *val);
-int timestamp_tz_tostr(str *buf, int *len, timestamp *val, tzone *timezone);
+int timestamp_tostr(str *buf, int *len, const timestamp *val);
+int timestamp_tostr(str *buf, int *len, const timestamp *val);
+int timestamp_tz_tostr(str *buf, int *len, const timestamp *val, const tzone
*timezone);
str tinterRef;
str tintersectRef;
int tlbProp;
@@ -3140,7 +3139,7 @@ void typeChecker(stream *out, Module sco
int tzone_fromstr(str buf, int *len, tzone **d);
int tzone_fromstr(str buf, int *len, tzone **d);
tzone tzone_local;
-int tzone_tostr(str *buf, int *len, tzone *z);
+int tzone_tostr(str *buf, int *len, const tzone *z);
str unescape_str(str *retval, str s);
str unionRef;
void unloadLibraries(void);
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -483,7 +483,7 @@ static int dummy;
#define BEFORE(d1,m1,d2,m2) (d1 < d2 || (d1 == d2 && m1 <= m2))
static int
-timestamp_inside(timestamp *ret, timestamp *t, tzone *z, lng offset)
+timestamp_inside(timestamp *ret, const timestamp *t, const tzone *z, lng
offset)
{
/* starts with GMT time t, and returns whether it is in the DST for z */
lng add = (offset != (lng) 0) ? offset : (get_offset(z)) * (lng) 60000;
@@ -598,7 +598,7 @@ date_fromstr(str buf, int *len, date **d
}
int
-date_tostr(str *buf, int *len, date *val)
+date_tostr(str *buf, int *len, const date *val)
{
int day, month, year;
@@ -707,7 +707,7 @@ daytime_tz_fromstr(str buf, int *len, da
}
int
-daytime_tostr(str *buf, int *len, daytime *val)
+daytime_tostr(str *buf, int *len, const daytime *val)
{
int hour, min, sec, msec;
@@ -787,7 +787,7 @@ timestamp_fromstr(str buf, int *len, tim
}
int
-timestamp_tz_tostr(str *buf, int *len, timestamp *val, tzone *timezone)
+timestamp_tz_tostr(str *buf, int *len, const timestamp *val, const tzone
*timezone)
{
int len1, len2, big = 128;
char buf1[128], buf2[128], *s = *buf, *s1 = buf1, *s2 = buf2;
@@ -832,7 +832,7 @@ timestamp_tz_tostr(str *buf, int *len, t
}
int
-timestamp_tostr(str *buf, int *len, timestamp *val)
+timestamp_tostr(str *buf, int *len, const timestamp *val)
{
return timestamp_tz_tostr(buf, len, val, &tzone_local);
}
@@ -855,7 +855,7 @@ count1(int i)
* @- rule
*/
int
-rule_tostr(str *buf, int *len, rule *r)
+rule_tostr(str *buf, int *len, const rule *r)
{
int hours = r->s.minutes / 60;
int minutes = r->s.minutes % 60;
@@ -1052,7 +1052,7 @@ tzone_fromstr(str buf, int *len, tzone *
}
int
-tzone_tostr(str *buf, int *len, tzone *z)
+tzone_tostr(str *buf, int *len, const tzone *z)
{
str s;
@@ -1509,7 +1509,7 @@ date_addmonths(date *ret, date *v, int *
/* returns the timestamp that comes 'milliseconds' after 'value'. */
str
-MTIMEtimestamp_add(timestamp *ret, timestamp *v, lng *msecs)
+MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msecs)
{
if (!ts_isnil(*v) && *msecs != lng_nil) {
int days = (int) (*msecs / (24 * 60 * 60 * 1000));
@@ -1827,7 +1827,7 @@ MTIMEdate_date(date *d, date *s)
}
str
-MTIMEdate_tostr(str *ret, date *d)
+MTIMEdate_tostr(str *ret, const date *d)
{
int big = 128;
char buf[128], *s1 = buf;
@@ -1863,7 +1863,7 @@ MTIMEdate_create(date *ret, int *year, i
}
str
-MTIMEdaytime_tostr(str *ret, daytime *d)
+MTIMEdaytime_tostr(str *ret, const daytime *d)
{
char buf[128], *s = buf;
int len = 128;
@@ -2224,7 +2224,7 @@ MTIMEtimestamp_inside_dst(bit *ret, time
}
str
-MTIMErule_tostr(str *s, rule *r)
+MTIMErule_tostr(str *s, const rule *r)
{
char buf[128], *s1 = buf;
int len = 128;
@@ -2445,7 +2445,7 @@ MTIMEcompute_rule_foryear(date *ret, rul
}
str
-MTIMEtzone_tostr(str *s, tzone *ret)
+MTIMEtzone_tostr(str *s, const tzone *ret)
{
char buf[128], *s1 = buf;
int len = 128;
diff --git a/monetdb5/modules/atoms/mtime.h b/monetdb5/modules/atoms/mtime.h
--- a/monetdb5/modules/atoms/mtime.h
+++ b/monetdb5/modules/atoms/mtime.h
@@ -125,8 +125,8 @@ mtime_export int daytime_tz_fromstr(str
mtime_export str MTIMEcurrent_timestamp(timestamp *t);
mtime_export str MTIMEcurrent_date(date *d);
mtime_export str MTIMEcurrent_time(daytime *t);
-mtime_export int timestamp_tostr(str *buf, int *len, timestamp *val);
-mtime_export int timestamp_tz_tostr(str *buf, int *len, timestamp *val, tzone
*timezone);
+mtime_export int timestamp_tostr(str *buf, int *len, const timestamp *val);
+mtime_export int timestamp_tz_tostr(str *buf, int *len, const timestamp *val,
const tzone *timezone);
mtime_export str MTIMEnil2date(date *ret, int *src);
mtime_export str MTIMEdate2date(date *ret, date *src);
mtime_export str MTIMEdaytime2daytime(daytime *ret, daytime *src);
@@ -147,10 +147,10 @@ mtime_export str MTIMEmonth_to_str(str *
mtime_export str MTIMEday_from_str(int *ret, str *day);
mtime_export str MTIMEday_to_str(str *ret, int *day);
mtime_export str MTIMEdate_date(date *d, date *s);
-mtime_export str MTIMEdate_tostr(str *ret, date *d);
+mtime_export str MTIMEdate_tostr(str *ret, const date *d);
mtime_export str MTIMEdate_fromstr(date *ret, str *s);
mtime_export str MTIMEdate_create(date *ret, int *year, int *month, int *day);
-mtime_export str MTIMEdaytime_tostr(str *ret, daytime *d);
+mtime_export str MTIMEdaytime_tostr(str *ret, const daytime *d);
mtime_export str MTIMEdaytime_create(daytime *ret, int *hour, int *min, int
*sec, int *msec);
mtime_export str MTIMEtimestamp_fromstr(timestamp *ret, str *d);
mtime_export str MTIMEtimestamp_timestamp(timestamp *d, timestamp *s);
@@ -177,7 +177,7 @@ mtime_export str MTIMEdate_adddays(date
mtime_export str MTIMEdate_addmonths(date *ret, date *v, int *delta);
mtime_export str MTIMEdate_diff(int *ret, date *v1, date *v2);
mtime_export str MTIMEdate_diff_bulk(bat *ret, bat *bid1, bat *bid2);
-mtime_export str MTIMEtimestamp_add(timestamp *ret, timestamp *v, lng *msecs);
+mtime_export str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const
lng *msecs);
mtime_export str MTIMEtimestamp_diff(lng *ret, timestamp *v1, timestamp *v2);
mtime_export str MTIMEtimestamp_diff_bulk(bat *ret, bat *bid1, bat *bid2);
mtime_export str MTIMEtimestamp_inside_dst(bit *ret, timestamp *p, tzone *z);
@@ -201,7 +201,7 @@ mtime_export str MTIMEtimestamp_LT(bit *
mtime_export str MTIMEtimestamp_LE(bit *retval, timestamp *val1, timestamp
*val2);
mtime_export str MTIMEtimestamp_GT(bit *retval, timestamp *val1, timestamp
*val2);
mtime_export str MTIMEtimestamp_GE(bit *retval, timestamp *val1, timestamp
*val2);
-mtime_export str MTIMErule_tostr(str *s, rule *r);
+mtime_export str MTIMErule_tostr(str *s, const rule *r);
mtime_export str MTIMErule_fromstr(rule *ret, str *s);
mtime_export str MTIMErule_create(rule *ret, int *month, int *day, int
*weekday, int *minutes);
mtime_export str MTIMEtzone_create_dst(tzone *ret, int *minutes, rule *start,
rule *end);
@@ -224,7 +224,7 @@ mtime_export str MTIMEtimestamp_add_mont
mtime_export str MTIMEtime_sub_msec_interval_wrap(daytime *ret, daytime *t,
lng *msec);
mtime_export str MTIMEtime_add_msec_interval_wrap(daytime *ret, daytime *t,
lng *msec);
mtime_export str MTIMEcompute_rule_foryear(date *ret, rule *val, int *year);
-mtime_export str MTIMEtzone_tostr(str *s, tzone *ret);
+mtime_export str MTIMEtzone_tostr(str *s, const tzone *ret);
mtime_export str MTIMEtzone_fromstr(tzone *ret, str *s);
mtime_export str MTIMEdaytime_fromstr(daytime *ret, str *s);
mtime_export str MTIMEmsecs(lng *ret, int *d, int *h, int *m, int *s, int *ms);
@@ -244,15 +244,15 @@ mtime_export str MTIMEcurrent_timestamp(
mtime_export str MTIMEcurrent_date(date *d);
mtime_export str MTIMEcurrent_time(daytime *t);
mtime_export int date_fromstr(str buf, int *len, date **d);
-mtime_export int date_tostr(str *buf, int *len, date *val);
+mtime_export int date_tostr(str *buf, int *len, const date *val);
mtime_export int daytime_fromstr(str buf, int *len, daytime **ret);
-mtime_export int daytime_tostr(str *buf, int *len, daytime *val);
+mtime_export int daytime_tostr(str *buf, int *len, const daytime *val);
mtime_export int timestamp_fromstr(str buf, int *len, timestamp **ret);
-mtime_export int timestamp_tostr(str *buf, int *len, timestamp *val);
+mtime_export int timestamp_tostr(str *buf, int *len, const timestamp *val);
mtime_export int tzone_fromstr(str buf, int *len, tzone **d);
-mtime_export int tzone_tostr(str *buf, int *len, tzone *z);
+mtime_export int tzone_tostr(str *buf, int *len, const tzone *z);
mtime_export int rule_fromstr(str buf, int *len, rule **d);
-mtime_export int rule_tostr(str *buf, int *len, rule *r);
+mtime_export int rule_tostr(str *buf, int *len, const rule *r);
mtime_export int tzone_fromstr(str buf, int *len, tzone **d);
mtime_export str MTIMEstrptime(date *d, str *s, str *format);
diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -94,7 +94,7 @@ void_bat_create(int adt, BUN nr)
return b;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list