Re: [BLACKBOX] [Fwd: Re: [BLACKBOX] Another trap during compile]

From: VDI <bernhardt.gunnar{([at]})nowhere.xy>
Date: Mon, 25 Oct 2010 09:28:16 +0200

----boundary-LibPST-iamunique-1608819247_-_-
Content-type: text/plain

Oleg,

please be a little more patient with us.
You appear to be deeply into quite advanced matters. So an additional
 explanation might help me to catch up with you.

Do you need to implement the entire SDL or might it be possible to
 restrict the implementation to a subset which only uses INTEGER?

Could you expatiate on why you prefer casting over converting?

kind regards
gunnar

-------------
> Chris Burrows wrote:
>
> >> MODULE XGrSettings;
> >>
> >> TYPE
> >> ScreenDepthBits8 = BYTE;
> >> ScreenDepthBits16 = SHORTINT;
> >> ScreenDepthBits32 = INTEGER;
> >> Color* = ScreenDepthBits8;
> >>
> >> ...
> >>
> >> END XGrSettings.
> >>
> >> PROCEDURE RGB* (r, g, b: SHORTCHAR): Color; BEGIN RETURN
> >> SYSTEM.VAL(Color, Sdl.MapRGB(screen.format,
> >> SYSTEM.VAL(UInt8, r), SYSTEM.VAL(UInt8, g),
> >> SYSTEM.VAL(UInt8, b))) END RGB;
> >>
>
> > Difficult to say as I'm not familiar with the SDL library
>
> Well, Sdl.MapRGB is defined as:
>
> PROCEDURE [ccall] MapRGB* ["SDL_MapRGB"] (format: PPixelFormat; r:
> UInt8; g: UInt8; b: UInt8): UInt32;
>
> As you see, result type of MapRGB is always UInt32 (INTEGER, in
 fact),
> and we need convert this value to one of types (BYTE, SHORTINT,

 INTEGER)
> that defines screen color depth OPTIONALLY defined in other module.
> UInt32, SInt32 are not my idea, it is adaptation of Delphi's JEDI
 SDL.
>
> And you can understant what is OPTIONALLY SETTINGS before critique
 my way?
>
> We can use {$IFDEF} in Pascal and Delphi, in CP I used optionally
 type,
> defined in special settings module.
>
> --
> Oleg
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
 LISTSERV{([at]})nowhere.xy
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1608819247_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIE9sZWcsXHBhcg0KXHBhcg0KcGxlYXNlIGJlIGEg
bGl0dGxlIG1vcmUgcGF0aWVudCB3aXRoIHVzLlxwYXINCllvdSBhcHBlYXIgdG8gYmUgZGVlcGx5
IGludG8gcXVpdGUgYWR2YW5jZWQgbWF0dGVycy4gU28gYW4gYWRkaXRpb25hbFxwYXINCiBleHBs
YW5hdGlvbiBtaWdodCBoZWxwIG1lIHRvIGNhdGNoIHVwIHdpdGggeW91LlxwYXINClxwYXINCkRv
IHlvdSBuZWVkIHRvIGltcGxlbWVudCB0aGUgZW50aXJlIFNETCBvciBtaWdodCBpdCBiZSBwb3Nz
aWJsZSB0b1xwYXINCiByZXN0cmljdCB0aGUgaW1wbGVtZW50YXRpb24gdG8gYSBzdWJzZXQgd2hp
Y2ggb25seSB1c2VzIElOVEVHRVI/XHBhcg0KXHBhcg0KQ291bGQgeW91IGV4cGF0aWF0ZSBvbiB3
aHkgeW91IHByZWZlciBjYXN0aW5nIG92ZXIgY29udmVydGluZz9ccGFyDQpccGFyDQpraW5kIHJl
Z2FyZHNccGFyDQpndW5uYXJccGFyDQpccGFyDQotLS0tLS0tLS0tLS0tXHBhcg0KPiBDa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bWVzc2FnZSB3aXRoIGJvZHkgIlNJR05P
RkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RTLk99fQBsaXN0DQpMaXN0LUg=
----boundary-LibPST-iamunique-1608819247_-_---
Received on Mon Oct 25 2010 - 09:28:16 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:29 UTC