tuned the liability of the license.
[muis.git] / problems / dhrystone-stripped.c
blob164333f3e12dcf74f367b96c753c87c3f80d3718
1 #define LOOPS 50
2 #undef NOENUM
3 #undef NOSTRUCTASSIGN
4 #define TIMES
5 #define HZ 100
6 char Version[] = "1.1";
9 typedef enum {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;
11 typedef int OneToThirty;
12 typedef int OneToFifty;
13 typedef char CapitalLetter;
14 typedef char String30[31];
15 typedef int Array1Dim[51];
16 typedef int Array2Dim[51][51];
18 struct Record
20 struct Record *PtrComp;
21 Enumeration Discr;
22 Enumeration EnumComp;
23 OneToFifty IntComp;
24 String30 StringComp;
27 typedef struct Record RecordType;
28 typedef RecordType * RecordPtr;
29 typedef int boolean;
31 #define NULL 0
32 #define TRUE 1
33 #define FALSE 0
35 #ifndef REG
36 #define REG
37 #endif
39 extern Enumeration Func1();
40 extern boolean Func2();
42 #ifdef TIMES
43 #include <sys/types.h>
44 #include <sys/times.h>
45 #endif
47 main()
49 Proc0();
50 exit(0);
54 * Package 1
56 int IntGlob;
57 boolean BoolGlob;
58 Array1Dim Array1Glob;
59 Array2Dim Array2Glob;
61 Proc0()
63 REG char CharLoc;
64 Enumeration EnumLoc;
65 String30 String1Loc;
66 String30 String2Loc;
68 #ifdef TIMES
69 register unsigned int i;
71 #endif
73 strcpy(String1Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
74 for (i = 0; i < LOOPS; ++i)
76 printf("%s", "looping");
77 BoolGlob = ! Func2(String1Loc, String2Loc);
83 boolean Func2(StrParI1, StrParI2)
84 String30 StrParI1;
85 String30 StrParI2;
87 REG OneToThirty IntLoc;
88 REG CapitalLetter CharLoc;
91 IntLoc = 1;
92 while (IntLoc <= 1)
93 if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1)
95 ++IntLoc;
97 if (CharLoc == 'X')
98 return(TRUE);
99 else
101 if (strcmp(StrParI1, StrParI2) > 0)
103 return (TRUE);
105 else
106 return (FALSE);
112 extern boolean Func3();
114 Proc6(EnumParIn, EnumParOut)
115 REG Enumeration EnumParIn;
116 REG Enumeration *EnumParOut;
118 *EnumParOut = EnumParIn;
119 switch (EnumParIn)
121 case Ident1: *EnumParOut = Ident1; break;
122 case Ident2: if (IntGlob > 100) *EnumParOut = Ident1;
123 case Ident3: *EnumParOut = Ident2; break;
124 case Ident4: break;
125 case Ident5: *EnumParOut = Ident3;
129 boolean Func3(EnumParIn)
130 REG Enumeration EnumParIn;
132 REG Enumeration EnumLoc;
134 EnumLoc = EnumParIn;
135 return (FALSE);
138 Enumeration Func1(CharPar1, CharPar2)
139 CapitalLetter CharPar1;
140 CapitalLetter CharPar2;
142 return (Ident1);