From: Guillaume M. <res...@gm...> - 2010-03-30 19:06:51
Hello,
I did a quick hack to be able to use the g_format_size_for_display()
function from Glib.
The C function needs a goffset parameter so I had to add a new
FundamentalThing to the code generator.
goffset is a guint64 so here is how I add it: goffset => Native long
type => JNI jlong type => Java long type.
The branch can be found at:
bzr/java-gnome/hackers/guillaume/glib_format_size/
Can anyone let me know if everything is right? (that's my first codegen
hack).
Cheers,
--
Guillaume Mazoyer - http://www.respawner.fr/
From: Andrew C. <an...@op...> - 2010-03-30 22:39:27
On Tue, 2010-03-30 at 21:06 +0200, Guillaume Mazoyer wrote:
> Can anyone let me know if everything is right? (that's my first codegen
> hack).
Yes everything looks fine. :)
I'm wondering if you need to add
(define-function format_size_for_display
(of-object "GlibMisc")
(c-name "g_format_size_for_display")
+ (caller-owns-return #t)
(return-type "char*")
(parameters
'("goffset" "size")
)
)
... yes you do.
See FunctionBlock's getCallerOwnsReturn() for the default and
StringThing's jniReturnCleanup() for the code that's output.
AfC
Melbourne
From: Andrew C. <an...@op...> - 2010-03-31 01:16:21
On Wed, 2010-03-31 at 01:50 +0200, Guillaume Mazoyer wrote:
> Added, commited and pushed :)
Great!
It'll need some testing, of course. I'd suggest the
ValidateUtilityFunctions test case class would be a good place to add a
fixture or two...
AfC
Melbourne