heimdal: fixed the use of error_message() in heimdal
authorAndrew Bartlett <abartlet@samba.org>
Mon, 8 Nov 2010 21:27:18 +0000 (08:27 +1100)
committerLove Hornquist Astrand <lha@h5l.org>
Mon, 8 Nov 2010 21:43:25 +0000 (13:43 -0800)
the lex code in heimdal had a function error_message() which is
confusingly the ame as a core function from the com_err library. This
replaces it with lex_error_message(), and allows Samba4 to have a
stricter check for duplicate symbols between it's components.

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
lib/asn1/asn1parse.y
lib/asn1/gen_decode.c
lib/asn1/lex.h
lib/asn1/lex.l
lib/asn1/symbol.c

index 611c5b521ad906a6260edbeb59264f38b3af9319..dad7f67a20229e870752ed9c6163913b2f92c655 100644 (file)
@@ -241,14 +241,14 @@ ModuleDefinition: IDENTIFIER objid_opt kw_DEFINITIONS TagDefault ExtensionDefaul
 
 TagDefault     : kw_EXPLICIT kw_TAGS
                | kw_IMPLICIT kw_TAGS
-                     { error_message("implicit tagging is not supported"); }
+                     { lex_error_message("implicit tagging is not supported"); }
                | kw_AUTOMATIC kw_TAGS
-                     { error_message("automatic tagging is not supported"); }
+                     { lex_error_message("automatic tagging is not supported"); }
                | /* empty */
                ;
 
 ExtensionDefault: kw_EXTENSIBILITY kw_IMPLIED
-                     { error_message("no extensibility options supported"); }
+                     { lex_error_message("no extensibility options supported"); }
                | /* empty */
                ;
 
