summaryrefslogtreecommitdiff
path: root/gtk/xdgmime
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-04-08 21:01:21 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-04-08 21:01:21 +0000
commit7d6f9b81eeb2c9e5a84e39e55e5acdfa1a5421ba (patch)
treed5702a3cb72f957a2a717576e3f7e6237a09c4e5 /gtk/xdgmime
parent4df90d3150a37838f76c5ef683bc4d3ce77e3b6c (diff)
downloadgtk+-7d6f9b81eeb2c9e5a84e39e55e5acdfa1a5421ba.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.
Diffstat (limited to 'gtk/xdgmime')
-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 949cc5927e..1cd2486fe2 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.
+
Tue Apr 5 16:00:04 2005 Manish Singh <yosh@gimp.org>
* Makefile.am: add xdgmimecache.[ch].
diff --git a/gtk/xdgmime/xdgmimecache.c b/gtk/xdgmime/xdgmimecache.c
index dba7c39904..bfa02862b5 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))