[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 1/5] Introduce strtobytes() library function to

From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 1/5] Introduce strtobytes() library function to convert string to byte count.
Date: Wed, 15 Sep 2010 22:50:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100805 Iceowl/1.0b1 Icedove/3.0.6

Am 15.09.2010 20:46, schrieb Andreas Färber:
Am 15.09.2010 um 14:23 schrieb address@hidden:
+ * Convert string to bytes, allowing either K/k for KB, M/m for MB,
+ * G/b for GB or T/t for TB. Default without any postfix is MB.
      ^^^ typo
+ * End pointer will be returned in *end, if end is valid.
+ * Return 0 on error.
+ */

You seem to be refactoring existing code into this function, but the use of such suffixes usually brings up the question whether it's factor 1024 or 1000. Here you're using 1024 apparently. If you don't want the user dealing with (imo ugly) Ki/Mi/Gi/Ti units this should at least be documented accordingly: G/g for GiB, etc. or G/g for GB = 1024 MB, etc.


I'd prefer the standard prefixes: KiB, MiB, GiB for powers of 1024, KB, MB, GB for powers of 1000. The standard has the big advantage of being a standard, even if not everybody likes it.

Existing QEMU code should be cleaned (= changed) were needed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]