]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Remove parser_compile_string_len, and make parser_compiler_string take an additional...
authorDale Weiler <killfieldengine@gmail.com>
Sun, 23 Dec 2012 07:22:15 +0000 (07:22 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sun, 23 Dec 2012 07:22:15 +0000 (07:22 +0000)
gmqcc.h
main.c
parser.c

diff --git a/gmqcc.h b/gmqcc.h
index 358b03c8fb243d8515f42e0fdd50ea83102de66d..3755a51384a1ee3cb0b2999d0630f418c6e04145 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -919,15 +919,11 @@ qcint             prog_tempstring(qc_program *prog, const char *_str);
 /*===================================================================*/
 
 bool parser_init          ();
-bool parser_compile_file  (const char *filename);
-bool parser_compile_string(const char *name, const char *str);
-bool parser_finish        (const char *output);
+bool parser_compile_file  (const char *);
+bool parser_compile_string(const char *, const char *, size_t);
+bool parser_finish        (const char *);
 void parser_cleanup       ();
 
-/* TODO: make compile_string accept len and remove this */
-/* There's really no need to strlen() preprocessed files */
-bool parser_compile_string_len(const char *name, const char *str, size_t len);
-
 /*===================================================================*/
 /*====================== ftepp.c commandline ========================*/
 /*===================================================================*/
diff --git a/main.c b/main.c
index 107098a6e582acf312b9663b2511ec651c2500aa..916a95e01ee52833b95fe029ab0fcb06effbfa04 100644 (file)
--- a/main.c
+++ b/main.c
@@ -681,7 +681,7 @@ srcdone:
                     }
                     data = ftepp_get();
                     if (vec_size(data)) {
-                        if (!parser_compile_string_len(items[itr].filename, data, vec_size(data))) {
+                        if (!parser_compile_string(items[itr].filename, data, vec_size(data))) {
                             retval = 1;
                             goto cleanup;
                         }
index 16d783a9c9d2545d00b8494fddb940d47bbfccad..46f4291ce24a20b3114f5374446c462ee97e4876 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4724,7 +4724,7 @@ bool parser_compile_file(const char *filename)
     return parser_compile();
 }
 
-bool parser_compile_string_len(const char *name, const char *str, size_t len)
+bool parser_compile_string(const char *name, const char *str, size_t len)
 {
     parser->lex = lex_open_string(str, len, name);
     if (!parser->lex) {
@@ -4734,16 +4734,6 @@ bool parser_compile_string_len(const char *name, const char *str, size_t len)
     return parser_compile();
 }
 
-bool parser_compile_string(const char *name, const char *str)
-{
-    parser->lex = lex_open_string(str, strlen(str), name);
-    if (!parser->lex) {
-        con_err("failed to create lexer for string \"%s\"\n", name);
-        return false;
-    }
-    return parser_compile();
-}
-
 void parser_cleanup()
 {
     size_t i;