Archived

This topic is now archived and is closed to further replies.

Ahnab

Help needed regarding the Quake2 engine & VC++

Recommended Posts

Hi! I downloaded the Q2 cource files from id''s site, and to test em, I made a new gamex86.dll by compiling all the files. The prob I''ve got is that I get a warning (NOT an error) that sez the following:- D:\Games\Quake2\Source\game\p_weapon.c(976) : warning C4700: local variable ''start'' used without having been initialized I''m using VC++ 6.0 Professional Edition. In all honesty, I have no idea why in Hell I''m geting this warning in the first place. All/any help would sure be appreciated. Thanx!

Share this post


Link to post
Share on other sites
You usually get that error when a variable is used in some way, without first being given a value.

Check this example code:

void myfunc()
{
int i;
my_other_func(i);
}

Thats a fairly lame and contrived example, but the point is you are using the variable when you don''t actually know what is stored in it. Remember, a variable, when first declared, is simply a named region of memory - it doesn''t necesarily mean that memory contains zero.
That example re-written to initialise the value of i would be something like this.

void myfunc()
{
int i;
i = 0; // here we initialise i
my_other_func(i);
}

I hope that clears things up, if I''m wrong I''m sure someone will correct me.

Take it easy,

-Mezz

Share this post


Link to post
Share on other sites