From: divVerent Date: Sat, 31 Mar 2012 21:24:00 +0000 (+0000) Subject: We changed scope. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ecdcd8d2aed3280d60fd84a0bf534cbd4b179e3;p=xonotic%2Fxonotic.wiki.git We changed scope. (Commit created by redmine exporter script from page "Introduction_to_QuakeC" version 7) --- diff --git a/Introduction_to_QuakeC.textile b/Introduction_to_QuakeC.textile index 8526f7f..c145c0a 100644 --- a/Introduction_to_QuakeC.textile +++ b/Introduction_to_QuakeC.textile @@ -90,7 +90,7 @@ declares a variable of function type. An alternate and often more readable way t h2. Scope A variable declared in the global scope has global scope, and is visible starting from its declaration to the end of the code. The order the code is read in by the compiler is defined in the file %%progs.src%%. -A variable declared inside a function has function scope, and is visible starting from its declaration to the end of the function (**not** to the end of the block). +A variable declared inside a function has block scope, and is visible starting from its declaration to the end of the smallest block that contains its declaration. Some variables are declared in "sys.qh":http://git.xonotic.org/?p=xonotic/xonotic-data.pk3dir.git;a=blob_plain;f=qcsrc/server/sys.qh;hb=HEAD. Their declarations or names should never be changed, as they have to match the order and names of the variables in the file file "progdefs.h":http://svn.icculus.org/twilight/trunk/darkplaces/progdefs.h?view=markup of the engine exactly, or the code won't load. The special markers _end_sys_globals_ and _end_sys_fields_ are placed to denote the end of this shared declaration section.