Minor coverity issue fixes 56/282556/6
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 5 Oct 2022 14:03:00 +0000 (23:03 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 18 Oct 2022 12:49:43 +0000 (21:49 +0900)
Fix some minor coverity issues that might has meanful

1. Initialize member value
2. Remove useless std::move
3. Remove const keyword for function return value.

Change-Id: Ie1ecaa3394607ea724a2074b991cee6681122bef
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
examples/builder/examples.cpp
examples/gestures/gesture-example.cpp
examples/scroll-view/scroll-view-example.cpp

index 7ba6fef..fd5d42a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -164,6 +164,8 @@ public:
   FileWatcher(void);
   ~FileWatcher(void);
   explicit FileWatcher(const std::string& fn)
+  : mLastTime(0),
+    mstringPath{}
   {
     SetFilename(fn);
   };
@@ -187,7 +189,8 @@ private:
 };
 
 FileWatcher::FileWatcher(void)
-: mLastTime(0)
+: mLastTime(0),
+  mstringPath{}
 {
 }
 
index 129a1b7..04f783a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -74,7 +74,7 @@ const float   ROTATE_BACK_ANIMATION_DURATION(0.25f);
  */
 void AddHelpInfo(const std::string&& string, const Vector2& windowSize, Actor parent, Animation animation, float startTime, float endTime)
 {
-  Actor   text = TextLabel::New(std::move(string));
+  Actor   text = TextLabel::New(string);
   Vector3 position(windowSize * HELP_TEXT_POSITION_MULTIPLIER);
 
   text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER);
index 1f62db9..c1374b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -105,7 +105,7 @@ const char* const IMAGE_PATHS[] = {
 
   NULL};
 
-const char* const GetNextImagePath()
+const char* GetNextImagePath()
 {
   static const char* const* imagePtr = &IMAGE_PATHS[0];