3 It is possible that at some point we decide to switch QC-compiler which requires some changes to the code.
7 In fteqcc there are some ambiguities regarding fieldpointers, function pointers, and field-return-types etc.
8 A clean syntax is needed, *SUGGESTIONS ARE WELCOME*, my(blub's) current suggestion is:
10 |_.definition|_.meaning|
11 |<code>float foo(void)</code>| function|
12 |<code>float foo*(void)</code>| function pointer|
13 |<code>.float foo(void)</code>| member: method/function pointer|
14 |<code>..float foo(void)</code>|/2. member: method/function pointer returning .float|
15 |<code>..*float foo(void)</code>|
16 |<code>.*float foo*(void)</code>| function pointer returning .float|
17 |<code>.*float</code>| fieldpointer|
18 |<code>.*float foo(void)</code>| fieldpointer: method/function pointer|
19 |<code>.*.float foo(void)</code>| fieldpointer: method/function pointer returning .float|
22 |_.definition|_.meaning|
23 |<code>float foo(void)</code>| function|
24 |<code>float foo*(void)</code>| function pointer|
25 |<code>.float foo(void)</code>| member: method/function pointer|
26 |<code>..float foo(void)</code>| member: method/function pointer returning .float|
27 |<code>..*float .foo(void)</code>| Member function returning pointer to float field
28 |<code>.*float foo*(void)</code>| function pointer returning .float|
29 |<code>.*float</code>| fieldpointer|
30 |<code>.*float foo(void)</code>| fieldpointer: method/function pointer|
31 |<code>.*.float foo(void)</code>| fieldpointer: method/function pointer returning .float|
33 Additionally, at places where the definition of members or global functions is not allowed, they will be treated like fieldpointers.
34 So inside parameterlists or a functionbody the list is as follows:
36 |_.definition|_.meaning|
37 |<code>float foo(void)</code>| *function pointer*|
38 |<code>float foo*(void)</code>| function pointer|
39 |<code>.float foo(void)</code>| *fieldpointer: method/function pointer*|
40 |<code>..float foo(void)</code>|/2. *fieldpointer: method/function pointer returning .float*|
41 |<code>..*float foo(void)</code>|
42 |<code>.*float foo*(void)</code>| function pointer returning .float|
43 |<code>.*float</code>| fieldpointer|
44 |<code>.*float foo(void)</code>| fieldpointer: method/function pointer|
45 |<code>.*.float foo(void)</code>| fieldpointer: method/function pointer returning .float|
47 h2. Function definitions:
49 The old-style QC way of defining functions will not be supported, so
50 <pre>void(float x) something = { ... }</pre>
52 <pre>void something(float x) { ... }</pre>
53 which is the most common way to define functions in the xonotic code already anyway.
58 <pre>float x = 3</pre>
59 does what the first instinct tells you: it creates a global with the initial value 3. Contrary to old QC, where it created a constant.
60 To create a constant use:
61 <pre>const float x = 3</pre>