@@ -353,9 +353,9 @@ BooleanType : kw_BOOLEAN
 range          : '(' Value RANGE Value ')'
                {
                    if($2->type != integervalue)
-                       error_message("Non-integer used in first part of range");
+                       lex_error_message("Non-integer used in first part of range");
                    if($2->type != integervalue)
-                       error_message("Non-integer in second part of range");
+                       lex_error_message("Non-integer in second part of range");
                    $$ = ecalloc(1, sizeof(*$$));
                    $$->min = $2->u.integervalue;
                    $$->max = $4->u.integervalue;
@@ -363,7 +363,7 @@ range               : '(' Value RANGE Value ')'
                | '(' Value RANGE kw_MAX ')'
                {       
                    if($2->type != integervalue)
-                       error_message("Non-integer in first part of range");
+                       lex_error_message("Non-integer in first part of range");
                    $$ = ecalloc(1, sizeof(*$$));
                    $$->min = $2->u.integervalue;
                    $$->max = $2->u.integervalue - 1;
@@ -371,7 +371,7 @@ range               : '(' Value RANGE Value ')'
                | '(' kw_MIN RANGE Value ')'
                {       
                    if($4->type != integervalue)
-                       error_message("Non-integer in second part of range");
+                       lex_error_message("Non-integer in second part of range");
                    $$ = ecalloc(1, sizeof(*$$));
                    $$->min = $4->u.integervalue + 2;
                    $$->max = $4->u.integervalue;
@@ -379,7 +379,7 @@ range               : '(' Value RANGE Value ')'
                | '(' Value ')'
                {
                    if($2->type != integervalue)
-                       error_message("Non-integer used in limit");
+                       lex_error_message("Non-integer used in limit");
                    $$ = ecalloc(1, sizeof(*$$));
                    $$->min = $2->u.integervalue;
                    $$->max = $2->u.integervalue;
@@ -550,7 +550,7 @@ DefinedType : IDENTIFIER
                  Symbol *s = addsym($1);
                  $$ = new_type(TType);
                  if(s->stype != Stype && s->stype != SUndefined)
-                   error_message ("%s is not a type\n", $1);
+                   lex_error_message ("%s is not a type\n", $1);
                  else
                    $$->symbol = s;
                }
@@ -606,7 +606,7 @@ ContentsConstraint: kw_CONTAINING Type
                | kw_ENCODED kw_BY Value
                {
                    if ($3->type != objectidentifiervalue)
-                       error_message("Non-OID used in ENCODED BY constraint");
+                       lex_error_message("Non-OID used in ENCODED BY constraint");
                    $$ = new_constraint_spec(CT_CONTENTS);
                    $$->u.content.type = NULL;
                    $$->u.content.encoding = $3;
@@ -614,7 +614,7 @@ ContentsConstraint: kw_CONTAINING Type
                | kw_CONTAINING Type kw_ENCODED kw_BY Value
                {
                    if ($5->type != objectidentifiervalue)
-                       error_message("Non-OID used in ENCODED BY constraint");
+                       lex_error_message("Non-OID used in ENCODED BY constraint");
                    $$ = new_constraint_spec(CT_CONTENTS);
                    $$->u.content.type = $2;
                    $$->u.content.encoding = $5;
@@ -851,7 +851,7 @@ objid_element       : IDENTIFIER '(' NUMBER ')'
                    Symbol *s = addsym($1);
                    if(s->stype != SValue ||
                       s->value->type != objectidentifiervalue) {
-                       error_message("%s is not an object identifier\n",
+                       lex_error_message("%s is not an object identifier\n",
                                      s->name);
                        exit(1);
                    }
@@ -884,7 +884,7 @@ Valuereference      : IDENTIFIER
                {
                        Symbol *s = addsym($1);
                        if(s->stype != SValue)
-                               error_message ("%s is not a value\n",
+                               lex_error_message ("%s is not a value\n",
                                                s->name);
                        else
                                $$ = s->value;
@@ -942,7 +942,7 @@ ObjectIdentifierValue: objid
 void
 yyerror (const char *s)
 {
-     error_message ("%s\n", s);
+     lex_error_message ("%s\n", s);
 }
 
 static Type *
index ad76c07251d4955ac17e8e23cff35e3a7e104a3a..002a471e96e7dc33c8e012e0cf1b144625eb6883 100644 (file)
@@ -143,10 +143,10 @@ find_tag (const Type *t,
     case TType:
        if ((t->symbol->stype == Stype && t->symbol->type == NULL)
            || t->symbol->stype == SUndefined) {
-           error_message("%s is imported or still undefined, "
-                         " can't generate tag checking data in CHOICE "
-                         "without this information",
-                         t->symbol->name);
+           lex_error_message("%s is imported or still undefined, "
+                             " can't generate tag checking data in CHOICE "
+                             "without this information",
+                             t->symbol->name);
            exit(1);
        }
        find_tag(t->symbol->type, cl, ty, tag);
index abca8f723de35c61fb6a7a9309716a334ba5be7f..1ee534178996b855847608866d3823455b176d4e 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <roken.h>
 
-void error_message (const char *, ...)
+void lex_error_message (const char *, ...)
 __attribute__ ((format (printf, 1, 2)));
 extern int error_flag;
 
index 7bd442bc502abcee27b1ac4b969905e019282e1b..dece0961646cc79e83e0dd03f6c9d7daca11c37c 100644 (file)
@@ -258,7 +258,7 @@ WITH                        { return kw_WITH; }
                          yylval.constant = strtol((const char *)yytext,
                                                   &e, 0);
                          if(e == y)
-                           error_message("malformed constant (%s)", yytext);
+                           lex_error_message("malformed constant (%s)", yytext);
                          else
                            return NUMBER;
                        }
@@ -270,7 +270,7 @@ WITH                        { return kw_WITH; }
 \n                     { ++lineno; }
 \.\.\.                 { return ELLIPSIS; }
 \.\.                   { return RANGE; }
-.                      { error_message("Ignoring char(%c)\n", *yytext); }
+.                      { lex_error_message("Ignoring char(%c)\n", *yytext); }
 %%
 
 #ifndef yywrap /* XXX */
@@ -282,7 +282,7 @@ yywrap ()
 #endif
 
 void
-error_message (const char *format, ...)
+lex_error_message (const char *format, ...)
 {
     va_list args;
 
@@ -296,5 +296,5 @@ error_message (const char *format, ...)
 static void
 unterminated(const char *type, unsigned start_lineno)
 {
-    error_message("unterminated %s, possibly started on line %d\n", type, start_lineno);
+    lex_error_message("unterminated %s, possibly started on line %d\n", type, start_lineno);
 }
index e65876a032c20bfc0b30c5abdb9c4b1fab99ddb1..b05f68fa74a9f9b9ac3b386115c6326ed195babd 100644 (file)
@@ -93,7 +93,7 @@ checkfunc(void *ptr, void *arg)
 {
     Symbol *s = ptr;
     if (s->stype == SUndefined) {
-       error_message("%s is still undefined\n", s->name);
+       lex_error_message("%s is still undefined\n", s->name);
        *(int *) arg = 1;
     }
     return 0;