SOURCES: unifdef-Makefile.am (NEW), unifdef-configure.ac (NEW), un...

glen glen at pld-linux.org
Wed Jul 12 12:26:31 CEST 2006


Author: glen                         Date: Wed Jul 12 10:26:31 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- from Suse 9.3 package

---- Files affected:
SOURCES:
   unifdef-Makefile.am (NONE -> 1.1)  (NEW), unifdef-configure.ac (NONE -> 1.1)  (NEW), unifdef-codecleanup.diff (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/unifdef-Makefile.am
diff -u /dev/null SOURCES/unifdef-Makefile.am:1.1
--- /dev/null	Wed Jul 12 12:26:31 2006
+++ SOURCES/unifdef-Makefile.am	Wed Jul 12 12:26:26 2006
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = foreign
+
+bin_PROGRAMS    = unifdef
+unifdef_SOURCES = unifdef.c
+               
+man_MANS = unifdef.1
+EXTRA_DIST = $(man_MANS) README LICENSE

================================================================
Index: SOURCES/unifdef-configure.ac
diff -u /dev/null SOURCES/unifdef-configure.ac:1.1
--- /dev/null	Wed Jul 12 12:26:31 2006
+++ SOURCES/unifdef-configure.ac	Wed Jul 12 12:26:26 2006
@@ -0,0 +1,25 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT(unifdef, 1.0, BUG-REPORT-ADDRESS)
+AC_CONFIG_SRCDIR([unifdef.c])
+AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for libraries.
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT

================================================================
Index: SOURCES/unifdef-codecleanup.diff
diff -u /dev/null SOURCES/unifdef-codecleanup.diff:1.1
--- /dev/null	Wed Jul 12 12:26:31 2006
+++ SOURCES/unifdef-codecleanup.diff	Wed Jul 12 12:26:26 2006
@@ -0,0 +1,206 @@
+--- unifdef.c
++++ unifdef.c
+@@ -35,13 +35,13 @@
+  */
+ 
+ #ifndef lint
+-static char copyright[] =
++static char __attribute__((used)) copyright[] =
+ "@(#) Copyright (c) 1985, 1993\n\
+ 	The Regents of the University of California.  All rights reserved.\n";
+ #endif /* not lint */
+ 
+ #ifndef lint
+-static char sccsid[] = "@(#)unifdef.c	8.1 (Berkeley) 6/6/93";
++static char __attribute__((used))  sccsid[] = "@(#)unifdef.c	8.1 (Berkeley) 6/6/93";
+ #endif /* not lint */
+ 
+ /*
+@@ -59,6 +59,8 @@
+ 
+ #include <stdio.h>
+ #include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+ #define BSS
+ FILE *input;
+@@ -93,12 +95,20 @@
+ char inquote BSS;           /* inside single or double quotes */
+ 
+ int exitstat BSS;
+-char *skipcomment ();
+-char *skipquote ();
++char *skipcomment (char *cp);
++char *skipquote (char *cp, int type);
+ 
+-main (argc, argv)
+-int argc;
+-char **argv;
++int findsym (char *str);
++void prname (void);
++int error (int err, int line, int depth);
++int getlin (char *line, int maxline, FILE *inp, int expandtabs);
++void flushline (Bool keep);
++void pfile (void);
++
++
++
++
++int main (int argc, char *argv[])
+ {
+     char **curarg;
+     register char *cp;
+@@ -190,9 +200,11 @@
+ #define LT_ELSE        5   /* #else */
+ #define LT_ENDIF       6   /* #endif */
+ #define LT_LEOF        7   /* end of file */
+-extern Linetype checkline ();
++Linetype checkline (int *cursym);
+ 
+ typedef int Reject_level;
++int doif (int thissym, int inif, Reject_level prevreject, int depth);
++
+ Reject_level reject BSS;    /* 0 or 1: pass thru; 1 or 2: ignore comments */
+ #define REJ_NO          0
+ #define REJ_IGNORE      1
+@@ -224,7 +236,7 @@
+ #define IN_IF   1
+ #define IN_ELSE 2
+ 
+-pfile ()
++void pfile (void)
+ {
+     reject = REJ_NO;
+     (void) doif (-1, IN_NONE, reject, 0);
+@@ -232,11 +244,10 @@
+ }
+ 
+ int
+-doif (thissym, inif, prevreject, depth)
+-register int thissym;   /* index of the symbol who was last ifdef'ed */
+-int inif;               /* YES or NO we are inside an ifdef */
+-Reject_level prevreject;/* previous value of reject */
+-int depth;              /* depth of ifdef's */
++doif (int thissym,		/* index of the symbol who was last ifdef'ed */
++      int inif,			/* YES or NO we are inside an ifdef */
++      Reject_level prevreject,	/* previous value of reject */
++      int depth)		/* depth of ifdef's */
+ {
+     register Linetype lineval;
+     register Reject_level thisreject;
+@@ -340,8 +351,7 @@
+ char tline[MAXLINE] BSS;
+ 
+ Linetype
+-checkline (cursym)
+-int *cursym;    /* if LT_TRUE or LT_FALSE returned, set this to sym index */
++checkline (int *cursym)    /* if LT_TRUE or LT_FALSE returned, set this to sym index */
+ {
+     register char *cp;
+     register char *symp;
+@@ -424,10 +434,9 @@
+  *  position that is not whitespace.
+  */
+ char *
+-skipcomment (cp)
+-register char *cp;
++skipcomment (char *cp)
+ {
+-    if (incomment)
++    if (!incomment)
+ 	goto inside;
+     for (;; cp++) {
+ 	while (*cp == ' ' || *cp == '\t')
+@@ -444,7 +453,8 @@
+ 	    stqcline = linenum;
+ 	}
+ 	cp += 2;
+- inside:
++
++inside:
+ 	for (;;) {
+ 	    for (; *cp != '*'; cp++)
+ 		if (*cp == '\0')
+@@ -466,9 +476,7 @@
+  *  position that is not whitespace.
+  */
+ char *
+-skipquote (cp, type)
+-register char *cp;
+-register int type;
++skipquote (char *cp, int type)
+ {
+     register char qchar;
+ 
+@@ -487,7 +495,7 @@
+ 	    if (*cp == qchar)
+ 		break;
+ 	    if (   *cp == '\0'
+-		|| *cp == '\\' && *++cp == '\0'
++		|| (*cp == '\\' && *++cp == '\0')
+ 	       )
+ 		return cp;
+ 	}
+@@ -501,8 +509,7 @@
+  *            else return -1.
+  */
+ int
+-findsym (str)
+-char *str;
++findsym (char *str)
+ {
+     register char *cp;
+     register char *symp;
+@@ -529,11 +536,7 @@
+  *            and (if compiled in) treats form-feed as an end-of-line
+  */
+ int
+-getlin (line, maxline, inp, expandtabs)
+-register char *line;
+-int maxline;
+-FILE *inp;
+-int expandtabs;
++getlin (char *line, int maxline, FILE *inp, int expandtabs)
+ {
+     int tmp;
+     register int num;
+@@ -600,32 +603,30 @@
+     return num;
+ }
+ 
+-flushline (keep)
+-Bool keep;
++void flushline (Bool keep)
+ {
+     if ((keep && reject != REJ_YES) ^ complement) {
+ 	register char *line = tline;
+ 	register FILE *out = stdout;
+ 	register char chr;
+ 
+-	while (chr = *line++)
++	while ((chr = *line++))
+ 	    putc (chr, out);
+     } else if (lnblank)
+ 	putc ('\n', stdout);
+     return;
+ }
+ 
+-prname ()
++void prname (void)
+ {
+     fprintf (stderr, "%s: ", progname);
+     return;
+ }
+ 
+ int
+-error (err, line, depth)
+-int err;        /* type of error & index into error string array */
+-int line;       /* line number */
+-int depth;      /* how many ifdefs we are inside */
++error (int err,		/* type of error & index into error string array */
++       int line,	/* line number */
++       int depth)	/* how many ifdefs we are inside */
+ {
+     if (err == END_ERR)
+ 	return err;
================================================================


More information about the pld-cvs-commit mailing list