Initial feedback for std.experimental.image

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 7 05:07:32 PDT 2015


On 7/07/2015 8:50 p.m., Manu via Digitalmars-d wrote:
> On 7 July 2015 at 01:34, ponce via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>> On Monday, 6 July 2015 at 13:48:53 UTC, Rikki Cattermole wrote:
>>>
>>> If reviewing the code itself is too much of a hassel, please review the
>>> specification document.
>>> http://cattermole.co.nz/phobosImage/docs/html/std_experimental_image_specification.html
>>>
>>
>>
>>> Use the Cartesian coordinates system using two (X and Y) size_t integers
>>
>>
>> Why not just int? There is preciously little addressable images beyond 2^31.
>> size_t has a variable size and is a source of build breaking.
>> Also, please no unsigned integers! This create all manners of bugs because
>> of how integer promotion work.
>
> size_t doesn't quietly cast to int. Most iterators are already size_t.
> Indexes shoulds be size_t for conventions sake, otherwise you case
> everywhere.
> Indices should be unsigned, otherwise you need to do 2 tests for
> validity, rather than just one; (x >= 0 && x < length) rather than
> just (x < length).

Well you both have very valid points.
In this case, lets go with: It's already written, let's not change it 
just because it might solve a few bugs while potentially adding others.



More information about the Digitalmars-d mailing list