Ignore:
Timestamp:
2013-11-08T08:21:40+01:00 (11 months ago)
Author:
moo
Message:

improve readability using ptradd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/foot.m4

    r1448 r1452  
    136136} 
    137137dnl }}} 
    138 #define ptradd(type, ptr, ptrdiff) ((type) ((char *) (ptr) + (ptrdiff))) 
    139 #define ptrsub(ptr1, ptr2) ((char *) (ptr1) - (char *)(ptr2)) 
    140138define(`DEFINE_RELOCATE_API', ` 
    141139EXPORTED_FUNCTION(`void xc_processor_relocate_$1($1 *old_src, $1 *old_start, $1 *new_src, $1 *new_start TSRMLS_DC)') dnl {{{ 
     
    149147    ptrdiff_t ptrdiff = (ptrdiff_t) new_address; 
    150148    ptrdiff_t relocatediff = (ptrdiff_t) ptradd($1 *, new_start, offset); 
     149    assert(new_src == ptradd($1 *, old_src, ptrdiff)); 
    151150 
    152151    xc_relocate_$1(new_src, ptrdiff, relocatediff TSRMLS_CC); 
Note: See TracChangeset for help on using the changeset viewer.