mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 08:01:23 +02:00
Remove unused code in ECPG.
scanner_init/scanner_finish weren't actually called from anywhere, and the scanbuf variables they set up weren't used either. Remove unused declaration for mm_realloc, too. John Naylor Discussion: https://postgr.es/m/CAJVSVGWGqY9YBs2EwtRUkbNv=hXkN8yRPOoD1wxE6COgvvrz5g@mail.gmail.com
This commit is contained in:
parent
ec937d0805
commit
4766bcd9e2
@ -76,7 +76,7 @@ extern char *hashline_number(void);
|
|||||||
extern int base_yyparse(void);
|
extern int base_yyparse(void);
|
||||||
extern int base_yylex(void);
|
extern int base_yylex(void);
|
||||||
extern void base_yyerror(const char *);
|
extern void base_yyerror(const char *);
|
||||||
extern void *mm_alloc(size_t), *mm_realloc(void *, size_t);
|
extern void *mm_alloc(size_t);
|
||||||
extern char *mm_strdup(const char *);
|
extern char *mm_strdup(const char *);
|
||||||
extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
|
extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
|
||||||
extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
|
extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
|
||||||
@ -105,9 +105,7 @@ extern void remove_variables(int);
|
|||||||
extern struct variable *new_variable(const char *, struct ECPGtype *, int);
|
extern struct variable *new_variable(const char *, struct ECPGtype *, int);
|
||||||
extern const ScanKeyword *ScanCKeywordLookup(const char *);
|
extern const ScanKeyword *ScanCKeywordLookup(const char *);
|
||||||
extern const ScanKeyword *ScanECPGKeywordLookup(const char *text);
|
extern const ScanKeyword *ScanECPGKeywordLookup(const char *text);
|
||||||
extern void scanner_init(const char *);
|
|
||||||
extern void parser_init(void);
|
extern void parser_init(void);
|
||||||
extern void scanner_finish(void);
|
|
||||||
extern int filtered_base_yylex(void);
|
extern int filtered_base_yylex(void);
|
||||||
|
|
||||||
/* return codes */
|
/* return codes */
|
||||||
|
@ -34,8 +34,6 @@ extern YYSTYPE base_yylval;
|
|||||||
|
|
||||||
static int xcdepth = 0; /* depth of nesting in slash-star comments */
|
static int xcdepth = 0; /* depth of nesting in slash-star comments */
|
||||||
static char *dolqstart = NULL; /* current $foo$ quote start string */
|
static char *dolqstart = NULL; /* current $foo$ quote start string */
|
||||||
static YY_BUFFER_STATE scanbufhandle;
|
|
||||||
static char *scanbuf;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* literalbuf is used to accumulate literal values when multiple rules
|
* literalbuf is used to accumulate literal values when multiple rules
|
||||||
@ -1436,7 +1434,7 @@ lex_init(void)
|
|||||||
if (literalbuf == NULL)
|
if (literalbuf == NULL)
|
||||||
{
|
{
|
||||||
literalalloc = 1024;
|
literalalloc = 1024;
|
||||||
literalbuf = (char *) malloc(literalalloc);
|
literalbuf = (char *) mm_alloc(literalalloc);
|
||||||
}
|
}
|
||||||
startlit();
|
startlit();
|
||||||
|
|
||||||
@ -1664,44 +1662,3 @@ static bool isinformixdefine(void)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Called before any actual parsing is done
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
scanner_init(const char *str)
|
|
||||||
{
|
|
||||||
Size slen = strlen(str);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Might be left over after ereport()
|
|
||||||
*/
|
|
||||||
if (YY_CURRENT_BUFFER)
|
|
||||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make a scan buffer with special termination needed by flex.
|
|
||||||
*/
|
|
||||||
scanbuf = mm_alloc(slen + 2);
|
|
||||||
memcpy(scanbuf, str, slen);
|
|
||||||
scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
|
|
||||||
scanbufhandle = yy_scan_buffer(scanbuf, slen + 2);
|
|
||||||
|
|
||||||
/* initialize literal buffer to a reasonable but expansible size */
|
|
||||||
literalalloc = 128;
|
|
||||||
literalbuf = (char *) mm_alloc(literalalloc);
|
|
||||||
startlit();
|
|
||||||
|
|
||||||
BEGIN(INITIAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Called after parsing is done to clean up after scanner_init()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
scanner_finish(void)
|
|
||||||
{
|
|
||||||
yy_delete_buffer(scanbufhandle);
|
|
||||||
free(scanbuf);
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user