Changeset: 33758bbc2356 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=33758bbc2356
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.mx
gdk/gdk_logger.mx
monetdb5/extras/compiler/mal_compiler.mx
monetdb5/extras/crackers/crackers_updates.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
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: Apr2011
Log Message:
Fixed format strings.
diffs (truncated from 525 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
@@ -2005,7 +2005,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
@@ -2564,8 +2564,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
@@ -1296,7 +1296,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.mx b/gdk/gdk_heap.mx
--- a/gdk/gdk_heap.mx
+++ b/gdk/gdk_heap.mx
@@ -1197,7 +1197,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.mx b/gdk/gdk_logger.mx
--- a/gdk/gdk_logger.mx
+++ b/gdk/gdk_logger.mx
@@ -632,7 +632,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", 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/extras/crackers/crackers_updates.mx
b/monetdb5/extras/crackers/crackers_updates.mx
--- a/monetdb5/extras/crackers/crackers_updates.mx
+++ b/monetdb5/extras/crackers/crackers_updates.mx
@@ -975,7 +975,7 @@
BAT *b;
b=BATdescriptor(CrackerIndex[i].did);
if (b == NULL){
- mnstr_printf(GDKout,"\n crack print deletions", "Failed
to access deletions.");
+ mnstr_printf(GDKout,"\n crack print deletions: Failed
to access deletions.");
return;
}
BATprint(b);
@@ -992,7 +992,7 @@
BAT *b;
b=BATdescriptor(CrackerIndex[i].iid);
if (b == NULL){
- mnstr_printf(GDKout,"\n crack print insertions",
"Failed to access insertions.");
+ mnstr_printf(GDKout,"\n crack print insertions: Failed
to access insertions.");
return;
}
BATprint(b);
@@ -1010,7 +1010,7 @@
if (CrackerIndex[i].did > 0){
u = BATdescriptor(CrackerIndex[i].did);
if (u == NULL){
- mnstr_printf(GDKout,"\n crack print deletions", "Failed
to access deletions.");
+ mnstr_printf(GDKout,"\n crack print deletions: Failed
to access deletions.");
return;
}
printf("\n pending deletions size: "BUNFMT"\n",BATcount(u));
@@ -1030,7 +1030,7 @@
if (CrackerIndex[i].iid > 0){
u = BATdescriptor(CrackerIndex[i].iid);
if (u == NULL){
- mnstr_printf(GDKout,"\n crack print insertions",
"Failed to access insertions.");
+ mnstr_printf(GDKout,"\n crack print insertions: Failed
to access insertions.");
return;
}
printf("\n pending insertions size: "BUNFMT" \n",BATcount(u));
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,
@@ -1647,12 +1647,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)
@@ -1991,7 +1991,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
@@ -2647,9 +2647,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
+++ b/monetdb5/modules/atoms/blob.mx
@@ -527,7 +527,7 @@
*/
i = strlen(instr);
if (i % 2 == 1) {
- GDKerror("sqlblob_fromstr: Illegal blob length '%d' (should be
even)\n", i);
+ GDKerror("sqlblob_fromstr: Illegal blob length '" SZFMT "'
(should be even)\n", i);
instr = 0;
nil = 1;
}
diff --git a/monetdb5/modules/kernel/group.mx b/monetdb5/modules/kernel/group.mx
--- a/monetdb5/modules/kernel/group.mx
+++ b/monetdb5/modules/kernel/group.mx
@@ -521,7 +521,7 @@
_t_ = GDKusec() - _t_;
ALGODEBUG THRprintf(GDKout,
- "# CTgroup_@1_@4_@5 <@2,@3> ( b=#%d:[%s,%s]:"BUNFMT" ,
bn=#%d:[%s,%s]:"BUNFMT" ) -> rtrn=#%d:[%s,%s] {%d.%06d s}\n",
+ "# CTgroup_@1_@4_@5 <@2,@3> ( b=#%d:[%s,%s]:"BUNFMT" ,
bn=#%d:[%s,%s]:"BUNFMT" ) -> rtrn=#%d:[%s,%s]:"BUNFMT" {%d.%06d s}\n",
b->batCacheid, ATOMname(b->htype), ATOMname(b->ttype),
BATcount(b),
bn->batCacheid, ATOMname(bn->htype), ATOMname(bn->ttype),
BATcount(bn),
rtrn->batCacheid, ATOMname(rtrn->htype), ATOMname(rtrn->ttype),
BATcount(rtrn),
@@ -1730,7 +1730,7 @@
_t_ = GDKusec() - _t_;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list