From ccca4d71360776f5589312525b2397c84ad0096d Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 15 Jun 2009 15:45:27 -0700 Subject: Acknowledge authorship and fix warning in the eng() function. --- test_util.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test_util.h b/test_util.h index 6e9e7f9..a998a19 100644 --- a/test_util.h +++ b/test_util.h @@ -1,3 +1,6 @@ +/* Function for printing numbers using si prefixes (k, M, G, etc.). + * From http://www.cs.tut.fi/~jkorpela/c/eng.html */ + #define PREFIX_START (-24) /* Smallest power of then for which there is a prefix defined. If the set of prefixes will be extended, change this constant @@ -8,7 +11,7 @@ static char *eng(double value, int digits, int numeric) { - static char *prefix[] = { + static const char *prefix[] = { "y", "z", "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" }; -- cgit v1.2.3