Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#897 closed task (fixed)

types inconsistency

Reported by: cvvergara Owned by: strk
Priority: minor Milestone: 3.8.0
Component: Core Version: master
Severity: Significant Keywords: static_cast types


  • geos has int, unsigned int, and size_t as return type of the size() of geometry objects
  • Also, the ith array element is the "index" and sometimes the index was int, unsigned int, or size_t

Some time ago a "static_cast" was added in order to have the compiler not complain like on the problems mentioned above:

conversion to ‘int’ from ‘std::vector<geos::index::sweepline::SweepLineEvent*>::size_type
{aka long unsigned int}’
may alter its value [-Wconversion]

Unifying all "index" and "size" types to size_t will:

  • make the size type consistent with std type used for size()
  • make the "index" type to a geometry be consistent across all geometries
  • make the "static_cast" usage redundant, so it can be removed

Change History (5)

comment:1 Changed 2 years ago by cvvergara

comment:2 Changed 2 years ago by cvvergara

related to #852

comment:3 Changed 2 years ago by cvvergara

Version: 3.6.2master

comment:4 Changed 2 years ago by cvvergara <vicky@…>

Resolution: fixed
Status: newclosed

In 7d577f9/git:

Closes #897 Unifying with size_t type

This is a combination of 23 commits.

comment:5 Changed 2 years ago by goatbar

std::size_t please.

SimpleSweepLineIntersector?.h:84:23: error: unknown type name 'size_t'; did you mean 'gnu_cxx::size_t'?

Note: See TracTickets for help on using tickets.