diff options
author | dholland <dholland@pkgsrc.org> | 2011-09-14 06:58:35 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2011-09-14 06:58:35 +0000 |
commit | c1128826839edca6d238cd70f09dcde4674846e5 (patch) | |
tree | ebf6d108c52b30ffa6c0fa47a6df8b7054d671fe /benchmarks/heapsort | |
parent | faf75aa19a047f7e24640f2db792ca3db8ea5d53 (diff) | |
download | pkgsrc-c1128826839edca6d238cd70f09dcde4674846e5.tar.gz |
fix void main, use stdlib.h instead of casting malloc, etc.
Diffstat (limited to 'benchmarks/heapsort')
-rw-r--r-- | benchmarks/heapsort/distinfo | 3 | ||||
-rw-r--r-- | benchmarks/heapsort/patches/patch-heapsort_c | 70 |
2 files changed, 72 insertions, 1 deletions
diff --git a/benchmarks/heapsort/distinfo b/benchmarks/heapsort/distinfo index f5a42b4d4f8..9caef20d3ca 100644 --- a/benchmarks/heapsort/distinfo +++ b/benchmarks/heapsort/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.3 2005/02/22 21:16:36 agc Exp $ +$NetBSD: distinfo,v 1.4 2011/09/14 06:58:35 dholland Exp $ SHA1 (heapsort.c) = 78d6ee3715a6250213b948bf7450b53520811e4c RMD160 (heapsort.c) = 7ff7fb39b0f774ba2feab1e8e1a9afd6bfaff6c4 Size (heapsort.c) = 17563 bytes +SHA1 (patch-heapsort_c) = 5dbe397d31f4714d0baccac2b8557d9dce106bad diff --git a/benchmarks/heapsort/patches/patch-heapsort_c b/benchmarks/heapsort/patches/patch-heapsort_c new file mode 100644 index 00000000000..75ae4b3e509 --- /dev/null +++ b/benchmarks/heapsort/patches/patch-heapsort_c @@ -0,0 +1,70 @@ +$NetBSD: patch-heapsort_c,v 1.1 2011/09/14 06:58:35 dholland Exp $ + +- use valid C + +--- heapsort.c.orig 2011-09-14 06:55:50.000000000 +0000 ++++ heapsort.c +@@ -57,6 +57,7 @@ + /***********************/ + + #include <stdio.h> ++#include <stdlib.h> + #include <math.h> + + #ifdef Amiga +@@ -73,7 +74,10 @@ + #include <ctype.h> + #endif + +-double nulltime,runtime,sta,stb,dtime(); ++int HSORT(long m, long n, long p); ++double dtime(void); ++ ++double nulltime,runtime,sta,stb; + double emips,hmips,lmips,smips[21]; + + long bplong,ErrorFlag; +@@ -81,7 +85,7 @@ long bplong,ErrorFlag; + long NLoops[21]; + + +-void main() ++int main() + { + + long i,j,k,p,imax; +@@ -91,7 +95,7 @@ bplong = sizeof(long); + printf("\n Heap Sort C Program\n"); + printf(" Version 1.0, 04 Oct 1992\n\n"); + +-printf(" Size of long (bytes): %d\n\n",bplong); ++printf(" Size of long (bytes): %ld\n\n",bplong); + + printf(" Array Size RunTime Scale MIPS\n"); + printf(" (bytes) (sec)\n"); +@@ -184,6 +188,7 @@ printf("\n Runtime is the average for + printf(" High MIPS = %8.2lf\n",hmips); + printf(" Low MIPS = %8.2lf\n\n",lmips); + ++return 0; + } /* End of main */ + + +@@ -191,7 +196,7 @@ printf(" Low MIPS = %8.2lf\n\n",lmips + /* Heap Sort Program */ + /*************************/ + +-HSORT(m,n,p) ++int HSORT(m,n,p) + long m,n,p; + { + +@@ -204,7 +209,7 @@ long count,ca,cb,cc,cd,ce,cf; + + msize = m * bplong; + size = m - 1; +-base = (long *)malloc((unsigned)msize); ++base = malloc(msize); + + ia = 106; + ic = 1283; |