Changeset: ab21a663e3cf for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ab21a663e3cf
Modified Files:
clients/mapiclient/dump.c
clients/mapilib/mapi.c
gdk/gdk_atoms.mx
gdk/gdk_bat.mx
gdk/gdk_batop.mx
gdk/gdk_heap.c
gdk/gdk_logger.c
monetdb5/extras/compiler/mal_compiler.mx
monetdb5/mal/mal_debugger.mx
monetdb5/mal/mal_interpreter.mx
monetdb5/mal/mal_profiler.mx
monetdb5/modules/atoms/blob.mx
monetdb5/modules/kernel/group.mx
monetdb5/modules/mal/Makefile.ag
monetdb5/modules/mal/groupby.mx
monetdb5/modules/mal/recycle.mx
monetdb5/modules/mal/tablet.mx
monetdb5/modules/mal/tablet_sql.mx
monetdb5/optimizer/opt_inline.mx
monetdb5/optimizer/opt_multiplex.mx
monetdb5/optimizer/opt_octopus.mx
monetdb5/optimizer/optimizerWrapper.mx
sql/server/rel_dump.c
sql/server/sql_mvc.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/multiplex-funnel.c
tools/mserver/mserver5.c
Branch: Aug2011
Log Message:
Fix printf formats.
diffs (truncated from 573 to 300 lines):
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -434,14 +434,14 @@
space += mnstr_printf(toConsole, "(%s)", c_type_digits);
} else if (strcmp(c_type, "timestamp") == 0 ||
strcmp(c_type, "timestamptz") == 0) {
- space = mnstr_printf(toConsole, "TIMESTAMP", c_type);
+ space = mnstr_printf(toConsole, "TIMESTAMP");
if (strcmp(c_type_digits, "7") != 0)
space += mnstr_printf(toConsole, "(%d)",
atoi(c_type_digits) - 1);
if (strcmp(c_type, "timestamptz") == 0)
space += mnstr_printf(toConsole, " WITH TIME ZONE");
} else if (strcmp(c_type, "time") == 0 ||
strcmp(c_type, "timetz") == 0) {
- space = mnstr_printf(toConsole, "TIME", c_type);
+ space = mnstr_printf(toConsole, "TIME");
if (strcmp(c_type_digits, "1") != 0)
space += mnstr_printf(toConsole, "(%d)",
atoi(c_type_digits) - 1);
if (strcmp(c_type, "timetz") == 0)
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1449,7 +1449,7 @@
snprintf(msg, sizeof(msg), "Xclose %d\n",
hdl->pending_close[i]);
mapi_log_record(mid, msg);
mid->active = hdl;
- if (mnstr_printf(mid->to, msg) < 0 ||
+ if (mnstr_printf(mid->to, "%s", msg) < 0 ||
mnstr_flush(mid->to)) {
close_connection(mid);
mapi_setError(mid,
mnstr_error(mid->to), "mapi_close_handle", MTIMEOUT);
@@ -1467,7 +1467,7 @@
snprintf(msg, sizeof(msg), "Xclose %d\n",
result->tableid);
mapi_log_record(mid, msg);
mid->active = hdl;
- if (mnstr_printf(mid->to, msg) < 0 ||
+ if (mnstr_printf(mid->to, "%s", msg) < 0 ||
mnstr_flush(mid->to)) {
close_connection(mid);
mapi_setError(mid,
mnstr_error(mid->to), "mapi_close_handle", MTIMEOUT);
@@ -1670,7 +1670,7 @@
snprintf(msg, sizeof(msg), "Xclose %d\n",
hdl->pending_close[i]);
mapi_log_record(mid, msg);
mid->active = hdl;
- if (mnstr_printf(mid->to, msg) < 0 ||
+ if (mnstr_printf(mid->to, "%s", msg) < 0 ||
mnstr_flush(mid->to)) {
close_connection(mid);
mapi_setError(mid, mnstr_error(mid->to),
"finish_handle", MTIMEOUT);
diff --git a/gdk/gdk_atoms.mx b/gdk/gdk_atoms.mx
--- a/gdk/gdk_atoms.mx
+++ b/gdk/gdk_atoms.mx
@@ -1895,7 +1895,7 @@
assert(newsize);
if (h->free + pad + len + extralen >= (((size_t) VAR_MAX) <<
GDK_VARSHIFT)) {
- GDKerror("strPut: string heaps gets larger than
%dGB.\n", (((size_t) VAR_MAX) << GDK_VARSHIFT) >> 30);
+ GDKerror("strPut: string heaps gets larger than " SZFMT
"GB.\n", (((size_t) VAR_MAX) << GDK_VARSHIFT) >> 30);
return 0;
}
if (h->free + pad + len + extralen < h->maxsize) {
diff --git a/gdk/gdk_bat.mx b/gdk/gdk_bat.mx
--- a/gdk/gdk_bat.mx
+++ b/gdk/gdk_bat.mx
@@ -2565,8 +2565,8 @@
if (@1 >= 0 && (@2) && @3 > 0 && (@2)->base &&
((@2)->storage != STORE_MEM) && MT_madvise((@2)->base,
@3, BUF_TO_MMAP[@1]))
{
- GDKsyserror("madvise(%x, " SZFMT ", %d) on @2 @1 failed\n",
- (@2)->base, @3, @1);
+ GDKsyserror("madvise(" PTRFMT ", " SZFMT ", %d) on @2 @1
failed\n",
+ PTRFMTCAST (@2)->base, @3, @1);
return -1;
}
@c
diff --git a/gdk/gdk_batop.mx b/gdk/gdk_batop.mx
--- a/gdk/gdk_batop.mx
+++ b/gdk/gdk_batop.mx
@@ -1303,7 +1303,7 @@
bn->T->nonil = tail;
else if (equi && !lnil)
bn->T->nonil = tail;
- ALGODEBUG THRprintf(GDKout, "#BAT_select_(b=%s): %s: hkey=" BUNFMT ",
tkey=" BUNFMT ", hsorted=" BUNFMT ", tsorted=" BUNFMT ".\n", BATgetId(b),
BATgetId(bn), bn->hkey, bn->tkey, bn->hsorted, bn->tsorted);
+ ALGODEBUG THRprintf(GDKout, "#BAT_select_(b=%s): %s: hkey=%d, tkey=%d,
hsorted=%d, tsorted=%d.\n", BATgetId(b), BATgetId(bn), bn->hkey, bn->tkey,
bn->hsorted, bn->tsorted);
ESTIDEBUG THRprintf(GDKout, "#BAT_select_(b=%s): resultsize: estimated
" BUNFMT ", got " BUNFMT ".\n", BATgetId(b), estimate, BATcount(bn));
return bn;
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -1180,7 +1180,7 @@
return FALSE;
}
if ((head != roundup_num(head, hheader->alignment))) {
- GDKerror("HEAP_check: Heap structure corrupt: head = %d\n",
head);
+ GDKerror("HEAP_check: Heap structure corrupt: head = " SZFMT
"\n", head);
return FALSE;
}
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -529,7 +529,7 @@
BAT *b = BATdescriptor(bid);
if (!b) {
- GDKerror("logger: could not use bat (" OIDFMT ") for %s\n",
bid, la->name);
+ GDKerror("logger: could not use bat (%d) for %s\n", (int) bid,
la->name);
return;
}
logger_add_bat(lg, b, la->name);
diff --git a/monetdb5/extras/compiler/mal_compiler.mx
b/monetdb5/extras/compiler/mal_compiler.mx
--- a/monetdb5/extras/compiler/mal_compiler.mx
+++ b/monetdb5/extras/compiler/mal_compiler.mx
@@ -496,7 +496,7 @@
if( getArgType(mb,p,i)== TYPE_str){
mnstr_printf(f,"\tif(backup[%d] &&
sbackup[%d]!= ",i,i);
mccVar(f,mb,getArg(p,i));
- mnstr_printf(f,"\t) GDKfree(sbackup[%d]);\n");
+ mnstr_printf(f,"\t) GDKfree(sbackup[%d]);\n",i);
}
}
}
diff --git a/monetdb5/mal/mal_debugger.mx b/monetdb5/mal/mal_debugger.mx
--- a/monetdb5/mal/mal_debugger.mx
+++ b/monetdb5/mal/mal_debugger.mx
@@ -1048,8 +1048,8 @@
cntxt->flags |=ioFlag ;
#ifdef HAVE_SYS_RESOURCE_H
getrusage(RUSAGE_SELF, &resource);
- mnstr_printf(out, "#maxrss %d ixrss=%d
idrss=%d isrss=%d"
- "
minflt=%d majflt=%d nswap=%d inblock=%d oublock=%d\n",
+ mnstr_printf(out, "#maxrss %ld
ixrss=%ld idrss=%ld isrss=%ld"
+ "
minflt=%ld majflt=%ld nswap=%ld inblock=%ld oublock=%ld\n",
resource.ru_maxrss, resource.ru_ixrss,
resource.ru_idrss, resource.ru_isrss,
resource.ru_minflt, resource.ru_majflt,
@@ -1652,12 +1652,12 @@
state.p = getInstrPtr(mb,pc);
state.pc= pc;
cntxt->mdb= &state;
- mnstr_printf(mal_clients[0].fdout,"#Process %d put to
sleep\n",cntxt-mal_clients);
+ mnstr_printf(mal_clients[0].fdout,"#Process %d put to
sleep\n",(int)(cntxt-mal_clients));
cntxt->itrace = 'W';
mdbTrap(cntxt,mb,stk,pc);
while(cntxt->itrace== 'W')
MT_sleep_ms(cntxt->delay);
- mnstr_printf(mal_clients[0].fdout,"#Process %d woke
up\n",cntxt-mal_clients);
+ mnstr_printf(mal_clients[0].fdout,"#Process %d woke
up\n",(int)(cntxt-mal_clients));
return;
}
if (stk->cmd == 0)
@@ -1998,7 +1998,7 @@
h= @1;
if(h && h->mask){
mnstr_printf(out,"\t@2=" PTRFMT " size=" SZFMT "\n",PTRFMTCAST h,
sizeof(*h));
- mnstr_printf(out,"\t@2link=" BUNFMT " size=" SZFMT "\n",h->link,
+ mnstr_printf(out,"\t@2link=" PTRFMT " size=" SZFMT "\n",PTRFMTCAST
h->link,
(h->mask+h->lim+1)*sizeof(int));
}
@-
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -1060,7 +1060,7 @@
}
#endif
assert(fs->pc > 0);
- PARDEBUG mnstr_printf(GDKstdout, "#execute pc= %d thr= %d
claim= %d,%d %s\n", fs->pc, task->id, fs->argclaim, fs->hotclaim, fs->error ?
fs->error : "");
+ PARDEBUG mnstr_printf(GDKstdout, "#execute pc= %d thr= %d
claim= " LLFMT "," LLFMT " %s\n", fs->pc, task->id, fs->argclaim, fs->hotclaim,
fs->error ? fs->error : "");
fs->error = DFLOWstep(task, fs);
PARDEBUG mnstr_printf(GDKstdout, "#execute pc= %d thr= %d
finished %s\n", fs->pc, task->id, fs->error ? fs->error : "");
@@ -1090,7 +1090,7 @@
task->flow->status[i].argclaim +=
fs->hotclaim;
task->flow->status[i].error = NULL;
nxtfs = task->flow->status + i;
- PARDEBUG mnstr_printf(GDKstdout,
"#continue pc= %d thr= %d claim= %d\n", nxtfs->pc, task->id,
task->flow->status[i].argclaim);
+ PARDEBUG mnstr_printf(GDKstdout,
"#continue pc= %d thr= %d claim= " LLFMT "\n", nxtfs->pc, task->id,
task->flow->status[i].argclaim);
break;
}
@@ -1264,7 +1264,7 @@
#endif
queued++;
flow->status[i].state = DFLOWrunning;
- PARDEBUG mnstr_printf(GDKstdout, "#enqueue pc=%d
claim=%d queue %d\n", flow->status[i].pc, flow->status[i].argclaim, queued);
+ PARDEBUG mnstr_printf(GDKstdout, "#enqueue pc=%d
claim=" LLFMT " queue %d\n", flow->status[i].pc, flow->status[i].argclaim,
queued);
q_enqueue_(flow->todo, flow->status + i);
}
MT_lock_unset(&flow->todo->l, "q_enqueue");
@@ -1308,7 +1308,7 @@
*/
f->state = DFLOWwrapup;
last = ABS(f->pc) - flow->start;
- PARDEBUG mnstr_printf(GDKstdout, "#finished pc=%d claim %d\n",
f->pc, f->hotclaim);
+ PARDEBUG mnstr_printf(GDKstdout, "#finished pc=%d claim " LLFMT
"\n", f->pc, f->hotclaim);
/* enter all dependencies before releasing the queue */
MT_lock_set(&flow->todo->l, "q_enqueue");
@@ -1324,14 +1324,14 @@
flow->status[i].state = DFLOWrunning;
flow->status[i].blocks--;
PARDEBUG
- mnstr_printf(GDKstdout, "#enqueue pc=%d
claim=%d queued= %d\n", flow->status[i].pc, flow->status[i].argclaim, queued);
+ mnstr_printf(GDKstdout, "#enqueue pc=%d
claim= " LLFMT " queued= %d\n", flow->status[i].pc, flow->status[i].argclaim,
queued);
} else {
if (ret == MAL_SUCCEED)
- PARDEBUG
mnstr_printf(GDKstdout, "#await pc %d block %d claim= %d\n", flow->start + i,
flow->status[i].blocks, flow->status[i].argclaim);
+ PARDEBUG
mnstr_printf(GDKstdout, "#await pc %d block %d claim= " LLFMT "\n",
flow->start + i, flow->status[i].blocks, flow->status[i].argclaim);
flow->status[i].blocks--;
}
} else { /* worker stole the candidate */
- PARDEBUG mnstr_printf(GDKstdout, "#woke up pc
%d block %d claim %d\n", flow->start + i, flow->status[i].blocks,
flow->status[i].argclaim);
+ PARDEBUG mnstr_printf(GDKstdout, "#woke up pc
%d block %d claim " LLFMT "\n", flow->start + i, flow->status[i].blocks,
flow->status[i].argclaim);
queued++;
oldq++;
}
@@ -1475,7 +1475,7 @@
msg = reenterMAL(cntxt, mb, p->start, p->stop, stk, 0, 0);
stk->keepAlive = sve;
if (msg != MAL_SUCCEED)
- GDKerror(msg); /* indirect way to pass an error */
+ GDKerror("%s", msg); /* indirect way to pass an error */
#ifdef DEBUG_DETACHED
mnstr_printf(cntxt->fdout, "finished thread in background\n");
#endif
@@ -2519,9 +2519,9 @@
if (cntxt->flags & ioFlag) {
struct rusage resource;
getrusage(RUSAGE_SELF, &resource);
- mnstr_printf(cntxt->fdout, " %3d R",
+ mnstr_printf(cntxt->fdout, " %3ld R",
resource.ru_inblock - oldinblock);
- mnstr_printf(cntxt->fdout, " %3d W ",
+ mnstr_printf(cntxt->fdout, " %3ld W ",
resource.ru_oublock - oldoublock);
}
#endif
diff --git a/monetdb5/mal/mal_profiler.mx b/monetdb5/mal/mal_profiler.mx
--- a/monetdb5/mal/mal_profiler.mx
+++ b/monetdb5/mal/mal_profiler.mx
@@ -586,16 +586,16 @@
}
#ifdef HAVE_TIMES
if (profileCounter[PROFcpu].status && delayswitch < 0) {
- log("%d,\t", newTms.tms_utime -
mb->profiler[pc].timer.tms_utime);
- log("%d,\t", newTms.tms_cutime -
mb->profiler[pc].timer.tms_cutime);
- log("%d,\t", newTms.tms_stime -
mb->profiler[pc].timer.tms_stime);
- log("%d,\t", newTms.tms_cstime -
mb->profiler[pc].timer.tms_cstime);
+ log("%ld,\t", (long) (newTms.tms_utime -
mb->profiler[pc].timer.tms_utime));
+ log("%ld,\t", (long) (newTms.tms_cutime -
mb->profiler[pc].timer.tms_cutime));
+ log("%ld,\t", (long) (newTms.tms_stime -
mb->profiler[pc].timer.tms_stime));
+ log("%ld,\t", (long) (newTms.tms_cstime -
mb->profiler[pc].timer.tms_cstime));
}
#endif
if (profileCounter[PROFmemory].status && delayswitch < 0) {
#ifdef HAVE_SYS_RESOURCE_H
- log("%d,\t", infoUsage.ru_maxrss);
+ log("%ld,\t", infoUsage.ru_maxrss);
#endif
log(SZFMT ",\t", (size_t)(infoMalloc.arena - prevMalloc.arena));
log(SZFMT ",\t", (size_t)(infoMalloc.ordblks -
prevMalloc.ordblks));
@@ -609,16 +609,16 @@
#ifdef HAVE_SYS_RESOURCE_H
if ((profileCounter[PROFreads].status ||
profileCounter[PROFwrites].status) && delayswitch < 0) {
- log("%d,\t", infoUsage.ru_inblock - prevUsage.ru_inblock);
- log("%d,\t", infoUsage.ru_oublock - prevUsage.ru_oublock);
+ log("%ld,\t", infoUsage.ru_inblock - prevUsage.ru_inblock);
+ log("%ld,\t", infoUsage.ru_oublock - prevUsage.ru_oublock);
prevUsage = infoUsage;
}
if (profileCounter[PROFprocess].status && delayswitch < 0) {
- log("%d,\t", infoUsage.ru_minflt - prevUsage.ru_minflt);
- log("%d,\t", infoUsage.ru_majflt - prevUsage.ru_majflt);
- log("%d,\t", infoUsage.ru_nswap - prevUsage.ru_nswap);
- log("%d,\t", infoUsage.ru_nvcsw - prevUsage.ru_nvcsw);
- log("%d,\t", infoUsage.ru_nivcsw - prevUsage.ru_nivcsw);
+ log("%ld,\t", infoUsage.ru_minflt - prevUsage.ru_minflt);
+ log("%ld,\t", infoUsage.ru_majflt - prevUsage.ru_majflt);
+ log("%ld,\t", infoUsage.ru_nswap - prevUsage.ru_nswap);
+ log("%ld,\t", infoUsage.ru_nvcsw - prevUsage.ru_nvcsw);
+ log("%ld,\t", infoUsage.ru_nivcsw - prevUsage.ru_nivcsw);
prevUsage = infoUsage;
}
#endif
@@ -628,7 +628,7 @@
log(LLFMT ",\t", mb->profiler[pc].wbytes);
if (profileCounter[PROFaggr].status)
- log2("%d,\t%d,\t", mb->profiler[pc].counter,
mb->profiler[pc].clk);
+ log2("%d,\t" LLFMT ",\t", mb->profiler[pc].counter,
mb->profiler[pc].clk);
if (profileCounter[PROFstmt].status) {
/* generate actual call statement */
diff --git a/monetdb5/modules/atoms/blob.mx b/monetdb5/modules/atoms/blob.mx
--- a/monetdb5/modules/atoms/blob.mx
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list