We return internal memory here, make sure it's const.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 libwacom/libwacom.c |    5 +++--
 libwacom/libwacom.h |    2 +-
 test/dbverify.c     |    3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index b966280..1c019b5 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -456,7 +456,8 @@ libwacom_new_from_name(WacomDeviceDatabase *db, const char 
*name, WacomError *er
 
 static void print_styli_for_device (int fd, WacomDevice *device)
 {
-       int nstyli, *styli;
+       int nstyli;
+       const int *styli;
        int i;
 
        if (!libwacom_has_stylus(device))
@@ -681,7 +682,7 @@ int libwacom_get_num_buttons(WacomDevice *device)
        return device->num_buttons;
 }
 
-int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli)
+const int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli)
 {
        *num_styli = device->num_styli;
        return device->supported_styli;
diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
index 96634f0..1efcf7d 100644
--- a/libwacom/libwacom.h
+++ b/libwacom/libwacom.h
@@ -388,7 +388,7 @@ int libwacom_get_num_buttons(WacomDevice *device);
  * @param num_styli Return location for the number of listed styli
  * @return an array of Styli IDs supported by the device
  */
-int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli);
+const int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli);
 
 /**
  * @param device The tablet to query
diff --git a/test/dbverify.c b/test/dbverify.c
index d0e539c..6a9149b 100644
--- a/test/dbverify.c
+++ b/test/dbverify.c
@@ -134,7 +134,8 @@ compare_written_database(WacomDeviceDatabase *db)
                int i;
                int fd;
                char *path = NULL;
-               int nstyli, *styli;
+               int nstyli;
+               const int *styli;
 
                asprintf(&path, "%s/%d-%04x-%04x.tablet", dirname,
                                libwacom_get_bustype(*device),
-- 
1.7.10


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to