Commit 54936bba authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hidclass.sys: Remove unused struct collection members.

parent 28c37bbd
...@@ -109,8 +109,6 @@ static const char* const collection_string[] = { ...@@ -109,8 +109,6 @@ static const char* const collection_string[] = {
struct collection { struct collection {
struct list entry; struct list entry;
HIDP_VALUE_CAPS caps;
unsigned int index;
unsigned int type; unsigned int type;
struct collection *parent; struct collection *parent;
struct list features; struct list features;
...@@ -186,15 +184,14 @@ static void debug_collection(struct collection *collection) ...@@ -186,15 +184,14 @@ static void debug_collection(struct collection *collection)
struct collection *centry; struct collection *centry;
if (TRACE_ON(hid)) if (TRACE_ON(hid))
{ {
TRACE("START Collection %i <<< %s, parent: %p, %i features, %i collections\n", TRACE( "START Collection <<< %s, parent: %p, %i features, %i collections\n",
collection->index, collection_string[collection->type], collection->parent, collection_string[collection->type], collection->parent,
list_count(&collection->features), list_count(&collection->collections)); list_count( &collection->features ), list_count( &collection->collections ) );
TRACE("Collection %s\n", debugstr_hidp_value_caps(&collection->caps));
LIST_FOR_EACH_ENTRY(fentry, &collection->features, struct feature, entry) LIST_FOR_EACH_ENTRY(fentry, &collection->features, struct feature, entry)
debug_feature(fentry); debug_feature(fentry);
LIST_FOR_EACH_ENTRY(centry, &collection->collections, struct collection, entry) LIST_FOR_EACH_ENTRY(centry, &collection->collections, struct collection, entry)
debug_collection(centry); debug_collection(centry);
TRACE(">>> END Collection %i\n", collection->index); TRACE( ">>> END Collection\n" );
} }
} }
...@@ -447,7 +444,7 @@ static void parse_collection(unsigned int bSize, int itemVal, ...@@ -447,7 +444,7 @@ static void parse_collection(unsigned int bSize, int itemVal,
} }
} }
static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int length, unsigned int *collection_index, static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int length,
struct collection *collection, struct hid_parser_state *state ) struct collection *collection, struct hid_parser_state *state )
{ {
int i, j; int i, j;
...@@ -518,17 +515,12 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int ...@@ -518,17 +515,12 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int
/* Only set our collection once... /* Only set our collection once...
We do not properly handle composite devices yet. */ We do not properly handle composite devices yet. */
if (state->usages_size) state->items.usage_min = state->usages[state->usages_size - 1]; if (state->usages_size) state->items.usage_min = state->usages[state->usages_size - 1];
if (*collection_index == 0) copy_hidp_value_caps( &collection->caps, &state->items );
copy_hidp_value_caps( &subcollection->caps, &state->items );
subcollection->index = *collection_index;
*collection_index = *collection_index + 1;
list_init(&subcollection->features); list_init(&subcollection->features);
list_init(&subcollection->collections); list_init(&subcollection->collections);
parse_collection(size, value, subcollection); parse_collection(size, value, subcollection);
if (!parse_new_collection( state )) return -1; if (!parse_new_collection( state )) return -1;
if ((i = parse_descriptor( descriptor, i, length, collection_index, subcollection, state )) < 0) if ((i = parse_descriptor( descriptor, i, length, subcollection, state )) < 0) return i;
return i;
continue; continue;
} }
case SHORT_ITEM(TAG_MAIN_END_COLLECTION, TAG_TYPE_MAIN): case SHORT_ITEM(TAG_MAIN_END_COLLECTION, TAG_TYPE_MAIN):
...@@ -827,8 +819,6 @@ WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) ...@@ -827,8 +819,6 @@ WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length)
struct collection *base; struct collection *base;
int i; int i;
unsigned int cidx;
if (TRACE_ON(hid)) if (TRACE_ON(hid))
{ {
TRACE("descriptor %p, length %u:\n", descriptor, length); TRACE("descriptor %p, length %u:\n", descriptor, length);
...@@ -846,12 +836,10 @@ WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) ...@@ -846,12 +836,10 @@ WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length)
free( state ); free( state );
return NULL; return NULL;
} }
base->index = 1;
list_init(&base->features); list_init(&base->features);
list_init(&base->collections); list_init(&base->collections);
cidx = 0; if (parse_descriptor( descriptor, 0, length, base, state ) < 0)
if (parse_descriptor( descriptor, 0, length, &cidx, base, state ) < 0)
{ {
free_collection(base); free_collection(base);
free_parser_state( state ); free_parser_state( state );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment