Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: litghost on April 06, 2007, 05:39:29 am

Title: VS 2005 fixes for 3.6.9 branch
Post by: litghost on April 06, 2007, 05:39:29 am
In order to compile the current 3.6.9 with Visual Studio 2005 Express I had to fix some bugs and remake the compile environment.  I think I started from the VS2003 environment.  I have attached the complete VS2005 environment.

First bug fix was a MSVC6 error about for loops and variable scoping.   Second was an implicit boolean in outwnd.cpp.  Third was some weird usage of unsigned shorts as WCHAR.  The fourth and largest change was lua.h and lua.cpp to utilized iterators instead of raw pointers.  This was the cause of the vector index off end run-time errors.  In order to determine the "end" raw pointer, code like
Code: [Select]
lib_end = &lua_Libraries[lua_Libraries.size()];
was used.  This volates the VS2005 run-time sanity check, because it expose unallocated memory without ensuring it is not written.  The end iterator fixes this.  Hence, the proper STL way to do this is:
Code: [Select]
lib_end = lua_Libraries.end();

In the end I had to change all pointer types to iterator types and add some new interfaces to the lua_obj_h and lua_lib objects.

I have attached the code patch for the 4 bug-fixes, and an archive containing the new VS2005 environment.

[attachment deleted by admin]
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: jr2 on April 06, 2007, 08:16:00 am
Hmm.. way to go, 3 posts and you've contributed something on all three.  I can't believe you escaped so long... ;7
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: Goober5000 on April 06, 2007, 10:24:18 pm
Ooh.  The second coming of taylor, perhaps? :)

Would you like SCP internal access? :D
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: litghost on April 07, 2007, 12:20:01 am
If I knew what you meant, I could answer.
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: Goober5000 on April 07, 2007, 12:56:53 am
Do you want access to the SCP developer board?  It's a child of this board, but private.

Taylor says that many developers prefer mailing lists and are reluctant to visit forums regularly, but we've sort of stayed in the forum groove ever since the source was released back in 2002. :)
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: jr2 on April 07, 2007, 01:33:14 am
Heh, heh... :welcome:

Exits are to the rear and left.  They have been plastered shut with baguettes and peanut butter, so don’t try to use them. All hallways are monitored by sentry cannons that are equipped with n00b and spam detection systems, so don’t move. Now, don’t breathe. Stay like this for a while.

Under your seat you will find some of Raa’s cookies, Shrike’s dungeon pr0n, an0n’s graffiti, and a soggy newspaper containing news on the events of April 1, 2005; and the forum’s latest highlights, and a flame thrower.  We ran out of napalm on January 7, 2001, so you’ll have to bludgeon people to death.  Be sure to check out the Source Code Project, “A Journey of the Forgotten” in Hard Light Art, and the HLP Store, well, you’ve already discovered, so max out that credit card for HLP rewards miles, which can get you a trip anywhere from Capella to Gamma Draconis, courtesy of the NTF Air!

If for some dull reason you have avoided the sentries and are stuck wandering through the dank, dark ducts, stay armed to the teeth with lunch.  Chances are, you’ll encounter Carl, our local Shivan, so if you do, set down your lunch and slowly step away.  Hopefully he’ll leave you alone—he’s usually satisfied with those.  On the other hand, if you follow Raa, our Professor Tor’h Coolguy Vasudan, you’ll see him enter a kitchen.  Should you wish to peek inside, you’ll see him pull out a box, then a human head.  Should he see you, he’ll pull out a machete…

Welcome to HLP! Have a nice day.*
*recycled welcome, but hey...
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: karajorma on April 07, 2007, 03:58:34 am
Ooh.  The second coming of taylor, perhaps? :)

litghost is one of the coders I've managed to attract bu waving BtRL around. Hopefully they'll be more. :)
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: litghost on April 08, 2007, 12:46:11 am
Do you want access to the SCP developer board?  It's a child of this board, but private.

Taylor says that many developers prefer mailing lists and are reluctant to visit forums regularly, but we've sort of stayed in the forum groove ever since the source was released back in 2002. :)

I like forums more than mailing lists, so ya I'll wallow in.
Title: Re: VS 2005 fixes for 3.6.9 branch
Post by: Goober5000 on April 08, 2007, 01:41:29 pm
K.  Added.