stevenblack-blocklist: 3.15.5 -> 3.15.8 (#372042)
[NixPkgs.git] / pkgs / by-name / pm / pmars / 0001-fix-round-redefinition.patch
blob455514a26ef9287f74a3289d757cc8864f9b5e26
1 diff '--color=auto' -ruN a/src/cdb.c b/src/cdb.c
2 --- a/src/cdb.c 1970-01-01 01:00:01.000000000 +0100
3 +++ b/src/cdb.c 2024-10-08 11:28:57.892951658 +0200
4 @@ -1564,7 +1564,7 @@
5 (warriorsLeft ? warriorsLeft : 1));
6 substitute(buf[bi1], "CYCLE", outs, buf[bi2]);
7 SWITCHBI;
8 - sprintf(outs, "%d", round);
9 + sprintf(outs, "%d", roundCounter);
10 substitute(buf[bi1], "ROUND", outs, buf[bi2]);
12 SWITCHBI;
13 @@ -1875,7 +1875,7 @@
14 #endif
15 int nFuture, nPast, count, taskHalf = (coreSize <= 10000 ? 7 : 5);
17 - sprintf(outs, roundOfCycle, round, rounds,
18 + sprintf(outs, roundOfCycle, roundCounter, rounds,
19 (cycle + (warriorsLeft ? warriorsLeft : 1) - 1) /
20 (warriorsLeft ? warriorsLeft : 1));
21 cdb_fputs(outs, COND);
22 diff '--color=auto' -ruN a/src/curdisp.c b/src/curdisp.c
23 --- a/src/curdisp.c 1970-01-01 01:00:01.000000000 +0100
24 +++ b/src/curdisp.c 2024-10-08 11:29:52.129955266 +0200
25 @@ -156,7 +156,7 @@
26 wstandend(corewin);
27 if (!--refreshCounter) {
28 refreshCounter = refreshInterval;
29 - update_statusline(round);
30 + update_statusline(roundCounter);
31 wrefresh(corewin);
34 @@ -542,7 +542,7 @@
35 text_display_close()
37 if (displayLevel) {
38 - update_statusline(round - 1);
39 + update_statusline(roundCounter - 1);
40 wstandout(corewin);
41 mvwaddstr(corewin, 0, 0, pressAnyKey);
42 wrefresh(corewin);
43 diff '--color=auto' -ruN a/src/sim.c b/src/sim.c
44 --- a/src/sim.c 1970-01-01 01:00:01.000000000 +0100
45 +++ b/src/sim.c 2024-10-08 11:28:21.848284678 +0200
46 @@ -173,7 +173,7 @@
47 mem_struct FAR *memory;
49 long cycle;
50 -int round;
51 +int roundCounter;
53 char alloc_p = 0; /* indicate whether memory has been allocated */
54 int warriorsLeft; /* number of warriors still left in core */
55 @@ -328,7 +328,7 @@
56 #endif
58 display_init();
59 - round = 1;
60 + roundCounter = 1;
61 do { /* each round */
62 #if defined(DOS16) && !defined(SERVER) && !defined(DOSTXTGRAPHX) && !defined(DOSGRXGRAPHX) && !defined(DJGPP)
63 fputc('\r', stdout); /* enable interruption by Ctrl-C */
64 @@ -1421,13 +1421,13 @@
65 #ifndef SERVER
66 if (debugState == BREAK) {
67 if (warriorsLeft == 1 && warriors != 1)
68 - sprintf(outs, warriorTerminatedEndOfRound, W - warrior, W->name, round);
69 + sprintf(outs, warriorTerminatedEndOfRound, W - warrior, W->name, roundCounter);
70 else
71 - sprintf(outs, endOfRound, round);
72 + sprintf(outs, endOfRound, roundCounter);
73 debugState = cdb(outs);
75 #endif
76 - } while (++round <= rounds);
77 + } while (++roundCounter <= rounds);
79 display_close();
80 #ifdef PERMUTATE
81 diff '--color=auto' -ruN a/src/sim.h b/src/sim.h
82 --- a/src/sim.h 1970-01-01 01:00:01.000000000 +0100
83 +++ b/src/sim.h 2024-10-08 11:27:46.730634854 +0200
84 @@ -89,7 +89,7 @@
85 #define FAR
86 #endif
88 -extern int round;
89 +extern int roundCounter;
90 extern long cycle;
91 extern ADDR_T progCnt; /* program counter */
92 extern warrior_struct *W; /* indicate which warrior is running */