Browse Source

Fix function prototypes with unspecified arguments

Change functions declared as taking unspecified number of arguments
of unspecified type to functions that take no arguments.

Reported by kernel's checkpatch.pl script.
Dmitry V. Levin 2 years ago
parent
commit
86bce103a6
6 changed files with 21 additions and 10 deletions
  1. 2
    2
      strace.c
  2. 3
    1
      test/mmap_offset_decode.c
  3. 3
    1
      test/mtd.c
  4. 4
    2
      test/sig.c
  5. 3
    1
      test/ubi.c
  6. 6
    3
      test/wait_must_be_interruptible.c

+ 2
- 2
strace.c View File

@@ -2319,7 +2319,7 @@ next_event(int *pstatus, siginfo_t *si)
2319 2319
 
2320 2320
 	/*
2321 2321
 	 * Used to exit simply when nprocs hits zero, but in this testcase:
2322
-	 *  int main() { _exit(!!fork()); }
2322
+	 *  int main(void) { _exit(!!fork()); }
2323 2323
 	 * under strace -f, parent sometimes (rarely) manages
2324 2324
 	 * to exit before we see the first stop of the child,
2325 2325
 	 * and we are losing track of it:
@@ -2594,7 +2594,7 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
2594 2594
 }
2595 2595
 
2596 2596
 #ifdef ENABLE_COVERAGE_GCOV
2597
-extern void __gcov_flush();
2597
+extern void __gcov_flush(void);
2598 2598
 #endif
2599 2599
 
2600 2600
 static void ATTRIBUTE_NORETURN

+ 3
- 1
test/mmap_offset_decode.c View File

@@ -22,7 +22,9 @@
22 22
 #define _FILE_OFFSET_BITS 64
23 23
 #include <sys/mman.h>
24 24
 #include <errno.h>
25
-int main()
25
+
26
+int
27
+main(void)
26 28
 {
27 29
 	/* 0x1000 is meant to be page size multiplier */
28 30
 	mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,

+ 3
- 1
test/mtd.c View File

@@ -6,7 +6,9 @@
6 6
 #include <sys/ioctl.h>
7 7
 #include <mtd/mtd-user.h>
8 8
 
9
-int main() {
9
+int
10
+main(void)
11
+{
10 12
 	int fd = open("/dev/null", 0);
11 13
 	struct mtd_info_user minfo;
12 14
 	struct erase_info_user einfo;

+ 4
- 2
test/sig.c View File

@@ -2,12 +2,14 @@
2 2
 #include <signal.h>
3 3
 #include <unistd.h>
4 4
 
5
-void interrupt()
5
+static void
6
+interrupt(void)
6 7
 {
7 8
 	write(2, "xyzzy\n", 6);
8 9
 }
9 10
 
10
-int main(int argc, char *argv[])
11
+int
12
+main(int argc, char *argv[])
11 13
 {
12 14
 	char buf[1024];
13 15
 

+ 3
- 1
test/ubi.c View File

@@ -9,7 +9,9 @@
9 9
 
10 10
 #define zero(x) memset(&x, 0, sizeof(x))
11 11
 
12
-int main() {
12
+int
13
+main(void)
14
+{
13 15
 	int fd = open("/dev/null", 0);
14 16
 	struct ubi_mkvol_req mkvol = {
15 17
 		.vol_id = 3,

+ 6
- 3
test/wait_must_be_interruptible.c View File

@@ -18,12 +18,14 @@ static const char msg1[] = "Child signals parent\n";
18 18
 static const char msg2[] = "Parent got signal\n";
19 19
 static const char msg3[] = "Child will exit now\n";
20 20
 
21
-static void handler(int s)
21
+static void
22
+handler(int s)
22 23
 {
23 24
 	write(1, msg2, sizeof(msg2)-1);
24 25
 }
25 26
 
26
-static void test()
27
+static void
28
+test(void)
27 29
 {
28 30
 	/* Note: in Linux, signal() installs handler with SA_RESTART flag,
29 31
 	 * therefore wait will be restarted.
@@ -45,7 +47,8 @@ static void test()
45 47
 	_exit(0);
46 48
 }
47 49
 
48
-int main()
50
+int
51
+main(void)
49 52
 {
50 53
 	char buf1[80];
51 54
 	char buf2[80];

Loading…
Cancel
Save