[前][次][番号順一覧][スレッド一覧]

ruby-changes:12003

From: nobu <ko1@a...>
Date: Thu, 11 Jun 2009 17:51:16 +0900 (JST)
Subject: [ruby-changes:12003] Ruby:r23667 (ruby_1_8, trunk): * ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.

nobu	2009-06-11 17:49:37 +0900 (Thu, 11 Jun 2009)

  New Revision: 23667

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23667

  Log:
    * ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.
    * ext/bigdecimal/bigdecimal.c (VpInit): fixed format modifiers.
    
    * ext/bigdecimal/bigdecimal.c (VPrint): constified.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ext/bigdecimal/bigdecimal.c
    branches/ruby_1_8/ext/bigdecimal/bigdecimal.h
    trunk/ChangeLog
    trunk/ext/bigdecimal/bigdecimal.c
    trunk/ext/bigdecimal/bigdecimal.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23666)
+++ ChangeLog	(revision 23667)
@@ -1,3 +1,11 @@
+Thu Jun 11 17:49:33 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.
+
+	* ext/bigdecimal/bigdecimal.c (VpInit): fixed format modifiers.
+
+	* ext/bigdecimal/bigdecimal.c (VPrint): constified.
+
 Thu Jun 11 15:27:17 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/prime.rb: documentation typo fixed.  a patch from okkez.
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 23666)
+++ ext/bigdecimal/bigdecimal.c	(revision 23667)
@@ -2054,7 +2054,9 @@
  */
 #ifdef _DEBUG
 static int gfDebug = 1;         /* Debug switch */
+#if 0
 static int gfCheckVal = 1;      /* Value checking flag in VpNmlz()  */
+#endif
 #endif /* _DEBUG */
 
 static U_LONG gnPrecLimit = 0;  /* Global upper limit of the precision newly allocated */
@@ -2507,8 +2509,8 @@
         printf("  BASE   = %lu\n", BASE);
         printf("  HALF_BASE = %lu\n", HALF_BASE);
         printf("  BASE1  = %lu\n", BASE1);
-        printf("  BASE_FIG  = %lu\n", BASE_FIG);
-        printf("  DBLE_FIG  = %lu\n", DBLE_FIG);
+        printf("  BASE_FIG  = %d\n", BASE_FIG);
+        printf("  DBLE_FIG  = %d\n", DBLE_FIG);
     }
 #endif /* _DEBUG */
 
@@ -3658,7 +3660,7 @@
  *    a  ... VP variable to be printed
  */
 VP_EXPORT int
