Преглед на файлове

Do not make function typedefs pointers

Guillem Jover преди 16 години
родител
ревизия
9d6a9e4375
променени са 3 файла, в които са добавени 12 реда и са изтрити 12 реда
  1. 3 3
      lib/dpkg/myopt.h
  2. 8 8
      lib/dpkg/tarfn.h
  3. 1 1
      src/main.c

+ 3 - 3
lib/dpkg/myopt.h

@@ -25,7 +25,7 @@
 
 DPKG_BEGIN_DECLS
 
-typedef void (*void_func)(void);
+typedef void void_func(void);
 
 struct cmdinfo {
   const char *olong;
@@ -36,7 +36,7 @@ struct cmdinfo {
   void (*call)(const struct cmdinfo*, const char *value);
   int arg;
   void *parg;
-  void_func farg;
+  void_func *farg;
 };
 
 extern const char printforhelp[];
@@ -58,7 +58,7 @@ void setaction(const struct cmdinfo *cip, const char *value);
 void setobsolete(const struct cmdinfo *cip, const char *value);
 
 #define ACTION(longopt, shortopt, code, func) \
- { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, (void_func)func }
+ { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, (void_func *)func }
 #define OBSOLETE(longopt, shortopt) \
  { longopt, shortopt, 0, NULL, NULL, setobsolete, 0, NULL, NULL }
 

+ 8 - 8
lib/dpkg/tarfn.h

@@ -62,17 +62,17 @@ struct tar_entry {
 	struct file_stat stat;
 };
 
-typedef int (*tar_read_func)(void *ctx, char *buffer, int length);
-typedef int (*tar_func)(void *ctx, struct tar_entry *h);
+typedef int tar_read_func(void *ctx, char *buffer, int length);
+typedef int tar_func(void *ctx, struct tar_entry *h);
 
 struct tar_operations {
-	tar_read_func read;
+	tar_read_func *read;
 
-	tar_func extract_file;
-	tar_func link;
-	tar_func symlink;
-	tar_func mkdir;
-	tar_func mknod;
+	tar_func *extract_file;
+	tar_func *link;
+	tar_func *symlink;
+	tar_func *mkdir;
+	tar_func *mknod;
 };
 
 int tar_extractor(void *ctx, const struct tar_operations *ops);

+ 1 - 1
src/main.c

@@ -453,7 +453,7 @@ static const struct cmdinfo cmdinfos[]= {
    * have a very similar structure.
    */
 #define ACTIONBACKEND(longopt, shortopt, backend) \
- { longopt, shortopt, 0, NULL, NULL, setaction, 0, (void *)backend, (void_func)execbackend }
+ { longopt, shortopt, 0, NULL, NULL, setaction, 0, (void *)backend, (void_func *)execbackend }
 
   ACTION( "install",                        'i', act_install,              archivefiles    ),
   ACTION( "unpack",                          0,  act_unpack,               archivefiles    ),