[commit: ghc] master: hp2ps: mark local functions as 'static' (72545c7)

git at git.haskell.org git at git.haskell.org
Sun Feb 7 15:00:21 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/72545c75556c4404048036ce7e07a447fd199cd5/ghc

>---------------------------------------------------------------

commit 72545c75556c4404048036ce7e07a447fd199cd5
Author: Sergei Trofimovich <siarheit at google.com>
Date:   Sun Feb 7 09:29:55 2016 +0000

    hp2ps: mark local functions as 'static'
    
    Found by uselex.rb:
        fonttab: [R]: exported from: ./utils/hp2ps/dist/build/Dimensions.o
        GetString: [R]: exported from: ./utils/hp2ps/dist/build/HpFile.o
        thestring: [R]: exported from: ./utils/hp2ps/dist/build/HpFile.o
        auxfp: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        dflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        filter: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        iflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        mflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        pflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        psfile: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        tflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o
        OrderOf: [R]: exported from: ./utils/hp2ps/dist/build/Reorder.o
    
    Signed-off-by: Sergei Trofimovich <siarheit at google.com>


>---------------------------------------------------------------

72545c75556c4404048036ce7e07a447fd199cd5
 utils/hp2ps/Dimensions.c |  2 +-
 utils/hp2ps/HpFile.c     |  4 +++-
 utils/hp2ps/HpFile.h     |  2 --
 utils/hp2ps/Main.c       | 16 ++++++++--------
 utils/hp2ps/Main.h       |  4 ----
 utils/hp2ps/Reorder.c    |  2 +-
 utils/hp2ps/Reorder.h    |  1 -
 7 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/utils/hp2ps/Dimensions.c b/utils/hp2ps/Dimensions.c
index a13ca33..f8e5c85 100644
--- a/utils/hp2ps/Dimensions.c
+++ b/utils/hp2ps/Dimensions.c
@@ -87,7 +87,7 @@ KeyWidth(void)
  */
 
 
