Author: duncan
Date: Wed Dec 19 15:57:46 2007
New Revision: 10223

Log:
[ 1853790 ] evdev broken on amd64
Patch from Michel Lespinasse applied


Modified:
   branches/rel-1-7/freevo/ChangeLog
   branches/rel-1-7/freevo/src/evdev.py
   branches/rel-1/freevo/ChangeLog
   branches/rel-1/freevo/src/evdev.py

Modified: branches/rel-1-7/freevo/ChangeLog
==============================================================================
--- branches/rel-1-7/freevo/ChangeLog   (original)
+++ branches/rel-1-7/freevo/ChangeLog   Wed Dec 19 15:57:46 2007
@@ -35,6 +35,7 @@
  * Fixed audioitem not displaying the year as a result of new metadata code 
(B#1838167)
  * Fixed audiodiskitem not playing a cd when inserted (B#1830000)
  * Fixed audioscrobbler killing the auto shutdown feature (F#1831371)
+ * Fixed evdev for 64bit machines (B#1853790)
  * Fixed helper plugins, not allowing tuples as arguments (B#1832837)
  * Fixed geexbox skin TV menu reporting record server status (B#1835256)
  * Fixed itv plug-in, having "No player for this item found" 
(B#1833018,B#1833829)

Modified: branches/rel-1-7/freevo/src/evdev.py
==============================================================================
--- branches/rel-1-7/freevo/src/evdev.py        (original)
+++ branches/rel-1-7/freevo/src/evdev.py        Wed Dec 19 15:57:46 2007
@@ -147,7 +147,7 @@
         '''
         '''
         buf = ioctl(self._fd, EVIOCGVERSION, "    ")
-        l, =  struct.unpack("L", buf)
+        l, =  struct.unpack("I", buf)
         return (l >> 16, (l >> 8) & 0xff, l & 0xff)
 
     def get_id(self):
@@ -182,7 +182,7 @@
         l = ((keys[-1] + 7) / 8 + 3) & ~0x3
 
         buf = ioctl(self._fd, EVIOCGBIT(0, l), " " * l)
-        array = struct.unpack("L" * (l/4), buf)
+        array = struct.unpack("I" * (l/4), buf)
 
         self._events = {}
 
@@ -203,7 +203,7 @@
             except IOError:
                 # No events for a type results in Errno 22 (EINVAL)
                 break
-            subarray = struct.unpack("L" * (sl/4), buf)
+            subarray = struct.unpack("I" * (sl/4), buf)
 
             for j in xrange(sl * 8):
                 if not subarray[j / 32] & (1 << j % 32):
@@ -224,13 +224,13 @@
         '''
         '''
         try:
-            buf = os.read(self._fd, 16)
+            buf = os.read(self._fd, struct.calcsize("LLHHi"))
         except OSError, (errno, str):
             if errno == 11:
                 return None
             raise
 
-        sec, usec, type, code, value = struct.unpack("LLHHl", buf)
+        sec, usec, type, code, value = struct.unpack("LLHHi", buf)
 
         return (float(sec) + float(usec)/1000000.0, _types[type], 
_events[type][code], value)
 

Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog     (original)
+++ branches/rel-1/freevo/ChangeLog     Wed Dec 19 15:57:46 2007
@@ -43,6 +43,7 @@
  * Fixed audioitem not displaying the year as a result of new metadata code 
(B#1838167)
  * Fixed audiodiskitem not playing a cd when inserted (B#1830000)
  * Fixed audioscrobbler killing the auto shutdown feature (F#1831371)
+ * Fixed evdev for 64bit machines (B#1853790)
  * Fixed geexbox skin TV menu reporting record server status (B#1835256)
  * Fixed helper plugins, not allowing tuples as arguments (B#1832837)
  * Fixed itv plug-in, having "No player for this item found" 
(B#1833018,B#1833829)

Modified: branches/rel-1/freevo/src/evdev.py
==============================================================================
--- branches/rel-1/freevo/src/evdev.py  (original)
+++ branches/rel-1/freevo/src/evdev.py  Wed Dec 19 15:57:46 2007
@@ -147,7 +147,7 @@
         '''
         '''
         buf = ioctl(self._fd, EVIOCGVERSION, "    ")
-        l, =  struct.unpack("L", buf)
+        l, =  struct.unpack("I", buf)
         return (l >> 16, (l >> 8) & 0xff, l & 0xff)
 
     def get_id(self):
@@ -182,7 +182,7 @@
         l = ((keys[-1] + 7) / 8 + 3) & ~0x3
 
         buf = ioctl(self._fd, EVIOCGBIT(0, l), " " * l)
-        array = struct.unpack("L" * (l/4), buf)
+        array = struct.unpack("I" * (l/4), buf)
 
         self._events = {}
 
@@ -203,7 +203,7 @@
             except IOError:
                 # No events for a type results in Errno 22 (EINVAL)
                 break
-            subarray = struct.unpack("L" * (sl/4), buf)
+            subarray = struct.unpack("I" * (sl/4), buf)
 
             for j in xrange(sl * 8):
                 if not subarray[j / 32] & (1 << j % 32):
@@ -224,13 +224,13 @@
         '''
         '''
         try:
-            buf = os.read(self._fd, 16)
+            buf = os.read(self._fd, struct.calcsize("LLHHi"))
         except OSError, (errno, str):
             if errno == 11:
                 return None
             raise
 
-        sec, usec, type, code, value = struct.unpack("LLHHl", buf)
+        sec, usec, type, code, value = struct.unpack("LLHHi", buf)
 
         return (float(sec) + float(usec)/1000000.0, _types[type], 
_events[type][code], value)
 

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to