Use the modern Ki/Mi/Gi prefixes to clarify that 1024 is the base.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@668 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-04-09 19:32:16 +00:00
parent a6ce5c4b1d
commit 0d200ee743
2 changed files with 5 additions and 5 deletions

View file

@ -115,11 +115,11 @@ char *pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec) {
void pa_bytes_snprint(char *s, size_t l, unsigned v) { void pa_bytes_snprint(char *s, size_t l, unsigned v) {
if (v >= ((unsigned) 1024)*1024*1024) if (v >= ((unsigned) 1024)*1024*1024)
snprintf(s, l, "%0.1f GB", ((double) v)/1024/1024/1024); snprintf(s, l, "%0.1f GiB", ((double) v)/1024/1024/1024);
else if (v >= ((unsigned) 1024)*1024) else if (v >= ((unsigned) 1024)*1024)
snprintf(s, l, "%0.1f MB", ((double) v)/1024/1024); snprintf(s, l, "%0.1f MiB", ((double) v)/1024/1024);
else if (v >= (unsigned) 1024) else if (v >= (unsigned) 1024)
snprintf(s, l, "%0.1f KB", ((double) v)/1024); snprintf(s, l, "%0.1f KiB", ((double) v)/1024);
else else
snprintf(s, l, "%u B", (unsigned) v); snprintf(s, l, "%u B", (unsigned) v);
} }

View file

@ -91,7 +91,7 @@
* \li pa_parse_sample_format() - Parse a text string into a sample format. * \li pa_parse_sample_format() - Parse a text string into a sample format.
* \li pa_sample_spec_snprint() - Create a textual description of a complete * \li pa_sample_spec_snprint() - Create a textual description of a complete
* sample format specification. * sample format specification.
* \li pa_bytes_snprint() - Pretty print a byte value (e.g. 2.5 MB). * \li pa_bytes_snprint() - Pretty print a byte value (e.g. 2.5 MiB).
*/ */
/** \file /** \file
@ -178,7 +178,7 @@ pa_sample_format_t pa_parse_sample_format(const char *format);
/** Pretty print a sample type specification to a string */ /** Pretty print a sample type specification to a string */
char* pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec); char* pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec);
/** Pretty print a byte size value. (i.e. "2.5 MB") */ /** Pretty print a byte size value. (i.e. "2.5 MiB") */
void pa_bytes_snprint(char *s, size_t l, unsigned v); void pa_bytes_snprint(char *s, size_t l, unsigned v);
PA_C_DECL_END PA_C_DECL_END