| 1 | |
| 2 | |
| 3 | ****************************************************************************
|
| 4 | *
|
| 5 | * "DHRYSTONE" Benchmark Program
|
| 6 | * -----------------------------
|
| 7 | *
|
| 8 | * Version: C, Version 2.1
|
| 9 | *
|
| 10 | * File: dhry_2.c (part 3 of 3)
|
| 11 | *
|
| 12 | * Date: May 25, 1988
|
| 13 | *
|
| 14 | * Author: Reinhold P. Weicker
|
| 15 | *
|
| 16 | ****************************************************************************
|
| 17 |
|
| 18 |
|
| 19 | #include "dhry.h"
|
| 20 |
|
| 21 | #include <linux/string.h>
|
| 22 |
|
| 23 |
|
| 24 | static Boolean Func_3(Enumeration Enum_Par_Val)
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 | {
|
| 29 | Enumeration Enum_Loc;
|
| 30 |
|
| 31 | Enum_Loc = Enum_Par_Val;
|
| 32 | if (Enum_Loc == Ident_3) {
|
| 33 |
|
| 34 | return true;
|
| 35 | } else {
|
| 36 |
|
| 37 | return false;
|
| 38 | }
|
| 39 | }
|
| 40 |
|
| 41 |
|
| 42 | void Proc_6(Enumeration Enum_Val_Par, Enumeration *Enum_Ref_Par)
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 | {
|
| 47 | *Enum_Ref_Par = Enum_Val_Par;
|
| 48 | if (!Func_3(Enum_Val_Par)) {
|
| 49 |
|
| 50 | *Enum_Ref_Par = Ident_4;
|
| 51 | }
|
| 52 | switch (Enum_Val_Par) {
|
| 53 | case Ident_1:
|
| 54 | *Enum_Ref_Par = Ident_1;
|
| 55 | break;
|
| 56 | case Ident_2:
|
| 57 | if (Int_Glob > 100) {
|
| 58 |
|
| 59 | *Enum_Ref_Par = Ident_1;
|
| 60 | } else {
|
| 61 | *Enum_Ref_Par = Ident_4;
|
| 62 | }
|
| 63 | break;
|
| 64 | case Ident_3:
|
| 65 | *Enum_Ref_Par = Ident_2;
|
| 66 | break;
|
| 67 | case Ident_4:
|
| 68 | break;
|
| 69 | case Ident_5:
|
| 70 | *Enum_Ref_Par = Ident_3;
|
| 71 | break;
|
| 72 | }
|
| 73 | }
|
| 74 |
|
| 75 |
|
| 76 | void Proc_7(One_Fifty Int_1_Par_Val, One_Fifty Int_2_Par_Val, One_Fifty *Int_Par_Ref)
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 | {
|
| 86 | One_Fifty Int_Loc;
|
| 87 |
|
| 88 | Int_Loc = Int_1_Par_Val + 2;
|
| 89 | *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
|
| 90 | }
|
| 91 |
|
| 92 |
|
| 93 | void Proc_8(Arr_1_Dim Arr_1_Par_Ref, Arr_2_Dim Arr_2_Par_Ref, int Int_1_Par_Val, int Int_2_Par_Val)
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 | {
|
| 99 | One_Fifty Int_Index;
|
| 100 | One_Fifty Int_Loc;
|
| 101 |
|
| 102 | Int_Loc = Int_1_Par_Val + 5;
|
| 103 | Arr_1_Par_Ref[Int_Loc] = Int_2_Par_Val;
|
| 104 | Arr_1_Par_Ref[Int_Loc+1] = Arr_1_Par_Ref[Int_Loc];
|
| 105 | Arr_1_Par_Ref[Int_Loc+30] = Int_Loc;
|
| 106 | for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
|
| 107 | Arr_2_Par_Ref[Int_Loc][Int_Index] = Int_Loc;
|
| 108 | Arr_2_Par_Ref[Int_Loc][Int_Loc-1] += 1;
|
| 109 | Arr_2_Par_Ref[Int_Loc+20][Int_Loc] = Arr_1_Par_Ref[Int_Loc];
|
| 110 | Int_Glob = 5;
|
| 111 | }
|
| 112 |
|
| 113 |
|
| 114 | Enumeration Func_1(Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val)
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 | {
|
| 121 | Capital_Letter Ch_1_Loc;
|
| 122 | Capital_Letter Ch_2_Loc;
|
| 123 |
|
| 124 | Ch_1_Loc = Ch_1_Par_Val;
|
| 125 | Ch_2_Loc = Ch_1_Loc;
|
| 126 | if (Ch_2_Loc != Ch_2_Par_Val) {
|
| 127 |
|
| 128 | return Ident_1;
|
| 129 | } else {
|
| 130 |
|
| 131 | Ch_1_Glob = Ch_1_Loc;
|
| 132 | return Ident_2;
|
| 133 | }
|
| 134 | }
|
| 135 |
|
| 136 |
|
| 137 | Boolean Func_2(Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref)
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 | {
|
| 143 | One_Thirty Int_Loc;
|
| 144 | Capital_Letter Ch_Loc;
|
| 145 |
|
| 146 | Int_Loc = 2;
|
| 147 | while (Int_Loc <= 2) {
|
| 148 |
|
| 149 | if (Func_1(Str_1_Par_Ref[Int_Loc],
|
| 150 | Str_2_Par_Ref[Int_Loc+1]) == Ident_1) {
|
| 151 |
|
| 152 | Ch_Loc = 'A';
|
| 153 | Int_Loc += 1;
|
| 154 | }
|
| 155 | }
|
| 156 | if (Ch_Loc >= 'W' && Ch_Loc < 'Z') {
|
| 157 |
|
| 158 | Int_Loc = 7;
|
| 159 | }
|
| 160 | if (Ch_Loc == 'R') {
|
| 161 |
|
| 162 | return true;
|
| 163 | } else {
|
| 164 |
|
| 165 | if (strcmp(Str_1_Par_Ref, Str_2_Par_Ref) > 0) {
|
| 166 |
|
| 167 | Int_Loc += 7;
|
| 168 | Int_Glob = Int_Loc;
|
| 169 | return true;
|
| 170 | } else {
|
| 171 |
|
| 172 | return false;
|
| 173 | }
|
| 174 | }
|
| 175 | }
|