summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-21 06:29:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-21 06:29:35 +0000
commit6ccce7e3f521c04bd3ef83f6d19e534bb7d266bb (patch)
tree31bb54feba52082c52663555c1e8a397d52491e9
parent2bd1599caf09fda03bbce9d1fcd71da01b0f044a (diff)
* missing/vsnprintf.c (struct __sbuf, FILE): use size_t.
* sprintf.c (ruby__sfvwrite): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--missing/vsnprintf.c9
-rw-r--r--sprintf.c2
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b6ebb22..ef0a213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jul 21 15:29:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * missing/vsnprintf.c (struct __sbuf, FILE): use size_t.
+
+ * sprintf.c (ruby__sfvwrite): ditto.
+
Mon Jul 21 13:55:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* README.EXT, README.EXT.ja (1.5 Manipulating Ruby data): mentioned
diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c
index c1f1eca..af9d516 100644
--- a/missing/vsnprintf.c
+++ b/missing/vsnprintf.c
@@ -132,7 +132,7 @@
/* stdio buffers */
struct __sbuf {
unsigned char *_base;
- int _size;
+ size_t _size;
};
@@ -165,13 +165,13 @@ struct __sbuf {
typedef struct __sFILE {
unsigned char *_p; /* current position in (some) buffer */
#if 0
- int _r; /* read space left for getc() */
+ size_t _r; /* read space left for getc() */
#endif
- int _w; /* write space left for putc() */
+ size_t _w; /* write space left for putc() */
short _flags; /* flags, below; this FILE is free if 0 */
short _file; /* fileno, if Unix descriptor, else -1 */
struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
- int _lbfsize; /* 0 or -_bf._size, for inline putc */
+ size_t _lbfsize; /* 0 or -_bf._size, for inline putc */
int (*vwrite)(/* struct __sFILE*, struct __suio * */);
} FILE;
@@ -622,6 +622,7 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
uio.uio_resid = 0;
uio.uio_iovcnt = 0;
ret = 0;
+ xdigs = 0;
/*
* Scan the format for conversions (`%' character).
diff --git a/sprintf.c b/sprintf.c
index 36d06c4..9a49c36 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -1043,7 +1043,7 @@ ruby__sfvwrite(register rb_printf_buffer *fp, register struct __suio *uio)
VALUE result = (VALUE)fp->_bf._base;
char *buf = (char*)fp->_p;
size_t len, n;
- int blen = buf - RSTRING_PTR(result), bsiz = fp->_w;
+ size_t blen = buf - RSTRING_PTR(result), bsiz = fp->_w;
if (RBASIC(result)->klass) {
rb_raise(rb_eRuntimeError, "rb_vsprintf reentered");