pkgsrc/benchmarks/dhrystone/patches/patch-dhry__1_c
2012-07-01 09:56:13 +00:00

44 lines
1.6 KiB
Text

$NetBSD: patch-dhry__1_c,v 1.3 2012/07/01 09:56:13 sbd Exp $
- use standard headers
- don't declare own malloc
- print pointers with %p
--- dhry_1.c.orig 1988-07-12 19:35:10.000000000 +0000
+++ dhry_1.c
@@ -15,6 +15,9 @@
****************************************************************************
*/
+#include <stdlib.h>
+#include <string.h>
+
#include "dhry.h"
/* Global Variables: */
@@ -28,7 +31,6 @@ char Ch_1_Glob,
int Arr_1_Glob [50];
int Arr_2_Glob [50] [50];
-extern char *malloc ();
Enumeration Func_1 ();
/* forward declaration necessary since Enumeration may not simply be int */
@@ -221,7 +223,7 @@ main ()
printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
printf (" should be: Number_Of_Runs + 10\n");
printf ("Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
+ printf (" Ptr_Comp: %p\n", Ptr_Glob->Ptr_Comp);
printf (" should be: (implementation-dependent)\n");
printf (" Discr: %d\n", Ptr_Glob->Discr);
printf (" should be: %d\n", 0);
@@ -232,7 +234,7 @@ main ()
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
printf ("Next_Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
+ printf (" Ptr_Comp: %p\n", Next_Ptr_Glob->Ptr_Comp);
printf (" should be: (implementation-dependent), same as above\n");
printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
printf (" should be: %d\n", 0);