~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/lib/dhry_2.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  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 /* executed once        */
 27 /* Enum_Par_Val == Ident_3 */
 28 {
 29         Enumeration Enum_Loc;
 30 
 31         Enum_Loc = Enum_Par_Val;
 32         if (Enum_Loc == Ident_3) {
 33                 /* then, executed */
 34                 return true;
 35         } else {
 36                 /* not executed */
 37                 return false;
 38         }
 39 } /* Func_3 */
 40 
 41 
 42 void Proc_6(Enumeration  Enum_Val_Par, Enumeration *Enum_Ref_Par)
 43 /*********************************/
 44 /* executed once */
 45 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
 46 {
 47         *Enum_Ref_Par = Enum_Val_Par;
 48         if (!Func_3(Enum_Val_Par)) {
 49                 /* then, not executed */
 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                         /* then */
 59                         *Enum_Ref_Par = Ident_1;
 60                 } else {
 61                         *Enum_Ref_Par = Ident_4;
 62                 }
 63                 break;
 64         case Ident_3: /* executed */
 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         } /* switch */
 73 } /* Proc_6 */
 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 /* executed three times                                      */
 79 /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
 80 /*                  Int_Par_Ref becomes 7                    */
 81 /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
 82 /*                  Int_Par_Ref becomes 17                   */
 83 /* third call:      Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
 84 /*                  Int_Par_Ref becomes 18                   */
 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 } /* Proc_7 */
 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 /* executed once      */
 96 /* Int_Par_Val_1 == 3 */
 97 /* Int_Par_Val_2 == 7 */
 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 } /* Proc_8 */
112 
113 
114 Enumeration Func_1(Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val)
115 /*************************************************/
116 /* executed three times                                         */
117 /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
118 /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
119 /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
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                 /* then, executed */
128                 return Ident_1;
129         } else {
130                 /* not executed */
131                 Ch_1_Glob = Ch_1_Loc;
132                 return Ident_2;
133         }
134 } /* Func_1 */
135 
136 
137 Boolean Func_2(Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref)
138 /*************************************************/
139 /* executed once */
140 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
141 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
142 {
143         One_Thirty Int_Loc;
144         Capital_Letter Ch_Loc;
145 
146         Int_Loc = 2;
147         while (Int_Loc <= 2) {
148                 /* loop body executed once */
149                 if (Func_1(Str_1_Par_Ref[Int_Loc],
150                            Str_2_Par_Ref[Int_Loc+1]) == Ident_1) {
151                         /* then, executed */
152                         Ch_Loc = 'A';
153                         Int_Loc += 1;
154                 }
155         } /* if, while */
156         if (Ch_Loc >= 'W' && Ch_Loc < 'Z') {
157                 /* then, not executed */
158                 Int_Loc = 7;
159         }
160         if (Ch_Loc == 'R') {
161                 /* then, not executed */
162                 return true;
163         } else {
164                 /* executed */
165                 if (strcmp(Str_1_Par_Ref, Str_2_Par_Ref) > 0) {
166                         /* then, not executed */
167                         Int_Loc += 7;
168                         Int_Glob = Int_Loc;
169                         return true;
170                 } else {
171                         /* executed */
172                         return false;
173                 }
174         } /* if Ch_Loc */
175 } /* Func_2 */
176 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php