aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-04 04:11:52 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-04 04:11:52 -0500
commitb15db320a6085c1c7563b0ffb972f2b25775d299 (patch)
treea398267f9104b6021706b699f0203450c4c73116
parentb6d1fb91ce749c996230df2e5ae7479759c11b53 (diff)
downloadtaipan-b15db320a6085c1c7563b0ffb972f2b25775d299.tar.gz
get rid of ultoa() wrapper for ultostr()
-rw-r--r--.gitignore1
-rw-r--r--taipan.c46
2 files changed, 2 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index 3613a7b..8404da4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+tags
comptitle.s
comptitle.dat
help.dat
diff --git a/taipan.c b/taipan.c
index 4cce51e..685cf45 100644
--- a/taipan.c
+++ b/taipan.c
@@ -198,7 +198,6 @@ unsigned char get_item(unsigned char allow_all) {
/* modified ultoa() with hardcoded radix */
extern char *ultostr(unsigned long value, char* s);
-#define ultoa(x, y, z) ultostr(x, y)
/* if your debt goes above this, Elder Brother Wu has
you assassinated, game over. Value is:
@@ -450,7 +449,7 @@ int get_time(void) {
/* print an int or long as a string, conio-style */
void cprintulong(unsigned long ul) {
- cputs(ultoa(ul, num_buf, 10));
+ cputs(ultostr(ul, num_buf));
}
void at_sea(void) {
@@ -585,14 +584,12 @@ void cprintfancy_centered(unsigned long num) {
| 999 |
| 99 |
| 9 | */
- // cputs(" ");
cspaces(3);
if(num < 100L) cspace();
if(num < 10000L) cspace();
revers(1);
cprintulong(num);
} else {
- // if(num < 10000000L) cspace();
revers(1);
cprintfancy(num);
}
@@ -662,47 +659,6 @@ void cprintfancy(unsigned long num) {
}
#endif
-/*
-void fancy_numbers(unsigned long num, char *fancy) {
- static char number[18];
- char mil = 0;
- unsigned int num1, num2;
-
- if (num >= 100000000L)
- {
- num1 = (num / 1000000L);
- ultoa(num1, fancy, 10);
- mil = 1;
- } else if (num >= 10000000L) {
- num1 = (num / 1000000L);
- num2 = ((num % 1000000L) / 100000L);
- ultoa(num1, fancy, 10);
- if (num2 > 0)
- {
- strcat(fancy, ".");
- ultoa(num2, number, 10);
- strcat(fancy, number);
- }
- mil = 1;
- } else if (num >= 1000000L) {
- num1 = (num / 1000000L);
- num2 = ((num % 1000000L) / 10000L);
- ultoa(num1, fancy, 10);
- if (num2 > 0)
- {
- strcat(fancy, ".");
- ultoa(num2, number, 10);
- strcat(fancy, number);
- }
- mil = 1;
- } else {
- ultoa(num, fancy, 10);
- }
-
- if(mil) strcat(fancy, " Million");
-}
-*/
-
void justify_int(unsigned int num) {
if(num < 1000) cspace();
if(num < 100) cspace();