• R/O
  • SSH
  • HTTPS

cstl: Commit


Commit MetaInfo

Revision412 (tree)
Time2010-10-07 23:21:34
Authorkatono

Log Message

長さ修飾子hとlに対応。

Change Summary

Incremental Difference

--- branches/try-vfunc/unittest/test/test_LibcImpl.c (revision 411)
+++ branches/try-vfunc/unittest/test/test_LibcImpl.c (revision 412)
@@ -30,6 +30,11 @@
3030 printf("%s\n", buf);
3131 assert(strcmp(buf, sp_buf) == 0);
3232
33+ sprintf(sp_buf, "%hd, %ld, %ld, \"%8ld\"", 9999, 0L, -1L, -1234L);
34+ LibcImpl_sprintf(buf, "%hd, %ld, %ld, \"%8ld\"", 9999, 0L, -1L, -1234L);
35+ printf("%s\n", buf);
36+ assert(strcmp(buf, sp_buf) == 0);
37+
3338 sprintf(sp_buf, "%u, %u, %-d, \"%-8d\"", 12345, 0, -123, -111);
3439 LibcImpl_sprintf(buf, "%u, %u, %-d, \"%-8d\"", 12345, 0, -123, -111);
3540 printf("%s\n", buf);
--- branches/try-vfunc/unittest/LibcImpl.c (revision 411)
+++ branches/try-vfunc/unittest/LibcImpl.c (revision 412)
@@ -175,6 +175,9 @@
175175 } else {
176176 width = 0;
177177 }
178+ if (*p == 'h' || *p == 'l') {
179+ p++;
180+ }
178181 switch (*p) {
179182 case 'c':
180183 buf[i++] = (char) arg_list[arg_idx++];
Show on old repository browser