Skip to content

Commit 32607d4

Browse files
committed
tests/examples/find-global-state: clarify the example by renaming variables
1 parent 42a1bbd commit 32607d4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/examples/find-global-state/input.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
static int a_global;
2323

2424
struct {
25-
int i;
25+
int f;
2626
} bar;
2727

2828
extern int foo;
@@ -35,11 +35,11 @@ int test(int j)
3535
return i + 1;
3636
}
3737

38-
int test2(int j)
38+
int test2(int p)
3939
{
40-
static int i = 0;
41-
i += j;
42-
return j * i;
40+
static int q = 0;
41+
q += p;
42+
return p * q;
4343
}
4444

4545
int test3(int k)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/examples/find-global-state/input.c:40:14: note: global state "int i" defined here
1+
tests/examples/find-global-state/input.c:40:14: note: global state "int q" defined here
22
tests/examples/find-global-state/input.c:26:3: note: global state "struct
33
{
4-
int i;
4+
int f;
55
} bar" defined here
66
tests/examples/find-global-state/input.c:22:12: note: global state "int a_global" defined here

0 commit comments

Comments
 (0)