From: Ken Raeburn Date: Thu, 7 Aug 2008 03:29:52 +0000 (+0000) Subject: sequence_of_no_tagvars declared variables used only in X-Git-Tag: krb5-1.7-alpha1~513 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=52a5d1f981236517b295badcb96bbbd5734b2fd0;p=krb5.git sequence_of_no_tagvars declared variables used only in end_sequence_of_no_tagvars and only as unnecessary temporaries, so get rid of them; also, push most of the work of the latter macro into a helper function. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20632 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 91e6ffcf5..10d0a05f8 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -284,11 +284,6 @@ asn1_get_eoc_tag (asn1buf *buf) * than does sequence_of() to avoid shadowing. */ #define sequence_of_no_tagvars(buf) \ - asn1_class eseqclass; \ - asn1_construction eseqconstr; \ - asn1_tagnum eseqnum; \ - unsigned int eseqlen; \ - int eseqindef; \ sequence_of_common(buf) /* @@ -335,21 +330,22 @@ asn1_get_eoc_tag (asn1buf *buf) * Like end_sequence_of(), but uses the different (non-shadowing) * variable names. */ -#define end_sequence_of_no_tagvars(buf) \ - { \ - taginfo t5; \ - retval = asn1_get_tag_2(&seqbuf, &t5); \ - if (retval) return retval; \ - /* Copy out to match previous functionality, until better integrated. */ \ - eseqclass = t5.asn1class; \ - eseqconstr = t5.construction; \ - eseqnum = t5.tagnum; \ - eseqlen = t5.length; \ - eseqindef = t5.indef; \ - } \ - retval = asn1buf_sync(buf, &seqbuf, eseqclass, eseqnum, \ - eseqlen, eseqindef, seqofindef); \ - if (retval) return retval; +static asn1_error_code +end_sequence_of_no_tagvars_helper(asn1buf *buf, asn1buf *seqbufp, + int seqofindef) +{ + taginfo t; + asn1_error_code retval; + + retval = asn1_get_tag_2(seqbufp, &t); + if (retval) + return retval; + retval = asn1buf_sync(buf, seqbufp, t.asn1class, t.tagnum, + t.length, t.indef, seqofindef); + return retval; +} +#define end_sequence_of_no_tagvars(buf) \ + end_sequence_of_no_tagvars_helper(buf, &seqbuf, seqofindef) #define cleanup() \ return 0