diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-10-07 19:29:18 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-10-07 19:29:18 +0000 |
commit | 5783505b99eeb53c271d2437153a5e4a7f278d4d (patch) | |
tree | 79033b5d423d5a0cbc3dcce4ce0e8aa423b124c7 /firmware/export | |
parent | 42a33a7f70de01b64e2430dc1c989a2937126818 (diff) | |
download | rockbox-5783505b99eeb53c271d2437153a5e4a7f278d4d.tar.gz rockbox-5783505b99eeb53c271d2437153a5e4a7f278d4d.zip |
Add two macros for char*-based pointer arithmetic and use it in font.c
This fixes errornous pointer addition (+ on a short*), which crashed in some situation.
Fixes FS#12317 and should hopefully get the clips booting again.
Thanks to Jonathan Gordon for spotting the bad pointer arithmetic.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30724 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/system.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index cec47f1a71..aa079940d1 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -124,6 +124,8 @@ int get_cpu_boost_counter(void); | |||
124 | ptr = (typeof(ptr))tmp_ptr1; \ | 124 | ptr = (typeof(ptr))tmp_ptr1; \ |
125 | } | 125 | } |
126 | 126 | ||
127 | #define PTR_ADD(ptr, x) ((typeof(ptr))((char*)(ptr) + (x))) | ||
128 | #define PTR_SUB(ptr, x) ((typeof(ptr))((char*)(ptr) - (x))) | ||
127 | 129 | ||
128 | /* newer? SDL includes endian.h, So we ignore it */ | 130 | /* newer? SDL includes endian.h, So we ignore it */ |
129 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) || defined(__PCTOOL__) | 131 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) || defined(__PCTOOL__) |