-VPrint(FILE *fp, char *cntl_chr, Real *a)
+VPrint(FILE *fp, const char *cntl_chr, Real *a)
 {
     U_LONG i, j, nc, nd, ZeroSup;
     U_LONG n, m, e, nn;
@@ -3702,7 +3704,7 @@
                     while(m) {
                         nn = e / m;
                         if((!ZeroSup) || nn) {
-                            nc += fprintf(fp, "%lu", nn);    /* The reading zero(s) */
+                            nc += fprintf(fp, "%lu", nn);    /* The leading zero(s) */
                             /* as 0.00xx will not */
                             /* be printed. */
                             ++nd;
@@ -3824,7 +3826,7 @@
             while(m) {
                 nn = e / m;
                 if((!ZeroSup) || nn) {
-                    sprintf(psz, "%lu", nn);    /* The reading zero(s) */
+                    sprintf(psz, "%lu", nn);    /* The leading zero(s) */
                     psz += strlen(psz);
                     /* as 0.00xx will be ignored. */
                     ZeroSup = 0;    /* Set to print succeeding zeros */
@@ -4179,7 +4181,7 @@
     if(gfDebug) {
         VPrint(stdout, " VpVtoD: m=%\n", m);
         printf("   d=%e * 10 **%ld\n", *d, *e);
-        printf("   DBLE_FIG = %ld\n", DBLE_FIG);
+        printf("   DBLE_FIG = %d\n", DBLE_FIG);
     }
 #endif /*_DEBUG */
     return f;
@@ -4447,11 +4449,11 @@
     nf += y->exponent*((int)BASE_FIG);
     exptoadd=0;
     if (nf < 0) {
-		/* rounding position too left(large). */
-		if((f!=VP_ROUND_CEIL) && (f!=VP_ROUND_FLOOR)) {
-			VpSetZero(y,VpGetSign(y)); /* truncate everything */
-			return 0;
-		}
+	/* rounding position too left(large). */
+	if((f!=VP_ROUND_CEIL) && (f!=VP_ROUND_FLOOR)) {
+	    VpSetZero(y,VpGetSign(y)); /* truncate everything */
+	    return 0;
+	}
         exptoadd = -nf;
         nf = 0;
     }
Index: ext/bigdecimal/bigdecimal.h
===================================================================
--- ext/bigdecimal/bigdecimal.h	(revision 23666)
+++ ext/bigdecimal/bigdecimal.h	(revision 23667)
@@ -211,7 +211,7 @@
 #define VpExponent(a)   (a->exponent)
 #ifdef _DEBUG
 int VpVarCheck(Real * v);
-VP_EXPORT int VPrint(FILE *fp,char *cntl_chr,Real *a);
+VP_EXPORT int VPrint(FILE *fp,const char *cntl_chr,Real *a);
 #endif /* _DEBUG */
 
 #if defined(__cplusplus)
Index: ruby_1_8/ext/bigdecimal/bigdecimal.c
===================================================================
--- ruby_1_8/ext/bigdecimal/bigdecimal.c	(revision 23666)
+++ ruby_1_8/ext/bigdecimal/bigdecimal.c	(revision 23667)
@@ -647,10 +647,10 @@
     VALUE obj;
     Real *b;
     if(TYPE(other) == T_FLOAT) {
-       obj = rb_assoc_new(other, BigDecimal_to_f(self));
+	obj = rb_assoc_new(other, BigDecimal_to_f(self));
     } else {
-       GUARD_OBJ(b,GetVpValue(other,1));
-       obj = rb_assoc_new(b->obj, self);
+	GUARD_OBJ(b,GetVpValue(other,1));
+	obj = rb_assoc_new(b->obj, self);
     }
     return obj;
 }
@@ -1945,7 +1945,7 @@
     rb_define_method(rb_cBigDecimal, "add", BigDecimal_add2, 2);
     rb_define_method(rb_cBigDecimal, "sub", BigDecimal_sub2, 2);
     rb_define_method(rb_cBigDecimal, "mult", BigDecimal_mult2, 2);
-    rb_define_method(rb_cBigDecimal, "div",BigDecimal_div2, -1);
+    rb_define_method(rb_cBigDecimal, "div", BigDecimal_div2, -1);
     rb_define_method(rb_cBigDecimal, "hash", BigDecimal_hash, 0);
     rb_define_method(rb_cBigDecimal, "to_s", BigDecimal_to_s, -1);
     rb_define_method(rb_cBigDecimal, "to_i", BigDecimal_to_i, 0);
@@ -2005,7 +2005,9 @@
  */
 #ifdef _DEBUG
 static int gfDebug = 1;         /* Debug switch */
+#if 0
 static int gfCheckVal = 1;      /* Value checking flag in VpNmlz()  */
+#endif
 #endif /* _DEBUG */
 
 static U_LONG gnPrecLimit = 0;  /* Global upper limit of the precision newly allocated */
@@ -2458,8 +2460,8 @@
         printf("  BASE   = %lu\n", BASE);
         printf("  HALF_BASE = %lu\n", HALF_BASE);
         printf("  BASE1  = %lu\n", BASE1);
-        printf("  BASE_FIG  = %lu\n", BASE_FIG);
-        printf("  DBLE_FIG  = %lu\n", DBLE_FIG);
+        printf("  BASE_FIG  = %d\n", BASE_FIG);
+        printf("  DBLE_FIG  = %d\n", DBLE_FIG);
     }
 #endif /* _DEBUG */
 
@@ -3609,7 +3611,7 @@
  *    a  ... VP variable to be printed
  */
 VP_EXPORT int
-VPrint(FILE *fp, char *cntl_chr, Real *a)
+VPrint(FILE *fp, const char *cntl_chr, Real *a)
 {
     U_LONG i, j, nc, nd, ZeroSup;
     U_LONG n, m, e, nn;
@@ -3653,7 +3655,7 @@
                     while(m) {
                         nn = e / m;
                         if((!ZeroSup) || nn) {
-                            nc += fprintf(fp, "%lu", nn);    /* The reading zero(s) */
+                            nc += fprintf(fp, "%lu", nn);    /* The leading zero(s) */
                             /* as 0.00xx will not */
                             /* be printed. */
                             ++nd;
@@ -3775,7 +3777,7 @@
             while(m) {
                 nn = e / m;
                 if((!ZeroSup) || nn) {
-                    sprintf(psz, "%lu", nn);    /* The reading zero(s) */
+                    sprintf(psz, "%lu", nn);    /* The leading zero(s) */
                     psz += strlen(psz);
                     /* as 0.00xx will be ignored. */
                     ZeroSup = 0;    /* Set to print succeeding zeros */
@@ -4130,7 +4132,7 @@
     if(gfDebug) {
         VPrint(stdout, " VpVtoD: m=%\n", m);
         printf("   d=%e * 10 **%ld\n", *d, *e);
-        printf("   DBLE_FIG = %ld\n", DBLE_FIG);
+        printf("   DBLE_FIG = %d\n", DBLE_FIG);
     }
 #endif /*_DEBUG */
     return f;
Index: ruby_1_8/ext/bigdecimal/bigdecimal.h
===================================================================
--- ruby_1_8/ext/bigdecimal/bigdecimal.h	(revision 23666)
+++ ruby_1_8/ext/bigdecimal/bigdecimal.h	(revision 23667)
@@ -211,7 +211,7 @@
 #define VpExponent(a)   (a->exponent)
 #ifdef _DEBUG
 int VpVarCheck(Real * v);
-VP_EXPORT int VPrint(FILE *fp,char *cntl_chr,Real *a);
+VP_EXPORT int VPrint(FILE *fp,const char *cntl_chr,Real *a);
 #endif /* _DEBUG */
 
 #if defined(__cplusplus)
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 23666)
+++ ruby_1_8/ChangeLog	(revision 23667)
@@ -1,3 +1,11 @@
+Thu Jun 11 17:49:33 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.
+
+	* ext/bigdecimal/bigdecimal.c (VpInit): fixed format modifiers.
+
+	* ext/bigdecimal/bigdecimal.c (VPrint): constified.
+
 Thu Jun 11 15:05:00 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* ext/bigdecimal/bigdecimal.c (VpCtoV): big number should result

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]