File: custom-types.vala

package info (click to toggle)
vala 0.56.18-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 57,468 kB
  • sloc: ansic: 581,293; sh: 5,334; makefile: 3,946; xml: 3,161; yacc: 1,219; lex: 374; javascript: 23
file content (52 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[IntegerType (rank = 6, signed = true, width = 32)]
[SimpleType]
[CCode (has_type_id = false)]
struct foo_t {
}

[IntegerType (rank = 11, signed = false, width = 64)]
[SimpleType]
[CCode (has_type_id = false)]
struct faz_t {
}

[FloatingType (rank = 1, width = 32)]
[SimpleType]
[CCode (has_type_id = false)]
struct bar_t {
}

[FloatingType (rank = 2, width = 64)]
[SimpleType]
[CCode (has_type_id = false)]
struct baz_t {
}

[BooleanType]
[SimpleType]
[CCode (has_type_id = false)]
struct manam_t {
}

void main () {
	{
		foo_t foo = int32.MAX;
		assert (foo == int32.MAX);
	}
	{
		faz_t faz = uint64.MAX;
		assert (faz == uint64.MAX);
	}
	{
		bar_t bar = float.MAX;
		assert (bar == float.MAX);
	}
	{
		baz_t baz = double.MAX;
		assert (baz == double.MAX);
	}
	{
		manam_t manam = true;
		assert (manam);
	}
}