[Vm-dev] Compiling DBusPlugin

Damien Cassou damien.cassou at gmail.com
Wed May 16 15:41:56 UTC 2012


Hi,

the official DBusPlugin source file defines argumentsAddInt16toIter() as

static sqInt argumentsAddInt16toIter(sqInt oop, DBusMessageIter*iter) {
	dbus_int16_t intArg;

	if (!((oop & 1))) {
		msg("Oop is no integer value");
		return interpreterProxy->primitiveFail();
	}
	intArg = (oop >> 1);
	if (!(dbus_message_iter_append_basic(iter, DBUS_TYPE_INT16, &intArg))) {
		msg("Can not add Int16 argument.");
		return interpreterProxy->primitiveFail();
	}
}


however, if I generate the sources using VMMaker, I get

static void
argumentsAddInt16toIter(sqInt oop, DBusMessageIter*iter)
{
    dbus_int16_t intArg;

    if (!((oop & 1))) {
        msg("Oop is no integer value");
        interpreterProxy->primitiveFail(); return;
    }
    intArg = interpreterProxy->integerValueOf(oop);
    if (!(dbus_message_iter_append_basic(iter, DBUS_TYPE_INT16, &intArg))) {
        msg("Can not add Int16 argument.");
        interpreterProxy->primitiveFail(); return;
    }
}


The implementation and signature are different which makes the use of this
function not compile anymore:

[...]
_return_value = argumentsAddInt16toIter(arg, iter);
if (interpreterProxy->failed()) {
	return null;
}
interpreterProxy->popthenPush(3, _return_value);
[...]


How can I change this code so that it works with the generated definition
of argumentsAddInt16toIter()?

Thank you

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them popular
by not having them." James Iry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120516/f472560b/attachment.htm


More information about the Vm-dev mailing list