coreutils
[Top][All Lists]
Advanced

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

[PATCH] maint: correct formatting style in a header


From: Jim Meyering
Subject: [PATCH] maint: correct formatting style in a header
Date: Mon, 28 Mar 2011 11:53:34 +0200

FYI,

>From fde07ff436ef19cc85a8bb626535cc18fdb9d588 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 28 Mar 2011 07:57:51 +0200
Subject: [PATCH] maint: correct formatting style in a header

* src/find-mount-point.h: Move "*" to where it belongs.
Move "const", too.
* src/find-mount-point.c: Move "const" to conform.
* src/Makefile.am (sc_tight_scope): Allow `*'s before the function name.
Use perl's -l option and drop the \n after (and quotes around) $1.
---
 src/Makefile.am        |    5 +++--
 src/find-mount-point.c |    4 ++--
 src/find-mount-point.h |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index bf1d60a..5bd71d2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -727,7 +727,8 @@ sc_tight_scope: $(bin_PROGRAMS)
        ( printf 'main\nusage\n_.*\n';                                  \
          grep -h -A1 '^extern .*[^;]$$' $$src                          \
            | grep -vE '^(extern |--)' | sed 's/ .*//';                 \
-         perl -ne '/^extern (?:enum )?\S+ (\S*) \(/ and print "$$1\n"' $$hdr; \
+         perl -lne '/^extern (?:enum )?\S+ \**(\S*) \(/ and print $$1' \
+               $$hdr;                                                  \
        ) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t;                 \
        nm -e *.$(OBJEXT)                                               \
            | sed -n 's/.* T //p'                                       \
@@ -736,7 +737,7 @@ sc_tight_scope: $(bin_PROGRAMS)
          { echo 'the above functions should have static scope' 1>&2;   \
            exit 1; } || : ;                                            \
        ( printf '^program_name$$\n';                                   \
-         perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"'       \
+         perl -lne '/^extern .*?\**(\w+);/ and print "^$$1\$$"'        \
            $$hdr *.h ) | $(ASSORT) -u > $$t;                           \
        nm -e *.$(OBJEXT)                                               \
            | sed -n 's/.* [BD] //p'                                    \
diff --git a/src/find-mount-point.c b/src/find-mount-point.c
index 48dc423..30e5122 100644
--- a/src/find-mount-point.c
+++ b/src/find-mount-point.c
@@ -29,11 +29,11 @@
    Give a diagnostic and return NULL if unable to determine the mount point.
    Exit if unable to restore current working directory.  */
 extern char *
-find_mount_point (const char *file, const struct stat *file_stat)
+find_mount_point (char const *file, struct stat const *file_stat)
 {
   struct saved_cwd cwd;
   struct stat last_stat;
-  char *mp = NULL;             /* The malloced mount point.  */
+  char *mp = NULL;             /* The malloc'd mount point.  */

   if (save_cwd (&cwd) != 0)
     {
diff --git a/src/find-mount-point.h b/src/find-mount-point.h
index 956cc38..04c4c34 100644
--- a/src/find-mount-point.h
+++ b/src/find-mount-point.h
@@ -14,4 +14,4 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

-extern char* find_mount_point (const char *, const struct stat *);
+extern char *find_mount_point (char const *, struct stat const *);
--
1.7.4.1.688.g95e3e



reply via email to

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