ANSI function pointers are fun!
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 5 Jun 1991 07:49:25 +0000 (23:49 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 5 Jun 1991 07:49:25 +0000 (23:49 -0800)
SCCS-vsn: usr.bin/find/option.c 5.8

usr/src/usr.bin/find/option.c

index 86ec6d1..b875177 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)option.c   5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)option.c   5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -118,7 +118,7 @@ option(name)
        char *name;
 {
        OPTION tmp;
        char *name;
 {
        OPTION tmp;
-       int typecompare();
+       int typecompare __P((const void *, const void *));
 
        tmp.name = name;
        return((OPTION *)bsearch(&tmp, options,
 
        tmp.name = name;
        return((OPTION *)bsearch(&tmp, options,
@@ -126,7 +126,7 @@ option(name)
 }
        
 typecompare(a, b)
 }
        
 typecompare(a, b)
-       OPTION *a, *b;
+       const void *a, *b;
 {
 {
-       return(strcmp(a->name, b->name));
+       return(strcmp(((OPTION *)a)->name, ((OPTION *)b)->name));
 }
 }