Method: Fiddle::Pointer#-

Defined in:
ext/fiddle/pointer.c

#-(n) ⇒ Object

Returns a new pointer instance that has been moved back n bytes.



631
632
633
634
635
636
637
638
639
640
641
# File 'ext/fiddle/pointer.c', line 631

static VALUE
rb_fiddle_ptr_minus(VALUE self, VALUE other)
{
    void *ptr;
    long num, size;

    ptr = rb_fiddle_ptr2cptr(self);
    size = RPTR_DATA(self)->size;
    num = NUM2LONG(other);
    return rb_fiddle_ptr_new((char *)ptr - num, size + num, 0);
}