svn commit: trunk/uClibc/test: dlopen inet misc pthread setjmp signal etc...

vapier at uclibc.org vapier at uclibc.org
Mon Jan 29 02:56:46 UTC 2007


Author: vapier
Date: 2007-01-28 18:56:45 -0800 (Sun, 28 Jan 2007)
New Revision: 17615

Log:
fixup prototype warnings

Modified:
   trunk/uClibc/test/Test.mak
   trunk/uClibc/test/dlopen/libtest.c
   trunk/uClibc/test/dlopen/libtest1.c
   trunk/uClibc/test/dlopen/libtest2.c
   trunk/uClibc/test/inet/if_nameindex.c
   trunk/uClibc/test/misc/bug-glob2.c
   trunk/uClibc/test/misc/stdarg.c
   trunk/uClibc/test/pthread/ex1.c
   trunk/uClibc/test/pthread/ex2.c
   trunk/uClibc/test/pthread/ex4.c
   trunk/uClibc/test/pthread/ex5.c
   trunk/uClibc/test/pthread/ex6.c
   trunk/uClibc/test/pthread/ex7.c
   trunk/uClibc/test/setjmp/tst-vfork-longjmp.c
   trunk/uClibc/test/signal/sigchld.c
   trunk/uClibc/test/signal/signal.c
   trunk/uClibc/test/signal/tst-raise.c
   trunk/uClibc/test/stat/
   trunk/uClibc/test/stat/memcmp-stat.c
   trunk/uClibc/test/stat/stat.c
   trunk/uClibc/test/stdlib/qsort.c
   trunk/uClibc/test/unistd/clone.c
   trunk/uClibc/test/unistd/errno.c
   trunk/uClibc/test/unistd/fork.c


Changeset:
Modified: trunk/uClibc/test/Test.mak
===================================================================
--- trunk/uClibc/test/Test.mak	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/Test.mak	2007-01-29 02:56:45 UTC (rev 17615)
@@ -36,6 +36,7 @@
 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))

Modified: trunk/uClibc/test/dlopen/libtest.c
===================================================================
--- trunk/uClibc/test/dlopen/libtest.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/dlopen/libtest.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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;

Modified: trunk/uClibc/test/dlopen/libtest1.c
===================================================================
--- trunk/uClibc/test/dlopen/libtest1.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/dlopen/libtest1.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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"

Modified: trunk/uClibc/test/dlopen/libtest2.c
===================================================================
--- trunk/uClibc/test/dlopen/libtest2.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/dlopen/libtest2.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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"

Modified: trunk/uClibc/test/inet/if_nameindex.c
===================================================================
--- trunk/uClibc/test/inet/if_nameindex.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/inet/if_nameindex.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 @@
 	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 @@
 	printf("if_indextoname(1) = %s\n", ifname);
 }
 
-void test_if_nametoindex(void)
+static void test_if_nametoindex(void)
 {
 	int ifindex = if_nametoindex(ifname);
 

Modified: trunk/uClibc/test/misc/bug-glob2.c
===================================================================
--- trunk/uClibc/test/misc/bug-glob2.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/misc/bug-glob2.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -264,7 +264,7 @@
 }
 
 
-int
+static int
 do_test (void)
 {
   glob_t gl;
@@ -295,7 +295,7 @@
   return 0;
 }
 #else
-int do_test (void) { return 0; }
+static int do_test (void) { return 0; }
 #endif
 
 #define TEST_FUNCTION do_test ()

Modified: trunk/uClibc/test/misc/stdarg.c
===================================================================
--- trunk/uClibc/test/misc/stdarg.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/misc/stdarg.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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;

Modified: trunk/uClibc/test/pthread/ex1.c
===================================================================
--- trunk/uClibc/test/pthread/ex1.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/pthread/ex1.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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);

Modified: trunk/uClibc/test/pthread/ex2.c
===================================================================
--- trunk/uClibc/test/pthread/ex2.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/pthread/ex2.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -20,7 +20,7 @@
 
 /* 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 @@
 
 /* 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 @@
 
 /* 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 @@
 
 struct prodcons buffer;
 
-void * producer(void * data)
+static void * producer(void * data)
 {
   int n;
   for (n = 0; n < 10000; n++) {
@@ -86,7 +86,7 @@
   return NULL;
 }
 
-void * consumer(void * data)
+static void * consumer(void * data)
 {
   int d;
   while (1) {

Modified: trunk/uClibc/test/pthread/ex4.c
===================================================================
--- trunk/uClibc/test/pthread/ex4.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/pthread/ex4.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 @@
 
 /* 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 @@
 
 /* Test program */
 
