summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-18 08:46:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-18 08:46:18 +0000
commite63a9901412d465cd90143d658fda8fa938d7f8c (patch)
tree12cf55d22b7b78304e8a692c44217e9531a31c02 /sprintf.c
parent8a7b08bb787c2d8d531e0b84974fb2a4bec30d87 (diff)
* re.c (rb_reg_expr_str): should treat backslash specially in
escaping. * io.c: complete off_t handling; missing argument for fptr_finalize(); polished rb_scan_args call. * dir.c: wrap multi-statment macro by do { } while (0) * eval.c, numeric,c, sprintf.c, util.c: ditto. * bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum, Bignum, nor Float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sprintf.c b/sprintf.c
index e9742f3..5f0aeba 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -6,7 +6,7 @@
$Date$
created at: Fri Oct 15 10:39:26 JST 1993
- Copyright (C) 1993-2001 Yukihiro Matsumoto
+ Copyright (C) 1993-2002 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
@@ -62,23 +62,22 @@ remove_sign_bits(str, base)
#define FWIDTH 32
#define FPREC 64
-#define CHECK(l) {\
+#define CHECK(l) \
while (blen + (l) >= bsiz) {\
REALLOC_N(buf, char, bsiz*2);\
bsiz*=2;\
- }\
-}
+ }
-#define PUSH(s, l) { \
+#define PUSH(s, l) do { \
CHECK(l);\
memcpy(&buf[blen], s, l);\
blen += (l);\
-}
+} while (0)
#define GETARG() \
((nextarg >= argc) ? (rb_raise(rb_eArgError, "too few argument."), 0) : argv[nextarg++])
-#define GETASTER(val) { \
+#define GETASTER(val) do { \
t = p++; \
n = 0; \
for (; p < end && ISDIGIT(*p); p++) { \
@@ -98,7 +97,7 @@ remove_sign_bits(str, base)
p = t; \
} \
val = NUM2INT(tmp); \
-}
+} while (0)
VALUE
rb_f_sprintf(argc, argv)