[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/nolibc: Move fixed integer limit definitions to `stdint.h`



Hi Simon,

Patch looks good.

-- Felipe

Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>

On 17.04.19, 11:50, "Simon Kuenzer" <simon.kuenzer@xxxxxxxxx> wrote:

    Following the C standard, this patch moves fixed integer limit
    definitions (e.g., INT8_MIN, INT8_MAX, UINT8_MAX, SSIZE_MIN,
    SSIZE_MAX) from `limits.h` to `stdint.h`.
    
    Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
    ---
     lib/nolibc/include/limits.h | 24 ------------------------
     lib/nolibc/include/stdint.h | 25 +++++++++++++++++++++++++
     2 files changed, 25 insertions(+), 24 deletions(-)
    
    diff --git a/lib/nolibc/include/limits.h b/lib/nolibc/include/limits.h
    index 2a621a5c..e66bbace 100644
    --- a/lib/nolibc/include/limits.h
    +++ b/lib/nolibc/include/limits.h
    @@ -42,22 +42,6 @@
     extern "C" {
     #endif
     
    -#define INT8_MIN     __S8_MIN
    -#define INT8_MAX     __S8_MAX
    -#define UINT8_MAX    __U8_MAX
    -
    -#define INT16_MIN   __S16_MIN
    -#define INT16_MAX   __S16_MAX
    -#define UINT16_MAX  __U16_MAX
    -
    -#define INT32_MIN   __S32_MIN
    -#define INT32_MAX   __S32_MAX
    -#define UINT32_MAX  __U32_MAX
    -
    -#define INT64_MIN   __S64_MIN
    -#define INT64_MAX   __S64_MAX
    -#define UINT64_MAX  __U64_MAX
    -
     #define CHAR_BITS    __C_BITS
     #define CHAR_MIN      __C_MIN
     #define CHAR_MAX      __C_MAX
    @@ -79,14 +63,6 @@ extern "C" {
     #define LLONG_MAX    __LL_MAX
     #define ULLONG_MAX  __ULL_MAX
     
    -#define SSIZE_MIN   __SSZ_MIN
    -#define SSIZE_MAX   __SSZ_MAX
    -#define SIZE_MAX     __SZ_MAX
    -
    -#define INTMAX_MIN   __LL_MIN
    -#define INTMAX_MAX   __LL_MAX
    -#define UINTMAX_MAX __ULL_MAX
    -
     #define PATH_MAX 4096
     #define NAME_MAX 255
     
    diff --git a/lib/nolibc/include/stdint.h b/lib/nolibc/include/stdint.h
    index 945a75d3..a6a55c49 100644
    --- a/lib/nolibc/include/stdint.h
    +++ b/lib/nolibc/include/stdint.h
    @@ -37,6 +37,7 @@
     #define __STDINT_H__
     
     #include <uk/arch/types.h>
    +#include <uk/arch/limits.h>
     
     #ifdef __cplusplus
     extern "C" {
    @@ -55,6 +56,30 @@ typedef __u64 uint64_t;
     typedef __uptr uintptr_t;
     typedef __sptr intptr_t;
     
    +#define INT8_MIN     __S8_MIN
    +#define INT8_MAX     __S8_MAX
    +#define UINT8_MAX    __U8_MAX
    +
    +#define INT16_MIN   __S16_MIN
    +#define INT16_MAX   __S16_MAX
    +#define UINT16_MAX  __U16_MAX
    +
    +#define INT32_MIN   __S32_MIN
    +#define INT32_MAX   __S32_MAX
    +#define UINT32_MAX  __U32_MAX
    +
    +#define INT64_MIN   __S64_MIN
    +#define INT64_MAX   __S64_MAX
    +#define UINT64_MAX  __U64_MAX
    +
    +#define SSIZE_MIN   __SSZ_MIN
    +#define SSIZE_MAX   __SSZ_MAX
    +#define SIZE_MAX     __SZ_MAX
    +
    +#define INTMAX_MIN   __LL_MIN
    +#define INTMAX_MAX   __LL_MAX
    +#define UINTMAX_MAX __ULL_MAX
    +
     #ifdef __cplusplus
     }
     #endif
    -- 
    2.20.1
    
    

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.