Page 1 of 2

[TEST] C++ conversion

Posted: 03 Sep 2012, 23:42
by o11c
In order to have a codebase that I can hack in, I need to get rid of the nasty C code that makes up tmwa.

I renamed the files and fixed all the compiler errors while keeping behavior changes to a minimum.

There is now a test server this on caliban.homeip.net:6904

There is no new content on this server, it is just to confirm that it doesn't break anything that worked before (I have already unbroken one bug in my code and worked around one compiler bug)

---

If building this yourself, you may need to install/upgrade new packages (the 32-bit version of g++ instead of just gcc, version 4.4 or later. You may also build with clang by passing CXX=clang++ to the 'make' command; the required version is not exactly known but believed to be at least 2.9 (note that apple-branded clang has two version numbers, you want the one corresponding to LLVM))

In addition, I would also like feedback regarding which version of gcc or clang you are using - particularly, whether anyone other than Frost is still using gcc 4.4; and how many people besides Platinum still use gcc 4.5

Edit: the code is on the 'cxx' branch of the server repository

Re: [TEST] C++ conversion

Posted: 04 Sep 2012, 06:48
by Jenalya
o11c wrote: In addition, I would also like feedback regarding which version of gcc or clang you are using - particularly, whether anyone other than Frost is still using gcc 4.4; and how many people besides Platinum still use gcc 4.5

Code: Select all

gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Re: [TEST] C++ conversion

Posted: 04 Sep 2012, 07:28
by tux9th

Code: Select all

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Ubuntu 12.04

Re: [TEST] C++ conversion

Posted: 04 Sep 2012, 11:30
by Kandiman
> gcc --version
gcc (Debian 4.4.5-8) 4.4.5
Debian Squeeze

Re: [TEST] C++ conversion

Posted: 04 Sep 2012, 16:26
by o11c
are you guys actually testing, too?

Re: [TEST] C++ conversion

Posted: 08 Sep 2012, 14:30
by baedamichi
Hi,

I tested the "converted" server a bit, so far everything seems to work normally.

Tried all of the everyday stuff, like talking to NPCs, fighting, walking, using the bank, buying from NPC shops and such.

Anything specific you'd like me to test?

Regards,

Baeda

Re: [TEST] C++ conversion

Posted: 09 Sep 2012, 05:00
by o11c
baedamichi wrote:Anything specific you'd like me to test?
Not really - I'm not *expecting* anything to go wrong. Though before making this thread I did fix one unexpected problem that only occurs with old GCC, not with 4.6 or newer.

You might not have thought to test creating/deleting accounts and characters, both in-game and via ladmin.

Re: [TEST] C++ conversion

Posted: 11 Sep 2012, 21:13
by o11c
As there have been no reports of trouble I pushed this to master.

I will keep the cxx branch open for future work.

I will disable my instance on the test server and restart the main one.

Re: [TEST] C++ conversion

Posted: 11 Sep 2012, 21:25
by 4144
what features you removed from server?

Re: [TEST] C++ conversion

Posted: 11 Sep 2012, 21:28
by o11c
4144 wrote:what features you removed from server?
In this conversion I did my best not to change anything. Pruning, refactoring, and addition will come later.

Re: [TEST] C++ conversion

Posted: 11 Sep 2012, 21:57
by v0id
o11c, I didn't understand well if, among other things, you intended to get rid of all compiler warnings or not ?. If it's the case, i get a bunch of them (gcc 4.7.0). If it isnt expected, i ll throw them here.

Also, I'm quite concerned about all these changes: for example the scripting language is rather picky (like areatimers that dont work if the event string is too long......).

So I fear it might break things especially in cases where scripts are complex.
What do you think ?

Re: [TEST] C++ conversion

Posted: 11 Sep 2012, 22:13
by o11c
v0id wrote:o11c, I didn't understand well if, among other things, you intended to get rid of all compiler warnings or not ?. If it's the case, i get a bunch of them (gcc 4.7.0). If it isnt expected, i ll throw them here.

Also, I'm quite concerned about all these changes: for example the scripting language is rather picky (like areatimers that dont work if the event string is too long......).

So I fear it might break things especially in cases where scripts are complex.
What do you think ?
I didn't eliminate *all* the warnings, just the errors and a few of the (arbitrarily selected) "worst" warnings.

Nothing should've changed about limits of the scripting engine. In future I will eliminate all length limits except the ones that must be sent to the client.

Re: [TEST] C++ conversion

Posted: 16 Sep 2012, 16:39
by o11c
V0id reports an issue with getarraysize on string arrays.

Re: [TEST] C++ conversion

Posted: 17 Sep 2012, 11:55
by baseballboy
Slackware 13.37.0
gcc 4.5.2

Re: [TEST] C++ conversion

Posted: 18 Sep 2012, 14:33
by Jenalya
Why does it need to be build with 32-bit?