[Tile-serving] [osm2pgsql] Fix type-related warnings (#470)
alex85k
notifications at github.com
Thu Oct 22 19:20:28 UTC 2015
Here is the sorted list of type-related warnings by MSVC. Its type policy is rather strict.
Most of the warnings are not a problem and can be eliminated by cosmetic changes but sometimes problems with big files or big data can be related to these warnings.
I know this is not a high priority task, but I'll try to make PRs for some of the most obvious changes, or people touching the code of modules can improve this simultaneously.
Let us keep this for reference (will remove fixed warnings from the list). Sorry for big list :)
```log
c:\osm2pgsql\pgsql.hpp(28): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\pgsql.hpp(32): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\osm2pgsql\node-ram-cache.hpp(66): warning C4244: 'return': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(353): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(355): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(397): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(398): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(400): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(401): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\expire-tiles.cpp(506): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\geometry-builder.cpp(131): warning C4101: 'e': unreferenced local variable
C:\osm2pgsql\geometry-builder.cpp(192): warning C4244: 'initializing': conversion from 'double' to 'const size_t', possible loss of data
C:\osm2pgsql\geometry-builder.cpp(192): warning C4244: 'initializing': conversion from 'double' to 'size_t', possible loss of data
C:\osm2pgsql\geometry-builder.cpp(245): warning C4101: 'e': unreferenced local variable
C:\osm2pgsql\geometry-builder.cpp(760): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
C:\osm2pgsql\middle-pgsql.cpp(1286): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\middle-pgsql.cpp(178): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\middle-pgsql.cpp(200): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\middle-pgsql.cpp(322): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\middle-pgsql.cpp(532): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\middle-pgsql.cpp(746): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\node-persistent-cache.cpp(216): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
C:\osm2pgsql\node-persistent-cache.cpp(216): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\node-persistent-cache.cpp(249): warning C4244: '=': conversion from 'osmid_t' to 'int32_t', possible loss of data
C:\osm2pgsql\node-persistent-cache.cpp(332): warning C4244: 'initializing': conversion from 'osmid_t' to 'int32_t', possible loss of data
C:\osm2pgsql\node-ram-cache.cpp(315): warning C4244: '=': conversion from 'unsigned __int64' to 'int', possible loss of data
C:\osm2pgsql\node-ram-cache.cpp(70): warning C4244: 'return': conversion from '__int64' to 'int32_t', possible loss of data
c:\osm2pgsql\node-ram-cache.hpp(66): warning C4244: 'return': conversion from 'double' to 'int', possible loss of data
C:\osm2pgsql\osmdata.cpp(199): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
C:\osm2pgsql\output-multi.cpp(110): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
C:\osm2pgsql\output-multi.cpp(160): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
C:\osm2pgsql\parse-o5m.cpp(453): warning C4244: '=': conversion from '__int64' to 'int', possible loss of data
C:\osm2pgsql\parse-o5m.cpp(459): warning C4244: '=': conversion from '__int64' to 'int', possible loss of data
C:\osm2pgsql\parse-o5m.cpp(585): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\parse-o5m.cpp(603): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\parse-o5m.cpp(793): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data
C:\osm2pgsql\sprompt.cpp(147): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\sprompt.cpp(158): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\table.cpp(500): warning C4305: '*=': truncation from 'double' to 'float'
C:\osm2pgsql\table.cpp(507): warning C4305: '*=': truncation from 'double' to 'float'
C:\osm2pgsql\table.cpp(508): warning C4305: '*=': truncation from 'double' to 'float'
C:\osm2pgsql\table.cpp(548): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(356): warning C4244: 'argument': conversion from 'size_t' to 'lua_Number', possible loss of data
C:\osm2pgsql\tagtransform.cpp(361): warning C4244: 'argument': conversion from 'unsigned __int64' to 'lua_Number', possible loss of data
C:\osm2pgsql\tagtransform.cpp(369): warning C4244: '=': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(371): warning C4244: '=': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(373): warning C4244: '=': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(379): warning C4244: '=': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(396): warning C4244: 'initializing': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(537): warning C4244: '=': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(540): warning C4244: '=': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tagtransform.cpp(552): warning C4244: 'initializing': conversion from 'lua_Integer' to 'int', possible loss of data
C:\osm2pgsql\tests\middle-tests.cpp(153): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\tests\middle-tests.cpp(186): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\osm2pgsql\tests\test-options-parse.cpp(277): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
```
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/470
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20151022/e8629d1f/attachment-0001.html>
More information about the Tile-serving
mailing list