1 | /* -------------------- */ |
---|
2 | /* --- ecc_common.c --- */ |
---|
3 | /* -------------------- */ |
---|
4 | |
---|
5 | #include <stdio.h> |
---|
6 | #include <stdlib.h> |
---|
7 | #include <string.h> |
---|
8 | #include <math.h> |
---|
9 | |
---|
10 | #include "nrc_os_config.h" |
---|
11 | #include "nrc.h" |
---|
12 | |
---|
13 | #if TARGET_OS == LINUX |
---|
14 | #include <sys/types.h> |
---|
15 | #include <sys/stat.h> |
---|
16 | #include <fcntl.h> |
---|
17 | #endif |
---|
18 | |
---|
19 | |
---|
20 | #include "ecc_common.h" |
---|
21 | #include "mt19937.h" |
---|
22 | |
---|
23 | #ifdef ENABLE_GLOBAL_DEBUG |
---|
24 | // variables globales externes pour log de configurations particulieres |
---|
25 | int g_density; |
---|
26 | int g_granularity; |
---|
27 | int g_iter; |
---|
28 | int g_i; |
---|
29 | int g_j; |
---|
30 | |
---|
31 | int g_p; |
---|
32 | uint32 g_ne; |
---|
33 | uint32 g_ne_start; |
---|
34 | uint32 g_ne_end; |
---|
35 | #endif |
---|
36 | |
---|
37 | |
---|
38 | // -------------------------------- |
---|
39 | uint32 ui32Max2(uint32 a, uint32 b) |
---|
40 | // -------------------------------- |
---|
41 | { |
---|
42 | return (a > b ? a : b); |
---|
43 | } |
---|
44 | |
---|
45 | |
---|
46 | // ------------------------------------------ |
---|
47 | uint32 ui32Max3(uint32 a, uint32 b, uint32 c) |
---|
48 | // ------------------------------------------ |
---|
49 | { |
---|
50 | return ui32Max2(ui32Max2(a, b), c); |
---|
51 | } |
---|
52 | |
---|
53 | |
---|
54 | // ---------------------------------------------------- |
---|
55 | uint32 ui32Max4(uint32 a, uint32 b, uint32 c, uint32 d) |
---|
56 | // ---------------------------------------------------- |
---|
57 | { |
---|
58 | return ui32Max2(ui32Max2(a, b), ui32Max2(c,d)); |
---|
59 | } |
---|
60 | |
---|
61 | |
---|
62 | // -------------------------------- |
---|
63 | uint32 ui32Min2(uint32 a, uint32 b) |
---|
64 | // -------------------------------- |
---|
65 | { |
---|
66 | return (a < b ? a : b); |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | // ------------------------------------------ |
---|
71 | uint32 ui32Min3(uint32 a, uint32 b, uint32 c) |
---|
72 | // ------------------------------------------ |
---|
73 | { |
---|
74 | return ui32Min2(ui32Min2(a, b), c); |
---|
75 | } |
---|
76 | |
---|
77 | |
---|
78 | // ---------------------------------------------------- |
---|
79 | uint32 ui32Min4(uint32 a, uint32 b, uint32 c, uint32 d) |
---|
80 | // ---------------------------------------------------- |
---|
81 | { |
---|
82 | return ui32Min2(ui32Min2(a, b), ui32Min2(c,d)); |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | /* ----------------------------------- */ |
---|
87 | uint32 ui32MinNonNul2(uint32 a, uint32 b) |
---|
88 | /* ----------------------------------- */ |
---|
89 | { |
---|
90 | if (a && b) |
---|
91 | return (a < b ? a : b); |
---|
92 | if (a == 0) |
---|
93 | return b; |
---|
94 | return a; |
---|
95 | } |
---|
96 | |
---|
97 | |
---|
98 | /* --------------------------------------------- */ |
---|
99 | uint32 ui32MinNonNul3(uint32 a, uint32 b, uint32 c) |
---|
100 | /* --------------------------------------------- */ |
---|
101 | { |
---|
102 | uint32 m = 0xffffffff; |
---|
103 | |
---|
104 | if (a) m = a; |
---|
105 | if (b && (b<m)) m = b; |
---|
106 | if (c && (c<m)) m = c; |
---|
107 | |
---|
108 | return m; |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | /* ---------------------------------------------------- */ |
---|
113 | uint32 ui32MinNonNul3Cond(uint32 a0, uint32 a1, uint32 a2) |
---|
114 | /* ---------------------------------------------------- */ |
---|
115 | { |
---|
116 | uint32 m = 0; |
---|
117 | |
---|
118 | if (a1) m = ui32MinNonNul3(a0, a1, a2); |
---|
119 | return m; |
---|
120 | } |
---|
121 | |
---|
122 | |
---|
123 | /* ----------------------------------------------------------- */ |
---|
124 | uint32 ui32MinNonNul4(uint32 a0, uint32 a1, uint32 a2, uint32 a3) |
---|
125 | /* ----------------------------------------------------------- */ |
---|
126 | { |
---|
127 | uint32 m = 0xffffffff; |
---|
128 | |
---|
129 | if (a0) m = a0; |
---|
130 | if (a1 && (a1<m)) m = a1; |
---|
131 | if (a2 && (a2<m)) m = a2; |
---|
132 | if (a3 && (a3<m)) m = a3; |
---|
133 | |
---|
134 | return m; |
---|
135 | } |
---|
136 | |
---|
137 | |
---|
138 | /* ---------------------------------------------------------------------- */ |
---|
139 | uint32 ui32MinNonNul5(uint32 a0, uint32 a1, uint32 a2, uint32 a3, uint32 a4) |
---|
140 | /* ---------------------------------------------------------------------- */ |
---|
141 | { |
---|
142 | uint32 m = 0xffffffff; |
---|
143 | |
---|
144 | if (a0) m = a0; |
---|
145 | if (a1 && (a1<m)) m = a1; |
---|
146 | if (a2 && (a2<m)) m = a2; |
---|
147 | if (a3 && (a3<m)) m = a3; |
---|
148 | if (a4 && (a4<m)) m = a4; |
---|
149 | |
---|
150 | return m; |
---|
151 | } |
---|
152 | |
---|
153 | |
---|
154 | /* -------------------------------------------------------------------------- */ |
---|
155 | uint32 ui32MinNonNul5Cond(uint32 a0, uint32 a1, uint32 a2, uint32 a3, uint32 a4) |
---|
156 | /* -------------------------------------------------------------------------- */ |
---|
157 | { |
---|
158 | uint32 m = 0; |
---|
159 | |
---|
160 | if (a2) m = ui32MinNonNul5(a0, a1, a2, a3, a4); |
---|
161 | return m; |
---|
162 | } |
---|
163 | |
---|
164 | |
---|
165 | /* ------------------------------------------------------------------------------------------------------- */ |
---|
166 | uint32 ui32MinNonNul8(uint32 a0, uint32 a1, uint32 a2, uint32 a3, uint32 a4, uint32 a5, uint32 a6, uint32 a7) |
---|
167 | /* ------------------------------------------------------------------------------------------------------- */ |
---|
168 | { |
---|
169 | uint32 m = 0xffffffff; |
---|
170 | |
---|
171 | if (a0) m = a0; |
---|
172 | if (a1 && (a1<m)) m = a1; |
---|
173 | if (a2 && (a2<m)) m = a2; |
---|
174 | if (a3 && (a3<m)) m = a3; |
---|
175 | if (a4 && (a4<m)) m = a4; |
---|
176 | if (a5 && (a5<m)) m = a5; |
---|
177 | if (a6 && (a6<m)) m = a6; |
---|
178 | if (a7 && (a7<m)) m = a7; |
---|
179 | |
---|
180 | return m; |
---|
181 | } |
---|
182 | |
---|
183 | |
---|
184 | /* ------------------------------------------------------------------------------------------------------------------ */ |
---|
185 | uint32 ui32MinNonNul9(uint32 a0, uint32 a1, uint32 a2, uint32 a3, uint32 a4, uint32 a5, uint32 a6, uint32 a7, uint32 a8) |
---|
186 | /* ------------------------------------------------------------------------------------------------------------------ */ |
---|
187 | { |
---|
188 | uint32 m = 0xffffffff; |
---|
189 | |
---|
190 | if (a0) m = a0; |
---|
191 | if (a1 && (a1<m)) m = a1; |
---|
192 | if (a2 && (a2<m)) m = a2; |
---|
193 | if (a3 && (a3<m)) m = a3; |
---|
194 | if (a4 && (a4<m)) m = a4; |
---|
195 | if (a5 && (a5<m)) m = a5; |
---|
196 | if (a6 && (a6<m)) m = a6; |
---|
197 | if (a7 && (a7<m)) m = a7; |
---|
198 | if (a8 && (a8<m)) m = a8; |
---|
199 | |
---|
200 | return m; |
---|
201 | } |
---|
202 | |
---|
203 | |
---|
204 | /* ---------------------------------------------------------------------------------------------------------------------- */ |
---|
205 | uint32 ui32MinNonNul9Cond(uint32 a0, uint32 a1, uint32 a2, uint32 a3, uint32 a4, uint32 a5, uint32 a6, uint32 a7, uint32 a8) |
---|
206 | /* ---------------------------------------------------------------------------------------------------------------------- */ |
---|
207 | { |
---|
208 | // a0 b0 c0 |
---|
209 | // a1 b1 c1 |
---|
210 | // a2 b2 c2 |
---|
211 | |
---|
212 | uint32 m = 0; |
---|
213 | |
---|
214 | if (a4) m = ui32MinNonNul9(a0, a1, a2, a3, a4, a5, a6, a7, a8); |
---|
215 | |
---|
216 | return m; |
---|
217 | } |
---|
218 | |
---|
219 | |
---|
220 | // --------------------------------- |
---|
221 | void initT(uint32 * T, uint32 nemax) |
---|
222 | // --------------------------------- |
---|
223 | { |
---|
224 | int i; |
---|
225 | for (i = 0; i <= (int) nemax; i++) { |
---|
226 | T[i] = i; |
---|
227 | } |
---|
228 | } |
---|
229 | |
---|
230 | |
---|
231 | /* -------------------------- */ |
---|
232 | //void initA(uint32 *A, uint32 nemax) |
---|
233 | /* ------------------------------- */ |
---|
234 | /*{ |
---|
235 | int i; |
---|
236 | for(i=0; i<=nemax; i++) { |
---|
237 | A[i] = 0; |
---|
238 | } |
---|
239 | }*/ |
---|
240 | |
---|
241 | |
---|
242 | // -------------------------------- |
---|
243 | void initZ(uint32 *T, uint32 nemax) |
---|
244 | // -------------------------------- |
---|
245 | { |
---|
246 | int i; |
---|
247 | for (i = 0; i <= (int) nemax; i++) { |
---|
248 | T[i] = 0; |
---|
249 | } |
---|
250 | } |
---|
251 | |
---|
252 | |
---|
253 | // -------------------------------------- |
---|
254 | void check_initT(uint32 *T, uint32 nemax) |
---|
255 | // -------------------------------------- |
---|
256 | { |
---|
257 | check_initT_range(T, 0, nemax, nemax); |
---|
258 | } |
---|
259 | |
---|
260 | |
---|
261 | // -------------------------------------- |
---|
262 | void check_initZ(uint32 *T, uint32 nemax) |
---|
263 | // -------------------------------------- |
---|
264 | { |
---|
265 | check_initZ_range(T, 0, nemax, nemax); |
---|
266 | } |
---|
267 | |
---|
268 | |
---|
269 | // --------------------------------------------------------------- |
---|
270 | void check_initT_range(uint32 *T, uint32 i0, uint32 ii, uint32 i1) |
---|
271 | // --------------------------------------------------------------- |
---|
272 | { |
---|
273 | uint32 i; |
---|
274 | |
---|
275 | printf("check_initT_range[%d %d %d]\n", i0, ii, i1); |
---|
276 | |
---|
277 | for (i = i0; i <= i1; i++) { |
---|
278 | if (T[i] != i) { |
---|
279 | printf("[check_initT]: T[%d] = %d\n", i, T[i]); |
---|
280 | } |
---|
281 | } |
---|
282 | } |
---|
283 | |
---|
284 | |
---|
285 | // --------------------------------------------------------------- |
---|
286 | void check_initR_range(uint32 *R, uint32 i0, uint32 ii, uint32 i1) |
---|
287 | // --------------------------------------------------------------- |
---|
288 | { |
---|
289 | uint32 i; |
---|
290 | |
---|
291 | printf("check_initR_range[%d %d %d]\n", i0, ii, i1); |
---|
292 | |
---|
293 | for (i = i0; i <= i1; i++) { |
---|
294 | if (R[i] != i) { |
---|
295 | printf("[check_initR]: R[%d] = %d\n", i, R[i]); |
---|
296 | } |
---|
297 | } |
---|
298 | } |
---|
299 | |
---|
300 | |
---|
301 | // --------------------------------------------------------------- |
---|
302 | void check_initZ_range(uint32 *T, uint32 i0, uint32 ii, uint32 i1) |
---|
303 | // --------------------------------------------------------------- |
---|
304 | { |
---|
305 | uint32 i; |
---|
306 | |
---|
307 | printf("check_initZ_range[%d %d %d]\n", i0, ii, i1); |
---|
308 | |
---|
309 | for (i = i0; i <= i1; i++) { |
---|
310 | if (T[i] != 0) { |
---|
311 | printf("[check_initZ]: T[%d] = %d\n", i, T[i]); |
---|
312 | } |
---|
313 | } |
---|
314 | } |
---|
315 | |
---|
316 | |
---|
317 | /* --------------------------------------------------------------------------------------------------- */ |
---|
318 | void binarisation_ui8matrix(uint8 **X, int i0, int i1, int j0, int j1, uint8 seuil, uint8 val, uint8 **Y) |
---|
319 | /* --------------------------------------------------------------------------------------------------- */ |
---|
320 | { |
---|
321 | int i, j; |
---|
322 | uint8 x, y; |
---|
323 | |
---|
324 | for (i = i0; i <= i1; i++) { |
---|
325 | for (j = j0; j <= j1; j++) { |
---|
326 | x = X[i][j]; |
---|
327 | if (x >= seuil) |
---|
328 | y = val; |
---|
329 | else |
---|
330 | y = 0; |
---|
331 | Y[i][j] = y; |
---|
332 | } |
---|
333 | } |
---|
334 | } |
---|
335 | |
---|
336 | /* ------------------------------------------------------------------- */ |
---|
337 | void applyTable(uint32 **X, int height, int width, uint32 *T, uint32 **Y) |
---|
338 | /* ------------------------------------------------------------------- */ |
---|
339 | { |
---|
340 | int i, j; |
---|
341 | |
---|
342 | uint32 e, a; |
---|
343 | |
---|
344 | |
---|
345 | for (i = 0; i < height; i++) { |
---|
346 | for (j = 0; j < width; j++) { |
---|
347 | |
---|
348 | e = X[i][j]; |
---|
349 | a = T[e]; |
---|
350 | |
---|
351 | Y[i][j] = a; |
---|
352 | } |
---|
353 | } |
---|
354 | } |
---|
355 | /* ---------------------------------------------------------------------------------- */ |
---|
356 | void graphviz_write_ui8vector(uint8 * v, int i0, int i1, char * format, char * filename) |
---|
357 | /* ---------------------------------------------------------------------------------- */ |
---|
358 | { |
---|
359 | int i; |
---|
360 | char complete_filename[64]; |
---|
361 | |
---|
362 | snprintf(complete_filename, 64, "%s.dot", filename); |
---|
363 | |
---|
364 | #if TARGET_OS == GIETVM |
---|
365 | int fd; |
---|
366 | fd = open(complete_filename, O_CREAT | O_TRUNC); |
---|
367 | |
---|
368 | fprintf(fd, "digraph %s {\n", filename); |
---|
369 | for (i = i0; i <= i1; i++) { |
---|
370 | fprintf(fd, "%3d -> %3d;\n", i, v[i]); |
---|
371 | } |
---|
372 | fprintf(fd, "}\n"); |
---|
373 | close(fd); |
---|
374 | #elif TARGET_OS == LINUX |
---|
375 | FILE * f; |
---|
376 | f = fopen(complete_filename, "w"); |
---|
377 | if (f == NULL) { |
---|
378 | fprintf(stderr, "Can't open file %s in %s\n", complete_filename, __func__); |
---|
379 | } |
---|
380 | |
---|
381 | fprintf(f, "digraph %s {\n", filename); |
---|
382 | for (i = i0; i <= i1; i++) { |
---|
383 | fprintf(f, "%3d -> %3d;\n", i, v[i]); |
---|
384 | } |
---|
385 | fprintf(f, "}\n"); |
---|
386 | fclose(f); |
---|
387 | #endif |
---|
388 | } |
---|
389 | /* ------------------------------------------------------------------------------------ */ |
---|
390 | void graphviz_write_ui16vector(uint16 * v, int i0, int i1, char * format, char * filename) |
---|
391 | /* ------------------------------------------------------------------------------------ */ |
---|
392 | { |
---|
393 | int i; |
---|
394 | char complete_filename[64]; |
---|
395 | |
---|
396 | snprintf(complete_filename, 64, "%s.dot", filename); |
---|
397 | |
---|
398 | #if TARGET_OS == GIETVM |
---|
399 | int fd; |
---|
400 | fd = open(complete_filename, O_CREAT | O_TRUNC); |
---|
401 | |
---|
402 | fprintf(fd, "digraph %s {\n", filename); |
---|
403 | for (i = i0; i <= i1; i++) { |
---|
404 | fprintf(fd, "%3d -> %3d;\n", i, v[i]); |
---|
405 | } |
---|
406 | fprintf(fd, "}\n"); |
---|
407 | close(fd); |
---|
408 | #elif TARGET_OS == LINUX |
---|
409 | FILE * f; |
---|
410 | f = fopen(complete_filename, "w"); |
---|
411 | if (f == NULL) { |
---|
412 | fprintf(stderr, "Can't open file %s in %s\n", complete_filename, __func__); |
---|
413 | } |
---|
414 | |
---|
415 | fprintf(f, "digraph %s {\n", filename); |
---|
416 | for (i = i0; i <= i1; i++) { |
---|
417 | fprintf(f, "%3d -> %3d;\n", i, v[i]); |
---|
418 | } |
---|
419 | fprintf(f, "}\n"); |
---|
420 | fclose(f); |
---|
421 | #endif |
---|
422 | } |
---|
423 | |
---|
424 | |
---|
425 | /* ------------------------------------------------------------------------------------ */ |
---|
426 | void graphviz_write_ui32vector(uint32 * v, int i0, int i1, char * format, char * filename) |
---|
427 | /* ------------------------------------------------------------------------------------ */ |
---|
428 | { |
---|
429 | int i; |
---|
430 | char complete_filename[64]; |
---|
431 | |
---|
432 | snprintf(complete_filename, 64, "%s.dot", filename); |
---|
433 | |
---|
434 | #if TARGET_OS == GIETVM |
---|
435 | int fd; |
---|
436 | fd = open(complete_filename, O_CREAT | O_TRUNC); |
---|
437 | |
---|
438 | fprintf(fd, "digraph %s {\n", filename); |
---|
439 | for (i = i0; i <= i1; i++) { |
---|
440 | fprintf(fd, "%3d -> %3d;\n", i, v[i]); |
---|
441 | } |
---|
442 | fprintf(fd, "}\n"); |
---|
443 | close(fd); |
---|
444 | #elif TARGET_OS == LINUX |
---|
445 | FILE * f; |
---|
446 | f = fopen(complete_filename, "w"); |
---|
447 | if (f == NULL) { |
---|
448 | fprintf(stderr, "Can't open file %s in %s\n", complete_filename, __func__); |
---|
449 | } |
---|
450 | |
---|
451 | fprintf(f, "digraph %s {\n", filename); |
---|
452 | for (i = i0; i <= i1; i++) { |
---|
453 | fprintf(f, "%3d -> %3d;\n", i, v[i]); |
---|
454 | } |
---|
455 | fprintf(f, "}\n"); |
---|
456 | fclose(f); |
---|
457 | #endif |
---|
458 | } |
---|
459 | |
---|
460 | |
---|
461 | /* -------------------------------------------------------------------------------- */ |
---|
462 | void mod_ui32matrix_ui8matrix(uint32 ** X, int i0, int i1, int j0, int j1, uint8 ** Y) |
---|
463 | /* -------------------------------------------------------------------------------- */ |
---|
464 | { |
---|
465 | int i, j; |
---|
466 | for (i = i0; i <= i1; i++) { |
---|
467 | for (j = j0; j <= j1; j++) { |
---|
468 | Y[i][j] = X[i][j] & 255; |
---|
469 | } |
---|
470 | } |
---|
471 | } |
---|
472 | |
---|
473 | |
---|
474 | // -------------------------------------------------------------------------------------------- |
---|
475 | void positive_mod_ui32matrix_ui8matrix(uint32 ** X, int i0, int i1, int j0, int j1, uint8 ** Y) |
---|
476 | // -------------------------------------------------------------------------------------------- |
---|
477 | { |
---|
478 | int i, j; |
---|
479 | for (i = i0; i <= i1; i++) { |
---|
480 | for (j = j0; j <= j1; j++) { |
---|
481 | if (X[i][j]) { |
---|
482 | if (X[i][j] < 255) { |
---|
483 | Y[i][j] = X[i][j]; // pour que e=1 reste rouge |
---|
484 | } |
---|
485 | else { |
---|
486 | Y[i][j] = (X[i][j] % 254) + 1; |
---|
487 | } |
---|
488 | } |
---|
489 | else { |
---|
490 | Y[i][j] = 0; |
---|
491 | } |
---|
492 | |
---|
493 | } |
---|
494 | } |
---|
495 | } |
---|
496 | |
---|
497 | |
---|
498 | /* ---------------------------------------------------------------------------------------- */ |
---|
499 | void graphviz_write_ui32vector_par(uint32 * v, int i0, int i1, char * format, char * filename) |
---|
500 | /* ---------------------------------------------------------------------------------------- */ |
---|
501 | { |
---|
502 | int i; |
---|
503 | char complete_filename[64]; |
---|
504 | |
---|
505 | snprintf(complete_filename, 64, "%s.dot", filename); |
---|
506 | |
---|
507 | #if TARGET_OS == GIETVM |
---|
508 | int fd; |
---|
509 | fd = open(complete_filename, O_CREAT | O_TRUNC); |
---|
510 | |
---|
511 | fprintf(fd, "digraph %s {\n", filename); |
---|
512 | for (i = i0; i <= i1; i++) { |
---|
513 | fprintf(fd, "%3d -> %3d;\n", i, v[i]); |
---|
514 | } |
---|
515 | fprintf(fd, "}\n"); |
---|
516 | close(fd); |
---|
517 | #else |
---|
518 | FILE * f; |
---|
519 | f = fopen(complete_filename, "w"); |
---|
520 | if (f == NULL) { |
---|
521 | fprintf(stderr, "Can't open file %s in %s\n", complete_filename, __func__); |
---|
522 | } |
---|
523 | fprintf(f, "digraph %s {\n", filename); |
---|
524 | for (i = i0; i <= i1; i++) { |
---|
525 | fprintf(f, "%3d -> %3d;\n", i, v[i]); |
---|
526 | } |
---|
527 | fprintf(f, "}\n"); |
---|
528 | fclose(f); |
---|
529 | #endif |
---|
530 | } |
---|
531 | |
---|
532 | |
---|
533 | // -------------------------------------- |
---|
534 | uint32 mt19937_uint32(uint32 a, uint32 b) |
---|
535 | // -------------------------------------- |
---|
536 | // nombre aleatoire 32 bit sur [a..b] |
---|
537 | { |
---|
538 | uint32 d; |
---|
539 | uint32 x32; |
---|
540 | |
---|
541 | if (b < a) { |
---|
542 | return mt19937_uint32(b, a); |
---|
543 | } |
---|
544 | |
---|
545 | //printf("a = %u b = %u\n", a, b); |
---|
546 | |
---|
547 | d = b - a + 1; |
---|
548 | x32 = genrand_int32(); |
---|
549 | //printf("x32 = %u, d = %u\n", x32, d); |
---|
550 | x32 = (x32 % d) + a; |
---|
551 | return x32; |
---|
552 | } |
---|
553 | |
---|
554 | |
---|
555 | // ------------------------ |
---|
556 | bool strto_Bool(char * str) |
---|
557 | // ------------------------ |
---|
558 | { |
---|
559 | bool b = true; |
---|
560 | if (strcmp(str, "TRUE" ) == 0) b = true; |
---|
561 | if (strcmp(str, "true" ) == 0) b = true; |
---|
562 | |
---|
563 | if (strcmp(str, "FALSE") == 0) b = false; |
---|
564 | if (strcmp(str, "false") == 0) b = false; |
---|
565 | |
---|
566 | return b; |
---|
567 | } |
---|
568 | |
---|
569 | |
---|
570 | // ------------------------------------------------------------- |
---|
571 | void check_no_write(uint32 ** T, int i0, int i1, int j0, int j1) |
---|
572 | // ------------------------------------------------------------- |
---|
573 | { |
---|
574 | int i, j; |
---|
575 | for (i = i0; i <= i1; i++) { |
---|
576 | for (j = j0; j <= j1; j++) { |
---|
577 | if (T[i][j] == 0xDEADBEFF) { |
---|
578 | printf("[check_no_write]: T[%d][%d] = %d\n", i, j, T[i][j]); |
---|
579 | } |
---|
580 | } |
---|
581 | } |
---|
582 | } |
---|
583 | |
---|
584 | |
---|