summaryrefslogtreecommitdiff
path: root/config/auto-aux
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-09-02 12:55:01 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-09-02 12:55:01 +0000
commit1517cea772058b0fcbe778d05b8b99c7e6f3b25f (patch)
treea2d817fe623f81b7729ed3cd2e128cad91eca02b /config/auto-aux
parentd75918f7e459b507ac6b4b95f14df0a1eedd4937 (diff)
downloadocaml-1517cea772058b0fcbe778d05b8b99c7e6f3b25f.tar.gz
Sources C convertis en ANSI C
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1696 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'config/auto-aux')
-rw-r--r--config/auto-aux/align.c24
-rw-r--r--config/auto-aux/ansi.c19
-rw-r--r--config/auto-aux/async_io.c5
-rw-r--r--config/auto-aux/bytecopy.c2
-rw-r--r--config/auto-aux/dblalign.c8
-rw-r--r--config/auto-aux/endian.c2
-rw-r--r--config/auto-aux/getgroups.c4
-rw-r--r--config/auto-aux/schar.c2
-rw-r--r--config/auto-aux/schar2.c2
-rw-r--r--config/auto-aux/sighandler.c2
-rw-r--r--config/auto-aux/signals.c11
-rw-r--r--config/auto-aux/sizes.c4
12 files changed, 43 insertions, 42 deletions
diff --git a/config/auto-aux/align.c b/config/auto-aux/align.c
index 507176b658..92c18c981e 100644
--- a/config/auto-aux/align.c
+++ b/config/auto-aux/align.c
@@ -17,29 +17,24 @@
long foo;
-void access16(p)
- short * p;
+void access16(short int *p)
{
foo = *p;
}
-void access32(p)
- long * p;
+void access32(long int *p)
{
foo = *p;
}
jmp_buf failure;
-void sig_handler(dummy)
- int dummy;
+void sig_handler(int dummy)
{
longjmp(failure, 1);
}
-int test(fct, p)
- void (*fct)();
- char * p;
+int test(void (*fct) (/* ??? */), char *p)
{
int res;
@@ -58,20 +53,17 @@ int test(fct, p)
jmp_buf timer;
-void alarm_handler(dummy)
- int dummy;
+void alarm_handler(int dummy)
{
longjmp(timer, 1);
}
-void use(n)
- int n;
+void use(int n)
{
return;
}
-int speedtest(p)
- char * p;
+int speedtest(char *p)
{
int * q;
volatile int total;
@@ -94,7 +86,7 @@ int speedtest(p)
return total;
}
-main()
+main(void)
{
long n[1001];
int speed_aligned, speed_unaligned;
diff --git a/config/auto-aux/ansi.c b/config/auto-aux/ansi.c
new file mode 100644
index 0000000000..35e0f5090d
--- /dev/null
+++ b/config/auto-aux/ansi.c
@@ -0,0 +1,19 @@
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
+/* */
+/* Copyright 1997 Institut National de Recherche en Informatique et */
+/* Automatique. Distributed only by permission. */
+/* */
+/***********************************************************************/
+
+int main()
+{
+#ifdef __STDC__
+ return 0;
+#else
+ return 1;
+#endif
+}
diff --git a/config/auto-aux/async_io.c b/config/auto-aux/async_io.c
index e38a74212c..5a53552410 100644
--- a/config/auto-aux/async_io.c
+++ b/config/auto-aux/async_io.c
@@ -19,13 +19,12 @@
int signalled;
-void sigio_handler(arg)
- int arg;
+void sigio_handler(int arg)
{
signalled = 1;
}
-int main()
+int main(void)
{
#if defined(SIGIO) && defined(FASYNC) && defined(F_SETFL) && defined(F_SETOWN)
int p[2];
diff --git a/config/auto-aux/bytecopy.c b/config/auto-aux/bytecopy.c
index b8cb38cfee..cb0a1c8698 100644
--- a/config/auto-aux/bytecopy.c
+++ b/config/auto-aux/bytecopy.c
@@ -19,7 +19,7 @@ char buffer[27];
#define cpy copy
#endif
-main()
+int main(int argc, char ** argv)
{
cpy("abcdefghijklmnopqrstuvwxyz", buffer, 27);
if (strcmp(buffer, "abcdefghijklmnopqrstuvwxyz") != 0) exit(1);
diff --git a/config/auto-aux/dblalign.c b/config/auto-aux/dblalign.c
index 2006c26206..71c4655b06 100644
--- a/config/auto-aux/dblalign.c
+++ b/config/auto-aux/dblalign.c
@@ -17,21 +17,19 @@
double foo;
-void access_double(p)
- double * p;
+void access_double(double *p)
{
foo = *p;
}
jmp_buf failure;
-void sig_handler(sig)
- int sig;
+void sig_handler(int sig)
{
longjmp(failure, 1);
}
-int main()
+int main(void)
{
long n[10];
int res;
diff --git a/config/auto-aux/endian.c b/config/auto-aux/endian.c
index 7f1da82d30..deabe55727 100644
--- a/config/auto-aux/endian.c
+++ b/config/auto-aux/endian.c
@@ -23,7 +23,7 @@ char * bigendian = "ABCDEFGH";
char * littleendian = "HGFEDCBA";
#endif
-main()
+main(void)
{
long n[2];
char * p;
diff --git a/config/auto-aux/getgroups.c b/config/auto-aux/getgroups.c
index b69a10c009..5d2dde8fd4 100644
--- a/config/auto-aux/getgroups.c
+++ b/config/auto-aux/getgroups.c
@@ -16,7 +16,7 @@
#ifdef NGROUPS
-int main()
+int main(void)
{
int gidset[NGROUPS];
if (getgroups(NGROUPS, gidset) == -1) return 1;
@@ -25,6 +25,6 @@ int main()
#else
-int main() { return 1; }
+int main(void) { return 1; }
#endif
diff --git a/config/auto-aux/schar.c b/config/auto-aux/schar.c
index b68c69a47a..96106e277e 100644
--- a/config/auto-aux/schar.c
+++ b/config/auto-aux/schar.c
@@ -12,7 +12,7 @@
/* $Id$ */
char foo[]="\377";
-main()
+main(void)
{
int i;
i = foo[0];
diff --git a/config/auto-aux/schar2.c b/config/auto-aux/schar2.c
index 062aef2524..e5dbadc8f6 100644
--- a/config/auto-aux/schar2.c
+++ b/config/auto-aux/schar2.c
@@ -12,7 +12,7 @@
/* $Id$ */
signed char foo[]="\377";
-main()
+main(void)
{
int i;
i = foo[0];
diff --git a/config/auto-aux/sighandler.c b/config/auto-aux/sighandler.c
index 489a2a2df9..fc06c513a6 100644
--- a/config/auto-aux/sighandler.c
+++ b/config/auto-aux/sighandler.c
@@ -13,7 +13,7 @@
#include <signal.h>
-main()
+int main(void)
{
SIGRETURN (*old)();
old = signal(SIGQUIT, SIG_DFL);
diff --git a/config/auto-aux/signals.c b/config/auto-aux/signals.c
index 144a4feb46..49e426dc5a 100644
--- a/config/auto-aux/signals.c
+++ b/config/auto-aux/signals.c
@@ -40,15 +40,12 @@
int counter;
-void sig_handler(dummy)
- int dummy;
+void sig_handler(int dummy)
{
counter++;
}
-int main(argc, argv)
- int argc;
- char ** argv;
+int main(int argc, char **argv)
{
signal(IGNSIG, sig_handler);
counter = 0;
@@ -61,9 +58,7 @@ int main(argc, argv)
/* If no suitable signal was found, assume System V */
-int main(argc, argv)
- int argc;
- char ** argv;
+int main(int argc, char ** argv)
{
return 1;
}
diff --git a/config/auto-aux/sizes.c b/config/auto-aux/sizes.c
index 0fccd80294..8eb2018df6 100644
--- a/config/auto-aux/sizes.c
+++ b/config/auto-aux/sizes.c
@@ -11,9 +11,7 @@
/* $Id$ */
-int main(argc, argv)
- int argc;
- char ** argv;
+int main(int argc, char **argv)
{
printf("%d %d %d\n", sizeof(int), sizeof(long), sizeof(long *));
return 0;