make-rxgen-split-rpcs-not-declare-start-parameters-for-functions-for-data-which-is...
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Wed, 30 May 2001 20:34:17 +0000 (20:34 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 30 May 2001 20:34:17 +0000 (20:34 +0000)
"fix for rxgen so that split rpc's don't erroneously declare parameters in
the "start" function that should only be declared in the "end":

example:

for the following declaration:
Store(IN struct _index_t *descr,
          IN string group<STAGE_STRINGSIZE>,
          OUT string spool<STAGE_STRINGSIZE>, OUT afs_uint32 *slot) split;

before patch:
int StartDMV_Store(z_call, descr, group)
        register struct rx_call *z_call;
        struct _index_t * descr;
        char * group, **spool;
{
[...]
after patch:
int StartDMV_Store(z_call, descr, group)
        register struct rx_call *z_call;
        struct _index_t * descr;
        char * group;
{
[...]
"

src/rxgen/rpc_parse.c

index a774acd..0d6a7fc 100644 (file)
@@ -1166,7 +1166,7 @@ int split_flag;
            }
            plist->pl.param_flag |= PROCESSED_PARAM;
            for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
-               if (streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
+               if ((plist1->component_kind == DEF_PARAM) && streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
                    char *star="";
                    char *pntr = index(plist1->pl.param_type, '*');
                    if (pntr) star = "*";
@@ -1407,7 +1407,7 @@ int *somefrees;
            }
            plist->pl.param_flag |= PROCESSED_PARAM;
            for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
-               if (streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
+               if ((plist1->component_kind == DEF_PARAM) && streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
                    if (plist1->pl.param_flag & INDIRECT_PARAM) {
                            f_print(fout, ", %s", plist1->pl.param_name);
                    } else if (index(plist1->pl.param_type, '*') == 0) {