OSDN Git Service

fixup prototype warnings
authorMike Frysinger <vapier@gentoo.org>
Mon, 29 Jan 2007 02:56:45 +0000 (02:56 -0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 29 Jan 2007 02:56:45 +0000 (02:56 -0000)
23 files changed:
test/Test.mak
test/dlopen/libtest.c
test/dlopen/libtest1.c
test/dlopen/libtest2.c
test/inet/if_nameindex.c
test/misc/bug-glob2.c
test/misc/stdarg.c
test/pthread/ex1.c
test/pthread/ex2.c
test/pthread/ex4.c
test/pthread/ex5.c
test/pthread/ex6.c
test/pthread/ex7.c
test/setjmp/tst-vfork-longjmp.c
test/signal/sigchld.c
test/signal/signal.c
test/signal/tst-raise.c
test/stat/memcmp-stat.c
test/stat/stat.c
test/stdlib/qsort.c
test/unistd/clone.c
test/unistd/errno.c
test/unistd/fork.c

index f3c6147..a5bc968 100644 (file)
@@ -36,6 +36,7 @@ endif
 CLEAN_TARGETS := $(U_TARGETS) $(G_TARGETS)
 
 test check all: $(TARGETS)
+       @true
 
 $(TARGETS): Makefile $(TESTDIR)Makefile $(TESTDIR)Rules.mak $(TESTDIR)Test.mak
 $(U_TARGETS): $(patsubst %,%.c,$(U_TARGETS))
index e37f779..a306e4b 100644 (file)
@@ -4,6 +4,7 @@
 
 extern int __pthread_once(void);
 
+void dltest(uint32_t **value1, uint32_t **value2);
 void dltest(uint32_t **value1, uint32_t **value2)
 {
        *value1 = (uint32_t *) __pthread_once;
index f0dc9f5..a2f7dcd 100644 (file)
@@ -2,28 +2,31 @@
 
 extern int libtest2_func(const char *s);
 
-
-void __attribute__((constructor)) libtest1_ctor(void)
+void __attribute__((constructor)) libtest1_ctor(void);
+void libtest1_ctor(void)
 {
     printf("libtest1: constructor!\n");
 }
 
-void __attribute__((destructor)) libtest1_dtor(void)
+void __attribute__((destructor)) libtest1_dtor(void);
+void libtest1_dtor(void)
 {
     printf("libtest1: destructor!\n");
 }
 
-void __attribute__((weak)) function1(void)
+void __attribute__((weak)) function1(void);
+void function1(void)
 {
     printf("libtest1: I am weak function1!\n");
 }
 
+void function2(void);
 void function2(void)
 {
     printf("libtest1: I am function2!\n");
 }
 
-
+int dltest(const char *s);
 int dltest(const char *s)
 {
     printf( "libtest1: function1 = %p\n"
index 529f8bb..5261506 100644 (file)
@@ -1,27 +1,32 @@
 #include <stdio.h>
 #include <pthread.h>
 
-void __attribute__((constructor)) libtest2_ctor(void)
+void __attribute__((constructor)) libtest2_ctor(void);
+void libtest2_ctor(void)
 {
     printf("libtest2: constructor!\n");
 }
 
-void __attribute__((destructor)) libtest2_dtor(void)
+void __attribute__((destructor)) libtest2_dtor(void);
+void libtest2_dtor(void)
 {
     printf("libtest2: destructor!\n");
 }
 
+void function1(void);
 void function1(void)
 {
     printf("libtest2: I am function1!\n");
 }
 
-void __attribute__((weak)) function2(void)
+void __attribute__((weak)) function2(void);
+void function2(void)
 {
     printf("libtest2: I am weak function2!\n");
 }
 
 
+int libtest2_func(const char *s);
 int libtest2_func(const char *s)
 {
     printf( "libtest2: function1 = %p\n"
index 069d96d..126c5ba 100644 (file)
@@ -11,7 +11,7 @@
 
 static char ifname[IF_NAMESIZE];
 
-void test_if_nameindex(void)
+static void test_if_nameindex(void)
 {
        size_t i;
        struct if_nameindex *ret;
@@ -30,7 +30,7 @@ void test_if_nameindex(void)
        if_freenameindex(ret);
 }
 
-void test_if_indextoname(void)
+static void test_if_indextoname(void)
 {
        if (if_indextoname(1, ifname) == NULL) {
                perror("if_nameindex()");
@@ -40,7 +40,7 @@ void test_if_indextoname(void)
        printf("if_indextoname(1) = %s\n", ifname);
 }
 
-void test_if_nametoindex(void)
+static void test_if_nametoindex(void)
 {
        int ifindex = if_nametoindex(ifname);
 
index 424ff4f..9e8be98 100644 (file)
@@ -264,7 +264,7 @@ init_glob_altdirfuncs (glob_t *pglob)
 }
 
 
-int
+static int
 do_test (void)
 {
   glob_t gl;
@@ -295,7 +295,7 @@ do_test (void)
   return 0;
 }
 #else
-int do_test (void) { return 0; }
+static int do_test (void) { return 0; }
 #endif
 
 #define TEST_FUNCTION do_test ()
index 561fd2c..1566e0c 100644 (file)
@@ -5,7 +5,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <stdarg.h>
-int foo(const char *format, ...)
+static int foo(const char *format, ...)
 {
        va_list ap;
        size_t len;
index a1b24c3..4d9de03 100644 (file)
@@ -7,7 +7,7 @@
 #include <unistd.h>
 #include "pthread.h"
 
-void *process(void * arg)
+static void *process(void * arg)
 {
        int i;
        printf("Starting process %s\n", (char *)arg);
index 70cb6b3..98bd4b3 100644 (file)
@@ -20,7 +20,7 @@ struct prodcons {
 
 /* Initialize a buffer */
 
-void init(struct prodcons * b)
+static void init(struct prodcons * b)
 {
   pthread_mutex_init(&b->lock, NULL);
   pthread_cond_init(&b->notempty, NULL);
@@ -31,7 +31,7 @@ void init(struct prodcons * b)
 
 /* Store an integer in the buffer */
 
-void put(struct prodcons * b, int data)
+static void put(struct prodcons * b, int data)
 {
   pthread_mutex_lock(&b->lock);
   /* Wait until buffer is not full */
@@ -50,7 +50,7 @@ void put(struct prodcons * b, int data)
 
 /* Read and remove an integer from the buffer */
 
-int get(struct prodcons * b)
+static int get(struct prodcons * b)
 {
   int data;
   pthread_mutex_lock(&b->lock);
@@ -75,7 +75,7 @@ int get(struct prodcons * b)
 
 struct prodcons buffer;
 
-void * producer(void * data)
+static void * producer(void * data)
 {
   int n;
   for (n = 0; n < 10000; n++) {
@@ -86,7 +86,7 @@ void * producer(void * data)
   return NULL;
 }
 
-void * consumer(void * data)
+static void * consumer(void * data)
 {
   int d;
   while (1) {
index 11a09f0..cf4cf1d 100644 (file)
@@ -14,7 +14,7 @@
 
 #if 0
 
-char * str_accumulate(char * s)
+static char * str_accumulate(char * s)
 {
   static char accu[1024] = { 0 };
   strcat(accu, s);
@@ -40,7 +40,7 @@ static void str_alloc_destroy_accu(void * accu);
 
 /* Thread-safe version of str_accumulate */
 
-char * str_accumulate(const char * s)
+static char * str_accumulate(const char * s)
 {
   char * accu;
 
@@ -81,7 +81,7 @@ static void str_alloc_destroy_accu(void * accu)
 
 /* Test program */
 
-void * process(void * arg)
+static void * process(void * arg)
 {
   char * res;
   res = str_accumulate("Result of ");
index 475de0e..7a293eb 100644 (file)
@@ -19,7 +19,7 @@ struct prodcons {
 
 /* Initialize a buffer */
 
-void init(struct prodcons * b)
+static void init(struct prodcons * b)
 {
   sem_init(&b->sem_write, 0, BUFFER_SIZE - 1);
   sem_init(&b->sem_read, 0, 0);
@@ -29,7 +29,7 @@ void init(struct prodcons * b)
 
 /* Store an integer in the buffer */
 
-void put(struct prodcons * b, int data)
+static void put(struct prodcons * b, int data)
 {
   /* Wait until buffer is not full */
   sem_wait(&b->sem_write);
@@ -43,7 +43,7 @@ void put(struct prodcons * b, int data)
 
 /* Read and remove an integer from the buffer */
 
-int get(struct prodcons * b)
+static int get(struct prodcons * b)
 {
   int data;
   /* Wait until buffer is not empty */
@@ -64,7 +64,7 @@ int get(struct prodcons * b)
 
 struct prodcons buffer;
 
-void * producer(void * data)
+static void * producer(void * data)
 {
   int n;
   for (n = 0; n < 10000; n++) {
@@ -75,7 +75,7 @@ void * producer(void * data)
   return NULL;
 }
 
-void * consumer(void * data)
+static void * consumer(void * data)
 {
   int d;
   while (1) {
index 15914ce..bb96ca5 100644 (file)
@@ -4,7 +4,7 @@
 #include <pthread.h>
 #include <unistd.h>
 
-void *
+static void *
 test_thread (void *v_param)
 {
   return NULL;
index bda2ca9..93fc34a 100644 (file)
@@ -22,7 +22,7 @@ typedef struct {
 event_t main_event;
 
 
-void *
+static void *
 test_thread (void *ms_param)
 {
     unsigned long status = 0;
index c64e805..2784424 100644 (file)
@@ -16,7 +16,7 @@
 
 int verbose = 0;
 
-int execute_child(const char *prog)
+static int execute_child(const char *prog)
 {
        int status;
        pid_t child;
@@ -33,7 +33,7 @@ int execute_child(const char *prog)
 
 sigset_t orig_mask;
 
-int check_sig_mask(void)
+static int check_sig_mask(void)
 {
        int status;
        pid_t child;
index 60ddf4b..d531654 100644 (file)
@@ -7,16 +7,15 @@
 #include <unistd.h>
 
 
-void test_handler(int signo) 
+#ifdef __ARCH_USE_MMU__
+
+static void test_handler(int signo)
 {
     write(1, "caught SIGCHLD\n", 15);
     return;
 }
 
-
-#ifdef __ARCH_USE_MMU__
-
-int main(void) 
+int main(void)
 {
     pid_t mypid;
     struct sigaction siga;
@@ -31,7 +30,6 @@ int main(void)
        fprintf(stderr, "sigaction choked: %s!", strerror(errno));
        exit(EXIT_FAILURE);
     }
-    
 
     /* Setup a child process to exercise the sig handling for us */
     mypid = getpid();
@@ -52,7 +50,7 @@ int main(void)
        sleep(10);
        if (waitpid(-1, NULL, WNOHANG | WUNTRACED) > 0)
            break;
-       write(1, "after sleep\n", 12); 
+       write(1, "after sleep\n", 12);
     }
 
     printf("Bye-bye!  All done!\n");
index 6e6f04a..01d1a78 100644 (file)
@@ -24,7 +24,7 @@
 const char *it = "<UNSET>";            /* Routine name for message routines. */
 size_t errors = 0;
 
-void check(int thing, int number)
+static void check(int thing, int number)
 {
        if (!thing) {
                printf("%s: flunked test %d\n", it, number);
@@ -32,10 +32,12 @@ void check(int thing, int number)
        }
 }
 
-void equal(const char *a, const char *b, int number)
+#if 0
+static void equal(const char *a, const char *b, int number)
 {
        check(a != NULL && b != NULL && (strcmp(a, b) == 0), number);
 }
+#endif
 
 
 /* -------------------------------------------------*/
@@ -44,14 +46,14 @@ void equal(const char *a, const char *b, int number)
 
 int global_int = 0;
 
-void set_global_int_to_one(int signum)
+static void set_global_int_to_one(int signum)
 {
        printf ("Received signal %d (%s).\n", signum, strsignal(signum));
        global_int = 1;
        return;
 }
 
-void signal_test_1(void)
+static void signal_test_1(void)
 {
        global_int = 0;
 
index 9e8e472..d24c316 100644 (file)
@@ -26,7 +26,7 @@
 
 volatile int count;
 
-void
+static void
 sh (int sig)
 {
   ++count;
index 3e0143e..c38e3ff 100644 (file)
@@ -18,7 +18,7 @@
 #include <assert.h>
 #include <time.h>
 
-void show_stat(struct stat *st)
+static void show_stat(struct stat *st)
 {
        printf(
                "------------------\n"
@@ -66,7 +66,7 @@ void show_stat(struct stat *st)
        );
 }
 
-int main()
+int main(void)
 {
        int ret;
        int fd;
index c9e063f..4980cdd 100644 (file)
@@ -5,7 +5,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-void print_struct_stat(char *msg, struct stat *s)
+static void print_struct_stat(char *msg, struct stat *s)
 {
     printf("%s\n", msg);
     /* The casts are because glibc thinks it's cool */
index 9e706c7..abc505e 100644 (file)
@@ -3,45 +3,43 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-int select_files(const struct dirent *dirbuf)
+static int select_files(const struct dirent *dirbuf)
 {
-    if (dirbuf->d_name[0] == '.')
-       return 0;
-    else         
-       return 1;
+       if (dirbuf->d_name[0] == '.')
+               return 0;
+       else
+               return 1;
 }
 
-
 int main(void)
 {
-    struct dirent **array;
-    struct dirent *dirbuf;
+       struct dirent **array;
+       struct dirent *dirbuf;
 
-    int i, numdir;        
+       int i, numdir;
 
-    chdir("/");
-    numdir = scandir(".", &array, select_files, NULL);
-    printf("\nGot %d entries from scandir().\n", numdir);              
-    for (i = 0; i < numdir; ++i) {      
-       dirbuf = array[i];
-       printf("[%d] %s\n", i, dirbuf->d_name);
-       free(array[i]);
-    }                  
-    free(array);
-    numdir = scandir(".", &array, select_files, alphasort);
-    printf("\nGot %d entries from scandir() using alphasort().\n", numdir);                   
-    for (i = 0; i < numdir; ++i) {      
-       dirbuf = array[i];
-       printf("[%d] %s\n", i, dirbuf->d_name);
-    }                                          
-    printf("\nCalling qsort()\n");                   
-    qsort(array, numdir, sizeof(struct dirent *), alphasort);
-    for (i = 0; i < numdir; ++i) {                           
-       dirbuf = array[i];
-       printf("[%d] %s\n", i, dirbuf->d_name);
-       free(array[i]);
-    }
-    free(array);
-    return(0);
+       chdir("/");
+       numdir = scandir(".", &array, select_files, NULL);
+       printf("\nGot %d entries from scandir().\n", numdir);
+       for (i = 0; i < numdir; ++i) {
+               dirbuf = array[i];
+               printf("[%d] %s\n", i, dirbuf->d_name);
+               free(array[i]);
+       }
+       free(array);
+       numdir = scandir(".", &array, select_files, alphasort);
+       printf("\nGot %d entries from scandir() using alphasort().\n", numdir);
+       for (i = 0; i < numdir; ++i) {
+               dirbuf = array[i];
+               printf("[%d] %s\n", i, dirbuf->d_name);
+       }
+       printf("\nCalling qsort()\n");
+       qsort(array, numdir, sizeof(struct dirent *), alphasort);
+       for (i = 0; i < numdir; ++i) {
+               dirbuf = array[i];
+               printf("[%d] %s\n", i, dirbuf->d_name);
+               free(array[i]);
+       }
+       free(array);
+       return (0);
 }
-
index bc08c94..ea7e6ac 100644 (file)
 #define GOT3     (1 << 3)
 #define ALLGOT   (GOT1|GOT2|GOT3)
 
-void child_handler(int sig)
+static void child_handler(int sig)
 {
        printf("I got a SIGCHLD\n");
 }
 
-int clone_main(void *arg)
+static int clone_main(void *arg)
 {
        unsigned long input = (unsigned long)arg;
        int secs = (input / 10) * 4;
index c77f58a..b9e0f52 100644 (file)
@@ -6,7 +6,7 @@
 #include <sched.h>
 #include "clone_cruft.h"
 
-int child_fn(void *arg)
+static int child_fn(void *arg)
 {
        fprintf(stderr, "in child_fn\n");
        exit(1);
index b163c0e..6d132d6 100644 (file)
@@ -18,7 +18,7 @@
 
 #ifdef __ARCH_USE_MMU__
 
-void child_handler(int sig)
+static void child_handler(int sig)
 {
        fprintf(stderr, "I got a SIGCHLD\n");
 }