aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2016-03-13 17:13:20 -0700
committerLev Walkin <vlm@lionet.info>2016-03-13 17:13:20 -0700
commit1ec76055007a79b1568bebc8f9e6ae015262df8c (patch)
treea5a2c907660acd4f2841d6ab61fd5ed7fd55a50d
parent84b578827c9d16888ccfe45fb9e3c6f4c2790cb8 (diff)
do not use reserved identifiers for variables
-rw-r--r--libasn1fix/asn1fix_misc.c27
-rw-r--r--libasn1print/asn1print.c14
-rw-r--r--skeletons/asn_internal.h34
3 files changed, 38 insertions, 37 deletions
diff --git a/libasn1fix/asn1fix_misc.c b/libasn1fix/asn1fix_misc.c
index d2c9e5c7..23005b95 100644
--- a/libasn1fix/asn1fix_misc.c
+++ b/libasn1fix/asn1fix_misc.c
@@ -22,20 +22,19 @@ asn1f_printable_value(asn1p_value_t *v) {
static size_t managedptr_len;
int ret;
-#define ENSURE(len) do { \
- size_t __len = (len); \
- if(__len >= managedptr_len) { \
- if(managedptr) \
- free(managedptr); \
- managedptr = malloc(__len + 1); \
- if(managedptr) { \
- managedptr_len = __len; \
- } else { \
- managedptr_len = 0; \
- return "<memory allocation error>"; \
- } \
- } \
- } while(0)
+#define ENSURE(len) do { \
+ size_t tmp_len = (len); \
+ if(tmp_len >= managedptr_len) { \
+ free(managedptr); \
+ managedptr = malloc(tmp_len + 1); \
+ if(managedptr) { \
+ managedptr_len = tmp_len; \
+ } else { \
+ managedptr_len = 0; \
+ return "<memory allocation error>"; \
+ } \
+ } \
+ } while(0)
if(v == NULL)
return "<no value>";
diff --git a/libasn1print/asn1print.c b/libasn1print/asn1print.c
index 6f67f2c7..3a9cb024 100644
--- a/libasn1print/asn1print.c
+++ b/libasn1print/asn1print.c
@@ -9,13 +9,13 @@
#include "asn1print.h"
-#define INDENT(fmt, args...) do { \
- if(!(flags & APF_NOINDENT)) { \
- int __i = level; \
- while(__i--) printf(" "); \
- } \
- printf(fmt, ##args); \
- } while(0)
+#define INDENT(fmt, args...) do { \
+ if(!(flags & APF_NOINDENT)) { \
+ int tmp_i = level; \
+ while(tmp_i--) printf(" "); \
+ } \
+ printf(fmt, ##args); \
+ } while(0)
static int asn1print_module(asn1p_t *asn, asn1p_module_t *mod, enum asn1print_flags flags);
static int asn1print_oid(int prior_len, asn1p_oid_t *oid, enum asn1print_flags flags);
diff --git a/skeletons/asn_internal.h b/skeletons/asn_internal.h
index 4242245a..bd7a373f 100644
--- a/skeletons/asn_internal.h
+++ b/skeletons/asn_internal.h
@@ -79,23 +79,25 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
|| __ASN_E_cbc(buf2, size2) \
|| __ASN_E_cbc(buf3, size3))
-#define _i_ASN_TEXT_INDENT(nl, level) do { \
- int __level = (level); \
- int __nl = ((nl) != 0); \
- int __i; \
- if(__nl) _ASN_CALLBACK("\n", 1); \
- if(__level < 0) __level = 0; \
- for(__i = 0; __i < __level; __i++) \
- _ASN_CALLBACK(" ", 4); \
- er.encoded += __nl + 4 * __level; \
-} while(0)
+#define _i_ASN_TEXT_INDENT(nl, level) do { \
+ int tmp_level = (level); \
+ int tmp_nl = ((nl) != 0); \
+ int tmp_i; \
+ if(tmp_nl) _ASN_CALLBACK("\n", 1); \
+ if(tmp_level < 0) tmp_level = 0; \
+ for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) \
+ _ASN_CALLBACK(" ", 4); \
+ er.encoded += tmp_nl + 4 * tmp_level; \
+ } while(0)
-#define _i_INDENT(nl) do { \
- int __i; \
- if((nl) && cb("\n", 1, app_key) < 0) return -1; \
- for(__i = 0; __i < ilevel; __i++) \
- if(cb(" ", 4, app_key) < 0) return -1; \
-} while(0)
+#define _i_INDENT(nl) do { \
+ int tmp_i; \
+ if((nl) && cb("\n", 1, app_key) < 0) \
+ return -1; \
+ for(tmp_i = 0; tmp_i < ilevel; tmp_i++) \
+ if(cb(" ", 4, app_key) < 0) \
+ return -1; \
+ } while(0)
/*
* Check stack against overflow, if limit is set.