Changeset: 66a648881887 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=66a648881887
Modified Files:
monetdb5/mal/mal_listing.c
Branch: default
Log Message:
Minor code cleanup
diffs (43 lines):
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -50,8 +50,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
// show the name when required or is used
if ((flg & LIST_MAL_NAME) && !isVarConstant(mb,varid) &&
!isVarTypedef(mb,varid)) {
nme = getVarName(mb,varid);
- snprintf(buf, maxlen, "%s", nme);
- len = strlen(buf);
+ len +=snprintf(buf, maxlen, "%s", nme);
nameused =1;
}
// show the value when required or being a constant
@@ -101,8 +100,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
if (stk && isaBatType(getVarType(mb,varid)) &&
abs(stk->stk[varid].val.ival) ){
BAT *d=
BBPquickdesc(abs(stk->stk[varid].val.ival),TRUE);
if( d)
- snprintf(buf+len,maxlen-len,"[" BUNFMT
"]", BATcount(d));
- len += strlen(buf+len);
+ len += snprintf(buf+len,maxlen-len,"["
BUNFMT "]", BATcount(d));
}
}
}
@@ -113,8 +111,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
strcat(buf + len,":");
len++;
tpe = getTypeName(getVarType(mb, varid));
- snprintf(buf+len,maxlen-len,"%s",tpe);
- len += strlen(buf+len);
+ len += snprintf(buf+len,maxlen-len,"%s",tpe);
GDKfree(tpe);
}
@@ -122,8 +119,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk,
if ( (flg & LIST_MAL_PROPS) && (idx < p->retc || getInstrPtr(mb,0) ==
p)) {
pstring = varGetPropStr(mb,varid);
if( pstring)
- snprintf(buf+len,maxlen-len,"%s",pstring);
- len += strlen(buf + len);
+ len +=snprintf(buf+len,maxlen-len,"%s",pstring);
GDKfree(pstring);
}
if( len >= maxlen)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list