Skip to contentSkip to conversation

dtc: Make eval_literal() static

PATCH David Gibson 1 participant 1 message Mar 5, 2008

lore
Share & tools
lore
#0 lore raw

eval_literal() is used only in the parser, so make it a static function.

---
 dtc-parser.y |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applies instead of the earlier patch that also localised yyerror().

dtc-parser.y +3 -3
Index: dtc/dtc-parser.y
===================================================================
@@ -24,12 +24,12 @@
 #include "dtc.h"
 #include "srcpos.h"
 
-int yylex(void);
-unsigned long long eval_literal(const char *s, int base, int bits);
+extern int yylex(void);
 
 extern struct boot_info *the_boot_info;
 extern int treesource_error;
 
+static unsigned long long eval_literal(const char *s, int base, int bits);
 %}
 
 %union {
@@ -330,7 +330,7 @@
 	yyerrorf("%s", s);
 }
 
-unsigned long long eval_literal(const char *s, int base, int bits)
+static unsigned long long eval_literal(const char *s, int base, int bits)
 {
 	unsigned long long val;
 	char *e;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson