aboutsummaryrefslogtreecommitdiff
path: root/type_ztf.h
diff options
context:
space:
mode:
authorPeter Kasting <pkasting@chromium.org>2021-06-09 19:27:03 +0000
committerCopybara-Service <copybara-worker@google.com>2021-07-25 21:32:31 -0700
commit3865f0bceb04ae529ba0c2d98a869a16072a90c2 (patch)
treed27353ae58fbb351a7720038358a698ab82706bf /type_ztf.h
parent1cec5a775590551e3c9f950afad3d95a6f6d950f (diff)
downloadzucchini-3865f0bceb04ae529ba0c2d98a869a16072a90c2.tar.gz
Add explicit type conversions where necessary: components/
These are cases that are implicitly narrowing today, and must do so explicitly in order to enable -Wc++11-narrowing. No behavior change intended. Bug: 1216696 Change-Id: Ic8f194bb0ab9a247d3e84cc59a687285cdb96d48 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2947886 Auto-Submit: Peter Kasting <pkasting@chromium.org> Commit-Queue: Jochen Eisinger <jochen@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Cr-Commit-Position: refs/heads/master@{#890878} NOKEYCHECK=True GitOrigin-RevId: 379c52be13901beae4f773fe9e8054ad42a186c4
Diffstat (limited to 'type_ztf.h')
-rw-r--r--type_ztf.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/type_ztf.h b/type_ztf.h
index 42798b2..8ecc9ca 100644
--- a/type_ztf.h
+++ b/type_ztf.h
@@ -38,11 +38,13 @@ struct DeltaLineCol {
};
constexpr DeltaLineCol operator-(const LineCol& lhs, const LineCol& rhs) {
- return DeltaLineCol{lhs.line - rhs.line, lhs.col - rhs.col};
+ return DeltaLineCol{static_cast<dim_t>(lhs.line - rhs.line),
+ static_cast<dim_t>(lhs.col - rhs.col)};
}
constexpr LineCol operator+(const LineCol& lhs, const DeltaLineCol& rhs) {
- return LineCol{lhs.line + rhs.line, lhs.col + rhs.col};
+ return LineCol{static_cast<dim_t>(lhs.line + rhs.line),
+ static_cast<dim_t>(lhs.col + rhs.col)};
}
} // namespace ztf