when to use std::int32_t and std::int64_t
还没有人认领这个 Issue。
评估
调研方向
查看 pull request 95、88 和 89 中之前的讨论,然后检查 src/util.hpp 和 src/vtquery.cpp 中列出的整数用法。就何时应使用每种整数宽度达成一致,并在所引用的函数中记录或应用由此产生的决定,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Description
Looks like there have been some conversations around this and thought we should discuss all the places where we need to be explicit about the bit size of the int and when we shouldn't. I'll start us off with refs to previous conversations and lists of our current int32_t and int64_t usage. It would be great to get some follow-up comments about the reasoning behind this.
It looks like the idea is that we want to use int32_t for x, y, z, and extent until we cast them to doubles or int64_ts when we store them in a mapbox::geometry::point. Looks like we use int64_t for id and property values, referred to as v in the code.
References
- https://github.com/mapbox/vtquery/pull/95#discussion_r198340002
- https://github.com/mapbox/vtquery/pull/88
- https://github.com/mapbox/vtquery/pull/89
int32_t/ uint32_t usage
create_query_point- https://github.com/mapbox/vtquery/blob/master/src/util.hpp#L54-L57convert_vt_to_ll- https://github.com/mapbox/vtquery/blob/master/src/util.hpp#L84-L87TileObject- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L64-L66 & https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L93-L95QueryData- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L102 & https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L128Execute- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L278 & https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L301-L304HandleOKCallback- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L433NAN_METHOD(vtquery)- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L507-L536 & https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L605-L613 & https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L651
int64_t/ uint64_t usage
mapbox::util::variant- https://github.com/mapbox/vtquery/blob/master/src/util.hpp#L40create_query_point- https://github.com/mapbox/vtquery/blob/master/src/util.hpp#L52 & https://github.com/mapbox/vtquery/blob/master/src/util.hpp#L68-L78convert_vt_to_ll- https://github.com/mapbox/vtquery/blob/master/src/util.hpp#L89ResultObject- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L44property_value_visitor- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L144-L147insert_result- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L201Execute- https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L306 & https://github.com/mapbox/vtquery/blob/master/src/vtquery.cpp#L317
- 主要语言
- JavaScript
- 星标
- 45
- 派生
- 14
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mapbox/vtquery 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 1/5 1 小时以内 新手友好度 35/100
-
union geometries未关闭
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 86/100
amponce/archive-movie-browser#354 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
saayam-for-all/webapp#1870 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
Imageomics/OpenCite#66 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
chr15m/twiiit.com#20 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 88/100
antropos17/Aegis#629 ·
维护者通常 4 天内回复