1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
mrkn 2010-08-15 04:32:40 +00:00
parent b167f42ca3
commit 1148f6a327
3 changed files with 11 additions and 4 deletions

View file

@ -1,4 +1,11 @@
Sat Aug 15 00:22:00 2010 Kenta Murata <mrkn@mrkn.jp> Sun Aug 15 13:30:35 2010 Kenta Murata <mrkn@mrkn.jp>
* 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 <mrkn@mrkn.jp>
* ext/bigdecimal/extconf.rb, ext/bigdecimal/bigdecimal.h * ext/bigdecimal/extconf.rb, ext/bigdecimal/bigdecimal.h
(labs, llabs): support environments missing labs and llabs. (labs, llabs): support environments missing labs and llabs.

View file

@ -239,7 +239,7 @@ BigDecimal_dump(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(vp,GetVpValue(self,1)); GUARD_OBJ(vp,GetVpValue(self,1));
dump = rb_str_new(0,VpNumOfChars(vp,"E")+50); dump = rb_str_new(0,VpNumOfChars(vp,"E")+50);
psz = RSTRING_PTR(dump); psz = RSTRING_PTR(dump);
sprintf(psz,"%lu:",VpMaxPrec(vp)*VpBaseFig()); sprintf(psz,"%zu:",VpMaxPrec(vp)*VpBaseFig());
VpToString(vp, psz+strlen(psz), 0, 0); VpToString(vp, psz+strlen(psz), 0, 0);
rb_str_resize(dump, strlen(psz)); rb_str_resize(dump, strlen(psz));
return dump; return dump;
@ -1639,7 +1639,7 @@ BigDecimal_inspect(VALUE self)
tmp = psz + strlen(psz); tmp = psz + strlen(psz);
VpToString(vp, tmp, 10, 0); VpToString(vp, tmp, 10, 0);
tmp += strlen(tmp); 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)); rb_str_resize(obj, strlen(psz));
return obj; return obj;
} }

View file

@ -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 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 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 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); VP_EXPORT void VpDtoV(Real *m,double d);
#if 0 /* unused */ #if 0 /* unused */
VP_EXPORT void VpItoV(Real *m,S_INT ival); VP_EXPORT void VpItoV(Real *m,S_INT ival);