JohnnyStarr
Wizard


Group: Members
Posts: 953
Joined: Feb 14, 2009
|
#1 id:44893 Posted Apr 5, 2010, 10:45 pm
|
I have had to come to the realization that I develop much faster in windows than i ever will
using *nix and Vim. I blame it on my first job as an administrative assistant coding VBA on our
access database all the time. I got used to the MS feel i guess.
I downloaded Nick Gammon's MSVS 2008 Rom pack.
It basically just has all the dlls required to run Rom in Windows, with a few tweaks to merc.h
99% of the codebase is standard Rom2.4b. I plan to upgrade-to or "enable" C++ right away.
This will be done in VS so the changes will be made to suit the needs of VS's compiler.
I am hoping that there wont be very many differences in g++, but I just don't know. My goal
is to write portable code, so that when I am done, it will be able to work on most compilers.
Although this is for a Rom base, it is more of a C++ question, thus this section was chosen.
For those of you with this type of experience, what things should I look for? Are there resources
I can take advantage of? ( note: i have enabled c++ on a rom project before for g++ 3.4.4 )
This time I plan to change all char* to std::string, and all lists to std::list or std::vector.
I am inspired by Tyche's Murk++, and would like to be able to do something similar with Rom.
|
Last edited Apr 5, 2010, 10:49 pm by JohnnyStarr
|
|
David Haley
Wizard


Group: Members
Posts: 7,783
Joined: Jun 30, 2007
|
#2 id:44894 Posted Apr 5, 2010, 10:53 pm
|
If you've already converted a base from C to C++, chances are that you're well aware of the various C to C++ differences like 'class' not being allowed anymore, etc.
I would not convert all char* to std::string and lists to std::list simply because you feel like it. For starters, you'll be spending an awful lot of time on that if you do, and chances are you won't touch the code again. Refactor if there is something to gain. I tend to refactor code as I touch it, and not go on a mass crusade to fix everything just because.
If you want to use C++ objects inside your structures, make sure that the structures are managed using not 'malloc' and 'free' but 'new' and 'delete'. If you use the C memory functions, the constructors and destructors on the objects will not be called leading to mass confusion, panic and unhappy people.
|
|
|
|
|
flumpy
Wizard


Group: Members
Posts: 623
Joined: Mar 27, 2009
|
#4 id:44900 Posted Apr 6, 2010, 5:29 am
|
Runter said:You know there's an old Chinese proverb that says "The man who hops back and forth between coding projects never finishes one." :)
It can't be /that/ old...
|
|
|
|
|
JohnnyStarr
Wizard


Group: Members
Posts: 953
Joined: Feb 14, 2009
|
#6 id:44904 Posted Apr 6, 2010, 8:28 am
|
See; I'm not plan on running a Rom, the "project" is the conversion itself.
The overall goal is to make the Rom equivalent to Murk++. My aim is to get rid of as much C-style coding as possible.
This will hopefully accomplish 2 things: 1) contribute something cool when all said and done. 2) get to know c++ better.
I have already cleaned things up this morning, and it is running fine. But I am just wanting to make sure that the standard
I am using accommodates both VC++ '08, and the latest g++. I could just fix it up to run on VC++ without worrying about
g++ until later, but if I know in advance what might clash, then I can get on the right track...
I guess this is more of a compiler question now that i think about it.
|
Last edited Apr 6, 2010, 8:32 am by JohnnyStarr
|
|
|
|
JohnnyStarr
Wizard


Group: Members
Posts: 953
Joined: Feb 14, 2009
|
#8 id:44912 Posted Apr 6, 2010, 6:46 pm
|
hey quix, which one? Is Ice the most recent?
|
|
|
Asylumius

Group: Members
Posts: 348
Joined: May 14, 2006
|
#9 id:44913 Posted Apr 6, 2010, 7:11 pm
|
IIRC, Ice is the cleaned up gcc version and Fire is the one with the g++ compatibility and additions.
|
|
|