[Insight-developers] Win64 "unsigned long" -> size_t changes

David Cole david.cole at kitware.com
Tue Nov 23 12:20:47 EST 2010


Questions and observations from my notes while making this change:
http://review.source.kitware.com/#change,427

Please read through and make any comments or replies as you see fit
within your areas of expertise. These were things that I had questions
about (I am non-expert on several ITK classes), and remain open for
future discussions.

Thanks,
David Cole


General: (other usages of "unsigned long" and "long" that remain:)
- what are EquivalencyTable and EquivalencyTable used for? is
"unsigned long" ok for it? or does it need 64-bit capacity? (i.e. --
are PointIdentifier or CellIdentifier entities used in the equivalency
tables? if so, they need 64-bit capacity...)
- update / modified times remain as "unsigned long"
- DataObject source index remains as "unsigned int"
- event observer "tags"
- number of dimensions
- consider adding globally known typedefs for DimensionType and
MTimeType and ObserverTagType


Specific questions about files in "Code/Common":

ITK\Code\Common\itkAzimuthElevationToCartesianTransform.h
ITK\Code\Common\itkAzimuthElevationToCartesianTransform.txx
  ?: azimuth and elevation expressed as "long", should be
     itk::Index::IndexValueType?

ITK\Code\Common\itkBlox*
  ?: number of boundary points, number of core atoms, number of itmes,
     number of pixels, size: all "unsigned long"

ITK\Code\Common\itkBoundingBox
  ?: BoundingBox::TPointIdentifier changed default to "size_t" instead of
     "unsigned long", should it be *ValueType instead?

ITK\Code\Common\itkBSpline*
  ?: ok as is? unsigned long used as weights count/index

ITK\Code\Common\itkCellInterface.h
  ?: cell id "unsigned long" -- should be instead?

ITK\Code\Common\itkCentralDifferenceImageFunction.txx
  ?: why the cast? is it necessary? was it to suppress warning?

ITK\Code\Common\itkConstNeighborhoodIterator.h
  ?: GetBound return value?

ITK\Code\Common\itkConstNeighborhoodIterator.txx
  ?: re-write loop with "long"s left in it?

ITK\Code\Common\itkCorrespondingList.h
  ?: changed to list::size_type

ITK\Code\Common\itkDefaultDynamicMeshTraits.h
  ?: changed to "size_t" from "unsigned long" but comment says it should be
     the "index type to the PointsContainer"

ITK\Code\Common\itkDefaultImageTraits.h
  ?: first template parameter to ValarrayImageContainer changed to "size_t"
     instead of "unsigned long", should it be *ValueType instead?
  ?: email to Luis and Brad :: REMOVE THIS FILE -- completely unreferenced

ITK\Code\Common\itkDefaultStaticMeshTraits.h
  ?: changed to "size_t" from "unsigned long" but comment says it should be
     the "index type to the PointsContainer"

ITK\Code\Common\itkDirectory.cxx
  ok: "unsigned long" to match underlying implementation signature

ITK\Code\Common\itkFixedArray.h
  ?: do we therefore also need long long and unsigned long long versions
     of operator[]?

ITK\Code\Common\itkImageConstIteratorWithIndex.h
  ?: why does line 106 use " - 1" to compute pastEnd? shouldn't it be " + 1"?

ITK\Code\Common\itkImageRandomConstIteratorWithIndex.txx
  ?: "PositionType" used to be "unsigned long" ... but it seems more
like an Index or Offset
     not a Size... should it be signed?

ITK\Code\Common\itkImageRandomNonRepeatingConstIteratorWithIndex.h
  ?: should first template parameter in "PriorityImageType" typedef be
size_t or a reference
     to another ITK-defined type?

ITK\Code\Common\itkIterationReporter.h
  ?: do we want more than 2 billion "steps per update"?

ITK\Code\Common\itkLinearInterpolateImageFunction.h
  ok: probably ok to be limited to 2 billion neighbors for
interpolation purposes...

ITK\Code\Common\itkMesh.h
  ?: still need to change this: size_t -> proper type (CellIdentifier?)...

ITK\Code\Common\itkNumericTraits.h
  ?: class NumericTraits< int > :public vcl_numeric_limits< int >
       ...
       typedef long         AccumulateType;
     AccumulateType should be a larger-sized type, right? int and long are
     the same (and both 32-bits) on Win32 and Win64

ITK\Code\Common\itkNeighborhoodAlgorithm.txx
  ?: local "long" variables in ImageBoundaryFacesCalculator< TImage
>::operator()
       should be "long long"?

ITK\Code\Common\itkPointSet.h
  ?: "typedef long RegionType;" should be larger than "long"?

ITK\Code\Common\itkQuadEdgeCellTraitsInfo.h
  ?: remaining "unsigned long" -- should be size_t, TPointIdentifier, other?
ITK\Code\Common\itkQuadEdgeMeshPoint.h
  ?: same : "unsigned long" here?

ITK\Code\Common\VNLIterativeSparseSolverTraits.h
  ok: leave alone... do we need more than 2 billion iterations here?


More information about the Insight-developers mailing list