summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-04-08 21:02:28 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-04-08 21:02:28 +0000
commit361429159c62f9a38a065f9c5c41b4e86f782166 (patch)
tree07862387a62549fc137cafadcaeec94c6ab6b5e0
parente77c3715e0b25028849ac44e2e228bf56c82af2d (diff)
downloadgdk-pixbuf-361429159c62f9a38a065f9c5c41b4e86f782166.tar.gz
Use cache->buffer, not cache.
2005-04-08 Matthias Clasen <mclasen@redhat.com> * xdgmimecache.c (cache_magic_matchlet_compare_to_data) (cache_magic_matchlet_compare): Use cache->buffer, not cache.
-rw-r--r--gtk/xdgmime/ChangeLog6
-rw-r--r--gtk/xdgmime/xdgmimecache.c20
2 files changed, 16 insertions, 10 deletions
diff --git a/gtk/xdgmime/ChangeLog b/gtk/xdgmime/ChangeLog
index 418dccbb2..dbec7b9b6 100644
--- a/gtk/xdgmime/ChangeLog
+++ b/gtk/xdgmime/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-08 Matthias Clasen <mclasen@redhat.com>
+
+ * xdgmimecache.c (cache_magic_matchlet_compare_to_data)
+ (cache_magic_matchlet_compare): Use cache->buffer, not
+ cache.
+
2005-04-02 Matthias Clasen <mclasen@redhat.com>
Sync to latest upstream, support mmapped
diff --git a/gtk/xdgmime/xdgmimecache.c b/gtk/xdgmime/xdgmimecache.c
index dba7c3990..bfa02862b 100644
--- a/gtk/xdgmime/xdgmimecache.c
+++ b/gtk/xdgmime/xdgmimecache.c
@@ -79,8 +79,8 @@ struct _XdgMimeCache
char *buffer;
};
-#define GET_UINT16(cache,offset) (ntohs(*(uint16_t*)&(cache)[offset]))
-#define GET_UINT32(cache,offset) (ntohl(*(uint32_t*)&(cache)[offset]))
+#define GET_UINT16(cache,offset) (ntohs(*(uint16_t*)((cache) + (offset))))
+#define GET_UINT32(cache,offset) (ntohl(*(uint32_t*)((cache) + (offset))))
XdgMimeCache *
_xdg_mime_cache_ref (XdgMimeCache *cache)
@@ -156,11 +156,11 @@ cache_magic_matchlet_compare_to_data (XdgMimeCache *cache,
const void *data,
size_t len)
{
- xdg_uint32_t range_start = GET_UINT32 (cache, offset);
- xdg_uint32_t range_length = GET_UINT32 (cache, offset + 4);
- xdg_uint32_t data_length = GET_UINT32 (cache, offset + 12);
- xdg_uint32_t data_offset = GET_UINT32 (cache, offset + 16);
- xdg_uint32_t mask_offset = GET_UINT32 (cache, offset + 20);
+ xdg_uint32_t range_start = GET_UINT32 (cache->buffer, offset);
+ xdg_uint32_t range_length = GET_UINT32 (cache->buffer, offset + 4);
+ xdg_uint32_t data_length = GET_UINT32 (cache->buffer, offset + 12);
+ xdg_uint32_t data_offset = GET_UINT32 (cache->buffer, offset + 16);
+ xdg_uint32_t mask_offset = GET_UINT32 (cache->buffer, offset + 20);
int i, j;
@@ -208,9 +208,9 @@ cache_magic_matchlet_compare (XdgMimeCache *cache,
const void *data,
size_t len)
{
- xdg_uint32_t n_children = GET_UINT32 (cache, offset + 24);
- xdg_uint32_t child_offset = GET_UINT32 (cache, offset + 28);
-
+ xdg_uint32_t n_children = GET_UINT32 (cache->buffer, offset + 24);
+ xdg_uint32_t child_offset = GET_UINT32 (cache->buffer, offset + 28);
+
int i;
if (cache_magic_matchlet_compare_to_data (cache, offset, data, len))