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 2022/08/15 14:35:24 UTC

[GitHub] [mynewt-nimble] supperthomas opened a new pull request, #1322: porting/nimble/include: Add check of macro

supperthomas opened a new pull request, #1322:
URL: https://github.com/apache/mynewt-nimble/pull/1322

   There isn't macro __BYTE_ORDER__ and __ORDER_BIG_ENDIAN__ on other compiler like KEIL or IAR. In that case, the complier will complier without error, but the HCI cmd will be BIG_ENDIAN as default which is wrong on ARM Cortex-m little endian platform.


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] supperthomas closed pull request #1322: porting/nimble/include: Add check of macro

Posted by GitBox <gi...@apache.org>.
supperthomas closed pull request #1322: porting/nimble/include: Add check of macro
URL: https://github.com/apache/mynewt-nimble/pull/1322


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #1322: porting/nimble/include: Add check of macro

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #1322:
URL: https://github.com/apache/mynewt-nimble/pull/1322#issuecomment-1215284032

   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### porting/nimble/include/os/endian.h
   <details>
   
   ```diff
   @@ -29,35 +29,35 @@
    /* Internal helpers */
    #ifndef os_bswap_64
    #define os_bswap_64(x)   ((uint64_t)                \
   -     ((((x) & 0xff00000000000000ull) >> 56) |       \
   -      (((x) & 0x00ff000000000000ull) >> 40) |       \
   -      (((x) & 0x0000ff0000000000ull) >> 24) |       \
   -      (((x) & 0x000000ff00000000ull) >>  8) |       \
   -      (((x) & 0x00000000ff000000ull) <<  8) |       \
   -      (((x) & 0x0000000000ff0000ull) << 24) |       \
   -      (((x) & 0x000000000000ff00ull) << 40) |       \
   -      (((x) & 0x00000000000000ffull) << 56)))
   +                          ((((x) & 0xff00000000000000ull) >> 56) |       \
   +                           (((x) & 0x00ff000000000000ull) >> 40) |       \
   +                           (((x) & 0x0000ff0000000000ull) >> 24) |       \
   +                           (((x) & 0x000000ff00000000ull) >>  8) |       \
   +                           (((x) & 0x00000000ff000000ull) <<  8) |       \
   +                           (((x) & 0x0000000000ff0000ull) << 24) |       \
   +                           (((x) & 0x000000000000ff00ull) << 40) |       \
   +                           (((x) & 0x00000000000000ffull) << 56)))
    #endif
    
    #ifndef os_bswap_32
    #define os_bswap_32(x)    ((uint32_t)               \
   -    ((((x) & 0xff000000) >> 24) |                   \
   -     (((x) & 0x00ff0000) >>  8) |                   \
   -     (((x) & 0x0000ff00) <<  8) |                   \
   -     (((x) & 0x000000ff) << 24)))
   +                           ((((x) & 0xff000000) >> 24) |                   \
   +                            (((x) & 0x00ff0000) >>  8) |                   \
   +                            (((x) & 0x0000ff00) <<  8) |                   \
   +                            (((x) & 0x000000ff) << 24)))
    #endif
    
    #ifndef os_bswap_16
    #define os_bswap_16(x)   ((uint16_t)                \
   -    ((((x) & 0xff00) >> 8) |                        \
   -     (((x) & 0x00ff) << 8)))
   -#endif
   -
   -#ifndef __BYTE_ORDER__ 
   +                          ((((x) & 0xff00) >> 8) |                        \
   +                           (((x) & 0x00ff) << 8)))
   +#endif
   +
   +#ifndef __BYTE_ORDER__
    #error  "Please define __BYTE_ORDER__ on complier"
    #endif
    
   -#ifndef __ORDER_BIG_ENDIAN__ 
   +#ifndef __ORDER_BIG_ENDIAN__
    #error  "Please define __ORDER_BIG_ENDIAN__ on complier"
    #endif
    
   ```
   
   </details>


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] supperthomas commented on pull request #1322: porting/nimble/include: Add check of macro

Posted by GitBox <gi...@apache.org>.
supperthomas commented on PR #1322:
URL: https://github.com/apache/mynewt-nimble/pull/1322#issuecomment-1216038121

   > 
   > <!-- style-bot -->
   > 
   > ## Style check summary
   > 
   > ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   > 
   > 
   > #### porting/nimble/include/os/endian.h
   > <details>
   > 
   > ```diff
   > @@ -29,35 +29,35 @@
   >  /* Internal helpers */
   >  #ifndef os_bswap_64
   >  #define os_bswap_64(x)   ((uint64_t)                \
   > -     ((((x) & 0xff00000000000000ull) >> 56) |       \
   > -      (((x) & 0x00ff000000000000ull) >> 40) |       \
   > -      (((x) & 0x0000ff0000000000ull) >> 24) |       \
   > -      (((x) & 0x000000ff00000000ull) >>  8) |       \
   > -      (((x) & 0x00000000ff000000ull) <<  8) |       \
   > -      (((x) & 0x0000000000ff0000ull) << 24) |       \
   > -      (((x) & 0x000000000000ff00ull) << 40) |       \
   > -      (((x) & 0x00000000000000ffull) << 56)))
   > +                          ((((x) & 0xff00000000000000ull) >> 56) |       \
   > +                           (((x) & 0x00ff000000000000ull) >> 40) |       \
   > +                           (((x) & 0x0000ff0000000000ull) >> 24) |       \
   > +                           (((x) & 0x000000ff00000000ull) >>  8) |       \
   > +                           (((x) & 0x00000000ff000000ull) <<  8) |       \
   > +                           (((x) & 0x0000000000ff0000ull) << 24) |       \
   > +                           (((x) & 0x000000000000ff00ull) << 40) |       \
   > +                           (((x) & 0x00000000000000ffull) << 56)))
   >  #endif
   >  
   >  #ifndef os_bswap_32
   >  #define os_bswap_32(x)    ((uint32_t)               \
   > -    ((((x) & 0xff000000) >> 24) |                   \
   > -     (((x) & 0x00ff0000) >>  8) |                   \
   > -     (((x) & 0x0000ff00) <<  8) |                   \
   > -     (((x) & 0x000000ff) << 24)))
   > +                           ((((x) & 0xff000000) >> 24) |                   \
   > +                            (((x) & 0x00ff0000) >>  8) |                   \
   > +                            (((x) & 0x0000ff00) <<  8) |                   \
   > +                            (((x) & 0x000000ff) << 24)))
   >  #endif
   >  
   >  #ifndef os_bswap_16
   >  #define os_bswap_16(x)   ((uint16_t)                \
   > -    ((((x) & 0xff00) >> 8) |                        \
   > -     (((x) & 0x00ff) << 8)))
   > -#endif
   > -
   > -#ifndef __BYTE_ORDER__ 
   > +                          ((((x) & 0xff00) >> 8) |                        \
   > +                           (((x) & 0x00ff) << 8)))
   > +#endif
   > +
   > +#ifndef __BYTE_ORDER__
   >  #error  "Please define __BYTE_ORDER__ on complier"
   >  #endif
   >  
   > -#ifndef __ORDER_BIG_ENDIAN__ 
   > +#ifndef __ORDER_BIG_ENDIAN__
   >  #error  "Please define __ORDER_BIG_ENDIAN__ on complier"
   >  #endif
   >  
   > ```
   > 
   > </details>
   
   could you give me the cmd of astyle? or something else cmd


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org