summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sysinfo/contrib/dhry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/contrib/dhry.c b/noncore/settings/sysinfo/contrib/dhry.c
index d1dadbd..20b627c 100644
--- a/noncore/settings/sysinfo/contrib/dhry.c
+++ b/noncore/settings/sysinfo/contrib/dhry.c
@@ -404,193 +404,193 @@ double dtime()
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/rusage.h>
#ifdef __hpux
#include <sys/syscall.h>
#endif
struct rusage rusage;
double dtime()
{
double q;
getrusage(RUSAGE_SELF,&rusage);
q = (double)(rusage.ru_utime.tv_sec);
q = q + (double)(rusage.ru_utime.tv_nsec) * 1.0e-09;
return q;
}
#endif
/****************************************************/
/* Windows NT (32 bit) dtime() routine */
/* Provided by: Piers Haken, piersh@microsoft.com */
/****************************************************/
#ifdef WIN32
#include <windows.h>
double dtime(void)
{
double q;
q = (double)GetTickCount() * 1.0e-03;
return q;
}
#endif
/*****************************************************/
/* Time according to POSIX.1 - <J.Pelan@qub.ac.uk> */
/* Ref: "POSIX Programmer's Guide" O'Reilly & Assoc.*/
/*****************************************************/
#ifdef POSIX1
#define _POSIX_SOURCE 1
#include <unistd.h>
#include <limits.h>
#include <sys/times.h>
struct tms tms;
double dtime()
{
double q;
times(&tms);
q = (double)tms.tms_utime / (double)CLK_TCK;
return q;
}
#endif
/*
*************************************************************************
*
* "DHRYSTONE" Benchmark Program
* -----------------------------
*
* Version: C, Version 2.1
*
* File: dhry_1.c (part 2 of 3)
*
* Date: May 25, 1988
*
* Author: Reinhold P. Weicker
*
*************************************************************************
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dhry.h"
/* Global Variables: */
Rec_Pointer Ptr_Glob,
Next_Ptr_Glob;
int Int_Glob;
Boolean Bool_Glob;
char Ch_1_Glob,
Ch_2_Glob;
int Arr_1_Glob [50];
int Arr_2_Glob [50] [50];
char Reg_Define[] = "Register option selected.";
-extern char *malloc ();
+//extern char *malloc ();
Enumeration Func_1 ();
/*
forward declaration necessary since Enumeration may not simply be int
*/
#ifndef ROPT
#define REG
/* REG becomes defined as empty */
/* i.e. no register variables */
#else
#define REG register
#endif
/* variables for time measurement: */
#define Too_Small_Time 2
/* Measurements should last at least 2 seconds */
double Begin_Time,
End_Time,
User_Time;
double Microseconds,
Dhrystones_Per_Second,
Vax_Mips;
/* end of variables for time measurement */
/**********************************************************************************************/
Proc_1 (Ptr_Val_Par)
/******************/
REG Rec_Pointer Ptr_Val_Par;
/* executed once */
{
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
/* == Ptr_Glob_Next */
/* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
/* corresponds to "rename" in Ada, "with" in Pascal */
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
Next_Record->variant.var_1.Int_Comp
= Ptr_Val_Par->variant.var_1.Int_Comp;
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
Proc_3 (&Next_Record->Ptr_Comp);
/* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
== Ptr_Glob->Ptr_Comp */
if (Next_Record->Discr == Ident_1)
/* then, executed */
{
Next_Record->variant.var_1.Int_Comp = 6;
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
&Next_Record->variant.var_1.Enum_Comp);
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
&Next_Record->variant.var_1.Int_Comp);
}
else /* not executed */
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
} /* Proc_1 */
Proc_2 (Int_Par_Ref)
/******************/
/* executed once */
/* *Int_Par_Ref == 1, becomes 4 */
One_Fifty *Int_Par_Ref;
{
One_Fifty Int_Loc;
Enumeration Enum_Loc;
Int_Loc = *Int_Par_Ref + 10;
do /* executed once */
if (Ch_1_Glob == 'A')
/* then, executed */
{
Int_Loc -= 1;
*Int_Par_Ref = Int_Loc - Int_Glob;
Enum_Loc = Ident_1;
} /* if */
while (Enum_Loc != Ident_1); /* true */
} /* Proc_2 */
Proc_3 (Ptr_Ref_Par)
/******************/
/* executed once */
/* Ptr_Ref_Par becomes Ptr_Glob */
Rec_Pointer *Ptr_Ref_Par;