Changeset: 2342b4c7c99e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2342b4c7c99e
Modified Files:
clients/mapilib/mapi.c
Branch: Apr2011
Log Message:
Removed unnecessary C-99-isms.
If the type being printed is (un)signed short or char, we don't need
to tell printf this. It'll do the right thing already as long as we
get the signedness right.
diffs (53 lines):
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -3271,11 +3271,11 @@
switch (hdl->params[i].intype) {
case MAPI_TINY:
checkSpace(5);
- sprintf(hdl->query + k, "%hhd", *(signed char
*) src);
+ sprintf(hdl->query + k, "%d", *(signed char *)
src);
break;
case MAPI_UTINY:
checkSpace(5);
- sprintf(hdl->query + k, "%hhu", *(unsigned char
*) src);
+ sprintf(hdl->query + k, "%u", *(unsigned char
*) src);
break;
case MAPI_SHORT:
checkSpace(10);
@@ -3283,7 +3283,7 @@
break;
case MAPI_USHORT:
checkSpace(10);
- sprintf(hdl->query + k, "%hu", *(unsigned short
*) src);
+ sprintf(hdl->query + k, "%u", *(unsigned short
*) src);
break;
case MAPI_INT:
checkSpace(20);
@@ -3320,7 +3320,7 @@
case MAPI_DATE:
checkSpace(50);
sprintf(hdl->query + k,
- "DATE '%04d-%02hu-%02hu'",
+ "DATE '%04d-%02u-%02u'",
((MapiDate *) src)->year,
((MapiDate *) src)->month,
((MapiDate *) src)->day);
@@ -3328,7 +3328,7 @@
case MAPI_TIME:
checkSpace(60);
sprintf(hdl->query + k,
- "TIME '%02hu:%02hu:%02hu'",
+ "TIME '%02u:%02u:%02u'",
((MapiTime *) src)->hour,
((MapiTime *) src)->minute,
((MapiTime *) src)->second);
@@ -3336,7 +3336,7 @@
case MAPI_DATETIME:
checkSpace(110);
sprintf(hdl->query + k,
- "TIMESTAMP '%04d-%02hu-%02hu
%02hu:%02hu:%02hu.%09u'",
+ "TIMESTAMP '%04d-%02u-%02u
%02u:%02u:%02u.%09u'",
((MapiDateTime *) src)->year,
((MapiDateTime *) src)->month,
((MapiDateTime *) src)->day,
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list