Fix build warnings
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 7 Feb 2023 07:54:08 +0000 (16:54 +0900)
committerKwanghoon Son <k.son@samsung.com>
Mon, 13 Feb 2023 02:31:48 +0000 (11:31 +0900)
[Issue type] : build

Change-Id: Ia1c2bfcdf50d39b61b8154e9bcca7f1dfc061029

mv_machine_learning/face_recognition/src/simple_shot.cpp
test/testsuites/machine_learning/face_recognition/test_face_recognition.cpp

index ef46f9d..cacf274 100644 (file)
@@ -43,7 +43,7 @@ SimpleShot::SimpleShot(const training_backend_type_e backend_type, const trainin
                { 1, 1, 1, 1 }, INFERENCE_TENSOR_SHAPE_NCHW, INFERENCE_TENSOR_DATA_TYPE_FLOAT32, 1
        };
 
-       for (auto idx = 0; idx < input_tensor_shape.size(); ++idx) {
+       for (size_t idx = 0; idx < input_tensor_shape.size(); ++idx) {
                input_tensor_info.size *= input_tensor_shape[idx];
                input_tensor_info.shape[idx] = input_tensor_shape[idx];
        }
@@ -93,7 +93,7 @@ void SimpleShot::ConfigureModel(int num_of_class)
        // NNTrainer needs revered tensor order so make sure to reverse the tensor order.
        reverse(input_tensor_info.shape.begin(), input_tensor_info.shape.end());
 
-       for (auto shape_idx = 0; shape_idx < input_tensor_info.shape.size(); ++shape_idx) {
+       for (size_t shape_idx = 0; shape_idx < input_tensor_info.shape.size(); ++shape_idx) {
                input_shape_str += to_string(input_tensor_info.shape[shape_idx]);
                if (shape_idx < input_tensor_info.shape.size() - 1)
                        input_shape_str += ":";
@@ -168,4 +168,4 @@ void SimpleShot::RemoveModel(const string file_path)
                if (ret)
                        throw InvalidOperation("Fail to remove internal model file.");
        }
-}
\ No newline at end of file
+}
index c91b440..015ca4c 100644 (file)
@@ -100,8 +100,9 @@ TEST(FaceRecognitionTest, InferenceAfterTrainingShouldBeOk)
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                ret = mv_face_recognition_inference(handle, mv_source);
-               if (ret != MEDIA_VISION_ERROR_NO_DATA)
+               if (ret != MEDIA_VISION_ERROR_NO_DATA) {
                        ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
+               }
 
                ret = mv_destroy_source(mv_source);
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);