struct name cleanup in preparation for AST + warning removal
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 9 Feb 2011 00:43:46 +0000 (19:43 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 9 Feb 2011 00:43:46 +0000 (19:43 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-ast.h
formats/ctf/metadata/ctf-lexer.l
formats/ctf/metadata/ctf-parser.y
formats/ctf/metadata/ctf-scanner.h

index 34d00367fc396ab93af2775c1dd677c6a563ae59..ae7381cc2d5f5e9c5d953f1a19e5c07bf35be3ca 100644 (file)
@@ -37,12 +37,6 @@ struct ctf_node {
        struct cds_list_head gc;
 };
 
-struct scope;
-struct scope {
-       struct scope *parent;
-       GHashTable *types;
-};
-
 struct ctf_ast {
        struct ctf_node root;
 };
index 07362fc9224513d842fcd0f53bdf8966251fd15b..5291d2cc442f98682dff200c56c61de399d432ba 100644 (file)
 #include "ctf-parser.h"
 #include "ctf-ast.h"
 
-extern void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src);
+extern
+void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src);
+
+static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
+       __attribute__((unused));
+static int input (yyscan_t yyscanner) __attribute__((unused));
 
 #define printf_dbg(fmt, args...)       fprintf(stderr, "%s: " fmt, __func__, args)
 #define printf_dbg_noarg(fmt)  fprintf(stderr, "%s: " fmt, __func__)
index 0b425cb9a84148a38d752390c7918db572e3f654..fb7e9b7cf5d4a4abf3d29f6fb4ffbe5279436aef 100644 (file)
@@ -70,31 +70,32 @@ void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src)
        strcpy(lvalp->gs->s, src);
 }
 
-static void init_scope(struct scope *scope, struct scope *parent)
+static void init_scope(struct ctf_scanner_scope *scope,
+                      struct ctf_scanner_scope *parent)
 {
        scope->parent = parent;
        scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
                                             (GDestroyNotify) free, NULL);
 }
 
-static void finalize_scope(struct scope *scope)
+static void finalize_scope(struct ctf_scanner_scope *scope)
 {
        g_hash_table_destroy(scope->types);
 }
 
 static void push_scope(struct ctf_scanner *scanner)
 {
-       struct scope *ns;
+       struct ctf_scanner_scope *ns;
 
        printf_dbg_noarg("push scope\n");
-       ns = malloc(sizeof(struct scope));
+       ns = malloc(sizeof(struct ctf_scanner_scope));
        init_scope(ns, scanner->cs);
        scanner->cs = ns;
 }
 
 static void pop_scope(struct ctf_scanner *scanner)
 {
-       struct scope *os;
+       struct ctf_scanner_scope *os;
 
        printf_dbg_noarg("pop scope\n");
        os = scanner->cs;
@@ -103,7 +104,7 @@ static void pop_scope(struct ctf_scanner *scanner)
        free(os);
 }
 
-static int lookup_type(struct scope *s, const char *id)
+static int lookup_type(struct ctf_scanner_scope *s, const char *id)
 {
        int ret;
 
@@ -114,7 +115,7 @@ static int lookup_type(struct scope *s, const char *id)
 
 int is_type(struct ctf_scanner *scanner, const char *id)
 {
-       struct scope *it;
+       struct ctf_scanner_scope *it;
        int ret = 0;
 
        for (it = scanner->cs; it != NULL; it = it->parent) {
index 07b5df7c75ac1d64201ee35587a174a39cf48212..f25efb9e5277cb2c78d12deebe49e238e81b1cdb 100644 (file)
@@ -9,11 +9,17 @@
 typedef void* yyscan_t;
 #endif
 
+struct ctf_scanner_scope;
+struct ctf_scanner_scope {
+       struct ctf_scanner_scope *parent;
+       GHashTable *types;
+};
+
 struct ctf_scanner {
        yyscan_t scanner;
        struct ctf_ast *ast;
-       struct scope root_scope;
-       struct scope *cs;
+       struct ctf_scanner_scope root_scope;
+       struct ctf_scanner_scope *cs;
        struct cds_list_head allocated_strings;
 };
 
This page took 0.027136 seconds and 4 git commands to generate.