Method: Fiddle::Pointer#-

Defined in:
pointer.c

#-(n) ⇒ Object

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



644
645
646
647
648
649
650
651
652
653
654
# File 'pointer.c', line 644

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);
}