summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2014-06-27 18:05:52 +0200
committerBardur Arantsson <bardur@scientician.net>2014-06-27 18:05:52 +0200
commit899b8fb81a1d5fa66fa842e2ddc4f25e97231ae7 (patch)
tree13a1d7a602e987fc8e588c3012865ca518217119
parentabf567b36fbaf67233c20345342536f754ae65ac (diff)
Remove unused variables and argv0
-rw-r--r--src/main.c4
-rw-r--r--src/z-util.c61
-rw-r--r--src/z-util.h33
3 files changed, 2 insertions, 96 deletions
diff --git a/src/main.c b/src/main.c
index 394d08d1..0715bb8e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -217,10 +217,6 @@ int main(int argc, char *argv[])
- /* Save the "program name" XXX XXX XXX */
- argv0 = argv[0];
-
-
/* Get the file paths */
init_file_paths_with_env();
diff --git a/src/z-util.c b/src/z-util.c
index 95f11d7a..4c59f793 100644
--- a/src/z-util.c
+++ b/src/z-util.c
@@ -8,65 +8,6 @@
/*
- * Global variables for temporary use
- */
-char char_tmp = 0;
-byte byte_tmp = 0;
-sint sint_tmp = 0;
-uint uint_tmp = 0;
-long long_tmp = 0;
-huge huge_tmp = 0;
-errr errr_tmp = 0;
-
-
-/*
- * Global pointers for temporary use
- */
-cptr cptr_tmp = NULL;
-vptr vptr_tmp = NULL;
-
-
-
-
-/*
- * Constant bool meaning true
- */
-bool_ bool_true = 1;
-
-/*
- * Constant bool meaning false
- */
-bool_ bool_false = 0;
-
-
-/*
- * Global NULL cptr
- */
-cptr cptr_null = NULL;
-
-
-/*
- * Global NULL vptr
- */
-vptr vptr_null = NULL;
-
-
-
-/*
- * Global SELF vptr
- */
-vptr vptr_self = (vptr)(&vptr_self);
-
-
-
-/*
- * Convenient storage of the program name
- */
-cptr argv0 = NULL;
-
-
-
-/*
* Determine if string "t" is equal to string "t"
*/
bool_ streq(cptr a, cptr b)
@@ -132,7 +73,7 @@ void plog(cptr str)
if (plog_aux) (*plog_aux)(str);
/* Just do a labeled fprintf to stderr */
- else (void)(fprintf(stderr, "%s: %s\n", argv0 ? argv0 : "???", str));
+ else (void)(fprintf(stderr, "%s\n", str));
}
diff --git a/src/z-util.h b/src/z-util.h
index b9554637..e9bbf873 100644
--- a/src/z-util.h
+++ b/src/z-util.h
@@ -8,41 +8,10 @@ extern "C" {
/*
- * Extremely basic stuff, like global temp and constant variables.
- * Also, some very useful low level functions, such as "streq()".
- * All variables and functions in this file are "addressable".
+ * Extremely basic stuff, like "streq()".
*/
-/**** Available variables ****/
-
-/* Temporary Vars */
-extern char char_tmp;
-extern byte byte_tmp;
-extern sint sint_tmp;
-extern uint uint_tmp;
-extern long long_tmp;
-extern huge huge_tmp;
-extern errr errr_tmp;
-
-/* Temporary Pointers */
-extern cptr cptr_tmp;
-extern vptr vptr_tmp;
-
-
-/* Constant pointers (NULL) */
-extern cptr cptr_null;
-extern vptr vptr_null;
-
-
-/* A bizarre vptr that always points at itself */
-extern vptr vptr_self;
-
-
-/* A cptr to the name of the program */
-extern cptr argv0;
-
-
/* Aux functions */
extern void (*plog_aux)(cptr);
extern void (*quit_aux)(cptr);