[PATCH] score: _Objects_Build_name() signed/unsigned char

Gedare Bloom gedare at rtems.org
Tue Feb 2 16:22:44 UTC 2021


OK. This one surprised me (and I'm sure I'm not the only one.)

On Tue, Feb 2, 2021 at 7:42 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> Change _Objects_Build_name() so that the result is independent of the
> signedness of char.
>
> Close #4228.
> ---
>  cpukit/include/rtems/score/object.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/cpukit/include/rtems/score/object.h
> b/cpukit/include/rtems/score/object.h
> index 28a2140521..c8243323a6 100644
> --- a/cpukit/include/rtems/score/object.h
> +++ b/cpukit/include/rtems/score/object.h
> @@ -242,10 +242,10 @@ typedef enum {
>   *  @param[in] _C4 is the fourth character of the name
>   */
>  #define  _Objects_Build_name( _C1, _C2, _C3, _C4 ) \
> -  ( (uint32_t)(_C1) << 24 | \
> -    (uint32_t)(_C2) << 16 | \
> -    (uint32_t)(_C3) << 8 | \
> -    (uint32_t)(_C4) )
> +  ( (uint32_t) (uint8_t) (_C1) << 24 | \
> +    (uint32_t) (uint8_t) (_C2) << 16 | \
> +    (uint32_t) (uint8_t) (_C3) << 8 | \
> +    (uint8_t) (_C4) )
>
>  /**
>   * @brief Returns the API portion of the ID.
> --
> 2.26.2
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210202/b1616c95/attachment.html>


More information about the devel mailing list