Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
memcached
fix-strict-aliasing.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-strict-aliasing.patch of Package memcached
diff -rdBu memcached-1.4.0-rc1/memcached.h memcached-1.4.0-my/memcached.h --- memcached-1.4.0-rc1/memcached.h 2009-05-29 00:51:56.000000000 +0400 +++ memcached-1.4.0-my/memcached.h 2009-06-07 22:32:52.000000000 +0400 @@ -75,21 +75,21 @@ /* warning: don't use these macros with a function, as it evals its arg twice */ #define ITEM_get_cas(i) ((uint64_t)(((i)->it_flags & ITEM_CAS) ? \ - *(uint64_t*)&((i)->end[0]) : 0x0)) + *(uint64_t*)((char*)(i) + sizeof(*i)) : 0x0)) #define ITEM_set_cas(i,v) { if ((i)->it_flags & ITEM_CAS) { \ - *(uint64_t*)&((i)->end[0]) = v; } } + *(uint64_t*)((char*)(i) + sizeof(*i)) = v; } } -#define ITEM_key(item) (((char*)&((item)->end[0])) \ +#define ITEM_key(item) ((char*)(item) + sizeof(*item) \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) -#define ITEM_suffix(item) ((char*) &((item)->end[0]) + (item)->nkey + 1 \ +#define ITEM_suffix(item) ((char*)(item) + sizeof(*item) + (item)->nkey + 1 \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) -#define ITEM_data(item) ((char*) &((item)->end[0]) + (item)->nkey + 1 \ +#define ITEM_data(item) ((char*)(item) + sizeof(*item) + (item)->nkey + 1 \ + (item)->nsuffix \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) -#define ITEM_ntotal(item) (sizeof(struct _stritem) + (item)->nkey + 1 \ +#define ITEM_ntotal(item) (sizeof(*item) + (item)->nkey + 1 \ + (item)->nsuffix + (item)->nbytes \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) @@ -285,7 +285,6 @@ uint8_t it_flags; /* ITEM_* above */ uint8_t slabs_clsid;/* which slab class we're in */ uint8_t nkey; /* key length, w/terminating null and padding */ - void * end[]; /* if it_flags & ITEM_CAS we have 8 bytes CAS */ /* then null-terminated key */ /* then " flags length\r\n" (no terminating null) */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor