]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Update man page
authorDale Weiler <killfieldengine@gmail.com>
Wed, 29 May 2013 11:29:52 +0000 (11:29 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Wed, 29 May 2013 11:29:52 +0000 (11:29 +0000)
doc/gmqcc.1
tests/rassign.qc

index 60257dc444b9645fe100f213d000f2ca3412437e..6ede944f1ffb68be44140899140e0ae7ba1e8439 100644 (file)
@@ -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
index f734e7eb5597dae8d28fc089c44c81da2d9b2acd..7e3d0e61f1b24cb5ace0b225081d7c2c50aa35c5 100644 (file)
@@ -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;
 }