rxgen: Always pass aliases (typedefs) as pointers
authorChaskiel Grundman <cg2v@andrew.cmu.edu>
Fri, 20 Sep 2013 18:28:07 +0000 (14:28 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 17 Dec 2014 15:51:44 +0000 (10:51 -0500)
Since prototypes were introduced, xdr functions for typedef foo
expect a foo *, never a foo, even if the underlying type is an array.
print_param (for stubs) got this right, but print_stat (for inter-xdr
calls) did not.

Change-Id: I2b12aaf919fd39e6195d85072fdfd915a1c509f0
Reviewed-on: http://gerrit.openafs.org/10259
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/rxgen/rpc_util.c

index 203fda2..f70c4ab 100644 (file)
@@ -59,7 +59,6 @@ list *defined;                        /* list of defined things */
 /* static prototypes */
 static int findit(definition * def, char *type);
 static char *fixit(char *type, char *orig);
-static int typedefed(definition * def, char *type);
 static char *locase(char *str);
 static char *toktostr(tok_kind kind);
 static void printbuf(void);
@@ -189,21 +188,9 @@ ptype(char *prefix, char *type, int follow)
 }
 
 
-static int
-typedefed(definition * def, char *type)
-{
-    if (def->def_kind != DEF_TYPEDEF || def->def.ty.old_prefix != NULL) {
-       return (0);
-    } else {
-       return (streq(def->def_name, type));
-    }
-}
-
 int
 isvectordef(char *type, relation rel)
 {
-    definition *def;
-
     for (;;) {
        switch (rel) {
        case REL_VECTOR:
@@ -213,12 +200,7 @@ isvectordef(char *type, relation rel)
        case REL_POINTER:
            return (0);
        case REL_ALIAS:
-           def = (definition *) FINDVAL(defined, type, typedefed);
-           if (def == NULL) {
-               return (0);
-           }
-           type = def->def.ty.old_type;
-           rel = def->def.ty.rel;
+           return (0);
        }
     }
 }