From eb0c669452e4e0bded36f93a4eb6606d59d81bef Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Wed, 3 Jan 2018 18:34:20 -0800 Subject: [PATCH] Better accessed control --- src/toolsrc/codegen.c | 15 ++++----------- src/toolsrc/parse.c | 2 -- src/toolsrc/symbols.h | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/toolsrc/codegen.c b/src/toolsrc/codegen.c index b5878ad..96d7b49 100755 --- a/src/toolsrc/codegen.c +++ b/src/toolsrc/codegen.c @@ -73,7 +73,11 @@ int idglobal_lookup(char *name, int len) int i; for (i = 0; i < globals; i++) if (id_match(name, len, &(idglobal_name[i][0]))) + { + if (idglobal_type[i] & EXTERN_TYPE) + idglobal_type[i] |= ACCESSED_TYPE; return (i); + } return (-1); } int idconst_add(char *name, int len, int value) @@ -256,17 +260,6 @@ int id_type(char *name, int len) parse_error("Undeclared identifier"); return (0); } -int id_access(char *name, int len) -{ - int i; - if ((i = idglobal_lookup(name, len)) >= 0) - { - idglobal_type[i] |= ACCESSED_TYPE; - return (idglobal_type[i]); - } - parse_error("Undeclared external function"); - return (0); -} int tag_new(int type) { if (type & EXTERN_TYPE) diff --git a/src/toolsrc/parse.c b/src/toolsrc/parse.c index 1bd11a2..2df3e2f 100755 --- a/src/toolsrc/parse.c +++ b/src/toolsrc/parse.c @@ -414,8 +414,6 @@ t_opseq *parse_value(t_opseq *codeseq, int rvalue, int *stackdepth) { cfnparms = funcparms_cnt(type); cfnvals = funcvals_cnt(type); - if (type & EXTERN_TYPE) - id_access(tokenstr, tokenlen); } } else if (scantoken == LAMBDA_TOKEN) diff --git a/src/toolsrc/symbols.h b/src/toolsrc/symbols.h index 0453ce5..4fc90ce 100755 --- a/src/toolsrc/symbols.h +++ b/src/toolsrc/symbols.h @@ -45,6 +45,5 @@ int idconst_add(char *name, int len, int value); int id_tag(char *name, int len); int id_const(char *name, int len); int id_type(char *name, int len); -int id_access(char *name, int len); void idglobal_size(int type, int size, int constsize); int tag_new(int type);