diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a4942419..ff546dd4 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1436,3 +1436,7 @@ Klaus Heppenheimer Thomas Günther for fixing handling the frame number display if '7' is pressed before the first editing mark, or '9' after the last one + +David Woodhouse + for his help in replacing the get/put_unaligned() macros from asm/unaligned.h with + own inline functions to avoid problems on platforms that don't provide these diff --git a/HISTORY b/HISTORY index 601dbad4..02cc7b7e 100644 --- a/HISTORY +++ b/HISTORY @@ -3713,3 +3713,6 @@ Video Disk Recorder Revision History - Fixed cDvbTuner to avoid lockups on NPTL systems (thanks to Marcel Wiesweg). - Added 'Service' functions to the plugin interface (thanks to Udo Richter). See PLUGINS.html, section "Custom services" for details. +- Replaced the get/put_unaligned() macros from with own inline + functions to avoid problems on platforms that don't provide these (thanks to + David Woodhouse for his help). diff --git a/ci.c b/ci.c index b99c5495..94a5cd63 100644 --- a/ci.c +++ b/ci.c @@ -4,11 +4,10 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 1.26 2005/08/20 15:27:35 kls Exp $ + * $Id: ci.c 1.27 2005/08/21 14:10:27 kls Exp $ */ #include "ci.h" -#include #include #include #include diff --git a/tools.h b/tools.h index 0644f4e6..0a8ee8b6 100644 --- a/tools.h +++ b/tools.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 1.73 2005/08/06 09:53:21 kls Exp $ + * $Id: tools.h 1.74 2005/08/21 14:06:38 kls Exp $ */ #ifndef __TOOLS_H @@ -57,6 +57,21 @@ template inline void swap(T &a, T &b) { T t = a; a = b; b = t; } #define BCDCHARTOINT(x) (10 * ((x & 0xF0) >> 4) + (x & 0xF)) int BCD2INT(int x); +// Unfortunately there are no platform independent macros for unaligned +// access. so we do it this way: + +template inline T get_unaligned(T *p) +{ + struct s { T v; } __attribute__((packed)); + return ((s *)p)->v; +} + +template inline void put_unaligned(unsigned int v, T* p) +{ + struct s { T v; } __attribute__((packed)); + ((s *)p)->v = v; +} + class cString { private: char *s;