* Correct case for long items (didn't matter as no long items are defined).

* Move the main data declaration to where it's used.
* Tiny cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40952 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2011-03-14 19:03:42 +00:00
parent 825c2d76d2
commit 6391a79957

View File

@ -103,7 +103,6 @@ HIDParser::ParseReportDescriptor(const uint8 *reportDescriptor,
switch (item->type) { switch (item->type) {
case ITEM_TYPE_MAIN: case ITEM_TYPE_MAIN:
{ {
main_item_data *mainData = (main_item_data *)&data;
if (item->tag == ITEM_TAG_MAIN_COLLECTION) { if (item->tag == ITEM_TAG_MAIN_COLLECTION) {
HIDCollection *newCollection HIDCollection *newCollection
= new(std::nothrow) HIDCollection(collection, = new(std::nothrow) HIDCollection(collection,
@ -186,6 +185,7 @@ HIDParser::ParseReportDescriptor(const uint8 *reportDescriptor,
if (!localState.string_index_set) if (!localState.string_index_set)
localState.string_index = localState.string_minimum; localState.string_index = localState.string_minimum;
main_item_data *mainData = (main_item_data *)&data;
target->AddMainItem(globalState, localState, *mainData, target->AddMainItem(globalState, localState, *mainData,
collection); collection);
} }
@ -351,7 +351,7 @@ HIDParser::ParseReportDescriptor(const uint8 *reportDescriptor,
break; break;
} }
case ITEM_TAG_LONG: case ITEM_TYPE_LONG:
{ {
long_item *longItem = (long_item *)item; long_item *longItem = (long_item *)item;