You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/04/01 05:45:23 UTC

[GitHub] ccollins476ad closed pull request #983: Some fixes for C++ compatibility.

ccollins476ad closed pull request #983: Some fixes for C++ compatibility.
URL: https://github.com/apache/mynewt-core/pull/983
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/mcu/stm/stm32f3xx/src/ext/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h b/hw/mcu/stm/stm32f3xx/src/ext/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h
index 31932538d..f4a8cfab9 100644
--- a/hw/mcu/stm/stm32f3xx/src/ext/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h
+++ b/hw/mcu/stm/stm32f3xx/src/ext/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h
@@ -3523,7 +3523,7 @@ __STATIC_INLINE void LL_TIM_EnableBRK(TIM_TypeDef *TIMx)
 
   /* Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective. */
   tmpreg = READ_REG(TIMx->BDTR);
-  (void)(tmpreg);
+  (void)tmpreg;
 }
 
 /**
@@ -3542,7 +3542,7 @@ __STATIC_INLINE void LL_TIM_DisableBRK(TIM_TypeDef *TIMx)
 
   /* Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective. */
   tmpreg = READ_REG(TIMx->BDTR);
-  (void)(tmpreg);
+  (void)tmpreg;
 }
 
 #if defined(TIM_BDTR_BKF)
diff --git a/kernel/os/include/os/os_fault.h b/kernel/os/include/os/os_fault.h
index 4ce34c26f..60f5faa7f 100644
--- a/kernel/os/include/os/os_fault.h
+++ b/kernel/os/include/os/os_fault.h
@@ -21,7 +21,7 @@
 #define _OS_FAULT_H
 
 #ifdef __cplusplus
-extern "c" {
+extern "C" {
 #endif
 
 void __assert_func(const char *, int, const char *, const char *)
diff --git a/libc/baselibc/include/stdio.h b/libc/baselibc/include/stdio.h
index 8b82262d2..fa7103fd0 100644
--- a/libc/baselibc/include/stdio.h
+++ b/libc/baselibc/include/stdio.h
@@ -50,13 +50,13 @@ extern FILE* const stderr;
 __extern_inline size_t fread(void *buf, size_t size, size_t nmemb, FILE *stream)
 {
     if (stream->vmt->read == NULL) return 0;
-    return stream->vmt->read(stream, buf, size*nmemb) / size;
+    return stream->vmt->read(stream, (char*)buf, size*nmemb) / size;
 }
 
 __extern_inline size_t fwrite(const void *buf, size_t size, size_t nmemb, FILE *stream)
 {
     if (stream->vmt->write == NULL) return 0;
-    return stream->vmt->write(stream, buf, size*nmemb) / size;
+    return stream->vmt->write(stream, (char*)buf, size*nmemb) / size;
 }
 
 __extern_inline int fputs(const char *s, FILE *f)
@@ -85,7 +85,7 @@ __extern_inline int fgetc(FILE *f)
 __extern int errno;
 __extern_inline char *strerror(int errnum)
 {
-	return "error_str";
+	return (char*)"error_str";
 }
 
 #define putc(c,f)  fputc((c),(f))
diff --git a/libc/baselibc/include/stdlib.h b/libc/baselibc/include/stdlib.h
index 2efd71eb7..0abc78376 100644
--- a/libc/baselibc/include/stdlib.h
+++ b/libc/baselibc/include/stdlib.h
@@ -77,10 +77,9 @@ __extern_inline char *getenv(const char *name)
 
 #define EXIT_SUCCESS	0
 #define EXIT_FAILURE	1
+__extern void _exit(int s);
 __extern_inline void exit(int err)
 {
-	__extern void _exit(int s);
-
 	_exit(err);
 }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services