make scope variables unique to avoid shadow warnings

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15614 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-07-10 05:13:09 +00:00
parent fe8d09cbc4
commit 53ac3a20b2
5 changed files with 73 additions and 34 deletions

View File

@@ -138,6 +138,7 @@ encode_type (const char *name, const Type *t)
case TSequence: {
Member *m;
int tag = -1;
int oldret_counter = unique_get_next();
if (t->members == NULL)
break;
@@ -152,8 +153,9 @@ encode_type (const char *name, const Type *t)
s);
#if 1
fprintf (codefile, "{\n"
"int oldret = ret;\n"
"ret = 0;\n");
"int oldret%d = ret;\n"
"ret = 0;\n",
oldret_counter);
#endif
encode_type (s, m->type);
fprintf (codefile,
@@ -163,8 +165,9 @@ encode_type (const char *name, const Type *t)
m->val);
#if 1
fprintf (codefile,
"ret += oldret;\n"
"}\n");
"ret += oldret%d;\n"
"}\n",
oldret_counter);
#endif
if (tag == -1)
tag = m->val;
@@ -176,26 +179,31 @@ encode_type (const char *name, const Type *t)
break;
}
case TSequenceOf: {
int oldret_counter = unique_get_next();
char *n;
fprintf (codefile,
"for(i = (%s)->len - 1; i >= 0; --i) {\n"
#if 1
"int oldret = ret;\n"
"int oldret%d = ret;\n"
"ret = 0;\n",
#else
,
#endif
name);
name, oldret_counter);
asprintf (&n, "&(%s)->val[i]", name);
encode_type (n, t->subtype);
fprintf (codefile,
#if 1
"ret += oldret;\n"
"ret += oldret%d;\n"
#endif
"}\n"
"e = der_put_length_and_tag (p, len, ret, ASN1_C_UNIV, CONS, UT_Sequence, &l);\n"
"BACK;\n");
"BACK;\n"
#if 1
, oldret_counter
#endif
);
free (n);
break;
}