pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/benchmarks/heapsort fix void main, use stdlib.h instea...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/78cae13419d6
branches:  trunk
changeset: 592785:78cae13419d6
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Wed Sep 14 06:58:35 2011 +0000

description:
fix void main, use stdlib.h instead of casting malloc, etc.

diffstat:

 benchmarks/heapsort/distinfo                 |   3 +-
 benchmarks/heapsort/patches/patch-heapsort_c |  70 ++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 1 deletions(-)

diffs (85 lines):

diff -r e2b31fe1ab89 -r 78cae13419d6 benchmarks/heapsort/distinfo
--- a/benchmarks/heapsort/distinfo      Tue Sep 13 22:39:03 2011 +0000
+++ b/benchmarks/heapsort/distinfo      Wed Sep 14 06:58:35 2011 +0000
@@ -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 -r e2b31fe1ab89 -r 78cae13419d6 benchmarks/heapsort/patches/patch-heapsort_c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/heapsort/patches/patch-heapsort_c      Wed Sep 14 06:58:35 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index