xref: /trunk/main/idlc/test/const.idl (revision cdf0e10c)
1*cdf0e10cSrcweirmodule idlc
2*cdf0e10cSrcweir{
3*cdf0e10cSrcweirmodule test
4*cdf0e10cSrcweir{
5*cdf0e10cSrcweir	const long l = 1;
6*cdf0e10cSrcweir	const long add = 1 + 2;
7*cdf0e10cSrcweir	const long sub = 3 - 2;
8*cdf0e10cSrcweir	const hyper h = 123456789;
9*cdf0e10cSrcweir	const float f7 = 3.4123;
10*cdf0e10cSrcweir	const float f2 = 3.4123 + 10e-12;
11*cdf0e10cSrcweir	const boolean bt = True;
12*cdf0e10cSrcweir	const boolean bf = False;
13*cdf0e10cSrcweir	const boolean and = bt & bf;
14*cdf0e10cSrcweir
15*cdf0e10cSrcweir	/// SHORT_MAX + 1;
16*cdf0e10cSrcweir	const short shortMax = -0x8000;
17*cdf0e10cSrcweir	/// LONG_MAX + 1;
18*cdf0e10cSrcweir	const unsigned long longMax = 0x80000000;
19*cdf0e10cSrcweir
20*cdf0e10cSrcweir
21*cdf0e10cSrcweirconstants USER
22*cdf0e10cSrcweir{
23*cdf0e10cSrcweir	/// = 1
24*cdf0e10cSrcweir	const long FLAG1 = 0x00000001;
25*cdf0e10cSrcweir	/// = 2
26*cdf0e10cSrcweir	const long FLAG2 = 0x00000002;
27*cdf0e10cSrcweir	/// = 4
28*cdf0e10cSrcweir	const long FLAG3 = 0x00000004;
29*cdf0e10cSrcweir	/// = 8
30*cdf0e10cSrcweir	const long FLAG4 = 0x00000008;
31*cdf0e10cSrcweir	/// = 16
32*cdf0e10cSrcweir	const long FLAG5 = 0x00000010;
33*cdf0e10cSrcweir	/// = 0
34*cdf0e10cSrcweir	const long FLAG6 = FLAG1 & FLAG2;
35*cdf0e10cSrcweir	/// = 3
36*cdf0e10cSrcweir	const long FLAG7 = FLAG1 | FLAG2;
37*cdf0e10cSrcweir	/// = 2
38*cdf0e10cSrcweir	const long FLAG8 = (FLAG1 | FLAG2) & FLAG2;
39*cdf0e10cSrcweir	/// = 4
40*cdf0e10cSrcweir	const long FLAG9 = FLAG1 << 2;
41*cdf0e10cSrcweir	/// = 32
42*cdf0e10cSrcweir	const long FLAG10 = (FLAG5 >> 1) << 2;
43*cdf0e10cSrcweir	/// = 1
44*cdf0e10cSrcweir	const long FLAG11 = 33 % 4;
45*cdf0e10cSrcweir	/// = 4
46*cdf0e10cSrcweir	const long FLAG12 = FLAG10 / 8;
47*cdf0e10cSrcweir};
48*cdf0e10cSrcweir
49*cdf0e10cSrcweir};
50*cdf0e10cSrcweir};
51