Fix an off-by-one bug in callbacks with struct argument
Fix an off-by-one bug in callbacks with struct argument

The first element in the block is for the return value, and the
arguments actually start from the second one.

Without this fix, this fails:

a: make struct! [
	int32 i: 0
]

mk-cb: func [
	args [block!]
	body [block!]
	/local r-args arg a tmp-func
][
	r-args: copy []

	arg:[
		copy a word! (append r-args a)
		block!
		opt string!
	]
	attr: [
		set-word!
		block! | word!
	]

	parse args [
		opt string!
		some [ arg | attr ]
	]

	print ["args:" mold args]

	tmp-func: function r-args body

	print ["tmp-func:" mold :tmp-func]
	make callback! compose/deep [[(args)] :tmp-func]
]

ca: mk-cb compose/deep [
	i [(a)]
	return: [void]
][
	print ["i/i:" i/i]
]

cb: make library! %libcb.so
call-f: make routine! compose [[
	f [pointer]
] (cb) "call_f" ]

call-f addr-of ca

** Script error: invalid argument: none
** Where: call-f do either either either -apply-
** Near: call-f addr-of ca

C library:

struct si {
	int i;
};

void call_f (void (*f)(struct si))
{
	struct si i;
	i.i = 10;
	f(i);
}

rgchris/ren-c,hostilefork/rebol,giuliolunati/ren-c,draegtun/ren-c,hostilefork/rebol,codebybrett/ren-c,draegtun/ren-c,rgchris/ren-c,mbk/ren-c,hostilefork/rebol,rgchris/ren-c,giuliolunati/ren-c,codebybrett/ren-c,draegtun/ren-c,draegtun/ren-c,giuliolunati/ren-c,giuliolunati/ren-c,kealist/ren-c,kealist/ren-c,codebybrett/ren-c,mbk/ren-c,rgchris/ren-c,giuliolunati/ren-c,hostilefork/rebol,hostilefork/rebol,hostilefork/rebol,mbk/ren-c,kealist/ren-c,codebybrett/ren-c,kealist/ren-c,kealist/ren-c,kealist/ren-c,rgchris/ren-c,mbk/ren-c,codebybrett/ren-c,draegtun/ren-c,codebybrett/ren-c,draegtun/ren-c