Re: MonetDB: DVframework - For 64-bit integers we need to use type l...
Stefan, FYI. Your fixes work. DVframework now also compiles on Lion :) Thanks! Jennie On May 06, 2013, at 19:22, Stefan Manegold wrote:
Changeset: 32b9bc615b3e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32b9bc615b3e Modified Files: sql/backends/monet5/vaults/mseed.c Branch: DVframework Log Message:
For 64-bit integers we need to use type lng, not type long. MSRecord.samplecnt is defined as int64_t, i.e., a 64-bit integer; hence, in MonetDB, we use type lng, not type long.
PLEASE NOTE: Ceterum censeo type long MUST NOT be used as it is everything but portable; for instance, on our beloved Windows platforms, long is always 32-bit, even on 64-bit systems.
diffs (30 lines):
diff --git a/sql/backends/monet5/vaults/mseed.c b/sql/backends/monet5/vaults/mseed.c --- a/sql/backends/monet5/vaults/mseed.c +++ b/sql/backends/monet5/vaults/mseed.c @@ -116,7 +116,7 @@ str SQLstatementIntern(Client c, str *ex
#define QRYinsertI "INSERT INTO mseedCatalog(mseed, seqno, dataquality, network, \ station, location, channel, starttime , samplerate, sampleindex, samplecnt, sampletype, minval,maxval) \ - VALUES(%d, %d,'%c','%s', '%s','%s','%s','%s',%f,%d,%d,'%s',%d,%d);" + VALUES(%d, %d,'%c','%s', '%s','%s','%s','%s',%f,%d,"LLFMT",'%s',%d,%d);"
str MseedImport(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) @@ -174,7 +174,7 @@ MseedImport(Client cntxt, MalBlkPtr mb, } t= MS_HPTIME2EPOCH(msr->starttime); tm = gmtime(&t); - snprintf(starttime,BUFSIZ,"%d-%02d-%02d %02d:%02d:%02d.%06ld", tm->tm_year +(tm->tm_year > 80?1900:2000), tm->tm_mon+1,tm->tm_mday, tm->tm_hour, tm->tm_min,tm->tm_sec, msr->starttime % HPTMODULUS); + snprintf(starttime,BUFSIZ,"%d-%02d-%02d %02d:%02d:%02d.%06d", tm->tm_year +(tm->tm_year > 80?1900:2000), tm->tm_mon+1,tm->tm_mday, tm->tm_hour, tm->tm_min,tm->tm_sec, (int) (msr->starttime % HPTMODULUS)); /* collect the statistics */ switch(msr->sampletype){ case 'i': @@ -185,7 +185,7 @@ MseedImport(Client cntxt, MalBlkPtr mb, if ( imax < ((int*) msr->datasamples)[j]) imax = ((int*) msr->datasamples)[j]; } snprintf(buf,BUFSIZ,QRYinsertI, *vid, msr->sequence_number,msr->dataquality,msr->network, msr->station, msr->location, msr->channel, - starttime,msr->samprate, sampleindex,msr->samplecnt,"int",imin,imax); + starttime,msr->samprate, sampleindex,(lng)msr->samplecnt,"int",imin,imax); break; case 'a': case 'f': case 'd': default: _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list
participants (1)
-
Ying Zhang