Fix a bunch of warnings (mainly old-style-definition)
cover Fix a bunch of warnings (mainly old-style-definition)
Hi,
I was able to find the time to fix a bunch of the warnings when building LTP. With a fex exceptions, this was fixig function definitions, like changing int foo() to int foo(void) or changing old K&R-style to what you would expect. None of the changes was bigger than that. I did one patch per file, and each of them was individually build-tested.
Michael
Michael Moese (19):
fix warning on old style function definition
fix default int in function definition
fix old style definition in nfs_lock.c
fix old style definition in mc_gethost.c
remove duplicate const in mremap05.c
fix old style definition in pidns06.c
fix old style function definition in memcg_process_stress.c fix two old style function definitions in mem_process.c fix old-style-definition in vfork.c
fix old style function definitions in libcpuset.c fix old style definition in cpuctl_test04.c
fix old style definition in cpuctl_test01.c
fix old style definition and unuses argc/argv in main() in
cpuctl_test02.c
fix unused parameter in tpci.c
fix old style definitions in memctl_test01.c fix old style definitions in cpuctl_def_task04.c fix old style definitions in fsx-linux.c fix old style definition in inode02.c fix old style definition in inode01.c
testcases/kernel/containers/pidns/pidns06.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_def_task04.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_test01.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_test02.c | 6 +- .../kernel/controllers/cpuctl/cpuctl_test04.c | 2 +- .../controllers/cpuset/cpuset_lib/libcpuset.c | 34 +++++------ testcases/kernel/controllers/freezer/vfork.c | 4 +- .../kernel/controllers/memcg/control/mem_process.c | 4 +- .../memcg/stress/memcg_process_stress.c | 2 +- .../kernel/controllers/memctl/memctl_test01.c | 8 ++- .../kernel/device-drivers/pci/tpci_user/tpci.c | 6 +- testcases/kernel/fs/fsx-linux/fsx-linux.c | 10 +--- testcases/kernel/fs/inode/inode01.c | 58 +++++++++---------- testcases/kernel/fs/inode/inode02.c | 67 ++++++++++------------ testcases/kernel/syscalls/mremap/mremap05.c | 2 +- testcases/misc/f00f/f00f.c | 4 +- .../network/multicast/mc_gethost/mc_gethost.c | 4 +- testcases/network/nfs/nfslock01/nfs_flock.c | 4 +- testcases/network/stress/ns-tools/ns-udpserver.c | 2 +- 19 files changed, 103 insertions(+), 120 deletions(-)
Signature · 1 line
2.13.6
PATCH 1/19 fix warning on old style function definition
--- testcases/misc/f00f/f00f.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/misc/f00f/f00f.c +2 -2
@@ -52,7 +52,7 @@ void sigill(int sig)tst_exit (); } -int main () +int main (void ) {signal (SIGILL , sigill);tst_resm (TINFO ,"Testing for proper f00f instruction handling." );
@@ -73,7 +73,7 @@ int main()#else /* __i386__ */ -int main () +int main (void ) {tst_brkm (TCONF ,NULL ,"f00f bug test only for i386" ); }
Signature · 1 line
2.13.6
PATCH 2/19 fix default int in function definition
In reply to Michael Moese--- testcases/network/stress/ns-tools/ns-udpserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/network/stress/ns-tools/ns-udpserver.c +1 -1
@@ -138,7 +138,7 @@ void set_signal_flag(int type)* Return value: * None */ -void respond_to_client (sock_fd ) +void respond_to_client (int sock_fd) {char *msgbuf;/* Pointer to the message */ size_t msgbuf_size;/* size of msgbuf */
Signature · 1 line
2.13.6
PATCH 3/19 fix old style definition in nfs_lock.c
In reply to Michael Moese--- testcases/network/nfs/nfslock01/nfs_flock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
testcases/network/nfs/nfslock01/nfs_flock.c +1 -3
@@ -13,9 +13,7 @@#define BYTES 64#define LINES 16384 -int main (argc, argv) -int argc; -char **argv; +int main (int argc,char **argv) {int i, fd, mac;int offset =0 ;
Signature · 1 line
2.13.6
PATCH 4/19 fix old style definition in mc_gethost.c
In reply to Michael Moese--- testcases/network/multicast/mc_gethost/mc_gethost.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
testcases/network/multicast/mc_gethost/mc_gethost.c +1 -3
@@ -21,9 +21,7 @@#define LOG_PERROR 0#endif -int main (argc, argv) -int argc; -char **argv; +int main (int argc,char **argv) {unsigned char b_addr[IN6ADDRSZ ];struct hostent *host;
Signature · 1 line
2.13.6
PATCH 5/19 remove duplicate const in mremap05.c
In reply to Michael Moese--- testcases/kernel/syscalls/mremap/mremap05.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/mremap/mremap05.c +1 -1
@@ -53,7 +53,7 @@ struct test_case_t {size_t old_size;/* in pages */ size_t new_size;/* in pages */ int flags; -const const char *msg; +const char *msg;void *exp_ret;int exp_errno;char *ret;
Signature · 1 line
2.13.6
PATCH 6/19 fix old style definition in pidns06.c
In reply to Michael Moese--- testcases/kernel/containers/pidns/pidns06.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/containers/pidns/pidns06.c +1 -1
@@ -112,7 +112,7 @@ static void setup(void)check_newpid (); } -int main () +int main (void ) {int status;
Signature · 1 line
2.13.6
PATCH 7/19 fix old style function definition in memcg_process_stress.c
In reply to Michael Moese--- testcases/kernel/controllers/memcg/stress/memcg_process_stress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/memcg/stress/memcg_process_stress.c +1 -1
@@ -37,7 +37,7 @@ unsigned long memsize;char **pages;int nr_page; -void touch_memory () +void touch_memory (void ) {int i;
Signature · 1 line
2.13.6
PATCH 8/19 fix two old style function definitions in mem_process.c
In reply to Michael Moese--- testcases/kernel/controllers/memcg/control/mem_process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/controllers/memcg/control/mem_process.c +2 -2
@@ -81,7 +81,7 @@ void touch_memory(char *p) p[i] =0xef ; } -void mem_map () +void mem_map (void ) {static char *p;
@@ -101,7 +101,7 @@ void mem_map()/* * done: retrieve instructions from the named pipe */ -char action () +char action (void ) {char ch;int fd;
Signature · 1 line
2.13.6
PATCH 9/19 fix old-style-definition in vfork.c
In reply to Michael Moese--- testcases/kernel/controllers/freezer/vfork.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/controllers/freezer/vfork.c +2 -2
@@ -88,7 +88,7 @@ void kill_child(void) } -void child_cleanup () +void child_cleanup (void ) {close (psync[0 ]);tst_exit ();
@@ -129,7 +129,7 @@ void sleepy_time(void) }while (1 ); } -void usage () +void usage (void ) {tst_resm (TBROK ,"usage: %s [-f [FILE]] [-s [NUM]] [-p] [NUM]\n\n" "\t-f FILE\t\tFile to output trace data to.\n"
Signature · 1 line
2.13.6
PATCH 10/19 fix old style function definitions in libcpuset.c
In reply to Michael Moese--- .../controllers/cpuset/cpuset_lib/libcpuset.c | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-)
testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c +17 -17
@@ -231,7 +231,7 @@ static enum { check_ok } check_state = check_notdone; -static int check () +static int check (void ) {if (check_state == check_notdone) {struct stat statbuf;
@@ -576,7 +576,7 @@ static int s2nbits(const char *s)return strlen (s) *32 /9 ; } -static void update_mask_sizes () +static void update_mask_sizes (void ) {FILE *fp =NULL ;char *buf =NULL ;
@@ -609,7 +609,7 @@ done: }/* Allocate a new struct cpuset */ -struct cpuset *cpuset_alloc () +struct cpuset *cpuset_alloc (void ) {struct cpuset *cp =NULL ;int nbits;
@@ -648,7 +648,7 @@ void cpuset_free(struct cpuset *cp) }/* Number of bits in a CPU bitmask on current system */ -int cpuset_cpus_nbits () +int cpuset_cpus_nbits (void ) {if (cpumask_sz ==0 )update_mask_sizes ();
@@ -656,7 +656,7 @@ int cpuset_cpus_nbits() }/* Number of bits in a Memory bitmask on current system */ -int cpuset_mems_nbits () +int cpuset_mems_nbits (void ) {if (nodemask_sz ==0 )update_mask_sizes ();
@@ -1195,7 +1195,7 @@ static struct cpunodemap {* available below /sys/devices/system. */ -static void rebuild_map () +static void rebuild_map (void ) {char buf[PATH_MAX ];DIR *dir1, *dir2;
@@ -1239,7 +1239,7 @@ static void rebuild_map()* Reload the cpunodemap[] array from the file. */ -static void load_map () +static void load_map (void ) {char buf[SMALL_BUFSZ ];/* buffer 1 line of mapfile */ FILE *mapfp;/* File stream on mapfile */
@@ -1274,7 +1274,7 @@ static void load_map()* Write cpunodemap[] out to mapfile. */ -static void store_map () +static void store_map (void ) {char buf[PATH_MAX ];int fd =-1 ;
@@ -1320,7 +1320,7 @@ err:* On error, return -1 with errno set and no lock held. */ -static int get_map () +static int get_map (void ) {time_t file_mtime;
@@ -1349,7 +1349,7 @@ err:return -1 ; } -static void put_map () +static void put_map (void ) {funlockfile (stdin); }
@@ -1513,7 +1513,7 @@ err:return -1 ; } -static void build_distmap () +static void build_distmap (void ) {static int tried_before =0 ;int ncpus =cpuset_cpus_nbits ();
@@ -1627,7 +1627,7 @@ err:free (dists); } -static void build_distmap_sn () +static void build_distmap_sn (void ) {int ncpus =cpuset_cpus_nbits ();int nmems =cpuset_mems_nbits ();
@@ -1840,7 +1840,7 @@ err:* open to close, the first time called. */ -static int get_siblings () +static int get_siblings (void ) {static int siblings;char buf[32 ];/* big enough for one 'siblings' line */
@@ -2230,7 +2230,7 @@ int cpuset_cpusetofpid(struct cpuset *cp, pid_t pid) }/* [optional] Return mountpoint of cpuset filesystem */ -const char *cpuset_mountpoint () +const char *cpuset_mountpoint (void ) {if (check () <0 ) {switch (errno) {
@@ -3683,7 +3683,7 @@ int cpuset_pin(int relcpu) }/* Return number CPUs in current tasks cpuset */ -int cpuset_size () +int cpuset_size (void ) {struct cpuset_placement *plc1 =NULL , *plc2 =NULL ;int r;
@@ -3707,7 +3707,7 @@ int cpuset_size() }/* Return relative CPU number, within current cpuset, last executed on */ -int cpuset_where () +int cpuset_where (void ) {struct cpuset_placement *plc1 =NULL , *plc2 =NULL ;int r;
@@ -3731,7 +3731,7 @@ int cpuset_where() }/* Undo cpuset_pin - let current task have the run of all CPUs in its cpuset */ -int cpuset_unpin () +int cpuset_unpin (void ) {struct bitmask *cpus =NULL , *mems =NULL ;int r =-1 ;
Signature · 1 line
2.13.6
PATCH 11/19 fix old style definition in cpuctl_test04.c
In reply to Michael Moese--- testcases/kernel/controllers/cpuctl/cpuctl_test04.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/cpuctl/cpuctl_test04.c +1 -1
@@ -71,7 +71,7 @@ int TST_TOTAL = 2;pid_t scriptpid;char path[] ="/dev/cpuctl" ; -extern void cleanup () +extern void cleanup (void ) {kill (scriptpid,SIGUSR1 );/* Inform the shell to do cleanup */ tst_exit ();/* Report exit status */
Signature · 1 line
2.13.6
PATCH 12/19 fix old style definition in cpuctl_test01.c
In reply to Michael Moese--- testcases/kernel/controllers/cpuctl/cpuctl_test01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/cpuctl/cpuctl_test01.c +1 -1
@@ -73,7 +73,7 @@ char *TCID = "cpuctl_test01";int TST_TOTAL =1 ;pid_t scriptpid;char path[] ="/dev/cpuctl" ; -extern void cleanup () +extern void cleanup (void ) {kill (scriptpid,SIGUSR1 );/* Inform the shell to do cleanup */ tst_exit ();/* Report exit status */
Signature · 1 line
2.13.6
PATCH 13/19 fix old style definition and unuses argc/argv in main() in cpuctl_test02.c
In reply to Michael Moese--- testcases/kernel/controllers/cpuctl/cpuctl_test02.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
testcases/kernel/controllers/cpuctl/cpuctl_test02.c +3 -3
@@ -71,7 +71,7 @@ int TST_TOTAL = 1;pid_t scriptpid;char path[] ="/dev/cpuctl" ; -extern void cleanup () +extern void cleanup (void ) {kill (scriptpid,SIGUSR1 );/* Inform the shell to do cleanup */ tst_exit ();/* Report exit status */
@@ -80,7 +80,7 @@ extern void cleanup()int migrate_task ();volatile int timer_expired =0 ; -int main (int argc,char *argv[]) +int main (void ) {int test_num;
@@ -272,7 +272,7 @@ with %u(shares) in %lu (s) INTERVAL\n", mygroup_num, task_num, delta_cpu_time, }/* end while */ }/* end main */ -int migrate_task () +int migrate_task (void ) {char target[32 ] ="/dev/cpuctl/group_2/tasks" ;/* Hard coding..Will try dynamic */ pid_t pid =getpid ();
Signature · 1 line
2.13.6
PATCH 14/19 fix unused parameter in tpci.c
In reply to Michael Moese--- testcases/kernel/device-drivers/pci/tpci_user/tpci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
testcases/kernel/device-drivers/pci/tpci_user/tpci.c +3 -3
@@ -47,7 +47,7 @@ static void cleanup(void)tst_module_unload (NULL , module_name); } -void setup (int argc,char *argv[]) +void setup (void ) {tst_require_root ();
@@ -105,9 +105,9 @@ static void test_run(void) } } -int main (int argc,char *argv[]) +int main (void ) { -setup (argc, argv); +setup ();test_run ();
Signature · 1 line
2.13.6
PATCH 15/19 fix old style definitions in memctl_test01.c
In reply to Michael Moese--- testcases/kernel/controllers/memctl/memctl_test01.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
testcases/kernel/controllers/memctl/memctl_test01.c +5 -3
@@ -63,7 +63,7 @@ void signal_handler_sigusr1(int signal);void signal_handler_sigusr2 (int signal);int allocate_memory (void ); -int main (int argc,char *argv[]) +int main (void ) {int ret;char mygroup[FILENAME_MAX ], mytaskfile[FILENAME_MAX ];
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])* Function: cleanup() * signals for system cleanup in case test breaks */ -void cleanup () +void cleanup (void ) {if (kill (scriptpid,SIGUSR1 ) ==-1 )tst_resm (TWARN |TERRNO ,"kill failed" );
@@ -134,6 +134,7 @@ void cleanup()void signal_handler_sigusr1 (int signal) {int i; + (void ) signal;for (i =0 ; i < num_of_chunks; ++i)free (array_of_chunks[i]);free (array_of_chunks);
@@ -148,6 +149,7 @@ void signal_handler_sigusr1(int signal)void signal_handler_sigusr2 (int signal) {int i; + (void ) signal;for (i =0 ; i < num_of_chunks; ++i)free (array_of_chunks[i]);free (array_of_chunks);
@@ -159,7 +161,7 @@ void signal_handler_sigusr2(int signal)allocate_memory (); } -int allocate_memory () +int allocate_memory (void ) {int i, j;/*
Signature · 1 line
2.13.6
PATCH 16/19 fix old style definitions in cpuctl_def_task04.c
In reply to Michael Moese--- testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c +1 -1
@@ -70,7 +70,7 @@ char *TCID = "cpu_controller_test06";int TST_TOTAL =2 ;pid_t scriptpid;char path[] ="/dev/cpuctl" ; -extern void cleanup () +extern void cleanup (void ) {kill (scriptpid,SIGUSR1 );/* Inform the shell to do cleanup */ /* Report exit status */
Signature · 1 line
2.13.6
PATCH 17/19 fix old style definitions in fsx-linux.c
In reply to Michael Moese--- testcases/kernel/fs/fsx-linux/fsx-linux.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
testcases/kernel/fs/fsx-linux/fsx-linux.c +3 -7
@@ -128,10 +128,7 @@ int fsxgoodfd = 0;FILE *fsxlogf =NULL ;int badoff =-1 ; -void vwarnc (code, fmt, ap) -int code; -const char *fmt; -va_list ap; +void vwarnc (int code,const char *fmt,va_list ap) {fprintf (stderr,"fsx: " );if (fmt !=NULL ) {
@@ -913,7 +910,7 @@ void dotruncate(unsigned size) } } -void writefileimage () +void writefileimage (void ) {ssize_t iret;int fd =get_fd ();
@@ -1038,8 +1035,7 @@ void test(void)docloseopen (); } -void cleanup (sig) -int sig; +void cleanup (int sig) {if (sig)prt ("signal %d\n" , sig);
Signature · 1 line
2.13.6
PATCH 18/19 fix old style definition in inode02.c
In reply to Michael Moese--- testcases/kernel/fs/inode/inode02.c | 67 +++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 37 deletions(-)
testcases/kernel/fs/inode/inode02.c +30 -37
@@ -110,9 +110,7 @@ char *TCID = "inode02"; /* Test program identifier. */int TST_TOTAL =1 ;/* Total number of test cases. */ /**************/ -int main (argc, argv) -int argc; -char *argv[]; +int main (int argc,char *argv[]) {int pid,tree (), p, status;int count, child;
@@ -216,8 +214,7 @@ char *argv[];tst_exit (); } -int bd_arg (str) -char *str; +int bd_arg (char *str) { fprintf(temp, "Bad argument - %s - could not parse as number.\n\tinode02 [max_depth] [max_breadth] [file_length] [#children]\n\tdefault: inode02 6 5 8 5\n",
@@ -225,7 +222,7 @@ char *str;exit (1 ); } -int tree () +int tree (void )/************************************************/ /* */
@@ -375,7 +372,7 @@ int tree()exit (exit_val); } -int generate (string ,level ) +int generate (char *string,int level)/****************************************/ /* */
@@ -388,19 +385,19 @@ int generate(string, level)/* reached or an error occurs */ /* */ /****************************************/ -/***************************/ -/* */ -char string[];/* the directory path */ -/* string below which a */ -/* tree is generated */ -/* */ -/***************************/ - -/***************************/ -/* */ -int level;/* the tree depth variable */ -/* */ -/***************************/ +/***************************/ +/* string: */ +/* the directory path */ +/* string below which a */ +/* tree is generated */ +/* */ +/***************************/ + +/***************************/ +/* level: */ +/* the tree depth variable */ +/* */ +/***************************/ {int switch_flag;int ret_val =0 ;
@@ -557,7 +554,7 @@ int level; /* the tree depth variable */return 0 ; } -int check () +int check (void )/****************************************/ /* */
@@ -675,7 +672,7 @@ int check() }/* while */ } -int get_next_name () +int get_next_name (void )/****************************************/ /* */
@@ -712,7 +709,7 @@ int get_next_name()return 0 ; } -int increment_name (position ) +int increment_name (int position)/****************************************/ /* */
@@ -721,7 +718,6 @@ int increment_name(position)/* next name */ /* */ /****************************************/ -int position; {int next_position;
@@ -746,7 +742,7 @@ int increment_name(position)/*********************************/ } -int mode (path_string ) +int mode (char *path_string)/****************************************/ /* */
@@ -754,7 +750,6 @@ int mode(path_string)/* the file named by path_string */ /* */ /****************************************/ -char path_string[]; {struct stat buf;int ret_val, mod;
@@ -768,9 +763,7 @@ int mode(path_string) } } -int escrivez (string) - -char string[]; +int escrivez (char *string) {char write_string[PATH_STRING_LENGTH +1 ];int len, ret_len;
@@ -789,7 +782,7 @@ char string[];return 0 ; } -int term () +int term (void ) {int status;
@@ -814,7 +807,7 @@ int term()return 0 ; } -int massmurder () +int massmurder (void ) {int i;for (i =0 ; i <MAXCHILD ; i++) {
@@ -831,7 +824,7 @@ int massmurder()* * Do set up - here its a dummy function */ -void setup () +void setup (void ) {tst_tmpdir (); temp = stderr;
@@ -842,7 +835,7 @@ void setup()* * Exit on failure */ -void fail_exit () +void fail_exit (void ) {tst_brkm (TFAIL , tst_rmdir,"Test failed\n" ); }
@@ -853,7 +846,7 @@ void fail_exit()* * Description: Exit a test. */ -void anyfail () +void anyfail (void ) { (local_flag ==FAILED ) ?tst_resm (TFAIL ,"Test failed" ) :tst_resm (TPASS ,"Test passed" );
@@ -866,7 +859,7 @@ void anyfail()* * Calling block passed the test */ -void ok_exit () +void ok_exit (void ) { local_flag =PASSED ;return ;
@@ -877,7 +870,7 @@ void ok_exit()* * exit on failure */ -void forkfail () +void forkfail (void ) {tst_brkm (TBROK , tst_rmdir,"Reason: %s\n" ,strerror (errno)); }
@@ -901,7 +894,7 @@ void terror(char *message)* Assume that we are always running under stress, so this function will * return > 0 value always. */ -int instress () +int instress (void ) {tst_resm (TINFO ,"System resource may be too low, fork() malloc()" " etc are likely to fail.\n" );
Signature · 1 line
2.13.6
PATCH 19/19 fix old style definition in inode01.c
In reply to Michael Moese--- testcases/kernel/fs/inode/inode01.c | 58 +++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 31 deletions(-)
testcases/kernel/fs/inode/inode01.c +27 -31
@@ -98,7 +98,7 @@ int list_id;int increment_name (),get_next_name (),mode (),escrivez (); -int main () +int main (void ) {char root[16 ];//as pids can get much longer int gen_ret_val, ch_ret_val, level;
@@ -275,7 +275,7 @@ int main()tst_exit (); } -int generate (string ,level ) +int generate (char *string,int level)/****************************************/ /* */
@@ -288,19 +288,19 @@ int generate(string, level)/* reached or an error occurs */ /* */ /****************************************/ -/***************************/ -/* */ -char string[];/* the directory path */ -/* string below which a */ -/* tree is generated */ -/* */ -/***************************/ - -/***************************/ -/* */ -int level;/* the tree depth variable */ -/* */ -/***************************/ +/***************************/ +/* string[] */ +/* the directory path */ +/* string below which a */ +/* tree is generated */ +/* */ +/***************************/ + +/***************************/ +/* level */ +/* the tree depth variable */ +/* */ +/***************************/ {int switch_flag;int ret_val =0 ;
@@ -453,7 +453,7 @@ int level; /* the tree depth variable */return 0 ; } -int check () +int check (void )/****************************************/ /* */
@@ -570,7 +570,7 @@ int check() }/* while */ } -int get_next_name () +int get_next_name (void )/****************************************/ /* */
@@ -607,7 +607,7 @@ int get_next_name()return 0 ; } -int increment_name (position ) +int increment_name (int position)/****************************************/ /* */
@@ -616,7 +616,6 @@ int increment_name(position)/* next name */ /* */ /****************************************/ -int position; {int next_position;
@@ -641,7 +640,7 @@ int increment_name(position)/*********************************/ } -int mode (path_string ) +int mode (char *path_string)/****************************************/ /* */
@@ -649,7 +648,6 @@ int mode(path_string)/* the file named by path_string */ /* */ /****************************************/ -char path_string[]; {struct stat buf;int ret_val, mod;
@@ -663,9 +661,7 @@ int mode(path_string) } } -int escrivez (string) - -char string[]; +int escrivez (char *string) {char write_string[PATH_STRING_LENGTH +1 ];int len, ret_len;
@@ -684,7 +680,7 @@ char string[];return 0 ; } -int term () +int term (void ) {int status;
@@ -713,7 +709,7 @@ int term()* * Do set up - here its a dummy function */ -void setup () +void setup (void ) {tst_tmpdir (); temp = stderr;
@@ -728,7 +724,7 @@ gical unitfail or * pass. */ -void blexit () +void blexit (void ) { (local_flag ==PASSED ) ?tst_resm (TPASS ,"Test block %d" , block_number) :tst_resm (TFAIL ,"Test block %d" , block_number);
@@ -741,7 +737,7 @@ void blexit()* * Description: Print message on entering a new block */ -void blenter () +void blenter (void ) { local_flag =PASSED ;return ;
@@ -752,7 +748,7 @@ void blenter()* * Exit on failure */ -void fail_exit () +void fail_exit (void ) {tst_brkm (TFAIL , tst_rmdir,"Test failed" ); }
@@ -763,7 +759,7 @@ void fail_exit()* * Description: Exit a test. */ -void anyfail () +void anyfail (void ) { (local_flag ==FAILED ) ?tst_resm (TFAIL ,"Test failed" ) :tst_resm (TPASS ,"Test passed" );
@@ -776,7 +772,7 @@ void anyfail()* * Calling block passed the test */ -void ok_exit () +void ok_exit (void ) { local_flag =PASSED ;return ;
Signature · 1 line
2.13.6
cover Fix a bunch of warnings (mainly old-style-definition)
In reply to Michael MoeseHi Michael,
Quoted 8 lines
Hi,
I was able to find the time to fix a bunch of the warnings when building LTP. With a fex exceptions, this was fixig function definitions, like changing intfoo()to int foo(void) or changing old K&R-style to what you would expect. None of the changes was bigger than that. I did one patch per file, and each of them was individually build-tested.Michael
Thanks :-).
Kind regards,
Petr
cover Fix a bunch of warnings (mainly old-style-definition)
In reply to Michael MoeseHi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]