xref: /aoo41x/main/idlc/test/const.idl (revision 540d5e64)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22module idlc
23{
24module test
25{
26	const long l = 1;
27	const long add = 1 + 2;
28	const long sub = 3 - 2;
29	const hyper h = 123456789;
30	const float f7 = 3.4123;
31	const float f2 = 3.4123 + 10e-12;
32	const boolean bt = True;
33	const boolean bf = False;
34	const boolean and = bt & bf;
35
36	/// SHORT_MAX + 1;
37	const short shortMax = -0x8000;
38	/// LONG_MAX + 1;
39	const unsigned long longMax = 0x80000000;
40
41
42constants USER
43{
44	/// = 1
45	const long FLAG1 = 0x00000001;
46	/// = 2
47	const long FLAG2 = 0x00000002;
48	/// = 4
49	const long FLAG3 = 0x00000004;
50	/// = 8
51	const long FLAG4 = 0x00000008;
52	/// = 16
53	const long FLAG5 = 0x00000010;
54	/// = 0
55	const long FLAG6 = FLAG1 & FLAG2;
56	/// = 3
57	const long FLAG7 = FLAG1 | FLAG2;
58	/// = 2
59	const long FLAG8 = (FLAG1 | FLAG2) & FLAG2;
60	/// = 4
61	const long FLAG9 = FLAG1 << 2;
62	/// = 32
63	const long FLAG10 = (FLAG5 >> 1) << 2;
64	/// = 1
65	const long FLAG11 = 33 % 4;
66	/// = 4
67	const long FLAG12 = FLAG10 / 8;
68};
69
70};
71};
72