diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-24 14:36:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-24 14:36:54 +0000 |
commit | ce8e2d54049ddbe4947ed90295b1b4d11ebaaa52 () | |
tree | b06c84e6da75e1a9821f6decc192299e5be8101c /vsnprintf.c | |
parent | 60e8cd2e686efd3a965cb43ae5963ce31fc90d71 (diff) |
Feature #5896
* vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in rb_enc_vsprintf(). [Feature #5896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vsnprintf.c | 33 |
1 files changed, 32 insertions, 1 deletions
@@ -183,6 +183,7 @@ typedef struct __sFILE { struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ size_t _lbfsize; /* 0 or -_bf._size, for inline putc */ int (*vwrite)(/* struct __sFILE*, struct __suio * */); } FILE; @@ -793,11 +794,39 @@ reswitch: switch (ch) { size = 1; sign = '\0'; break; case 'D': flags |= LONGINT; /*FALLTHROUGH*/ case 'd': - case 'i': #ifdef _HAVE_SANE_QUAD_ if (flags & QUADINT) { uqval = va_arg(ap, quad_t); @@ -1269,6 +1298,7 @@ ruby_vsnprintf(char *str, size_t n, const char *fmt, va_list ap) f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n - 1; f.vwrite = BSD__sfvwrite; ret = (int)BSD_vfprintf(&f, fmt, ap); *f._p = 0; return (ret); @@ -1289,6 +1319,7 @@ ruby_snprintf(char *str, size_t n, char const *fmt, ...) f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n - 1; f.vwrite = BSD__sfvwrite; ret = (int)BSD_vfprintf(&f, fmt, ap); *f._p = 0; va_end(ap); |