cederom commented on code in PR #3110:
URL: https://github.com/apache/nuttx-apps/pull/3110#discussion_r2166816248


##########
system/settings/settings.c:
##########
@@ -423,23 +424,24 @@ static int set_bool(FAR setting_t *setting, int i)
 static int get_float(FAR setting_t *setting, FAR double *f)
 {
   assert(setting);
-  if ((setting->type != SETTING_FLOAT) &&
-      (setting->type != SETTING_INT))
-    {
-      return -EACCES;
-    }
 
-  if (setting->type == SETTING_FLOAT)
-    {
-      *f = setting->val.f;
-    }
-  else if (setting->type == SETTING_INT)
-    {
-      *f = (double)setting->val.i;
-    }
-  else
+  switch (setting->type)
     {
-      return -EINVAL;
+      case SETTING_FLOAT:
+        {
+          *f = setting->val.f;
+        }
+        break;
+      case SETTING_INT:
+        {
+          *f = (double)setting->val.i;
+        }
+        break;
+      default:
+        {
+          return -EACCES;
+        }
+        break;

Review Comment:
   no break



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to