diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c index 050ee255..35bd65c9 100644 --- a/libwacom/libwacom-database.c +++ b/libwacom/libwacom-database.c @@ -271,17 +271,17 @@ libwacom_parse_stylus_keyfile(WacomDeviceDatabase *db, const char *path) WacomStylus *stylus; GError *error = NULL; char *eraser_type, *type; - int id; + int tool_id; char **string_list; - if (!safe_atoi_base (groups[i], &id, 16)) { + if (!safe_atoi_base (groups[i], &tool_id, 16)) { g_warning ("Failed to parse stylus ID '%s'", groups[i]); continue; } stylus = g_new0 (WacomStylus, 1); stylus->refcnt = 1; - stylus->id = id; + stylus->tool_id = tool_id; stylus->name = g_key_file_get_string(keyfile, groups[i], "Name", NULL); stylus->group = g_key_file_get_string(keyfile, groups[i], "Group", NULL); @@ -346,10 +346,10 @@ libwacom_parse_stylus_keyfile(WacomDeviceDatabase *db, const char *path) stylus->type = type_from_str (type); g_clear_pointer(&type, g_free); - if (g_hash_table_lookup (db->stylus_ht, GINT_TO_POINTER (id)) != NULL) - g_warning ("Duplicate definition for stylus ID '%#x'", id); + if (g_hash_table_lookup (db->stylus_ht, GINT_TO_POINTER (tool_id)) != NULL) + g_warning ("Duplicate definition for stylus ID '%#x'", tool_id); - g_hash_table_insert (db->stylus_ht, GINT_TO_POINTER (id), stylus); + g_hash_table_insert (db->stylus_ht, GINT_TO_POINTER (tool_id), stylus); } g_clear_pointer(&groups, g_strfreev); g_clear_pointer(&keyfile, g_key_file_free); @@ -721,7 +721,7 @@ libwacom_parse_styli_list(WacomDeviceDatabase *db, WacomDevice *device, while (g_hash_table_iter_next (&iter, &key, &value)) { WacomStylus *stylus = value; if (stylus->group && g_str_equal(group, stylus->group)) { - g_array_append_val (array, stylus->id); + g_array_append_val (array, stylus->tool_id); } } } else { diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c index 40b54b70..4366f291 100644 --- a/libwacom/libwacom.c +++ b/libwacom/libwacom.c @@ -1543,7 +1543,7 @@ libwacom_stylus_get_for_id (const WacomDeviceDatabase *db, int id) LIBWACOM_EXPORT int libwacom_stylus_get_id (const WacomStylus *stylus) { - return stylus->id; + return stylus->tool_id; } LIBWACOM_EXPORT const char * @@ -1564,7 +1564,7 @@ LIBWACOM_EXPORT int libwacom_stylus_get_num_buttons (const WacomStylus *stylus) { if (stylus->num_buttons == -1) { - g_warning ("Stylus '0x%x' has no number of buttons defined, falling back to 2", stylus->id); + g_warning ("Stylus '0x%x' has no number of buttons defined, falling back to 2", stylus->tool_id); return 2; } return stylus->num_buttons; @@ -1604,7 +1604,7 @@ LIBWACOM_EXPORT WacomStylusType libwacom_stylus_get_type (const WacomStylus *stylus) { if (stylus->type == WSTYLUS_UNKNOWN) { - g_warning ("Stylus '0x%x' has no type defined, falling back to 'General'", stylus->id); + g_warning ("Stylus '0x%x' has no type defined, falling back to 'General'", stylus->tool_id); return WSTYLUS_GENERAL; } return stylus->type; diff --git a/libwacom/libwacomint.h b/libwacom/libwacomint.h index 569683c8..36a6bf74 100644 --- a/libwacom/libwacomint.h +++ b/libwacom/libwacomint.h @@ -121,7 +121,7 @@ struct _WacomDevice { struct _WacomStylus { gint refcnt; - int id; + int tool_id; char *name; char *group; int num_buttons;