[MINC-development] MINC2 API inconsistent data type

Andrew Janke a.janke at gmail.com
Tue Dec 11 15:53:19 EST 2012


Hi Vlad,

> could somebody explain why
>
> int miget_dimension_size(midimhandle_t dimension, unsigned int *size_ptr);
>
> int miget_dimension_sizes(const midimhandle_t dimensions[], int array_length,
>                                  unsigned int sizes[]);
>
>
> - uses unsigned int for dimension size, while
>
> int miget_real_value_hyperslab(mihandle_t volume,
>                                       mitype_t buffer_data_type,
>                                       const unsigned long start[],
>                                       const unsigned long count[],
>                                       void *buffer);
>
> - uses unsigned long for indexing hyperslabs ? Which makes a difference on 64bit platform.

My initial reaction is: "because it's wrong".

> maybe it's worth to have uniform datatype describing size of the dimensions ?

Indeed.

I'll bet this is a result of history in that the first two functions
existed first and the last was added as part of MINC2 at which point
it was decided that such things should be a long. Mind you long is
very much overkill for dimension sizes/start/count but I imagine it
was done because of the 64bit problem as you have said.


a


More information about the MINC-development mailing list