Compare commits

..

15 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
4d30a76fb1 util-strings: drop unused safe_atou()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
7d617d1150 util-strings: drop unused zalloc()
Not used anywhere. And crashing the Xserver on alloc failure really
isn't a good idea anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
2146a29bdf util-strings: drop unused safe_atoi_base()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
64def2e59a util-strings: drop unused safe_atoi()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
8a743e7740 util-strings: drop unused safe_strdup()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
87dc6b6a3e util-strings: drop unused strv_join()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
110f454c1e util-strings: drop unused strv_from_argv()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
bd7f165019 util-strings: drop unused streq() and strneq()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
49ee2103a1 util-strings: drop unused kv_double_from_string()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
318a6119a8 util-strings: drop unused strstrip()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
6465d3cae8 util-strings: drop unused strendswith()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
94cfaa6b2d util-strings: drop unused strstartswith()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
d941ac25f1 util-strings: drop unused safe_basename()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
0ef9a59835 util-strings: drop unused trunkname()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
Enrico Weigelt, metux IT consult
c77c82d92c util-strings: drop unused str_sanitize()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:48:50 +01:00
4 changed files with 10 additions and 25 deletions

View File

@@ -43,8 +43,6 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
CFLAGS="$CFLAGS -Wno-declaration-after-statement"
# Obtain compiler/linker options from server and required extensions
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])

View File

@@ -92,9 +92,7 @@ strv_from_string(const char *in, const char *separators, size_t *num_elements)
}
size_t strv_len = nelems + 1; /* NULL-terminated */
char **strv = calloc(strv_len, sizeof(*strv));
if (!strv)
return NULL;
char **strv = zalloc(strv_len * sizeof *strv);
size_t idx = 0;
const char *word;

View File

@@ -137,10 +137,7 @@ double_array_from_string(const char *in,
if(!strv)
return result;
double *numv = calloc(nelem, sizeof(double));
if (!numv)
goto out;
double *numv = zalloc(sizeof(double) * nelem);
for (size_t idx = 0; idx < nelem; idx++) {
double val;
if (!safe_atod(strv[idx], &val))

View File

@@ -141,10 +141,6 @@ struct accel_points {
};
#endif
struct xf86libinput_pressure_range {
float min, max;
};
struct xf86libinput {
InputInfoPtr pInfo;
char *path;
@@ -203,7 +199,9 @@ struct xf86libinput {
float rotation_angle;
struct bezier_control_point pressurecurve[4];
struct xf86libinput_pressure_range pressure_range;
struct range {
float min, max;
} pressure_range;
struct ratio {
int x, y;
} area;
@@ -469,7 +467,7 @@ xf86libinput_set_pressurecurve(struct xf86libinput *driver_data,
static inline bool
xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
const struct xf86libinput_pressure_range *rangeopt)
const struct range *rangeopt)
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
@@ -941,7 +939,7 @@ LibinputApplyConfigPressureRange(DeviceIntPtr dev,
#if HAVE_LIBINPUT_PRESSURE_RANGE
InputInfoPtr pInfo = dev->public.devicePrivate;
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
struct xf86libinput_pressure_range *rangeopt = &driver_data->options.pressure_range;
struct range *rangeopt = &driver_data->options.pressure_range;
if (!subdevice_has_capabilities(dev, CAP_TABLET_TOOL))
return;
@@ -2741,12 +2739,6 @@ xf86libinput_handle_event(struct libinput_event *event)
break;
case LIBINPUT_EVENT_SWITCH_TOGGLE:
break;
// new libinput events we don't handle yet
case LIBINPUT_EVENT_GESTURE_HOLD_BEGIN:
case LIBINPUT_EVENT_GESTURE_HOLD_END:
case LIBINPUT_EVENT_TABLET_PAD_KEY:
break;
}
out:
@@ -3693,7 +3685,7 @@ out:
static void
xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
struct xf86libinput *driver_data,
struct xf86libinput_pressure_range *rangeopt)
struct range *rangeopt)
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
@@ -5392,7 +5384,7 @@ LibinputSetPropertyPressureRange(DeviceIntPtr dev,
InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
float *vals;
struct xf86libinput_pressure_range rangeopt = { 0.0, 1.0 };
struct range rangeopt = { 0.0, 1.0 };
if (val->format != 32 || val->size != 2 || val->type != prop_float)
return BadMatch;
@@ -6671,7 +6663,7 @@ LibinputInitPressureRangeProperty(DeviceIntPtr dev,
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
const struct xf86libinput_pressure_range *rangeopt = &driver_data->options.pressure_range;
const struct range *rangeopt = &driver_data->options.pressure_range;
float data[2] = {
rangeopt->min,
rangeopt->max,