Remove more unused code.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 13 Jun 2017 13:42:18 +0000 (09:42 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 13 Jun 2017 13:42:18 +0000 (09:42 -0400)
advent.h
misc.c

index c9fc43178b30fb3820c3028a5c8a86fbb07120f1..9c07cf390c18a62d7b58b589f6bf6407db725a6a 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -86,7 +86,6 @@ extern lcg_state lcgstate;
 /* b is not needed for POSIX but harmless */
 #define READ_MODE "rb"
 #define WRITE_MODE "wb"
-extern void* xmalloc(size_t);
 extern char* xstrdup(const char*);
 extern void packed_to_token(long, char token[6]);
 extern void newspeak(char*);
diff --git a/misc.c b/misc.c
index 16c6a78d6b30e02d599cba31bafb7caaf90c2a95..a58e461447c1f5701f45f56c5638082ba7ed10ee 100644 (file)
--- a/misc.c
+++ b/misc.c
 #include "linenoise/linenoise.h"
 #include "newdb.h"
 
-void* xmalloc(size_t size)
-{
-  void* ptr = malloc(size);
-  if (ptr == NULL)
-    {
-      fprintf(stderr, "Out of memory!\n");
-      exit(EXIT_FAILURE);
-    }
-  return(ptr);
-}
-
 char* xstrdup(const char* s)
 {
   char* ptr = strdup(s);