[PATCH 15/15] cpukit/libcrypt/misc.c: Conditionally correct 16-bit unclean code

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Mar 10 14:04:14 UTC 2015


On 09/03/15 18:38, Joel Sherrill wrote:
> ---
>   cpukit/libcrypt/misc.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/cpukit/libcrypt/misc.c b/cpukit/libcrypt/misc.c
> index 9f2c13e..9ca26d4 100644
> --- a/cpukit/libcrypt/misc.c
> +++ b/cpukit/libcrypt/misc.c
> @@ -52,7 +52,11 @@ b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp
>   	uint32_t w;
>   	int i;
>   
> +#if defined(__rtems__)
>   	w = (B2 << 16) | (B1 << 8) | B0;
> +#else
> +	w = ((uint32_t)B2 << 16) | ((uint32_t)B1 << 8) | B0;
> +#endif
>   	for (i = 0; i < n; i++) {
>   		**cp = itoa64[w&0x3f];
>   		(*cp)++;

Should this be the other way around?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list