Error: prefixes to denote integers are deprecated

Discuss programming in the QuakeC language.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Error: prefixes to denote integers are deprecated

Post by Baker »

Trying to compile RQuake (download for reference) with FTEQCC and I think it worked in the past:

bprint (vip.noise2[%1]); <---- error
in function vote_action (line 103),
vote.qc:110: warning: ~ or % prefixes to denote integers are deprecated. Please use a postfix of 'i'
vote.qc:110: error: Opcode "=|LOADA_FLD" not valid for target
I don't know what %1 used to do and not sure what format it is looking for.

I'm sure this is easy, but I don't know what to do. old frikqcc 2.5 compiles it as is. Searching here + google = no dice to see if question has been answered before = no dice.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Error: prefixes to denote integers are deprecated

Post by Spike »

FTEQCC does not support QCCX syntax. it never has, it probably never will.
%5 is meant to be equivelent to 5i, although there are some other differences like fteqcc implicitly converting ints to floats as needed - which for non-constants depends upon opcode extensions.

Presumably that line can be fixed with:
bprint(substring(vip.noise2, 1, -1));
If you want to avoid extra builtin dependancies, you can also do:
local string tmp = vip.noise2;
asm ADD_F tmp 1i tmp;
bprint(tmp);
Unfortunately, the following requires opcode extensions (because its rare enough that I didn't bother trying to emulate it), but would do the same thing:
bprint(vip.noisei2 + 1);

Of course, you'll have other issues elsewhere.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Error: prefixes to denote integers are deprecated

Post by Baker »

I thought I had a no-qccx version of it. Apparently not.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Post Reply