#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:1 by , 6 years ago
comment:3 by , 6 years ago
Milestone: | 3.6.3 → 3.8.0 |
---|---|
Version: | 3.6.2 → master |
comment:5 by , 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.
This branch does makes the types consistent https://github.com/libgeos/geos/compare/master...cvvergara:rm-static-1
and travis execution is found here: https://travis-ci.org/cvvergara/geos/builds/404504153