-floatish fonttab[] = {
+static floatish fonttab[] = {
     /*  20 (' ') = */ 3.0,
     /*  21 ('!') = */ 1.0,
     /*  22 ('"') = */ 1.0,
diff --git a/utils/hp2ps/HpFile.c b/utils/hp2ps/HpFile.c
index 12ef8d6..deef582 100644
--- a/utils/hp2ps/HpFile.c
+++ b/utils/hp2ps/HpFile.c
@@ -18,7 +18,7 @@ double atof PROTO((const char *));
 #define N_SAMPLES 500		/* start size of the sample table */
 
 char *theident;
-char *thestring;
+static char *thestring;
 int theinteger;
 floatish thefloatish;
 int ch;						/* last character read  */
@@ -39,6 +39,8 @@ static void GetHpTok  PROTO((FILE *, int));	/* forward */
 
 static struct entry *GetEntry PROTO((char *));	/* forward */
 
+static void GetString PROTO((FILE *));		/* forward */
+
 static void MakeIdentTable PROTO((void));	/* forward */
 
 char *jobstring;
diff --git a/utils/hp2ps/HpFile.h b/utils/hp2ps/HpFile.h
index 1c43f73..6e01d1e 100644
--- a/utils/hp2ps/HpFile.h
+++ b/utils/hp2ps/HpFile.h
@@ -44,7 +44,6 @@ struct entry {
 };
 
 extern char *theident;
-extern char *thestring;
 extern int theinteger;
 extern floatish thefloatish;
 extern int ch;
@@ -65,7 +64,6 @@ struct entry *MakeEntry PROTO((char *));
 
 token GetNumber PROTO((FILE *));
 void  GetIdent  PROTO((FILE *));
-void  GetString PROTO((FILE *));
 boolish IsIdChar PROTO((int)); /* int is a "char" from getc */
 
 extern char *jobstring;
diff --git a/utils/hp2ps/Main.c b/utils/hp2ps/Main.c
index 88f9b08..7731d4c 100644
--- a/utils/hp2ps/Main.c
+++ b/utils/hp2ps/Main.c
@@ -16,26 +16,26 @@
 #include "Error.h"
 #include "Utilities.h"
 
-boolish pflag = 0;	/* read auxiliary file			*/
+static boolish pflag = 0;	/* read auxiliary file			*/
 boolish eflag = 0;	/* scaled EPSF 				*/
-boolish dflag = 0;	/* sort by standard deviation		*/
-int     iflag = 0;	/* sort by identifier (3-way flag)      */
+static boolish dflag = 0;	/* sort by standard deviation		*/
+static int     iflag = 0;	/* sort by identifier (3-way flag)      */
 boolish gflag = 0;	/* output suitable for previewer	*/
 boolish yflag = 0; 	/* ignore marks				*/
 boolish bflag = 0; 	/* use a big title box			*/
 boolish sflag = 0;	/* use a small title box		*/
-int     mflag = 0;	/* max no. of bands displayed (default 20) */
-boolish tflag = 0;	/* ignored threshold specified          */
+static int     mflag = 0;	/* max no. of bands displayed (default 20) */
+static boolish tflag = 0;	/* ignored threshold specified          */
 boolish cflag = 0;      /* colour output                        */
 
-boolish filter;		/* true when running as a filter	*/
+static boolish filter;		/* true when running as a filter	*/
 boolish multipageflag = 0;  /* true when the output should be 2 pages - key and profile */ 
 
 static floatish WidthInPoints PROTO((char *));		  /* forward */
 static FILE *Fp PROTO((char *, char **, char *, char *)); /* forward */
 
 char *hpfile;
-char *psfile;
+static char *psfile;
 char *auxfile;
 
 char *programname;
@@ -45,7 +45,7 @@ static char *baseName; /* "basename" is a std C library name (sigh) */
 
 FILE* hpfp;
 FILE* psfp;
-FILE* auxfp;
+static FILE* auxfp;
 
 floatish xrange = 0.0;
 floatish yrange = 0.0;
diff --git a/utils/hp2ps/Main.h b/utils/hp2ps/Main.h
index 0d0d75f..7a8626b 100644
--- a/utils/hp2ps/Main.h
+++ b/utils/hp2ps/Main.h
@@ -60,8 +60,6 @@ extern boolish gflag;
 extern boolish yflag;
 extern boolish bflag;
 extern boolish sflag;
-extern int     mflag;
-extern boolish tflag;
 extern boolish cflag;
 
 extern boolish multipageflag;
@@ -69,11 +67,9 @@ extern boolish multipageflag;
 extern char *programname;
 
 extern char *hpfile;
-extern char *psfile;
 extern char *auxfile;
 
 extern FILE *hpfp;
 extern FILE *psfp;
-extern FILE *auxfp;
 
 #endif /* MAIN_H */
diff --git a/utils/hp2ps/Reorder.c b/utils/hp2ps/Reorder.c
index 2a7fb98..144b3f9 100644
--- a/utils/hp2ps/Reorder.c
+++ b/utils/hp2ps/Reorder.c
@@ -43,7 +43,7 @@ OrderFor(char *ident, int order)
  *	Otherwise, return 0 which is the minimum ordering value. 
  */
 
-int
+static int
 OrderOf(char *ident)
 {
     int i;
diff --git a/utils/hp2ps/Reorder.h b/utils/hp2ps/Reorder.h
index 089ef75..ec3ec98 100644
--- a/utils/hp2ps/Reorder.h
+++ b/utils/hp2ps/Reorder.h
@@ -2,7 +2,6 @@
 #define REORDER_H
 
 void Reorder  PROTO((void));
-int  OrderOf  PROTO((char *));
 void OrderFor PROTO((char *, int));
 
 #endif /* REORDER_H */



More information about the ghc-commits mailing list