diff --git a/tools/qfcc/source/dump_globals.c b/tools/qfcc/source/dump_globals.c index d2c4702a6..c42ab10d7 100644 --- a/tools/qfcc/source/dump_globals.c +++ b/tools/qfcc/source/dump_globals.c @@ -89,7 +89,7 @@ dump_def (progs_t *pr, ddef_t *def, int indent) comment = va (" %g", G_FLOAT (pr, offset)); break; case ev_vector: - comment = va (" '%g %g %g", + comment = va (" '%g %g %g'", G_VECTOR (pr, offset)[0], G_VECTOR (pr, offset)[1], G_VECTOR (pr, offset)[2]); @@ -118,7 +118,7 @@ dump_def (progs_t *pr, ddef_t *def, int indent) comment = va (" %x", G_INT (pr, offset)); break; case ev_quat: - comment = va (" '%g %g %g %g", + comment = va (" '%g %g %g %g'", G_QUAT (pr, offset)[0], G_QUAT (pr, offset)[1], G_QUAT (pr, offset)[2], diff --git a/tools/qfcc/test/cast2.r b/tools/qfcc/test/cast2.r new file mode 100644 index 000000000..0427a4221 --- /dev/null +++ b/tools/qfcc/test/cast2.r @@ -0,0 +1,9 @@ +void foo (vector x) +{ + entity *ep; + int d; + + //d = (int) x.y; + //ep = (entity *) d; + ep = (entity *) (int) x.y; +} diff --git a/tools/qfcc/test/class-end.r b/tools/qfcc/test/class-end.r new file mode 100644 index 000000000..02dfc1017 --- /dev/null +++ b/tools/qfcc/test/class-end.r @@ -0,0 +1,23 @@ +@interface foo +-init; +@end + +@implementation foo +-init +{ + return self; +} + +@protocol baz +-blah; +@end + +@interface bar +-init; +@end + +@implementation bar +-init +{ + return self; +} diff --git a/tools/qfcc/test/const.r b/tools/qfcc/test/const.r new file mode 100644 index 000000000..961b83d43 --- /dev/null +++ b/tools/qfcc/test/const.r @@ -0,0 +1,2 @@ +int x = 3; +float y = 4; diff --git a/tools/qfcc/test/field-alias.r b/tools/qfcc/test/field-alias.r new file mode 100644 index 000000000..a333f2ba2 --- /dev/null +++ b/tools/qfcc/test/field-alias.r @@ -0,0 +1,11 @@ +.int blah; +.void () think; +.SEL thinkMethod = think; + +void foo (entity e) +{ + *(SEL *)&e.think = @selector(foo:); + e.thinkMethod = @selector(foo:); +} +void __obj_exec_class (obj_module_t *msg) = #0; + diff --git a/tools/qfcc/test/self-this.r b/tools/qfcc/test/self-this.r new file mode 100644 index 000000000..12860140f --- /dev/null +++ b/tools/qfcc/test/self-this.r @@ -0,0 +1,6 @@ +.int a; + +void f(void) +{ + @self.@this = nil; +} diff --git a/tools/qfcc/test/value.r b/tools/qfcc/test/value.r index 816b3ff51..96b357d50 100644 --- a/tools/qfcc/test/value.r +++ b/tools/qfcc/test/value.r @@ -1,9 +1,16 @@ float VAL1 = 4; float VAL2 = 6; +vector VMIN = '-16 -16 -24'; +vector VMAX = '16 16 32'; +vector v; void send (float to, ...) = #0; void do_something () { + vector a; + + a = VMIN; + a = VMAX; send (VAL1, VAL2); } diff --git a/tools/qfcc/test/vector2.r b/tools/qfcc/test/vector2.r new file mode 100644 index 000000000..4b9aa031a --- /dev/null +++ b/tools/qfcc/test/vector2.r @@ -0,0 +1,13 @@ +vector a; +entity e; +.vector v; + +float foo (void) +{ + a.z += 3; + a_z += 3; + e.v = a; + e.v.y = 2; + e.v_y = 2; + return e.v.z; +}