enforsed compilation with -W -Werror
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@10 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1parser/asn1p_expr_str.h b/libasn1parser/asn1p_expr_str.h
index 02de131..7d98a55 100644
--- a/libasn1parser/asn1p_expr_str.h
+++ b/libasn1parser/asn1p_expr_str.h
@@ -45,13 +45,13 @@
/*
* Convert the ASN.1 expression type back into the string representation.
*/
-#define ASN_EXPR_TYPE2STR(type) \
- ( \
- ((type) < 0 \
- || (type) >= sizeof(asn1p_expr_type2str) \
- / sizeof(asn1p_expr_type2str[0])) \
- ? (char *)0 \
- : asn1p_expr_type2str[(type)] \
+#define ASN_EXPR_TYPE2STR(type) \
+ ( \
+ (((ssize_t)type) < 0 \
+ || ((size_t)type) >= sizeof(asn1p_expr_type2str) \
+ / sizeof(asn1p_expr_type2str[0])) \
+ ? (char *)0 \
+ : asn1p_expr_type2str[(type)] \
)
#endif /* ASN1_PARSER_EXPR_STR_H */
diff --git a/libasn1parser/asn1p_ref.c b/libasn1parser/asn1p_ref.c
index 4ac2b32..af6f6bb 100644
--- a/libasn1parser/asn1p_ref.c
+++ b/libasn1parser/asn1p_ref.c
@@ -80,7 +80,8 @@
int
asn1p_ref_add_component(asn1p_ref_t *ref, char *name, enum asn1p_ref_lex_type_e lex_type) {
- if(!ref || !name || lex_type < RLT_UNKNOWN || lex_type >= RLT_MAX) {
+ if(!ref || !name
+ || (int)lex_type < RLT_UNKNOWN || lex_type >= RLT_MAX) {
errno = EINVAL;
return -1;
}