[CodeClean] return type
authorJaeyun <jy1210.jung@samsung.com>
Mon, 20 Apr 2020 04:43:26 +0000 (13:43 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 20 Apr 2020 07:03:54 +0000 (16:03 +0900)
1. fix ret type of filter callback.
2. minor update (warning w/Wmissing-declarations)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
api/capi/src/tensor_filter_single.c
gst/nnstreamer/registerer/nnstreamer.c
tests/tizen_capi/unittest_tizen_capi.cc

index 75e7b0e..78f9b70 100644 (file)
@@ -247,7 +247,8 @@ g_tensor_filter_single_invoke (GTensorFilterSingle * self,
     const GstTensorMemory * input, GstTensorMemory * output)
 {
   GstTensorFilterPrivate *priv;
-  guint i, status;
+  guint i;
+  gint status;
   gboolean allocate_in_invoke;
   gboolean run_without_model;
 
@@ -297,9 +298,13 @@ g_tensor_filter_single_invoke (GTensorFilterSingle * self,
     return TRUE;
 
 error:
-  if (allocate_in_invoke == FALSE)
-    for (i = 0; i < priv->prop.output_meta.num_tensors; i++)
+  /* if failed to invoke the model, release allocated memory. */
+  if (allocate_in_invoke == FALSE) {
+    for (i = 0; i < priv->prop.output_meta.num_tensors; i++) {
       g_free (output[i].data);
+      output[i].data = NULL;
+    }
+  }
   return FALSE;
 }
 
index 1dc1b76..2bbaa90 100644 (file)
@@ -62,7 +62,7 @@
 #endif /* __gnu_linux__ && !__ANDROID__ */
 #include <tensor_split/gsttensorsplit.h>
 #include <tensor_transform/tensor_transform.h>
-#include "tensor_if/gsttensorif.h"
+#include <tensor_if/gsttensorif.h>
 
 #define NNSTREAMER_INIT(plugin,name,type) \
   do { \
index 494797e..515b4c1 100644 (file)
@@ -499,7 +499,7 @@ file_cmp (const gchar * f1, const gchar * f2)
  * @brief Wait until the change in pipeline status is done
  * @return ML_ERROR_NONE success, ML_ERROR_UNKNOWN if failed, ML_ERROR_TIMED_OUT if timeout happens.
  */
-int
+static int
 waitPipelineStateChange (ml_pipeline_h handle, ml_pipeline_state_e state,
     guint timeout_ms)
 {