From 1148f6a327e23a003640f2dc691b20a5bf826a04 Mon Sep 17 00:00:00 2001 From: mrkn Date: Sun, 15 Aug 2010 04:32:40 +0000 Subject: [PATCH] * ext/bigdecimal/bigdecimal.h (VpVtoD): fix a type of e. * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_inspect): fix format for size_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 ++++++++- ext/bigdecimal/bigdecimal.c | 4 ++-- ext/bigdecimal/bigdecimal.h | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 894a97b38a..156c3adf21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -Sat Aug 15 00:22:00 2010 Kenta Murata +Sun Aug 15 13:30:35 2010 Kenta Murata + + * ext/bigdecimal/bigdecimal.h (VpVtoD): fix a type of e. + + * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_inspect): + fix format for size_t. + +Sun Aug 15 00:22:00 2010 Kenta Murata * ext/bigdecimal/extconf.rb, ext/bigdecimal/bigdecimal.h (labs, llabs): support environments missing labs and llabs. diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 3aa44140e9..1985a26acc 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -239,7 +239,7 @@ BigDecimal_dump(int argc, VALUE *argv, VALUE self) GUARD_OBJ(vp,GetVpValue(self,1)); dump = rb_str_new(0,VpNumOfChars(vp,"E")+50); psz = RSTRING_PTR(dump); - sprintf(psz,"%lu:",VpMaxPrec(vp)*VpBaseFig()); + sprintf(psz,"%zu:",VpMaxPrec(vp)*VpBaseFig()); VpToString(vp, psz+strlen(psz), 0, 0); rb_str_resize(dump, strlen(psz)); return dump; @@ -1639,7 +1639,7 @@ BigDecimal_inspect(VALUE self) tmp = psz + strlen(psz); VpToString(vp, tmp, 10, 0); tmp += strlen(tmp); - sprintf(tmp,"',%lu(%lu)>",VpPrec(vp)*VpBaseFig(),VpMaxPrec(vp)*VpBaseFig()); + sprintf(tmp, "',%zu(%zu)>", VpPrec(vp)*VpBaseFig(), VpMaxPrec(vp)*VpBaseFig()); rb_str_resize(obj, strlen(psz)); return obj; } diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h index e5a8c36e29..d77371fe38 100644 --- a/ext/bigdecimal/bigdecimal.h +++ b/ext/bigdecimal/bigdecimal.h @@ -200,7 +200,7 @@ VP_EXPORT int VpToSpecialString(Real *a,char *psz,int fPlus); VP_EXPORT void VpToString(Real *a, char *psz, size_t fFmt, int fPlus); VP_EXPORT void VpToFString(Real *a, char *psz, size_t fFmt, int fPlus); VP_EXPORT int VpCtoV(Real *a, const char *int_chr, size_t ni, const char *frac, size_t nf, const char *exp_chr, size_t ne); -VP_EXPORT int VpVtoD(double *d, ssize_t *e, Real *m); +VP_EXPORT int VpVtoD(double *d, SIGNED_VALUE *e, Real *m); VP_EXPORT void VpDtoV(Real *m,double d); #if 0 /* unused */ VP_EXPORT void VpItoV(Real *m,S_INT ival);