summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Cutts <hcutts@chromium.org>2023-01-10 14:55:19 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-13 13:42:47 +0000
commitc37522a3d43349b7f5c7f63c40fbf3e0c3a94bca (patch)
tree213eace9d325355b012d293ac1c987544f637f76
parent66809a113c15d7a0c233385005f1ed55bab33ac2 (diff)
downloadlibchrome-gestures-c37522a3d43349b7f5c7f63c40fbf3e0c3a94bca.tar.gz
Deprecate GesturesPropProvider::create_short_fn
The infrastructure for short properties was removed in 2020 [0], so this function wasn't being called. Make clear that it's not used any more and can be null. [0]: https://crrev.com/c/1988601 BUG=b:251196347,b:265022208 TEST=cros_workon_make --board=volteer --test chromeos-base/gestures (both with and without changes to src/prop_registry_unittest.cc) Change-Id: I46fa33a1d18ed689474b4cf9cc4081d21e910991 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4151715 Tested-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org> Reviewed-by: Sean O'Brien <seobrien@chromium.org>
-rw-r--r--include/gestures.h10
-rw-r--r--src/prop_registry_unittest.cc10
2 files changed, 7 insertions, 13 deletions
diff --git a/include/gestures.h b/include/gestures.h
index 5100eb4..31e6f57 100644
--- a/include/gestures.h
+++ b/include/gestures.h
@@ -550,9 +550,9 @@ typedef GesturesProp* (*GesturesPropCreateInt)(void* data, const char* name,
int* loc, size_t count,
const int* init);
-typedef GesturesProp* (*GesturesPropCreateShort)(void* data, const char* name,
- short* loc, size_t count,
- const short* init);
+// Deprecated: the gestures library no longer uses short gesture properties.
+typedef GesturesProp* (*GesturesPropCreateShort_Deprecated)(
+ void*, const char*, short*, size_t, const short*);
typedef GesturesProp* (*GesturesPropCreateBool)(void* data, const char* name,
GesturesPropBool* loc,
@@ -593,7 +593,9 @@ typedef void (*GesturesPropFree)(void* data, GesturesProp* prop);
typedef struct GesturesPropProvider {
GesturesPropCreateInt create_int_fn;
- GesturesPropCreateShort create_short_fn;
+ // Deprecated: the library no longer uses short gesture properties, so this
+ // function pointer should be null.
+ GesturesPropCreateShort_Deprecated create_short_fn;
GesturesPropCreateBool create_bool_fn;
GesturesPropCreateString create_string_fn;
GesturesPropCreateReal create_real_fn;
diff --git a/src/prop_registry_unittest.cc b/src/prop_registry_unittest.cc
index 37856a6..1b994fb 100644
--- a/src/prop_registry_unittest.cc
+++ b/src/prop_registry_unittest.cc
@@ -161,14 +161,6 @@ GesturesProp* MockGesturesPropCreateReal(void* data, const char* name,
return dummy;
}
-GesturesProp* MockGesturesPropCreateShort(void* data, const char* name,
- short* loc, size_t count,
- const short* init) {
- GesturesProp *dummy = new GesturesProp();
- *loc = 1;
- return dummy;
-}
-
GesturesProp* MockGesturesPropCreateString(void* data, const char* name,
const char** loc,
const char* const init) {
@@ -192,7 +184,7 @@ void MockGesturesPropFree(void* data, GesturesProp* prop) {
TEST(PropRegistryTest, SetAtCreateShouldNotifyTest) {
GesturesPropProvider mock_gestures_props_provider = {
MockGesturesPropCreateInt,
- MockGesturesPropCreateShort,
+ NULL,
MockGesturesPropCreateBool,
MockGesturesPropCreateString,
MockGesturesPropCreateReal,