freesci-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [freesci-develop] Making FreeSCI code C++ friendly


From: Max Horn
Subject: Re: [freesci-develop] Making FreeSCI code C++ friendly
Date: Sun, 4 Mar 2007 19:46:55 +0100

HI folks,


Am 04.03.2007 um 04:40 schrieb Christoph Reichenbach:

Jordi,

On Fri, Mar 02, 2007 at 12:40:21AM +0100, Jordi Vilalta wrote:
I wrote a few months ago asking about the possibility of merging
FreeSCI into ScummVM. Last week I finally begun working on it, and the
first step has been making the FreeSCI code almost compile with a C++
compiler.

  Which parts are missing?

While I haven't seen this ominous "patch" either, my guess here is that nothing is "missing", but rather, he wanted to change some bits which are valid in C but not in C++ (as you probably aware of, C++ is not a proper superset of C, and with ISO C99 and newer there are even more disparities). Mainly, C++ is a bit more rectal about certain things, like implicit casts etc. (as one can easily find out when trying to compile with g++ instead of gcc), and then there are some additional reserved keywords. Some examples:

kgraphics.c:3386: error: invalid conversion from 'gint16' to 'gfx_alignment_t' kgraphics.c:3398: error: cannot convert 'gfx_pixmap_color_t*' to 'gfx_color_t*' in assignment kgraphics.c:3414: error: cannot convert 'gfx_pixmap_color_t*' to 'gfx_color_t*' in assignment

or

../../src/include/vm.h:323: error: expected unqualified-id before 'delete'
../../src/include/vm.h:619: error: expected ',' or '...' before 'export'

or

../../src/include/sci_memory.h: At global scope:
../../src/include/sci_memory.h:166: warning: inline function 'void* _SCI_MALLOC(size_t, const char*, int, const char*)' used but never defined ../../src/include/sci_memory.h:206: warning: inline function 'void _SCI_FREE(void*, const char*, int, const char*)' used but never defined


etc. Most of them are trivial to fix w/o any real impact on the regular use of the code (well, only that you'll have to get used to a different name than "delete" :-)



By the way, while any attempt to clean up the source code is appreciated,
I'm not sure how much of this is strictly neccessary-- most languages,
including C++, can link against C object files without too much trouble.

That's true, but it helps if one can compile all the code with a single compiler. But it's definitely not a strict requirement.


Cheers,
Max






reply via email to

[Prev in Thread] Current Thread [Next in Thread]