You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/08/30 20:58:58 UTC

incubator-mynewt-core git commit: No need to set errno; it is not used.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop fa876031e -> 1f32d15a1


No need to set errno; it is not used.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/1f32d15a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1f32d15a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1f32d15a

Branch: refs/heads/develop
Commit: 1f32d15a1a4cf3b47b7dec79dd450086fe99b828
Parents: fa87603
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Aug 30 13:58:07 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Aug 30 13:58:07 2016 -0700

----------------------------------------------------------------------
 hw/bsp/arduino_primo_nrf52/src/sbrk.c | 5 +----
 hw/bsp/bmd300eval/src/sbrk.c          | 5 +----
 hw/bsp/native/src/sbrk.c              | 3 +--
 hw/bsp/nrf51-arduino_101/src/sbrk.c   | 4 ----
 hw/bsp/nrf51-blenano/src/sbrk.c       | 6 +-----
 hw/bsp/nrf51dk-16kbram/src/sbrk.c     | 5 +----
 hw/bsp/nrf51dk/src/sbrk.c             | 5 +----
 hw/bsp/nrf52dk/src/sbrk.c             | 5 +----
 hw/bsp/nrf52pdk/src/sbrk.c            | 3 ---
 libs/json/src/json_decode.c           | 1 -
 libs/shell/src/shell.c                | 3 +--
 11 files changed, 8 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/arduino_primo_nrf52/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/arduino_primo_nrf52/src/sbrk.c b/hw/bsp/arduino_primo_nrf52/src/sbrk.c
index 36a1af0..242f11b 100644
--- a/hw/bsp/arduino_primo_nrf52/src/sbrk.c
+++ b/hw/bsp/arduino_primo_nrf52/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
 #include <hal/hal_bsp.h>
 
 /* put these in the data section so they are not cleared by _start */
@@ -42,7 +41,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < sbrkBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -54,7 +52,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/bmd300eval/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/src/sbrk.c b/hw/bsp/bmd300eval/src/sbrk.c
index 8549266..1596d46 100644
--- a/hw/bsp/bmd300eval/src/sbrk.c
+++ b/hw/bsp/bmd300eval/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
 #include <hal/hal_bsp.h>
 
 extern char __HeapBase;
@@ -35,7 +34,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < &__HeapBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -47,7 +45,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/native/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/native/src/sbrk.c b/hw/bsp/native/src/sbrk.c
index 3ec8a90..5baa299 100644
--- a/hw/bsp/native/src/sbrk.c
+++ b/hw/bsp/native/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -19,7 +19,6 @@
 
 #include <sys/mman.h>
 #include <unistd.h>
-#include <errno.h>
 
 #include <hal/hal_bsp.h>
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/nrf51-arduino_101/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-arduino_101/src/sbrk.c b/hw/bsp/nrf51-arduino_101/src/sbrk.c
index 27f1486..fb844a6 100644
--- a/hw/bsp/nrf51-arduino_101/src/sbrk.c
+++ b/hw/bsp/nrf51-arduino_101/src/sbrk.c
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
-
 extern char __HeapBase;
 extern char __HeapLimit;
 
@@ -33,7 +31,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < &__HeapBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -45,7 +42,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/nrf51-blenano/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-blenano/src/sbrk.c b/hw/bsp/nrf51-blenano/src/sbrk.c
index 14307ba..1402c7e 100644
--- a/hw/bsp/nrf51-blenano/src/sbrk.c
+++ b/hw/bsp/nrf51-blenano/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
-
 /* put these in the data section so they are not cleared by _start */
 static char *sbrkBase __attribute__ ((section (".data")));
 static char *sbrkLimit __attribute__ ((section (".data")));
@@ -41,7 +39,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < sbrkBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -53,7 +50,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/nrf51dk-16kbram/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk-16kbram/src/sbrk.c b/hw/bsp/nrf51dk-16kbram/src/sbrk.c
index 7daef1a..1e64f68 100644
--- a/hw/bsp/nrf51dk-16kbram/src/sbrk.c
+++ b/hw/bsp/nrf51dk-16kbram/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
 #include <hal/hal_bsp.h>
 
 extern char __HeapBase;
@@ -34,7 +33,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < &__HeapBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -46,7 +44,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/nrf51dk/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk/src/sbrk.c b/hw/bsp/nrf51dk/src/sbrk.c
index 36a1af0..242f11b 100644
--- a/hw/bsp/nrf51dk/src/sbrk.c
+++ b/hw/bsp/nrf51dk/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
 #include <hal/hal_bsp.h>
 
 /* put these in the data section so they are not cleared by _start */
@@ -42,7 +41,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < sbrkBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -54,7 +52,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/nrf52dk/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52dk/src/sbrk.c b/hw/bsp/nrf52dk/src/sbrk.c
index 36a1af0..242f11b 100644
--- a/hw/bsp/nrf52dk/src/sbrk.c
+++ b/hw/bsp/nrf52dk/src/sbrk.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
 #include <hal/hal_bsp.h>
 
 /* put these in the data section so they are not cleared by _start */
@@ -42,7 +41,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < sbrkBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -54,7 +52,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/hw/bsp/nrf52pdk/src/sbrk.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52pdk/src/sbrk.c b/hw/bsp/nrf52pdk/src/sbrk.c
index 8549266..d06d574 100644
--- a/hw/bsp/nrf52pdk/src/sbrk.c
+++ b/hw/bsp/nrf52pdk/src/sbrk.c
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-#include <errno.h>
 #include <hal/hal_bsp.h>
 
 extern char __HeapBase;
@@ -35,7 +34,6 @@ _sbrk(int incr)
         incr = -incr;
         if (brk - incr < &__HeapBase) {
             prev_brk = (void *)-1;
-            errno = EINVAL;
         } else {
             prev_brk = brk;
             brk -= incr;
@@ -47,7 +45,6 @@ _sbrk(int incr)
             brk += incr;
         } else {
             prev_brk = (void *)-1;
-            errno = ENOMEM;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/libs/json/src/json_decode.c
----------------------------------------------------------------------
diff --git a/libs/json/src/json_decode.c b/libs/json/src/json_decode.c
index c748f5a..b78bbfd 100644
--- a/libs/json/src/json_decode.c
+++ b/libs/json/src/json_decode.c
@@ -77,7 +77,6 @@ PERMISSIONS
 #include <stdbool.h>
 #include <stdarg.h>
 #include <ctype.h>
-#include <errno.h>
 #include <math.h>        /* for HUGE_VAL */
 
 static void

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1f32d15a/libs/shell/src/shell.c
----------------------------------------------------------------------
diff --git a/libs/shell/src/shell.c b/libs/shell/src/shell.c
index 4ae9bc3..8c904ec 100644
--- a/libs/shell/src/shell.c
+++ b/libs/shell/src/shell.c
@@ -33,7 +33,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
-#include <errno.h>
 
 static shell_nlip_input_func_t g_shell_nlip_in_func;
 static void *g_shell_nlip_in_arg;
@@ -544,7 +543,7 @@ shell_task_init(uint8_t prio, os_stack_t *stack, uint16_t stack_size,
     if (max_input_length > 0) {
         shell_line = malloc(max_input_length);
         if (shell_line == NULL) {
-            rc = ENOMEM;
+            rc = OS_ENOMEM;
             goto err;
         }
     }