[Vala] DBUS warnings (I don't understand)



Hello everyone,

I have a simple dbus example working, but I am getting some compiler
warnings that I don't understand.

eg.  warning: passing argument 3 of ‘g_cclosure_new’ from incompatible
pointer type [enabled by default].

I have narrowed it down to the Bus.own_name call ...

Bus.own_name (BusType.SESSION, "org.example.Demo", BusNameOwnerFlags.NONE,
                  on_bus_aquired,
                  () => {},
                  () => stderr.printf ("Could not aquire name\n"));

Any idea what I am doing wrong?

Here is my code and compiler output ...

Thanks

Brian

Code ...

using Clutter;
using ClutterGst;

/*
Gui: class called from main to define the ui before the clutter.main loop
is called
*/
class Gui : GLib.Object {

private Stage stage;
private VideoTexture videoPlayer;
        private Actor videoActor;

public Gui() {
 // All the worlds a stage
stage = new Stage();
//stage.set_fullscreen(true);
stage.color = Color () { alpha = 255 };
stage.set_reactive(true);
stage.set_size(1280, 800);
stage.hide.connect (Clutter.main_quit);

videoActor = new Actor();

videoPlayer = new ClutterGst.VideoTexture();
videoPlayer.set_uri("file:///home/brian/Videos/louis_ck.mp4");
videoPlayer.set_property("seek-flags", 1);
videoPlayer.set_reactive(true);
videoPlayer.set_playing(false);
videoPlayer.set_opacity(120);

videoPlayer.button_press_event.connect(onPlayPress);

videoActor.add(videoPlayer);
videoActor.hide();

stage.add(videoActor);

                // WARNINGS COMING FROM THIS BLOCK OF CODE
!!!!!!!!!!!!!!!!!!!!!!!!!!!
Bus.own_name (BusType.SESSION, "org.example.Demo", BusNameOwnerFlags.NONE,
                  on_bus_aquired,
                  () => {},
                  () => stderr.printf ("Could not aquire name\n"));

stage.show();

}

  private bool onPlayPress (ButtonEvent event) {
if (videoPlayer.get_playing() == false) {
videoPlayer.set_playing(true);
                        stdout.printf("%s", "setting to play");
}else{
videoPlayer.set_playing(false);
}
return true;
        }


private void on_bus_aquired (DBusConnection conn) {
try {
    conn.register_object ("/org/example/demo",
        new DemoServer ());
} catch (IOError e) {
    stderr.printf ("Could not register service\n");
}
}


}


/*
D-BUS Class to accept remote control input from
lirc using gdbus command in ~/.lircrc
*/

[DBus (name = "org.example.Demo")]
public class DemoServer : GLib.Object {

public DemoServer()  {

}
 public int Ping (string msg) {

if (msg == "KEY_OK") {
stdout.printf("%s",msg);
}else if (msg == "KEY_FORWARD") {
stdout.printf("%s",msg);
}else if (msg == "KEY_UP") {
stdout.printf("%s",msg);
}else if (msg == "KEY_LEFT") {
stdout.printf("%s",msg);
}else if (msg == "KEY_DOWN") {
stdout.printf("%s",msg);
}

return 0;
    }
}



int main (string[] args) {

//Clutter.init(ref args);
//Gst.init(ref args);

ClutterGst.init(ref args);

var gui = new Gui();

Clutter.main();

return 0;
}

/*
valac -X -O2 -g --pkg clutter-1.0 --pkg gstreamer-0.10 --pkg
gstreamer-interfaces-0.10 --pkg clutter-gst-1.0 --pkg gio-2.0
VideoTest.vala
*/

// -X -O2 for optimizations
// -g for debug


-- compile ...

[brian duffybr2 fm]$ valac -X -O2 -g --pkg clutter-1.0 --pkg gstreamer-0.10
--pkg gstreamer-interfaces-0.10 --pkg clutter-gst-1.0 --pkg gio-2.0
VideoTest.vala
VideoTest.vala:112.6-112.20: warning: local variable `gui' declared but
never used
var gui = new Gui();
    ^^^^^^^^^^^^^^^
/home/brian/bb/fm/VideoTest.vala: In function ‘gui_construct’:
/home/brian/bb/fm/VideoTest.vala:40:2: warning: passing argument 3 of
‘g_cclosure_new’ from incompatible pointer type [enabled by default]
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:31,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /home/brian/bb/fm/VideoTest.vala.c:6:
/usr/include/glib-2.0/gobject/gclosure.h:206:11: note: expected
‘GClosureNotify’ but argument is of type ‘void (*)(void *)’
/home/brian/bb/fm/VideoTest.vala:40:2: warning: passing argument 3 of
‘g_cclosure_new’ from incompatible pointer type [enabled by default]
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:31,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /home/brian/bb/fm/VideoTest.vala.c:6:
/usr/include/glib-2.0/gobject/gclosure.h:206:11: note: expected
‘GClosureNotify’ but argument is of type ‘void (*)(void *)’
/home/brian/bb/fm/VideoTest.vala:40:2: warning: passing argument 3 of
‘g_cclosure_new’ from incompatible pointer type [enabled by default]
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:31,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /home/brian/bb/fm/VideoTest.vala.c:6:
/usr/include/glib-2.0/gobject/gclosure.h:206:11: note: expected
‘GClosureNotify’ but argument is of type ‘void (*)(void *)’
Compilation succeeded - 1 warning(s)
[brian duffybr2 fm]$
[brian duffybr2 fm]$
[brian duffybr2 fm]$
[brian duffybr2 fm]$
[brian duffybr2 fm]$
[brian duffybr2 fm]$ ./VideoTest
(0,)
(0,)
KEY_OKKEY_FORWARD[brian duffybr2 fm]$

-- 
Duff


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]