]> Git Repo - binutils.git/blobdiff - libiberty/argv.c
merge from gcc
[binutils.git] / libiberty / argv.c
index 4205579a576530089f432ca737e4fb10b43e85cb..ad4c9a79388aef37350af5a96b7366c0a7771e0e 100644 (file)
@@ -29,26 +29,10 @@ Boston, MA 02111-1307, USA.  */
 
 /*  Routines imported from standard C runtime libraries. */
 
-#ifdef __STDC__
-
 #include <stddef.h>
 #include <string.h>
 #include <stdlib.h>
 
-#else  /* !__STDC__ */
-
-#if !defined _WIN32 || defined __GNUC__
-extern char *memcpy ();                /* Copy memory region */
-extern int strlen ();          /* Count length of string */
-extern char *malloc ();                /* Standard memory allocater */
-extern char *realloc ();       /* Standard memory reallocator */
-extern void free ();           /* Free malloc'd memory */
-extern char *strdup ();                /* Duplicate a string */
-#endif
-
-#endif /* __STDC__ */
-
-
 #ifndef NULL
 #define NULL 0
 #endif
@@ -75,8 +59,7 @@ argument vector.
 */
 
 char **
-dupargv (argv)
-     char **argv;
+dupargv (char **argv)
 {
   int argc;
   char **copy;
@@ -94,7 +77,7 @@ dupargv (argv)
   for (argc = 0; argv[argc] != NULL; argc++)
     {
       int len = strlen (argv[argc]);
-      copy[argc] = malloc (sizeof (char *) * (len + 1));
+      copy[argc] = (char *) malloc (len + 1);
       if (copy[argc] == NULL)
        {
          freeargv (copy);
@@ -119,8 +102,7 @@ itself.
 
 */
 
-void freeargv (vector)
-char **vector;
+void freeargv (char **vector)
 {
   register char **scan;
 
@@ -174,8 +156,7 @@ returned, as appropriate.
 
 */
 
-char **buildargv (input)
-     const char *input;
+char **buildargv (const char *input)
 {
   char *arg;
   char *copybuf;
@@ -325,7 +306,8 @@ static const char *const tests[] =
   NULL
 };
 
-int main ()
+int
+main (void)
 {
   char **argv;
   const char *const *test;
This page took 0.024115 seconds and 4 git commands to generate.