[Libosinfo] [libosinfo PATCH 09/31] osinfo: Use _link_get_target() instead of _device_link_get_target()

Fabiano Fidêncio fidencio at redhat.com
Fri Nov 23 10:14:58 UTC 2018


Let's start using the parent's methods so we can, in the future,
deprecate _device_link_get_target().

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 osinfo/osinfo_deployment.c       | 4 ++--
 osinfo/osinfo_devicelinkfilter.c | 2 +-
 osinfo/osinfo_devicelinklist.c   | 2 +-
 osinfo/osinfo_os.c               | 2 +-
 osinfo/osinfo_platform.c         | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/osinfo/osinfo_deployment.c b/osinfo/osinfo_deployment.c
index 7191ac3..ae8afc7 100644
--- a/osinfo/osinfo_deployment.c
+++ b/osinfo/osinfo_deployment.c
@@ -258,7 +258,7 @@ OsinfoDevice *osinfo_deployment_get_preferred_device(OsinfoDeployment *deploymen
     OsinfoDeviceLinkFilter *linkfilter = osinfo_devicelinkfilter_new(filter);
     OsinfoDeviceLink *devlink = osinfo_deployment_get_preferred_device_link(deployment, OSINFO_FILTER(linkfilter));
     if (devlink)
-        return osinfo_devicelink_get_target(devlink);
+        return OSINFO_DEVICE(osinfo_link_get_target(OSINFO_LINK(devlink)));
     return NULL;
 }
 
@@ -316,7 +316,7 @@ OsinfoDeviceList *osinfo_deployment_get_devices(OsinfoDeployment *deployment, Os
 
     while (tmp) {
         OsinfoDeviceLink *devlink = OSINFO_DEVICELINK(tmp->data);
-        OsinfoDevice *dev = osinfo_devicelink_get_target(devlink);
+        OsinfoDevice *dev = OSINFO_DEVICE(osinfo_link_get_target(OSINFO_LINK(devlink)));
         if (!filter || osinfo_filter_matches(filter, OSINFO_ENTITY(dev)))
             osinfo_list_add(OSINFO_LIST(newList), OSINFO_ENTITY(dev));
 
diff --git a/osinfo/osinfo_devicelinkfilter.c b/osinfo/osinfo_devicelinkfilter.c
index 5ecb09b..9b0021e 100644
--- a/osinfo/osinfo_devicelinkfilter.c
+++ b/osinfo/osinfo_devicelinkfilter.c
@@ -195,7 +195,7 @@ static gboolean osinfo_devicelinkfilter_matches_default(OsinfoFilter *filter, Os
         return FALSE;
 
     if (!osinfo_filter_matches(linkfilter->priv->targetFilter,
-                               OSINFO_ENTITY(osinfo_devicelink_get_target(OSINFO_DEVICELINK(entity)))))
+                               osinfo_link_get_target(OSINFO_LINK(entity))))
         return FALSE;
 
     return TRUE;
diff --git a/osinfo/osinfo_devicelinklist.c b/osinfo/osinfo_devicelinklist.c
index ccd7d11..5f27392 100644
--- a/osinfo/osinfo_devicelinklist.c
+++ b/osinfo/osinfo_devicelinklist.c
@@ -181,7 +181,7 @@ OsinfoDeviceList *osinfo_devicelinklist_get_devices(OsinfoDeviceLinkList *list,
     for (i = 0; i < osinfo_list_get_length(OSINFO_LIST(list)); i++) {
         OsinfoEntity *ent = osinfo_list_get_nth(OSINFO_LIST(list), i);
         if (!filter || osinfo_filter_matches(filter, ent)) {
-            OsinfoDevice *dev = osinfo_devicelink_get_target(OSINFO_DEVICELINK(ent));
+            OsinfoDevice *dev = OSINFO_DEVICE(osinfo_link_get_target(OSINFO_LINK(ent)));
             osinfo_list_add(OSINFO_LIST(newList), OSINFO_ENTITY(dev));
         }
     }
diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c
index 303fe73..9ed93d1 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -248,7 +248,7 @@ osinfo_os_get_devices_internal(OsinfoOs *os,
 
     while (tmp) {
         OsinfoDeviceLink *devlink = OSINFO_DEVICELINK(tmp->data);
-        OsinfoDevice *dev = osinfo_devicelink_get_target(devlink);
+        OsinfoDevice *dev = OSINFO_DEVICE(osinfo_link_get_target(OSINFO_LINK(devlink)));
 
         if (add_entity_to_list_check(OSINFO_ENTITY(devlink),
                                      OSINFO_ENTITY(dev),
diff --git a/osinfo/osinfo_platform.c b/osinfo/osinfo_platform.c
index b17eef6..a7e66d8 100644
--- a/osinfo/osinfo_platform.c
+++ b/osinfo/osinfo_platform.c
@@ -173,7 +173,7 @@ OsinfoDeviceList *osinfo_platform_get_devices(OsinfoPlatform *platform, OsinfoFi
 
     while (tmp) {
         OsinfoDeviceLink *devlink = OSINFO_DEVICELINK(tmp->data);
-        OsinfoDevice *dev = osinfo_devicelink_get_target(devlink);
+        OsinfoDevice *dev = OSINFO_DEVICE(osinfo_link_get_target(OSINFO_LINK(devlink)));
         if (!filter || osinfo_filter_matches(filter, OSINFO_ENTITY(dev)))
             osinfo_list_add(OSINFO_LIST(newList), OSINFO_ENTITY(dev));
 
-- 
2.19.1




More information about the Libosinfo mailing list