[haiku-commits] r40952 - haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 14 Mar 2011 20:03:42 +0100 (CET)

Author: mmlr
Date: 2011-03-14 20:03:42 +0100 (Mon, 14 Mar 2011)
New Revision: 40952
Changeset: http://dev.haiku-os.org/changeset/40952

Modified:
   haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp
Log:
* 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.


Modified: haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp  
2011-03-14 17:24:52 UTC (rev 40951)
+++ haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp  
2011-03-14 19:03:42 UTC (rev 40952)
@@ -103,7 +103,6 @@
                switch (item->type) {
                        case ITEM_TYPE_MAIN:
                        {
-                               main_item_data *mainData = (main_item_data 
*)&data;
                                if (item->tag == ITEM_TAG_MAIN_COLLECTION) {
                                        HIDCollection *newCollection
                                                = new(std::nothrow) 
HIDCollection(collection,
@@ -173,7 +172,7 @@
                                                
localState.usage_minimum.is_extended
                                                        = 
localState.usage_maximum.is_extended = true;
                                        }
- 
+
                                        localState.usage_stack = usageStack;
                                        localState.usage_stack_used = 
usageStackUsed;
 
@@ -186,6 +185,7 @@
                                        if (!localState.string_index_set)
                                                localState.string_index = 
localState.string_minimum;
 
+                                       main_item_data *mainData = 
(main_item_data *)&data;
                                        target->AddMainItem(globalState, 
localState, *mainData,
                                                collection);
                                }
@@ -351,7 +351,7 @@
                                break;
                        }
 
-                       case ITEM_TAG_LONG:
+                       case ITEM_TYPE_LONG:
                        {
                                long_item *longItem = (long_item *)item;
 


Other related posts:

  • » [haiku-commits] r40952 - haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid - mmlr