Working on a library: request for code review

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 18 06:42:31 PDT 2014


On Wednesday, 18 June 2014 at 09:41:01 UTC, Marc Schütz wrote:
> On Tuesday, 17 June 2014 at 18:35:34 UTC, Mike wrote:
>> Thanks, will work on fixes tonight.
>>
>>
>>> The current method will not detect an error when the image 
>>> type
>>> is not mapped  but a color map is present.
>>> At least I assume that is not a valid TGA file?
>>
>> A non-mapped image may contain a color map ;-0 it's simply 
>> discarded.
>>
>>
>> As per your ideas
>>
>>>return to!bool(isColorMapped(header)
>>>                      ? header.colorMapDepth.among(16, 32)
>>>                      : header.pixelDepth.among(16, 32));
>>
>> this is not nothrow, but as you can see there is nothing that 
>> can ever throw.. so perhaps I'll stick to the cast(bool) 
>> thing.. Any idea?
>
> Perhaps `return !!(...);` ?

test


More information about the Digitalmars-d-learn mailing list