Removed the unnecessary hacks from some boolean statements.
authorRossen Apostolov <rossen@cbr.su.se>
Thu, 26 Aug 2010 08:54:56 +0000 (10:54 +0200)
committerRossen Apostolov <rossen@cbr.su.se>
Thu, 26 Aug 2010 08:54:56 +0000 (10:54 +0200)
Having gmx_bool of type 'char' was causing some boolean operations to issue warnings.
Now that it is 'int' those hacks became unnecessary.

src/gmxlib/checkpoint.c
src/kernel/md.c
src/mdlib/sim_util.c
src/mdlib/stat.c
src/tools/gmx_membed.c

index f1b90cd79b3108512a0e957f839758c365751ccf..9ca934bb7e9acb28882641a1365169cbe31d931d 100644 (file)
@@ -1922,9 +1922,7 @@ void read_checkpoint_trxframe(t_fileio *fp,t_trxframe *fr)
         fr->x     = state.x;
         state.x   = NULL;
     }
-/* FIX ME after 4.5 */
-/* temporary hack because we are using gmx_bool (unsigned char) */
-    fr->bV      = (state.flags & (1<<estV)) != 0;
+    fr->bV      = (state.flags & (1<<estV));
     if (fr->bV)
     {
         fr->v     = state.v;
index 8cde3adb58de6d0aa3fac7ae7cf93e2f8b4a2f25..8c1625c5e97c879593c8489ef42ff70edb1e2e14 100644 (file)
@@ -323,17 +323,14 @@ static void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr,
     bStopCM = flags & CGLO_STOPCM;
     bGStat = flags & CGLO_GSTAT;
 
-/* FIX ME after 4.5 */
-/* temporary hack because we are using gmx_bool (unsigned char) */
-
-    bReadEkin = (flags & CGLO_READEKIN) != 0;
-    bScaleEkin = (flags & CGLO_SCALEEKIN) != 0;
+    bReadEkin = (flags & CGLO_READEKIN);
+    bScaleEkin = (flags & CGLO_SCALEEKIN);
     bEner = flags & CGLO_ENERGY;
     bTemp = flags & CGLO_TEMPERATURE;
-    bPres  = (flags & CGLO_PRESSURE) != 0;
-    bConstrain = (flags & CGLO_CONSTRAINT) != 0;
-    bIterate = (flags & CGLO_ITERATE) != 0;
-    bFirstIterate = (flags & CGLO_FIRSTITERATE) != 0;
+    bPres  = (flags & CGLO_PRESSURE);
+    bConstrain = (flags & CGLO_CONSTRAINT);
+    bIterate = (flags & CGLO_ITERATE);
+    bFirstIterate = (flags & CGLO_FIRSTITERATE);
 
     /* we calculate a full state kinetic energy either with full-step velocity verlet
        or half step where we need the pressure */
index 61b7f87fde33959c5ed831457b04fada9967ea71..d8d94ffe70162304db0d02c4cef6494c6e132611 100644 (file)
@@ -530,9 +530,7 @@ void do_force(FILE *fplog,t_commrec *cr,
 
     gmx_pme_send_x(cr,bBS ? boxs : box,x,
                    mdatoms->nChargePerturbed,lambda,
-/* FIX ME after 4.5 */
-/* we are using gmx_bool of type char */
-                   ( flags & GMX_FORCE_VIRIAL) != 0,step);
+                   ( flags & GMX_FORCE_VIRIAL),step);
 
     GMX_MPE_LOG(ev_send_coordinates_finish);
     wallcycle_stop(wcycle,ewcPP_PMESENDX);
index 94ec31384bc0b360523701cf903017743eaaab77..6e6a19be75c6c7a13511d8e91bf9d5c2d343b3a8 100644 (file)
@@ -168,13 +168,11 @@ void global_stat(FILE *fplog,gmx_global_stat_t gs,
   bVV           = EI_VV(inputrec->eI);
   bTemp         = flags & CGLO_TEMPERATURE;
   bEner         = flags & CGLO_ENERGY;
-/* FIX ME after 4.5 */
-/* temporary hack because we are using gmx_bool (unsigned char) */
-  bPres         = (flags & CGLO_PRESSURE) != 0; 
-  bConstrVir    = (flags & CGLO_CONSTRAINT) != 0;
-  bFirstIterate = (flags & CGLO_FIRSTITERATE) != 0;
+  bPres         = (flags & CGLO_PRESSURE); 
+  bConstrVir    = (flags & CGLO_CONSTRAINT);
+  bFirstIterate = (flags & CGLO_FIRSTITERATE);
   bEkinAveVel   = (inputrec->eI==eiVV || (inputrec->eI==eiVVAK && bPres));
-  bReadEkin     = (flags & CGLO_READEKIN) != 0;
+  bReadEkin     = (flags & CGLO_READEKIN);
 
   rb   = gs->rb;
   itc0 = gs->itc0;
@@ -454,9 +452,9 @@ gmx_mdoutf_t *init_mdoutf(int nfile,const t_filenm fnm[],int mdrun_flags,
 
     if (MASTER(cr))
     {
-        bAppendFiles = (mdrun_flags & MD_APPENDFILES) != 0;
+        bAppendFiles = (mdrun_flags & MD_APPENDFILES);
 
-        of->bKeepAndNumCPT = (mdrun_flags & MD_KEEPANDNUMCPT) != 0;
+        of->bKeepAndNumCPT = (mdrun_flags & MD_KEEPANDNUMCPT);
 
         sprintf(filemode, bAppendFiles ? "a+" : "w+");  
         
index 2936f1e0d32abb8116fb87f10b90fe31303f33b9..5d31885326811e207e78ca854751af4542cabfdb 100644 (file)
@@ -1156,17 +1156,14 @@ static void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr,
     bRerunMD = flags & CGLO_RERUNMD;
     bStopCM = flags & CGLO_STOPCM;
     bGStat = flags & CGLO_GSTAT;
-/* FIX ME after 4.5 */
-/* temporary hack because we are using gmx_bool (unsigned char) */
-
-    bReadEkin = (flags & CGLO_READEKIN) != 0;
-    bScaleEkin = (flags & CGLO_SCALEEKIN) != 0;
+    bReadEkin = (flags & CGLO_READEKIN);
+    bScaleEkin = (flags & CGLO_SCALEEKIN);
     bEner = flags & CGLO_ENERGY;
     bTemp = flags & CGLO_TEMPERATURE;
-    bPres  = (flags & CGLO_PRESSURE) != 0;
-    bConstrain = (flags & CGLO_CONSTRAINT) != 0;
-    bIterate = (flags & CGLO_ITERATE) != 0;
-    bFirstIterate = (flags & CGLO_FIRSTITERATE) != 0;
+    bPres  = (flags & CGLO_PRESSURE);
+    bConstrain = (flags & CGLO_CONSTRAINT);
+    bIterate = (flags & CGLO_ITERATE);
+    bFirstIterate = (flags & CGLO_FIRSTITERATE);
 
     /* we calculate a full state kinetic energy either with full-step velocity verlet
        or half step where we need the pressure */