[libdmapsharing] Update Vala code
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Update Vala code
- Date: Sun, 8 Dec 2019 01:51:48 +0000 (UTC)
commit 8a240946b14884f529b55a7f9b89987544b7f760
Author: W. Michael Petullo <mike flyn org>
Date: Fri Dec 6 22:35:08 2019 -0500
Update Vala code
Signed-off-by: W. Michael Petullo <mike flyn org>
tests/dacplisten.c | 12 ++++++++----
tests/dmapcopy.c | 8 ++++++--
tests/dmapserve.c | 8 ++++++--
tests/vala-dmap-container-db.c | 31 ++++++++++++++-----------------
tests/vala-dmap-container-db.vala | 6 +++---
tests/vala-dmap-db.vala | 4 ++--
6 files changed, 39 insertions(+), 30 deletions(-)
---
diff --git a/tests/dacplisten.c b/tests/dacplisten.c
index f08fa4e..549a992 100644
--- a/tests/dacplisten.c
+++ b/tests/dacplisten.c
@@ -1,4 +1,4 @@
-/* dacplisten.c generated by valac 0.44.3, the Vala compiler
+/* dacplisten.c generated by valac 0.46.5, the Vala compiler
* generated from dacplisten.vala, do not modify */
/* FILE: dacplisten.vala -- Listen to DACP remotes
@@ -115,6 +115,7 @@ static gint DacpListener_private_offset;
static gpointer dacp_listener_parent_class = NULL;
GType vala_dacp_player_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDacpPlayer, g_object_unref)
static DmapAvRecord* vala_dacp_player_real_now_playing_record (DmapControlPlayer* base);
static const gchar* vala_dacp_player_real_now_playing_artwork (DmapControlPlayer* base,
guint width,
@@ -130,14 +131,17 @@ static void vala_dacp_player_real_cue_play (DmapControlPlayer* base,
ValaDacpPlayer* vala_dacp_player_new (void);
ValaDacpPlayer* vala_dacp_player_construct (GType object_type);
GType dacp_listener_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (DacpListener, g_object_unref)
DacpListener* dacp_listener_new (void);
DacpListener* dacp_listener_construct (GType object_type);
ValaDmapDb* vala_dmap_db_new (void);
ValaDmapDb* vala_dmap_db_construct (GType object_type);
GType vala_dmap_db_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDmapDb, g_object_unref)
ValaDmapContainerDb* vala_dmap_container_db_new (void);
ValaDmapContainerDb* vala_dmap_container_db_construct (GType object_type);
GType vala_dmap_container_db_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDmapContainerDb, g_object_unref)
static void __lambda4_ (DacpListener* self,
const gchar* service_name,
const gchar* display_name);
@@ -158,8 +162,8 @@ static DmapAvRecord*
vala_dacp_player_real_now_playing_record (DmapControlPlayer* base)
{
ValaDacpPlayer * self;
- DmapAvRecord* result = NULL;
FILE* _tmp0_;
+ DmapAvRecord* result = NULL;
self = (ValaDacpPlayer*) base;
_tmp0_ = stdout;
fprintf (_tmp0_, "Now playing record request received\n");
@@ -173,8 +177,8 @@ vala_dacp_player_real_now_playing_artwork (DmapControlPlayer* base,
guint height)
{
ValaDacpPlayer * self;
- const gchar* result = NULL;
FILE* _tmp0_;
+ const gchar* result = NULL;
self = (ValaDacpPlayer*) base;
_tmp0_ = stdout;
fprintf (_tmp0_, "Now playing artwork request received\n");
@@ -443,11 +447,11 @@ gint
_vala_main (gchar** args,
gint args_length1)
{
- gint result = 0;
GMainLoop* loop = NULL;
GMainLoop* _tmp0_;
DacpListener* dacplistener = NULL;
DacpListener* _tmp1_;
+ gint result = 0;
_tmp0_ = g_main_loop_new (NULL, FALSE);
loop = _tmp0_;
_tmp1_ = dacp_listener_new ();
diff --git a/tests/dmapcopy.c b/tests/dmapcopy.c
index 972e467..17940c7 100644
--- a/tests/dmapcopy.c
+++ b/tests/dmapcopy.c
@@ -1,4 +1,4 @@
-/* dmapcopy.c generated by valac 0.44.3, the Vala compiler
+/* dmapcopy.c generated by valac 0.46.5, the Vala compiler
* generated from dmapcopy.vala, do not modify */
/* FILE: dmapcopy.vala -- Copy files from a DMAP server
@@ -115,8 +115,11 @@ void value_take_dpap_copy (GValue* value,
gpointer v_object);
gpointer value_get_dpap_copy (const GValue* value);
GType dpap_copy_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (DPAPCopy, dpap_copy_unref)
GType vala_dmap_db_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDmapDb, g_object_unref)
GType vala_image_record_factory_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaImageRecordFactory, g_object_unref)
static void dpap_copy_connected_cb (DPAPCopy* self,
DmapConnection* connection,
gboolean _result_,
@@ -125,6 +128,7 @@ static void __lambda4_ (DPAPCopy* self,
guint k,
DmapRecord* v);
GType vala_image_record_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaImageRecord, g_object_unref)
const gchar* vala_image_record_get_location (ValaImageRecord* self);
static void ___lambda4__dmap_id_record_func (guint id,
DmapRecord* record,
@@ -527,12 +531,12 @@ gint
_vala_main (gchar** args,
gint args_length1)
{
- gint result = 0;
GMainLoop* loop = NULL;
GMainLoop* _tmp0_;
DPAPCopy* dmapcopy = NULL;
DPAPCopy* _tmp1_;
GError* _inner_error0_ = NULL;
+ gint result = 0;
_tmp0_ = g_main_loop_new (NULL, FALSE);
loop = _tmp0_;
g_log_set_handler ("libdmapsharing", G_LOG_LEVEL_DEBUG, _debug_null_glog_func, NULL);
diff --git a/tests/dmapserve.c b/tests/dmapserve.c
index 6fbda32..a8e6217 100644
--- a/tests/dmapserve.c
+++ b/tests/dmapserve.c
@@ -1,4 +1,4 @@
-/* dmapserve.c generated by valac 0.44.3, the Vala compiler
+/* dmapserve.c generated by valac 0.46.5, the Vala compiler
* generated from dmapserve.vala, do not modify */
/* FILE: dmapserve.vala -- Serve media using DMAP
@@ -115,9 +115,13 @@ void value_take_dpap_serve (GValue* value,
gpointer v_object);
gpointer value_get_dpap_serve (const GValue* value);
GType dpap_serve_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (DPAPServe, dpap_serve_unref)
GType vala_image_record_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaImageRecord, g_object_unref)
GType vala_dmap_db_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDmapDb, g_object_unref)
GType vala_dmap_container_db_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDmapContainerDb, g_object_unref)
DPAPServe* dpap_serve_new (GError** error);
DPAPServe* dpap_serve_construct (GType object_type,
GError** error);
@@ -452,12 +456,12 @@ gint
_vala_main (gchar** args,
gint args_length1)
{
- gint result = 0;
GMainLoop* loop = NULL;
GMainLoop* _tmp0_;
DPAPServe* dmapcopy = NULL;
DPAPServe* _tmp1_;
GError* _inner_error0_ = NULL;
+ gint result = 0;
_tmp0_ = g_main_loop_new (NULL, FALSE);
loop = _tmp0_;
g_log_set_handler ("libdmapsharing", G_LOG_LEVEL_DEBUG, _debug_printf_glog_func, NULL);
diff --git a/tests/vala-dmap-container-db.c b/tests/vala-dmap-container-db.c
index cf43a4a..ed701aa 100644
--- a/tests/vala-dmap-container-db.c
+++ b/tests/vala-dmap-container-db.c
@@ -1,4 +1,4 @@
-/* vala-dmap-container-db.c generated by valac 0.44.3, the Vala compiler
+/* vala-dmap-container-db.c generated by valac 0.46.5, the Vala compiler
* generated from vala-dmap-container-db.vala, do not modify */
/* FILE: vala-dmap-db.vala -- A DmapContainerDb implementation in Vala
@@ -63,9 +63,10 @@ static gpointer vala_dmap_container_db_parent_class = NULL;
static DmapContainerDbInterface * vala_dmap_container_db_dmap_container_db_parent_iface = NULL;
GType vala_dmap_container_db_get_type (void) G_GNUC_CONST;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaDmapContainerDb, g_object_unref)
static gint64 vala_dmap_container_db_real_count (DmapContainerDb* base);
static void vala_dmap_container_db_real_foreach (DmapContainerDb* base,
- GHFunc func,
+ DmapIdContainerRecordFunc func,
gpointer func_target);
static DmapContainerRecord* vala_dmap_container_db_real_lookup_by_id (DmapContainerDb* base,
guint id);
@@ -86,10 +87,10 @@ static gint64
vala_dmap_container_db_real_count (DmapContainerDb* base)
{
ValaDmapContainerDb * self;
- gint64 result = 0LL;
GeeArrayList* _tmp0_;
gint _tmp1_;
gint _tmp2_;
+ gint64 result = 0LL;
self = (ValaDmapContainerDb*) base;
_tmp0_ = self->priv->db;
_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
@@ -100,7 +101,7 @@ vala_dmap_container_db_real_count (DmapContainerDb* base)
static void
vala_dmap_container_db_real_foreach (DmapContainerDb* base,
- GHFunc func,
+ DmapIdContainerRecordFunc func,
gpointer func_target)
{
ValaDmapContainerDb * self;
@@ -114,10 +115,9 @@ vala_dmap_container_db_real_foreach (DmapContainerDb* base,
GeeArrayList* _tmp2_;
gint _tmp3_;
gint _tmp4_;
- void* _tmp5_;
- GeeArrayList* _tmp6_;
- gpointer _tmp7_;
- DmapRecord* _tmp8_;
+ GeeArrayList* _tmp5_;
+ gpointer _tmp6_;
+ DmapContainerRecord* _tmp7_;
if (!_tmp0_) {
gint _tmp1_;
_tmp1_ = i;
@@ -130,12 +130,11 @@ vala_dmap_container_db_real_foreach (DmapContainerDb* base,
if (!(i < _tmp4_)) {
break;
}
- _tmp5_ = GINT_TO_POINTER (i);
- _tmp6_ = self->priv->db;
- _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, i);
- _tmp8_ = (DmapRecord*) _tmp7_;
- func (_tmp5_, _tmp8_, func_target);
- _g_object_unref0 (_tmp8_);
+ _tmp5_ = self->priv->db;
+ _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, i);
+ _tmp7_ = (DmapContainerRecord*) _tmp6_;
+ func ((guint) i, _tmp7_, func_target);
+ _g_object_unref0 (_tmp7_);
}
}
}
@@ -145,10 +144,8 @@ vala_dmap_container_db_real_lookup_by_id (DmapContainerDb* base,
guint id)
{
ValaDmapContainerDb * self;
- DmapContainerRecord* result = NULL;
self = (ValaDmapContainerDb*) base;
g_error ("vala-dmap-container-db.vala:40: lookup_by_id not implemented");
- return result;
}
static void
@@ -202,7 +199,7 @@ vala_dmap_container_db_instance_init (ValaDmapContainerDb * self,
{
GeeArrayList* _tmp0_;
self->priv = vala_dmap_container_db_get_instance_private (self);
- _tmp0_ = gee_array_list_new (DMAP_TYPE_RECORD, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify)
g_object_unref, NULL, NULL, NULL);
+ _tmp0_ = gee_array_list_new (DMAP_TYPE_CONTAINER_RECORD, (GBoxedCopyFunc) g_object_ref,
(GDestroyNotify) g_object_unref, NULL, NULL, NULL);
self->priv->db = _tmp0_;
}
diff --git a/tests/vala-dmap-container-db.vala b/tests/vala-dmap-container-db.vala
index d46ea2c..c3c1272 100644
--- a/tests/vala-dmap-container-db.vala
+++ b/tests/vala-dmap-container-db.vala
@@ -23,16 +23,16 @@
private class ValaDmapContainerDb : GLib.Object, Dmap.ContainerDb {
// A dumb database that stores everything in an array
- private Gee.ArrayList<Dmap.Record> db = new Gee.ArrayList<Dmap.Record> ();
+ private Gee.ArrayList<Dmap.ContainerRecord> db = new Gee.ArrayList<Dmap.ContainerRecord> ();
public int64 count () {
return db.size;
}
- public void @foreach (GLib.HFunc func) {
+ public void @foreach (Dmap.IdContainerRecordFunc func) {
int i;
for (i = 0; i < db.size; i++) {
- func (i.to_pointer (), db[i]);
+ func (i, db[i]);
}
}
diff --git a/tests/vala-dmap-db.vala b/tests/vala-dmap-db.vala
index 743a582..375e9ca 100644
--- a/tests/vala-dmap-db.vala
+++ b/tests/vala-dmap-db.vala
@@ -43,12 +43,12 @@ private class ValaDmapDb : GLib.Object, Dmap.Db {
return db.size;
}
- public void @foreach (GLib.HFunc func) {
+ public void @foreach (Dmap.IdRecordFunc func) {
int i;
for (i = 0; i < db.size; i++) {
// NOTE: iPhoto does not like a record ID of 0,
// so we pretend to start with 1
- func ((i + 1).to_pointer (), db[i]);
+ func (i + 1, db[i]);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]