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

From: [at]} <Chris>
Date: Sun, 24 Oct 2010 22:30:31 +1030

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

> -----Original Message-----
> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
> Oleg N. Cher
> Sent: Saturday, 23 October 2010 8:59 PM
> To: BLACKBOX{([at]})nowhere.xy
> Subject: Re: [BLACKBOX] [Fwd: Re: [BLACKBOX] Another trap
> during compile]
>
>
> Well, Sdl.MapRGB is defined as:
>
> PROCEDURE [ccall] MapRGB* ["SDL_MapRGB"] (format: PPixelFormat; r:
> UInt8; g: UInt8; b: UInt8): UInt32;
>

OK. I'm not 100% sure but I think you can equivalently map this definition
as:

PROCEDURE [ccall] MapRGB* ["SDL_MapRGB"] (format: PPixelFormat; r, g, b:
SHORTCHAR): INTEGER;

and then avoid the UInt8 typecasts.

As long as you aren't using the result in arithmetic expressions I don't see
that it really matters whether it is defined as signed or unsigned as long
as it is a 32-bit value.

> 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 is where SYSTEM.VAL is not going to work. If you are *converting* the
32-bit return value to a smaller (16-, or 8-bit) type you can't do that with
typecasting, you should use the SHORT function instead.

However, don't take my word for it - I might well be missing the point
altogether.

> 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?
>

No sorry - I do not understand exactly how you have set it up to OPTIONALLY
using different result types.

Regards,
Chris Burrows
CFB Software
http://www.cfbsoftware.com


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1778229109_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRle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9uJ3QgdGFrZSBteSB3b3JkIGZvciBpdCAtIEkgbWlnaHQgd2VsbCBiZSBt
aXNzaW5nIHRoZSBwb2ludFxwYXINCmFsdG9nZXRoZXIuXHBhcg0KXHBhcg0KPiB0aGF0IGRlZmlu
ZXMgc2NyZWVuIGNvbG9yIGRlcHRoIE9QVElPTkFMTFkgZGVmaW5lZCBpbiBvdGhlciBtb2R1bGUu
XHBhcg0KPiBVSW50MzIsIFNJbnQzMiBhcmUgbm90IG15IGlkZWEsIGl0IGlzIGFkYXB0YXRpb24g
b2YgRGVscGhpJ3MgSkVESSBTREwuXHBhcg0KPiBccGFyDQo+IEFuZCB5b3UgY2FuIHVuZGVyc3Rh
bnQgd2hhdCBpcyBPUFRJT05BTExZIFNFVFRJTkdTIGJlZm9yZSBccGFyDQo+IGNyaXRpcXVlIG15
IHdheT9ccGFyDQo+IFxwYXINClxwYXINCk5vIHNvcnJ5IC0gSSBkbyBub3QgdW5kZXJzdGFuZCBl
eGFjdGx5IGhvdyB5b3UgaGF2ZSBzZXQgaXQgdXAgdG8gT1BUSU9OQUxMWVxwYXINCnVzaW5nIGRp
ZmZlcmVudCByZXN1bHQgdHlwZXMuXHBhcg0KXHBhcg0KUmVnYXJkcyxccGFyDQpDaHJpcyBCdXJy
b3dzXHBhcg0KQ0ZCIFNvZnR3YXJlXHBhcg0KaHR0cDovL3d3dy5jZmJzb2Z0d2FyZS5jb21ccGFy
DQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdp
dGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JFUk9OLkNIXH19
AC9PVQ==
----boundary-LibPST-iamunique-1778229109_-_---
Received on Sun Oct 24 2010 - 14:00:31 UTC

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