[haiku-commits] haiku: hrev45746 - src/add-ons/input_server/filters/shortcut_catcher headers/private/virtio

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 7 Jun 2013 18:00:45 +0200 (CEST)

hrev45746 adds 2 changesets to branch 'master'
old head: 1c95f72222f766079af3183ab490e42506f5feca
new head: 6e6c121b84c609e395642175109ac778a92e6543
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=6e6c121+%5E1c95f72

----------------------------------------------------------------------------

d323ad6: shortcut_catcher: fixed out of bounds access and a sign warning.
  
  * normal_map is an array with a length of 128

6e6c121: virtio: added several devices ids.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 8 insertions(+), 7 deletions(-)
headers/private/virtio/virtio.h                          |  3 +++
.../input_server/filters/shortcut_catcher/KeyInfos.cpp   | 12 +++++-------

############################################################################

Commit:      d323ad67085f21c23ef9f74e7ac74243f5a0130f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d323ad6
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Jun  6 15:42:05 2013 UTC

shortcut_catcher: fixed out of bounds access and a sign warning.

* normal_map is an array with a length of 128

----------------------------------------------------------------------------

diff --git a/src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp 
b/src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp
index 5174b4f..0014e31 100644
--- a/src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp
+++ b/src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp
@@ -19,7 +19,7 @@
 #include <InterfaceDefs.h>
 
 
-#define NUM_KEYS 256
+#define NUM_KEYS 128
 #define MAX_UTF8_LENGTH 5      // up to 4 chars, plus a nul terminator
 
 struct KeyLabelMap {
@@ -97,10 +97,8 @@ static const char* keyDescriptions[NUM_KEYS];
 // series of optional up-to-(4+1)-byte terminated UTF-8 character strings...
 static char utfDescriptions[NUM_KEYS * MAX_UTF8_LENGTH];
 
-static const char* FindSpecialKeyLabelFor(uint8 keyCode, int& last);
-
 static const char*
-FindSpecialKeyLabelFor(uint8 keyCode, int& last)
+FindSpecialKeyLabelFor(uint8 keyCode, uint32& last)
 {
        while ((keyLabels[last].fKeyCode < keyCode) 
                && (last < (sizeof(keyLabels) / sizeof(struct KeyLabelMap)) - 
1)) 
@@ -116,7 +114,7 @@ FindSpecialKeyLabelFor(uint8 keyCode, int& last)
 void 
 InitKeyIndices()
 {
-       int nextSpecial = 0;
+       uint32 nextSpecial = 0;
        key_map* map;
        char* keys;
        get_key_map(&map, &keys);
@@ -125,8 +123,8 @@ InitKeyIndices()
                keyDescriptions[j] = NULL;      // default
 
                const char* slabel = FindSpecialKeyLabelFor(j, nextSpecial);
-               int keyCode = map->normal_map[j];
-               
+               int32 keyCode = map->normal_map[j];
+
                if (keyCode >= 0) {
                        const char* mapDesc = &keys[keyCode];
                        uint8 len = *mapDesc;

############################################################################

Revision:    hrev45746
Commit:      6e6c121b84c609e395642175109ac778a92e6543
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6e6c121
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Jun  6 15:47:56 2013 UTC

virtio: added several devices ids.

----------------------------------------------------------------------------

diff --git a/headers/private/virtio/virtio.h b/headers/private/virtio/virtio.h
index 8e446f5..3b2b299 100644
--- a/headers/private/virtio/virtio.h
+++ b/headers/private/virtio/virtio.h
@@ -16,8 +16,11 @@
 #define VIRTIO_DEVICE_ID_ENTROPY       0x04
 #define VIRTIO_DEVICE_ID_BALLOON       0x05
 #define VIRTIO_DEVICE_ID_IOMEMORY      0x06
+#define VIRTIO_DEVICE_ID_RP_MESSAGE    0x07
 #define VIRTIO_DEVICE_ID_SCSI          0x08
 #define VIRTIO_DEVICE_ID_9P                    0x09
+#define VIRTIO_DEVICE_ID_RP_SERIAL     0x0b
+#define VIRTIO_DEVICE_ID_CAIF          0x0c
 
 #define VIRTIO_FEATURE_TRANSPORT_MASK  ((1 << 28) - 1)
 


Other related posts:

  • » [haiku-commits] haiku: hrev45746 - src/add-ons/input_server/filters/shortcut_catcher headers/private/virtio - korli