From: gichan Date: Wed, 12 Oct 2022 03:05:18 +0000 (+0900) Subject: Fix build error in Tizen tv profile. X-Git-Tag: accepted/tizen/unified/20221115.172904~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21548c636ba1ffb755282a36810d64a5da1b61ce;p=platform%2Fupstream%2Fnnstreamer-edge.git Fix build error in Tizen tv profile. Fix build error in Tizen tv profile. - Fix incompatible variable and function types. Signed-off-by: gichan --- diff --git a/src/libnnstreamer-edge/nnstreamer-edge-internal.c b/src/libnnstreamer-edge/nnstreamer-edge-internal.c index 2b79ab7..eea8895 100644 --- a/src/libnnstreamer-edge/nnstreamer-edge-internal.c +++ b/src/libnnstreamer-edge/nnstreamer-edge-internal.c @@ -134,7 +134,7 @@ _fill_socket_addr (struct sockaddr_in *saddr, const char *host, const int port) saddr->sin_family = AF_INET; saddr->sin_port = htons (port); - if ((saddr->sin_addr.s_addr = inet_addr (host)) == -1) { + if ((saddr->sin_addr.s_addr = inet_addr (host)) == INADDR_NONE) { struct hostent *ent = gethostbyname (host); if (!ent) @@ -1644,6 +1644,18 @@ _nns_edge_is_connected (nns_edge_h edge_h) return false; } +/** + * @brief internal wrapper function of the nns_edge_data_destory () to avoid build warning of the incompatibe type casting. + */ +void +_nns_edge_data_destroy (nns_edge_data_h data_h) +{ + if (data_h) { + if (NNS_EDGE_ERROR_NONE != nns_edge_data_destroy (data_h)) + nns_edge_logw ("Failed to destory the nns-edge data handle."); + } +} + /** * @brief Send data to desination (broker or connected node), asynchronously. */ @@ -1687,8 +1699,7 @@ nns_edge_send (nns_edge_h edge_h, nns_edge_data_h data_h) /* Create new data handle and push it into send-queue. */ nns_edge_data_copy (data_h, &new_data_h); - if (!nns_edge_queue_push (eh->send_queue, new_data_h, - (nns_edge_queue_data_destroy_cb) nns_edge_data_destroy)) { + if (!nns_edge_queue_push (eh->send_queue, new_data_h, _nns_edge_data_destroy)) { nns_edge_loge ("Failed to send data, cannot push data into queue."); nns_edge_unlock (eh); return NNS_EDGE_ERROR_IO;