freesci-develop
[Top][All Lists]
Advanced

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

Re: [freesci-develop] Introduction and Question About ScummVM Integratio


From: Matt
Subject: Re: [freesci-develop] Introduction and Question About ScummVM Integration
Date: Tue, 3 Jun 2008 12:26:12 -0700 (PDT)

On Tue, 3 Jun 2008, Christoph Reichenbach wrote:

 To my recollection, FILE * and its API functions are standardised as
part of C89.  (FreeSCI has historically targetted C89, though we have
recently discussed migrating to C99).  Thus, FILE * is not at all
platform-specific beyond the `C89 platform'.

I thought we decided that we wouldn't purposefully break C89 compatibility, but that if we did we wouldn't go out of our way to fix it.

 If such a change is needed, I propose making the decision statically
(i.e., at compile time) as the dynamic approach seems to offer no
benefits but requires additional type conversions.  (For all the
practical use cases I can think of, there is no need to be able to
switch file representations at run-time).

Unless you wanted to inject the dependencies for unit tests, of course. You can also do this by sprinkling #ifdef's throughout the code, but that does end up being more of a maintenance/readability drag.

 The easiest solution to me then seems to be the introduction of a
file abstraction API (by refactoring the existing header files) with
two underlying implementations, one relying on the one we already have
in scicore/tools.c (plus extensions as needed) and one relying on the
ScummVM mechanisms, with a flag triggering which one we use.

We discussed using a structure similar to that of the gfx and pcm drivers -- does that jive with you?


--
tangled strands of DNA explain the way that I behave.
http://www.clock.org/~matt




reply via email to

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