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

ruby-changes:27841

From: naruse <ko1@a...>
Date: Sun, 24 Mar 2013 04:51:43 +0900 (JST)
Subject: [ruby-changes:27841] naruse:r39893 (trunk): Suppress warnings

naruse	2013-03-24 04:50:47 +0900 (Sun, 24 Mar 2013)

  New Revision: 39893

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

  Log:
    Suppress warnings

  Modified files:
    trunk/ext/bigdecimal/bigdecimal.c

Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 39892)
+++ ext/bigdecimal/bigdecimal.c	(revision 39893)
@@ -3525,8 +3525,6 @@ VpIsNegDoubleZero(double v) https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L3525
 VP_EXPORT int
 VpException(unsigned short f, const char *str,int always)
 {
-    VALUE exc;
-    int   fatal=0;
     unsigned short const exception_mode = VpGetException();
 
     if (f == VP_EXCEPTION_OP || f == VP_EXCEPTION_MEMORY) always = 1;
@@ -3539,22 +3537,14 @@ VpException(unsigned short f, const char https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L3537
 	  case VP_EXCEPTION_NaN:
 	  case VP_EXCEPTION_UNDERFLOW:
 	  case VP_EXCEPTION_OP:
-	    exc = rb_eFloatDomainError;
-	    goto raise;
+	    rb_raise(rb_eFloatDomainError, "%s", str);
+	    break;
 	  case VP_EXCEPTION_MEMORY:
-	    fatal = 1;
-	    goto raise;
 	  default:
-	    fatal = 1;
-	    goto raise;
+	    rb_fatal("%s", str);
 	}
     }
     return 0; /* 0 Means VpException() raised no exception */
-
-raise:
-    if (fatal) rb_fatal("%s", str);
-    else       rb_raise(exc, "%s", str);
-    return 0;
 }
 
 /* Throw exception or returns 0,when resulting c is Inf or NaN */
@@ -4497,7 +4487,7 @@ VpMult(Real *c, Real *a, Real *b) https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L4487
 	    ind_ae = MxIndA - (nc - MxIndB);
 	    ind_bs = MxIndB;
 	}
-	else if (nc > MxIndA) {    /*  The right triangle of the Fig. */
+	else /* if (nc > MxIndA) */ {    /*  The right triangle of the Fig. */
 	    ind_as = 0;
 	    ind_ae = MxIndAB - nc - 1;
 	    ind_bs = MxIndB - (nc - MxIndA);

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

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