Commit 7d6f9b81 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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.
parent 4df90d31
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].
......
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment