Skip to content

Commit

Permalink
Removed some kind of pre-C89 hack
Browse files Browse the repository at this point in the history
It #defined _ANSI_ARGS_ which starts with
underscore and capital and is thus reserved.
  • Loading branch information
seanm committed Jul 2, 2015
1 parent 9c7f27f commit 1024c18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
18 changes: 9 additions & 9 deletions libsrc/ParseArgv.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ static ArgvInfo defaultTable[] = {
};

/*
* Forward declarations for procedures defined in this file:
* Forward declarations for functions defined in this file:
*/

static void PrintUsage _ANSI_ARGS_((ArgvInfo *argTable, int flags));
static void PrintVersion(ArgvInfo *argTable);
static void PrintUsage(ArgvInfo *argTable, int flags);
static void PrintVersion(ArgvInfo *argTable);

/*
* ParseLong
Expand Down Expand Up @@ -375,6 +375,11 @@ ParseArgv(argcPtr, argv, argTable, flags)
*
* Generate a help string describing command-line options.
*
* argTable: Array of command-specific argument descriptions.
*
* flags: If the ARGV_NO_DEFAULTS bit is set in this word, then don't
* generate information for default options.
*
* Results:
* Prints on stderr (unless ARGV_NO_PRINT is specified in flags)
* a help string describing all the options in argTable, plus all those
Expand All @@ -388,12 +393,7 @@ ParseArgv(argcPtr, argv, argTable, flags)
*/

static void
PrintUsage(argTable, flags)
ArgvInfo *argTable; /* Array of command-specific argument
* descriptions. */
int flags; /* If the ARGV_NO_DEFAULTS bit is set
* in this word, then don't generate
* information for default options. */
PrintUsage(ArgvInfo *argTable, int flags)
{
ArgvInfo *infoPtr;
size_t width, i, numSpaces;
Expand Down
17 changes: 3 additions & 14 deletions libsrc/ParseArgv.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
#else
#define MNCAPI
#endif
/*
* Definitions that allow this header file to be used either with or
* without ANSI C features like function prototypes.
*/

#undef _ANSI_ARGS_
#if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus)
# define _ANSI_ARGS_(x) x
#else
# define _ANSI_ARGS_(x) ()
#endif

/*
* Structure used to specify how to handle argv options.
Expand Down Expand Up @@ -89,10 +78,10 @@ typedef struct {
extern "C" {
#endif

int MNCAPI ParseArgv _ANSI_ARGS_((int *argcPtr, char **argv,
ArgvInfo *argTable, int flags));
int MNCAPI ParseArgv(int *argcPtr, char **argv,
ArgvInfo *argTable, int flags);

long int MNCAPI ParseLong _ANSI_ARGS_((const char *argPtr, char **endPtr));
long int MNCAPI ParseLong(const char *argPtr, char **endPtr);

#if defined(__cplusplus)
}
Expand Down

0 comments on commit 1024c18

Please sign in to comment.