repo.or.cz
/
vala-gnome.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Release 0.41.92
[vala-gnome.git]
/
tests
/
pointers
/
bug590641.vala
blob
c0978e7402784f4682271e257bb78b3fb2bcfeb9
1
const
string
[]
FOO
= {
"foo"
,
"bar"
};
2
3
void
foo
(
char
**
s
) {
4
assert
(((
string
[])
s
)[
0
] ==
"foo"
);
5
}
6
7
void
main
() {
8
uint
i
=
42
;
9
10
int
*
p0
= (
int
*) &
i
;
11
uint
u0
= (
uint
) *
p0
;
12
assert
(
u0
==
i
);
13
14
int
*
p1
= (
int
*) (&
i
);
15
uint
u1
= (
uint
) (*
p1
);
16
assert
(
u1
==
i
);
17
18
char
**
p2
= (
char
**)
FOO
;
19
foo
((
char
**)
FOO
);
20
foo
(
p2
);
21
22
string
s0
= (
string
)
p2
[
0
];
23
assert
(
s0
==
"foo"
);
24
string
s1
= (
string
) *(
p2
+
1
);
25
assert
(
s1
==
"bar"
);
26
}