[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/30] util/cutils: extract byte-based definitio
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH 01/30] util/cutils: extract byte-based definitions into a new header: "qemu/cunits.h" |
Date: |
Thu, 15 Feb 2018 10:55:10 +0100 |
On Thu, Feb 15, 2018 at 5:28 AM, Philippe Mathieu-Daudé <address@hidden> wrote:
> (added in 076b35b5a56)
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Or osdep.h?
Reviewed-by: Marc-André Lureau <address@hidden>
> ---
> include/qemu/cunits.h | 11 +++++++++++
> include/qemu/cutils.h | 8 +-------
> 2 files changed, 12 insertions(+), 7 deletions(-)
> create mode 100644 include/qemu/cunits.h
>
> diff --git a/include/qemu/cunits.h b/include/qemu/cunits.h
> new file mode 100644
> index 0000000000..c0207b7611
> --- /dev/null
> +++ b/include/qemu/cunits.h
> @@ -0,0 +1,11 @@
> +#ifndef QEMU_CUNITS_H
> +#define QEMU_CUNITS_H
> +
> +#define K_BYTE (1ULL << 10)
> +#define M_BYTE (1ULL << 20)
> +#define G_BYTE (1ULL << 30)
> +#define T_BYTE (1ULL << 40)
> +#define P_BYTE (1ULL << 50)
> +#define E_BYTE (1ULL << 60)
> +
> +#endif
> diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
> index f0878eaafa..01184a70b3 100644
> --- a/include/qemu/cutils.h
> +++ b/include/qemu/cutils.h
> @@ -2,6 +2,7 @@
> #define QEMU_CUTILS_H
>
> #include "qemu/fprintf-fn.h"
> +#include "qemu/cunits.h"
>
> /**
> * pstrcpy:
> @@ -143,13 +144,6 @@ int qemu_strtosz(const char *nptr, char **end, uint64_t
> *result);
> int qemu_strtosz_MiB(const char *nptr, char **end, uint64_t *result);
> int qemu_strtosz_metric(const char *nptr, char **end, uint64_t *result);
>
> -#define K_BYTE (1ULL << 10)
> -#define M_BYTE (1ULL << 20)
> -#define G_BYTE (1ULL << 30)
> -#define T_BYTE (1ULL << 40)
> -#define P_BYTE (1ULL << 50)
> -#define E_BYTE (1ULL << 60)
> -
> /* used to print char* safely */
> #define STR_OR_NULL(str) ((str) ? (str) : "null")
>
> --
> 2.16.1
>
>
--
Marc-André Lureau
- [Qemu-devel] [PATCH 00/30] hw: use the BYTE-based definitions when useful, Philippe Mathieu-Daudé, 2018/02/14
- [Qemu-devel] [PATCH 01/30] util/cutils: extract byte-based definitions into a new header: "qemu/cunits.h", Philippe Mathieu-Daudé, 2018/02/14
- Re: [Qemu-devel] [PATCH 01/30] util/cutils: extract byte-based definitions into a new header: "qemu/cunits.h",
Marc-André Lureau <=
- [Qemu-devel] [PATCH 02/30] hw: include "qemu/cunits.h" and clean unused "qemu/cutils.h", Philippe Mathieu-Daudé, 2018/02/14
- [Qemu-devel] [PATCH 04/30] hw/lm32/milkymist: remove unused include, Philippe Mathieu-Daudé, 2018/02/14
- [Qemu-devel] [PATCH 03/30] hw/block/nvme: include the "qemu/cutils.h" in the source file, Philippe Mathieu-Daudé, 2018/02/14
- [Qemu-devel] [PATCH 05/30] hw/mips/r4k: constify params_size, Philippe Mathieu-Daudé, 2018/02/14