bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/4] Initial small change


From: Paolo Bonzini
Subject: [PATCH 1/4] Initial small change
Date: Sun, 2 Nov 2008 11:07:32 +0100

This does not need comments.  Just a foreword, the patches apply on
top of Joel's.

* src/files.c (file_name_split): Move above.
---
 src/files.c |   70 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/src/files.c b/src/files.c
index be10c36..c6e5587 100644
--- a/src/files.c
+++ b/src/files.c
@@ -138,41 +138,6 @@ xfclose (FILE *ptr)
 | Compute ALL_BUT_EXT, ALL_BUT_TAB_EXT and output files extensions. |
 `------------------------------------------------------------------*/
 
-/* In the string S, replace all characters FROM by TO.  */
-static void
-tr (char *s, char from, char to)
-{
-  for (; *s; s++)
-    if (*s == from)
-      *s = to;
-}
-
-/* Compute extensions from the grammar file extension.  */
-static void
-compute_exts_from_gf (const char *ext)
-{
-  src_extension = xstrdup (ext);
-  header_extension = xstrdup (ext);
-  tr (src_extension, 'y', 'c');
-  tr (src_extension, 'Y', 'C');
-  tr (header_extension, 'y', 'h');
-  tr (header_extension, 'Y', 'H');
-}
-
-/* Compute extensions from the given c source file extension.  */
-static void
-compute_exts_from_src (const char *ext)
-{
-  /* We use this function when the user specifies `-o' or `--output',
-     so the extenions must be computed unconditionally from the file name
-     given by this option.  */
-  src_extension = xstrdup (ext);
-  header_extension = xstrdup (ext);
-  tr (header_extension, 'c', 'h');
-  tr (header_extension, 'C', 'H');
-}
-
-
 /* Decompose FILE_NAME in four parts: *BASE, *TAB, and *EXT, the fourth
    part, (the directory) is ranging from FILE_NAME to the char before
    *BASE, so we don't need an additional parameter.
@@ -225,6 +190,41 @@ file_name_split (const char *file_name,
 }
 
 
+/* In the string S, replace all characters FROM by TO.  */
+static void
+tr (char *s, char from, char to)
+{
+  for (; *s; s++)
+    if (*s == from)
+      *s = to;
+}
+
+/* Compute extensions from the grammar file extension.  */
+static void
+compute_exts_from_gf (const char *ext)
+{
+  src_extension = xstrdup (ext);
+  header_extension = xstrdup (ext);
+  tr (src_extension, 'y', 'c');
+  tr (src_extension, 'Y', 'C');
+  tr (header_extension, 'y', 'h');
+  tr (header_extension, 'Y', 'H');
+}
+
+/* Compute extensions from the given c source file extension.  */
+static void
+compute_exts_from_src (const char *ext)
+{
+  /* We use this function when the user specifies `-o' or `--output',
+     so the extenions must be computed unconditionally from the file name
+     given by this option.  */
+  src_extension = xstrdup (ext);
+  header_extension = xstrdup (ext);
+  tr (header_extension, 'c', 'h');
+  tr (header_extension, 'C', 'H');
+}
+
+
 static void
 compute_file_name_parts_new (char const **extp)
 {
-- 
1.5.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]