1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s4-heimdal: fixed the use of error_message() in heimdal

the lex code in heimdal had a function error_message() which conflicts
with a function from the com_err library. This replaces it with
lex_err_message()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andrew Tridgell 2010-10-29 11:46:44 +11:00
parent d6299d2667
commit 4bd7814a4e
12 changed files with 49 additions and 47 deletions

View File

@ -1794,21 +1794,21 @@ yyreduce:
/* Line 1455 of yacc.c */
#line 244 "heimdal/lib/asn1/asn1parse.y"
{ error_message("implicit tagging is not supported"); }
{ lex_err_message("implicit tagging is not supported"); }
break;
case 5:
/* Line 1455 of yacc.c */
#line 246 "heimdal/lib/asn1/asn1parse.y"
{ error_message("automatic tagging is not supported"); }
{ lex_err_message("automatic tagging is not supported"); }
break;
case 7:
/* Line 1455 of yacc.c */
#line 251 "heimdal/lib/asn1/asn1parse.y"
{ error_message("no extensibility options supported"); }
{ lex_err_message("no extensibility options supported"); }
break;
case 17:
@ -1888,9 +1888,9 @@ yyreduce:
#line 354 "heimdal/lib/asn1/asn1parse.y"
{
if((yyvsp[(2) - (5)].value)->type != integervalue)
error_message("Non-integer used in first part of range");
lex_err_message("Non-integer used in first part of range");
if((yyvsp[(2) - (5)].value)->type != integervalue)
error_message("Non-integer in second part of range");
lex_err_message("Non-integer in second part of range");
(yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
(yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
(yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
@ -1903,7 +1903,7 @@ yyreduce:
#line 364 "heimdal/lib/asn1/asn1parse.y"
{
if((yyvsp[(2) - (5)].value)->type != integervalue)
error_message("Non-integer in first part of range");
lex_err_message("Non-integer in first part of range");
(yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
(yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
(yyval.range)->max = (yyvsp[(2) - (5)].value)->u.integervalue - 1;
@ -1916,7 +1916,7 @@ yyreduce:
#line 372 "heimdal/lib/asn1/asn1parse.y"
{
if((yyvsp[(4) - (5)].value)->type != integervalue)
error_message("Non-integer in second part of range");
lex_err_message("Non-integer in second part of range");
(yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
(yyval.range)->min = (yyvsp[(4) - (5)].value)->u.integervalue + 2;
(yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
@ -1929,7 +1929,7 @@ yyreduce:
#line 380 "heimdal/lib/asn1/asn1parse.y"
{
if((yyvsp[(2) - (3)].value)->type != integervalue)
error_message("Non-integer used in limit");
lex_err_message("Non-integer used in limit");
(yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
(yyval.range)->min = (yyvsp[(2) - (3)].value)->u.integervalue;
(yyval.range)->max = (yyvsp[(2) - (3)].value)->u.integervalue;
@ -2177,7 +2177,7 @@ yyreduce:
Symbol *s = addsym((yyvsp[(1) - (1)].name));
(yyval.type) = new_type(TType);
if(s->stype != Stype && s->stype != SUndefined)
error_message ("%s is not a type\n", (yyvsp[(1) - (1)].name));
lex_err_message ("%s is not a type\n", (yyvsp[(1) - (1)].name));
else
(yyval.type)->symbol = s;
}
@ -2247,7 +2247,7 @@ yyreduce:
#line 607 "heimdal/lib/asn1/asn1parse.y"
{
if ((yyvsp[(3) - (3)].value)->type != objectidentifiervalue)
error_message("Non-OID used in ENCODED BY constraint");
lex_err_message("Non-OID used in ENCODED BY constraint");
(yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
(yyval.constraint_spec)->u.content.type = NULL;
(yyval.constraint_spec)->u.content.encoding = (yyvsp[(3) - (3)].value);
@ -2260,7 +2260,7 @@ yyreduce:
#line 615 "heimdal/lib/asn1/asn1parse.y"
{
if ((yyvsp[(5) - (5)].value)->type != objectidentifiervalue)
error_message("Non-OID used in ENCODED BY constraint");
lex_err_message("Non-OID used in ENCODED BY constraint");
(yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
(yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (5)].type);
(yyval.constraint_spec)->u.content.encoding = (yyvsp[(5) - (5)].value);
@ -2635,7 +2635,7 @@ yyreduce:
Symbol *s = addsym((yyvsp[(1) - (1)].name));
if(s->stype != SValue ||
s->value->type != objectidentifiervalue) {
error_message("%s is not an object identifier\n",
lex_err_message("%s is not an object identifier\n",
s->name);
exit(1);
}
@ -2659,7 +2659,7 @@ yyreduce:
{
Symbol *s = addsym((yyvsp[(1) - (1)].name));
if(s->stype != SValue)
error_message ("%s is not a value\n",
lex_err_message ("%s is not a value\n",
s->name);
else
(yyval.value) = s->value;
@ -2950,7 +2950,7 @@ yyreturn:
void
yyerror (const char *s)
{
error_message ("%s\n", s);
lex_err_message ("%s\n", s);
}
static Type *

View 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_err_message("implicit tagging is not supported"); }
| kw_AUTOMATIC kw_TAGS
{ error_message("automatic tagging is not supported"); }
{ lex_err_message("automatic tagging is not supported"); }
| /* empty */
;
ExtensionDefault: kw_EXTENSIBILITY kw_IMPLIED
{ error_message("no extensibility options supported"); }
{ lex_err_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_err_message("Non-integer used in first part of range");
if($2->type != integervalue)
error_message("Non-integer in second part of range");
lex_err_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_err_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_err_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_err_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_err_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_err_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_err_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_err_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_err_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_err_message ("%s\n", s);
}
static Type *

View File

@ -143,7 +143,7 @@ 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, "
lex_err_message("%s is imported or still undefined, "
" can't generate tag checking data in CHOICE "
"without this information",
t->symbol->name);

View File

@ -1657,7 +1657,7 @@ YY_RULE_SETUP
yylval.constant = strtol((const char *)yytext,
&e, 0);
if(e == y)
error_message("malformed constant (%s)", yytext);
lex_err_message("malformed constant (%s)", yytext);
else
return NUMBER;
}
@ -1694,7 +1694,7 @@ YY_RULE_SETUP
case 94:
YY_RULE_SETUP
#line 273 "lex.l"
{ error_message("Ignoring char(%c)\n", *yytext); }
{ lex_err_message("Ignoring char(%c)\n", *yytext); }
YY_BREAK
case 95:
YY_RULE_SETUP
@ -2712,7 +2712,7 @@ yywrap ()
#endif
void
error_message (const char *format, ...)
lex_err_message (const char *format, ...)
{
va_list args;
@ -2726,6 +2726,6 @@ 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_err_message("unterminated %s, possibly started on line %d\n", type, start_lineno);
}

View File

@ -35,7 +35,7 @@
#include <roken.h>
void error_message (const char *, ...)
void lex_err_message (const char *, ...)
__attribute__ ((format (printf, 1, 2)));
extern int error_flag;

View File

@ -50,6 +50,8 @@
#include "lex.h"
#include "gen_locl.h"
static void lex_err_message (const char *format, ...);
static unsigned lineno = 1;
#undef ECHO
@ -258,7 +260,7 @@ WITH { return kw_WITH; }
yylval.constant = strtol((const char *)yytext,
&e, 0);
if(e == y)
error_message("malformed constant (%s)", yytext);
lex_err_message("malformed constant (%s)", yytext);
else
return NUMBER;
}
@ -270,7 +272,7 @@ WITH { return kw_WITH; }
\n { ++lineno; }
\.\.\. { return ELLIPSIS; }
\.\. { return RANGE; }
. { error_message("Ignoring char(%c)\n", *yytext); }
. { lex_err_message("Ignoring char(%c)\n", *yytext); }
%%
#ifndef yywrap /* XXX */
@ -281,8 +283,8 @@ yywrap ()
}
#endif
void
error_message (const char *format, ...)
static void
lex_err_message (const char *format, ...)
{
va_list args;
@ -296,5 +298,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_err_message("unterminated %s, possibly started on line %d\n", type, start_lineno);
}

View 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_err_message("%s is still undefined\n", s->name);
*(int *) arg = 1;
}
return 0;

View File

@ -1899,7 +1899,7 @@ getstring(void)
continue;
}
if(c == '\n'){
error_message("unterminated string");
lex_err_message("unterminated string");
lineno++;
break;
}
@ -1919,7 +1919,7 @@ getstring(void)
}
void
error_message (const char *format, ...)
lex_err_message (const char *format, ...)
{
va_list args;

View File

@ -33,7 +33,7 @@
/* $Id$ */
void error_message (const char *, ...)
void lex_err_message (const char *, ...)
__attribute__ ((format (printf, 1, 2)));
int yylex(void);

View File

@ -94,7 +94,7 @@ getstring(void)
continue;
}
if(c == '\n'){
error_message("unterminated string");
lex_err_message("unterminated string");
lineno++;
break;
}
@ -114,7 +114,7 @@ getstring(void)
}
void
error_message (const char *format, ...)
lex_err_message (const char *format, ...)
{
va_list args;

View File

@ -1736,6 +1736,6 @@ name2number(const char *str)
void
yyerror (char *s)
{
error_message ("%s\n", s);
lex_err_message ("%s\n", s);
}

View File

@ -167,5 +167,5 @@ name2number(const char *str)
void
yyerror (char *s)
{
error_message ("%s\n", s);
lex_err_message ("%s\n", s);
}