GNOME Bugzilla – Bug 705699
Custom return value in _WRAP_VFUNC
Last modified: 2013-09-03 09:14:27 UTC
Created attachment 251208 [details] [review] patch Sometimes(e.g. here: https://github.com/loganek/gstreamermm-1.0/commit/ffb53ed748f7cabb02e479aa05862f75b4c09efa#commitcomment-3795769 ) we need to return custom, not default value of type. I attach patch, which allows to use _WRAP_VFUNC like this: _WRAP_VFUNC(bool start(), "start", returnValue(true))
Created attachment 253510 [details] [review] patch: gmmproc: Add parameter return_value in _WRAP_VFUNC. This is a slightly modified patch. Two modifications: 1. I changed return $14; to return _CONVERT($3,$4,`$14'); in _VFUNC_PCC in vfunc.m4. It converts the C++ return value to the corresponding C return value. It's not necessary for bool, int or similar return types, but it's necessary if the return type is an enum, for instance. 2. I changed on_wrap_vfunc() in WrapParser.pm to accept return_value true instead of returnValue(true) This is a matter of taste. I think it fits better with how other parameters in _WRAP_* directives are named. What do you think?
Thanks for reply, I'm not an expert, but I think your modifications makes my source code better;)
I have pushed the patch in comment 1. https://git.gnome.org/browse/glibmm/commit/?id=fc14e6c03db879bc3e0a7bac353c76948f482c10
thanks