-void * process(void * arg)
+static void * process(void * arg)
 {
   char * res;
   res = str_accumulate("Result of ");

Modified: trunk/uClibc/test/pthread/ex5.c
===================================================================
--- trunk/uClibc/test/pthread/ex5.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/pthread/ex5.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -19,7 +19,7 @@
 
 /* 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 @@
 
 /* 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 @@
 
 /* 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 @@
 
 struct prodcons buffer;
 
-void * producer(void * data)
+static void * producer(void * data)
 {
   int n;
   for (n = 0; n < 10000; n++) {
@@ -75,7 +75,7 @@
   return NULL;
 }
 
-void * consumer(void * data)
+static void * consumer(void * data)
 {
   int d;
   while (1) {

Modified: trunk/uClibc/test/pthread/ex6.c
===================================================================
--- trunk/uClibc/test/pthread/ex6.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/pthread/ex6.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -4,7 +4,7 @@
 #include <pthread.h>
 #include <unistd.h>
 
-void *
+static void *
 test_thread (void *v_param)
 {
   return NULL;

Modified: trunk/uClibc/test/pthread/ex7.c
===================================================================
--- trunk/uClibc/test/pthread/ex7.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/pthread/ex7.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -22,7 +22,7 @@
 event_t main_event;
 
 
-void *
+static void *
 test_thread (void *ms_param)
 {
     unsigned long status = 0;

Modified: trunk/uClibc/test/setjmp/tst-vfork-longjmp.c
===================================================================
--- trunk/uClibc/test/setjmp/tst-vfork-longjmp.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/setjmp/tst-vfork-longjmp.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 @@
 
 sigset_t orig_mask;
 
-int check_sig_mask(void)
+static int check_sig_mask(void)
 {
 	int status;
 	pid_t child;

Modified: trunk/uClibc/test/signal/sigchld.c
===================================================================
--- trunk/uClibc/test/signal/sigchld.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/signal/sigchld.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 @@
 	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 @@
 	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");

Modified: trunk/uClibc/test/signal/signal.c
===================================================================
--- trunk/uClibc/test/signal/signal.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/signal/signal.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 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 @@
 
 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;
 

Modified: trunk/uClibc/test/signal/tst-raise.c
===================================================================
--- trunk/uClibc/test/signal/tst-raise.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/signal/tst-raise.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -26,7 +26,7 @@
 
 volatile int count;
 
-void
+static void
 sh (int sig)
 {
   ++count;


Property changes on: trunk/uClibc/test/stat
___________________________________________________________________
Name: svn:ignore
   - stat
stat64
*_glibc
*.gdb
*.out

   + memcmp-stat
stat
stat64
*_glibc
*.gdb
*.out


Modified: trunk/uClibc/test/stat/memcmp-stat.c
===================================================================
--- trunk/uClibc/test/stat/memcmp-stat.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/stat/memcmp-stat.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 @@
 	);
 }
 
-int main()
+int main(void)
 {
 	int ret;
 	int fd;

Modified: trunk/uClibc/test/stat/stat.c
===================================================================
--- trunk/uClibc/test/stat/stat.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/stat/stat.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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 */

Modified: trunk/uClibc/test/stdlib/qsort.c
===================================================================
--- trunk/uClibc/test/stdlib/qsort.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/stdlib/qsort.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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);
 }
-

Modified: trunk/uClibc/test/unistd/clone.c
===================================================================
--- trunk/uClibc/test/unistd/clone.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/unistd/clone.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -19,12 +19,12 @@
 #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;

Modified: trunk/uClibc/test/unistd/errno.c
===================================================================
--- trunk/uClibc/test/unistd/errno.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/unistd/errno.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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);

Modified: trunk/uClibc/test/unistd/fork.c
===================================================================
--- trunk/uClibc/test/unistd/fork.c	2007-01-29 02:34:01 UTC (rev 17614)
+++ trunk/uClibc/test/unistd/fork.c	2007-01-29 02:56:45 UTC (rev 17615)
@@ -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");
 }




More information about the uClibc-cvs mailing list