[Patches] ScheduleSorter.c: reduce compiler warnings

Steve White steve.white at aei.mpg.de
Mon Feb 13 08:00:24 CST 2006


Hello,

This is part of a project to reduce the compiler warnings generated by
Cactus Flesh code.

Intel icc complains about a very weird looking automatic conversion that is 
probably intended:
	int to signed char

NOTE
----
An explanation as to why the 'thisorders' array should be of signed char
rather than int is warranted in the source code.  Otherwise, I think the
code would be improved by making the array of int.

Anyway, I made the conversion explicit, thus making the warning go away.
See attached patch.

I tested this by running the full set of testsuites with the modified
and unmodified code.  The results were identical.

Cheers!

-- 
Steve White : Programmer
Max-Planck-Institut für Gravitationsphysik      Albert-Einstein-Institut
Am Mühlenberg 1, D-14476 Golm, Germany                  +49-331-567-7625
-------------- next part --------------
Index: src/schedule/ScheduleSorter.c
===================================================================
RCS file: /cactusdevcvs/Cactus/src/schedule/ScheduleSorter.c,v
retrieving revision 1.11
diff -u -r1.11 ScheduleSorter.c
--- src/schedule/ScheduleSorter.c	18 Mar 2003 16:04:32 -0000	1.11
+++ src/schedule/ScheduleSorter.c	13 Feb 2006 11:04:20 -0000
@@ -190,9 +190,9 @@
   {
     if(thisorders[column])
     {
-      if(array[row][column] && array[row][column] != thisorders[column]) retval--;
-      array[row][column] =   thisorders[column];
-      array[column][row] = - thisorders[column];
+      if(array[row][column] && array[row][column] != (signed char)thisorders[column]) retval--;
+      array[row][column] = (signed char)(  thisorders[column]);
+      array[column][row] = (signed char)( -thisorders[column]);
     }
   }
     


More information about the Patches mailing list