[PATCH,gfortran] constify a function

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Dec 30 03:30:00 GMT 2004


The attached patch constifies the arguments to compare_case,
and then removes the unneeded pointer assignment and local
variables.

bubblestrapped and regression tested on i386-*-freebsd6.0

2004-12-29  Steven G. Kargl  <kargls@comcast.net>
        * resolve.c (compare_case): Constify
-- 
Steve
-------------- next part --------------
Index: resolve.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/resolve.c,v
retrieving revision 1.24
diff -u -b -u -r1.24 resolve.c
--- resolve.c	15 Dec 2004 03:56:05 -0000	1.24
+++ resolve.c	30 Dec 2004 03:22:45 -0000
@@ -2494,12 +2494,8 @@
    op1 > op2.  Assumes we're not dealing with the default case.  */
 
 static int
-compare_cases (const void * _op1, const void * _op2)
+compare_cases (const gfc_case * op1, const gfc_case * op2)
 {
-  const gfc_case *op1, *op2;
-
-  op1 = (const gfc_case *) _op1;
-  op2 = (const gfc_case *) _op2;
 
   if (op1->low == NULL) /* op1 = (:N) */
     {


More information about the Fortran mailing list