nrrd:
nrrd:

API CHANGE (rename):

These functions have been renamed as follows:
       nrrdWrap --> nrrdWrap_va
      nrrdAlloc --> nrrdAlloc_va
 nrrdMaybeAlloc --> nrrdMaybeAlloc_va
nrrdAxisInfoSet --> nrrdAxisInfoSet_va
nrrdAxisInfoGet --> nrrdAxisInfoGet_va
 nrrdContentSet --> nrrdContentSet_va
    nrrdReshape --> nrrdReshape_va
     nrrdSample --> nrrdSample_va
        nrrdPad --> nrrdPad_va
  nrrdSimplePad --> nrrdSimplePad_va

That is, all functions in the Nrrd API that use var-args now have
"_va" at the end of their name.

The extent of var-args usage in Nrrd was a mistake.  Gordon regrets
this mistake.  This rename is only a superficial change, and it does
not undo the mistake.  The purpose of the rename is to forcibly break
code that uses the var-args code, thereby creating the opportunity to
move to the non-var-args code.  There are non-var-args functions for
nearly all of the above:

nrrdWrap_nva
nrrdAlloc_nva
nrrdMaybeAlloc_nva
nrrdAxisInfoSet_nva
nrrdAxisInfoGet_nva
nrrdReshape_nva
nrrdSample_nva
nrrdPad_nva
nrrdSimplePad_nva

There is no non-var-args version of nrrdContentSet, because it is based
on a printf() style organization of parameters, and printf() will
always be var-args-based.

The rename also removes the appearance that normal or default
functions (with the undecorated names) support var-args usage.  Having
the "_va" in the function should serve as a little reminder that if
you use this function,

1) syntactic sugar and code brevity is more important to you than
   type safety
2) in lieu of type safety, you're going to be absolutely sure that
   you've cast the arguments as needed.  This means explicit casts
   for size_t-type parameters which are not already of that type.

The second point is because on 64-bit platforms, the type-promotion
rules applied to var-args arguments do not create size_t out of
non-size_t integral types. The size_t-type arguments are used in:

nrrdWrap_va
nrrdAlloc_va
nrrdMaybeAlloc_va
nrrdAxisInfoSet_va(nin, nrrdAxisInfoSize, ...)
nrrdReshape_va
nrrdSample_va

C code may use the AIR_CAST macro to make occurances of casting
grep-able, C++ code should use static_cast.

----------------------------------------------
nrrd:

API CHANGE:

These functions:

  nrrdCCSize(Nrrd *nout, const Nrrd *nin);
  nrrdCCMax(const Nrrd *nin);
  nrrdCCNum(const Nrrd *nin);

now return unsigned int instead of int.  This should have been fixed
in the previous great signed->unsigned type switch.

----------------------------------------------
nrrd:

API NEW:

unsigned int (*nrrdUILoad[NRRD_TYPE_MAX+1])(const void *v);
unsigned int (*nrrdUIStore[NRRD_TYPE_MAX+1])(void *v, unsigned int j);
unsigned int (*nrrdUILookup[NRRD_TYPE_MAX+1])(const void *v, size_t I);
unsigned int (*nrrdUIInsert[NRRD_TYPE_MAX+1])(void *v, size_t I,
                                              unsigned int j);

These are just unsigned int analogs for nrrdILoad, nrrdIStore,
nrrdILookup, and nrrdIInsert.


git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@3115 3d70eeeb-363e-0410-a505-8a46323a89f2

Slicer/teem,Slicer/teem,BRAINSia/teem,Slicer/teem,BRAINSia/teem,BRAINSia/teem,Slicer/teem,BRAINSia/teem,Slicer/teem,BRAINSia/teem