mirror of
https://github.com/xemu-project/xemu.git
synced 2024-12-01 07:21:09 +00:00
14632122b8
We define 54 macros for the powers of two >= 1024. We use six, in six macro definitions. Four of them could just as well use the common MiB macro, so do that. The remaining two can't, because they get passed to stringify. Replace the macro by the literal number there. Slightly harder to read in one instance (1048576 vs. S_1MiB), so add a comment there. The other instance is a wash: 65536 vs S_64KiB. 65536 has been good enough for more than seven years there. This effectively reverts commit540b849261
and1240ac558d
. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 lines
476 B
C
21 lines
476 B
C
/*
|
|
* IEC binary prefixes definitions
|
|
*
|
|
* Copyright (C) 2015 Nikunj A Dadhania, IBM Corporation
|
|
* Copyright (C) 2018 Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef QEMU_UNITS_H
|
|
#define QEMU_UNITS_H
|
|
|
|
#define KiB (INT64_C(1) << 10)
|
|
#define MiB (INT64_C(1) << 20)
|
|
#define GiB (INT64_C(1) << 30)
|
|
#define TiB (INT64_C(1) << 40)
|
|
#define PiB (INT64_C(1) << 50)
|
|
#define EiB (INT64_C(1) << 60)
|
|
|
|
#endif
|