Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#897 closed task (fixed)

types inconsistency

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

Description

  • 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:2 by cvvergara, 6 years ago

related to #852

comment:3 by cvvergara, 6 years ago

Milestone: 3.6.33.8.0
Version: 3.6.2master

comment:4 by cvvergara <vicky@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 7d577f9/git:

Closes #897 Unifying with size_t type

This is a combination of 23 commits.

comment:5 by goatbar, 6 years ago

std::size_t please. https://en.cppreference.com/w/cpp/types/size_t

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.