mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 18:30:52 +00:00
Update man page
This commit is contained in:
parent
6d6a2efada
commit
1b71caa1fe
2 changed files with 18 additions and 2 deletions
12
doc/gmqcc.1
12
doc/gmqcc.1
|
@ -506,6 +506,18 @@ Example:
|
|||
void printA() = #1; // the usual way
|
||||
void printB() = #2-1; // with a constant expression
|
||||
.Ed
|
||||
.It Fl f Ns Cm return-assignments
|
||||
Enabiling this option will allow assigning values or expressions to the
|
||||
return keyword as if it were a local variable of the same type as the
|
||||
function's signature's return type.
|
||||
.Pp
|
||||
Example:
|
||||
.Bd -literal -offset indent
|
||||
float bar() { return 1024; }
|
||||
float fun() {
|
||||
return = bar();
|
||||
return; // returns value of bar
|
||||
}
|
||||
.El
|
||||
.Sh OPTIMIZATIONS
|
||||
.Bl -tag -width Ds
|
||||
|
|
|
@ -5,8 +5,12 @@ float f_float() {
|
|||
}
|
||||
|
||||
vector f_vector() {
|
||||
return = '1 2 3';
|
||||
return = '2 3 4';
|
||||
vector foo;
|
||||
foo.x = f_float();
|
||||
foo.y = f_float();
|
||||
foo.z = f_float();
|
||||
|
||||
return = foo;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue