config: replace enums with int to handle negative values

This commit also fixes that an invalid value in <accelProfile> is interpreted as "flat"
This commit is contained in:
tokyo4j 2023-09-07 23:43:58 +09:00 committed by Johan Malm
parent 3c3656f74e
commit 19ffbae320
2 changed files with 8 additions and 8 deletions

View file

@ -339,11 +339,11 @@ fill_mousebind(char *nodename, char *content)
}
}
static enum libinput_config_accel_profile
static int
get_accel_profile(const char *s)
{
if (!s) {
return LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
return -1;
}
if (!strcasecmp(s, "flat")) {
return LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
@ -351,7 +351,7 @@ get_accel_profile(const char *s)
if (!strcasecmp(s, "adaptive")) {
return LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
}
return LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
return -1;
}
static void