discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Comparing @encode() output


From: Richard Frith-Macdonald
Subject: Re: Comparing @encode() output
Date: Thu, 18 Jun 2009 17:03:50 +0100


On 18 Jun 2009, at 15:00, Stefan Bidigaray wrote:

Just one more question... how sensible is it to use those OSTypes to do it? I've seen them all over the Apple docs, but gcc spits out a bunch of warnings.

Something like:
enum
{
  GSSoundUChar = 'UCHR'
  GSSoundSChar = 'CHAR'
  GSSoundShort = 'SHRT'
....
}

The only point I see to using the compiler extension to initialize a 4 byte integer with letter is if you want the resulting integer to be readily readable when viewed as a string ... pretty rare, and unlikely to be an issue in this case. Probably better to stick to a simple enumeration where the compiler will give you small integer values.

I wouldn't use names like GSSoundShort which are ambiguous (maybe a future processor will have a 32bit short). I'd have thought something like GSSound8BitPCM, GSSound16BitPCM, GSSound32BitPCM ...



reply via email to

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