|
// Camel - CPU Identifying Tool
// Copyright (C) 2002, Iain Chesworth
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef _CDHRYSTONE_H_
#define _CDHRYSTONE_H_
// Include any definitions that we require.
#define DHRYSTONE_LOOPS 17273273
#define GET_SECONDS_FROM_UCT (long)(GetTickCount () / 1000)
typedef enum __enumeration {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;
typedef int OneToThirty;
typedef int OneToFifty;
typedef char CapitalLetter;
typedef char String30[31];
typedef int Array1Dim[51];
typedef int Array2Dim[51][51];
struct Record {
struct Record *PtrComp;
Enumeration Discr;
Enumeration EnumComp;
OneToFifty IntComp;
String30 StringComp;
};
typedef struct Record RecordType;
typedef RecordType * RecordPtr;
#ifdef _WIN32
// Include Windows header files.
#include <windows.h>
#endif // _WIN32
// Include generic C / C++ header files.
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
class CDhryStone {
public:
CDhryStone ();
~CDhryStone ();
// Variables.
// Functions.
void PerformBenchmark (HWND, int);
private:
// Functions.
void Proc0 ();
void Proc1 (RecordPtr);
void Proc2 (OneToFifty *);
void Proc3 (RecordPtr *);
void Proc4 ();
void Proc5 ();
void Proc6 (Enumeration, Enumeration *);
void Proc7 (OneToFifty, OneToFifty, OneToFifty *);
void Proc8 (Array1Dim, Array2Dim, OneToFifty, OneToFifty);
Enumeration Func1 (CapitalLetter, CapitalLetter);
bool Func2 (String30, String30);
bool Func3 (Enumeration);
// Variables.
int IntGlob;
bool BoolGlob;
char Char1Glob;
char Char2Glob;
Array1Dim Array1Glob;
Array2Dim Array2Glob;
RecordPtr PtrGlb;
RecordPtr PtrGlbNext;
protected:
};
#endif // _CDHRYSTONE_H_
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Iain Chesworth graduated from Heriot-Watt University in June of 2002 in Computer Science and Physics. He now works as a C++ programmer and plays with code in his spare time. He is also a keen cyclist and swimmer.