extracted utility functions into util.c, use utility functions where possible,
add sample output to each screen function
This commit is contained in:
1 parent
82f8f7b19d
commit
9e5fa7ae04
9 files changed
+229
-155
No files matched your search
+1
-15
@@ -15,21 +15,7 @@
|
||||
#include "mode.h"
|
||||
#include "machine.h"
|
||||
#include "cpu.h"
|
||||
|
||||
|
||||
/** print a percentage value to a given string */
|
||||
static char *
|
||||
sprintf_percent(char *str, double percent)
|
||||
{
|
||||
if (str == NULL)
|
||||
return NULL;
|
||||
if (percent > 99.9)
|
||||
strcpy(str, "100%");
|
||||
else
|
||||
sprintf(str, "%.1f%%", (percent >= 0) ? percent : 0);
|
||||
|
||||
return str;
|
||||
}
|
||||
#include "util.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in new issue
Block a user