winedbg: Make lexeme_alloc() static in debug.l.

Francois Gouget fgouget at free.fr
Tue Jan 20 02:13:55 CST 2009


---

Reordered a bit to avoid forward declarations.

 programs/winedbg/debug.l    |   56 +++++++++++++++++++++---------------------
 programs/winedbg/debugger.h |    1 -
 2 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l
index 3a47a17..4332989 100644
--- a/programs/winedbg/debug.l
+++ b/programs/winedbg/debug.l
@@ -36,6 +36,34 @@
 
 #undef YY_INPUT
 
+static char** local_lexemes /* = NULL */;
+static int next_lexeme /* = 0 */;
+static int alloc_lexeme /* = 0 */;
+
+char* lexeme_alloc_size(int size)
+{
+    assert(0 <= next_lexeme && next_lexeme < alloc_lexeme + 1);
+    if (next_lexeme >= alloc_lexeme)
+    {
+        alloc_lexeme += 32;
+        local_lexemes = dbg_heap_realloc(local_lexemes, alloc_lexeme * sizeof(local_lexemes[0]));
+        assert(local_lexemes);
+    }
+    return local_lexemes[next_lexeme++] = HeapAlloc(GetProcessHeap(), 0, size + 1);
+}
+
+static char* lexeme_alloc(const char* lexeme)
+{
+    char*       ptr = lexeme_alloc_size(strlen(lexeme) + 1);
+    return strcpy(ptr, lexeme);
+}
+
+void lexeme_flush(void)
+{
+    while (--next_lexeme >= 0) HeapFree(GetProcessHeap(), 0, local_lexemes[next_lexeme]);
+    next_lexeme = 0;
+}
+
 static int read_input(const char* pfx, char* buf, int size)
 {
     int len;
@@ -234,31 +262,3 @@ all                                     { return tALL; }
 #ifndef dbg_wrap
 int dbg_wrap(void) { return 1; }
 #endif
-
-static char** local_lexemes /* = NULL */;
-static int next_lexeme /* = 0 */;
-static int alloc_lexeme /* = 0 */;
-
-char* lexeme_alloc_size(int size)
-{
-    assert(0 <= next_lexeme && next_lexeme < alloc_lexeme + 1);
-    if (next_lexeme >= alloc_lexeme)
-    {
-        alloc_lexeme += 32;
-        local_lexemes = dbg_heap_realloc(local_lexemes, alloc_lexeme * sizeof(local_lexemes[0]));
-        assert(local_lexemes);
-    }
-    return local_lexemes[next_lexeme++] = HeapAlloc(GetProcessHeap(), 0, size + 1);
-}
-
-char* lexeme_alloc(const char* lexeme)
-{
-    char*       ptr = lexeme_alloc_size(strlen(lexeme) + 1);
-    return strcpy(ptr, lexeme);
-}
-
-void lexeme_flush(void)
-{
-    while (--next_lexeme >= 0) HeapFree(GetProcessHeap(), 0, local_lexemes[next_lexeme]);
-    next_lexeme = 0;
-}
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index aa75239..4884e08 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -308,7 +308,6 @@ extern HANDLE           parser_generate_command_file(const char*, ...);
 
   /* debug.l */
 extern void             lexeme_flush(void);
-extern char*            lexeme_alloc(const char*);
 extern char*            lexeme_alloc_size(int);
 
   /* display.c */
-- 
1.5.6.5




More information about the wine-patches mailing list