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

ruby-changes:32836

From: nobu <ko1@a...>
Date: Wed, 12 Feb 2014 11:25:33 +0900 (JST)
Subject: [ruby-changes:32836] nobu:r44915 (trunk): bigdecimal.h: suppress warnings

nobu	2014-02-12 11:25:28 +0900 (Wed, 12 Feb 2014)

  New Revision: 44915

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

  Log:
    bigdecimal.h: suppress warnings
    
    * ext/bigdecimal/bigdecimal.h (VpSetZero, VpSetInf): get rid of
      unused-value warnings by gcc 4.9.

  Modified files:
    trunk/ext/bigdecimal/bigdecimal.h
Index: ext/bigdecimal/bigdecimal.h
===================================================================
--- ext/bigdecimal/bigdecimal.h	(revision 44914)
+++ ext/bigdecimal/bigdecimal.h	(revision 44915)
@@ -291,7 +291,7 @@ VP_EXPORT Real *VpOne(void); https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.h#L291
 #define VpIsZero(a)     (VpIsPosZero(a) || VpIsNegZero(a))
 #define VpSetPosZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_ZERO)
 #define VpSetNegZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_ZERO)
-#define VpSetZero(a,s)  ( ((s)>0)?VpSetPosZero(a):VpSetNegZero(a) )
+#define VpSetZero(a,s)  (void)(((s)>0)?VpSetPosZero(a):VpSetNegZero(a))
 
 /* NaN */
 #define VpIsNaN(a)      ((a)->sign==VP_SIGN_NaN)
@@ -304,7 +304,7 @@ VP_EXPORT Real *VpOne(void); https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.h#L304
 #define VpIsDef(a)      ( !(VpIsNaN(a)||VpIsInf(a)) )
 #define VpSetPosInf(a)  ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_INFINITE)
 #define VpSetNegInf(a)  ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_INFINITE)
-#define VpSetInf(a,s)   ( ((s)>0)?VpSetPosInf(a):VpSetNegInf(a) )
+#define VpSetInf(a,s)   (void)(((s)>0)?VpSetPosInf(a):VpSetNegInf(a))
 #define VpHasVal(a)     (a->frac[0])
 #define VpIsOne(a)      ((a->Prec==1)&&(a->frac[0]==1)&&(a->exponent==1))
 #define VpExponent(a)   (a->exponent)

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

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