FTL: Add cast safety checker
Add a function to check cast safety, to be used by a saturating cast
that (among other uses) will replace ui::Size::clamp, which invokes
the undefined behavior of signed overflow when casting INT32_MAX to
float and back.
Bug: 185536303
Test: ftl_test
Change-Id: I412a1d72de7235b73ea3dd3f194d0da178ce5eb2
diff --git a/libs/ftl/Android.bp b/libs/ftl/Android.bp
index 97626be..2226791 100644
--- a/libs/ftl/Android.bp
+++ b/libs/ftl/Android.bp
@@ -14,6 +14,7 @@
address: true,
},
srcs: [
+ "cast_test.cpp",
"future_test.cpp",
"small_map_test.cpp",
"small_vector_test.cpp",