.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...
Posts | ||
---|---|---|
Conserve global variables - use "null_string" | Locked | |
Thread Options | ||
|
Nov 17 2013 Anchor | |
Coding quake-c harks back to an older day. It makes me mindful of 6502 and Z80 coding. I have recently discovered global variables have a hard limit - 32768. These are all examples of global variables
Every line in the examples above loads another global variable. That is 15 globals in that example. Yes, the local variables are globals. Yes, the function defines are globals. And yes, the literals like 42, and "Hello!\n" are...you guessed it, globals. I found this trick with fteqcc - Replace all null string references "" (two quotes) with: string null_string = ""; // at the end of defs.qc instead of:
use:
Every instance will save you one global variable. Update: V106 qc already does this with - defs.qc:string string_null; // null string, nothing should be held here Edited by: numbersix |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.