mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
Fix issues in code that are causing error in Xcode 12 and caused warnings in previous versions. Namely include missing stdio.h, use int as return type for main and use return instead of exit in main. Closes: https://trac.macports.org/ticket/61870
90 lines
1.7 KiB
Diff
90 lines
1.7 KiB
Diff
diff --git eratspeed.c eratspeed.c
|
|
index 3bad129..08fe934 100644
|
|
--- eratspeed.c
|
|
+++ eratspeed.c
|
|
@@ -1,6 +1,7 @@
|
|
#define B32 1001
|
|
#define B (B32 * 32)
|
|
|
|
+#include <stdio.h>
|
|
#include "timing.h"
|
|
#include "uint32.h"
|
|
|
|
@@ -400,7 +401,7 @@ void countit()
|
|
timing t;
|
|
timing told;
|
|
|
|
-main()
|
|
+int main()
|
|
{
|
|
int L = 1;
|
|
|
|
@@ -432,5 +433,5 @@ main()
|
|
printf("Overall seconds: approximately %f.\n",0.000000001 * timing_basic_diff(&finishb,&startb));
|
|
printf("Tick counts may be underestimates on systems without hardware tick support.\n");
|
|
|
|
- exit(0);
|
|
+ return 0;
|
|
}
|
|
diff --git primegaps.c primegaps.c
|
|
index c040611..190d6b1 100644
|
|
--- primegaps.c
|
|
+++ primegaps.c
|
|
@@ -1,9 +1,10 @@
|
|
+#include <stdio.h>
|
|
#include <math.h>
|
|
#include "primegen.h"
|
|
|
|
primegen pg;
|
|
|
|
-void main()
|
|
+int main()
|
|
{
|
|
uint64 p;
|
|
uint64 lastp;
|
|
diff --git primes.c primes.c
|
|
index b8b0461..a9cd8e5 100644
|
|
--- primes.c
|
|
+++ primes.c
|
|
@@ -36,7 +36,7 @@ primegen pg;
|
|
uint32 digits[40];
|
|
int len;
|
|
|
|
-void main(argc,argv)
|
|
+int main(argc,argv)
|
|
int argc;
|
|
char **argv;
|
|
{
|
|
@@ -88,5 +88,5 @@ char **argv;
|
|
putchar('\n');
|
|
}
|
|
|
|
- exit(0);
|
|
+ return 0;
|
|
}
|
|
diff --git primespeed.c primespeed.c
|
|
index 3d16c04..294f120 100644
|
|
--- primespeed.c
|
|
+++ primespeed.c
|
|
@@ -1,3 +1,4 @@
|
|
+#include <stdio.h>
|
|
#include "timing.h"
|
|
#include "primegen.h"
|
|
#include "primegen_impl.h"
|
|
@@ -89,7 +90,7 @@ timing_basic startb;
|
|
timing finish;
|
|
timing_basic finishb;
|
|
|
|
-void main(argc,argv)
|
|
+int main(argc,argv)
|
|
int argc;
|
|
char **argv;
|
|
{
|
|
@@ -118,5 +119,5 @@ char **argv;
|
|
printf("Overall seconds: approximately %f.\n",0.000000001 * timing_basic_diff(&finishb,&startb));
|
|
printf("Tick counts may be underestimates on systems without hardware tick support.\n");
|
|
|
|
- exit(0);
|
|
+ return 0;
|
|
}
|