[Ecm-commits] r2401 - trunk

cvs commits ecm-commits at lists.gforge.inria.fr
Wed Feb 13 17:54:49 CET 2013


Author: kruppa
Date: 2013-02-13 17:54:49 +0100 (Wed, 13 Feb 2013)
New Revision: 2401

Log:
Use do{}while(0) idiom for compound code in macro


Modified:
   trunk/mpmod.c
Modified: trunk/mpmod.c
===================================================================
--- trunk/mpmod.c	2013-02-13 16:49:56 UTC (rev 2400)
+++ trunk/mpmod.c	2013-02-13 16:54:49 UTC (rev 2401)
@@ -57,11 +57,13 @@
 #define REDC2(rp,cp,np,nn,invm) __gmpn_redc_2(rp,cp,np,nn,invm)
 #else
 #define REDC1(rp,cp,np,nn,invm)                  \
-  if (__gmpn_redc_1 (rp,cp,np,nn,invm))          \
-    mpn_sub_n (rp, rp, np, nn)
+  do {if (__gmpn_redc_1 (rp,cp,np,nn,invm))      \
+    mpn_sub_n (rp, rp, np, nn);                  \
+  } while(0)
 #define REDC2(rp,cp,np,nn,invm)                  \
-  if (__gmpn_redc_2 (rp,cp,np,nn,invm))          \
-    mpn_sub_n (rp, rp, np, nn)
+  do {if (__gmpn_redc_2 (rp,cp,np,nn,invm))      \
+    mpn_sub_n (rp, rp, np, nn);                  \
+  while (0)
 #endif
 
 #if 0 /* PZ: commented out, since I don't see how to use this code.




More information about the Ecm-commits mailing list