- Change to offsetof as suggested by Clayton

This commit is contained in:
Marcus Boerger 2006-02-17 08:24:56 +00:00
parent ebdcf22445
commit f81239a2b3

View file

@ -77,10 +77,7 @@ typedef struct {
static inline text_iter_obj* text_iter_to_obj(zend_object_iterator *iter)
{
static text_iter_obj adr;
static int ofs = (char*)&adr.iter - (char*)&adr;
return (text_iter_obj *)((char*)iter - ofs);
return (text_iter_obj *)((char*)iter - offsetof(text_iter_obj, iter));
}
typedef struct {