commit 3499df75157c5f9bf5a75ff67260528183c78e99 Author: Kim Woelders Date: Tue Dec 25 17:22:25 2007 +0100 Remove unused code, ANSIfy, add const. diff --git a/dsimple.c b/dsimple.c index 6fd77df..2c407cd 100644 --- a/dsimple.c +++ b/dsimple.c @@ -41,9 +41,6 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ -#ifdef BUILD_PRINTSUPPORT -#include -#endif /* BUILD_PRINTSUPPORT */ #include "clientwin.h" #include "dsimple.h" @@ -62,54 +59,15 @@ from The Open Group. char *program_name = "unknown_program"; Display *dpy = NULL; int screen = 0; -Bool printer_output = False; /* Video or printer output ? */ -#ifdef BUILD_PRINTSUPPORT -XPContext pcontext = None; -#endif /* BUILD_PRINTSUPPORT */ - -static void _bitmap_error(int, char *); - -/* - * Malloc: like malloc but handles out of memory using Fatal_Error. - */ -char *Malloc(size) - unsigned size; -{ - char *data; - - if (!(data = malloc(size))) - Fatal_Error("Out of memory!"); - - return(data); -} - - -/* - * Realloc: like Malloc except for realloc, handles NULL using Malloc. - */ -char *Realloc(ptr, size) - char *ptr; - int size; -{ - char *new_ptr; - - if (!ptr) - return(Malloc(size)); - - if (!(new_ptr = realloc(ptr, size))) - Fatal_Error("Out of memory!"); - - return(new_ptr); -} /* * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Display_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +char *Get_Display_Name( + int *pargc, /* MODIFIED */ + char **argv) /* MODIFIED */ { int argc = *pargc; char **pargv = argv+1; @@ -139,49 +97,11 @@ char *Get_Display_Name(pargc, argv) } -#ifdef BUILD_PRINTSUPPORT -/* - * Get_Printer_Name (argc, argv) Look for -printer, -p, - * If found, remove it from command line. Don't go past a lone -. - */ -char *Get_Printer_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ -{ - int argc = *pargc; - char **pargv = argv+1; - char *printername = NULL; - int i; - - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - - if (!strcmp (arg, "-printer") || !strcmp (arg, "-p")) { - if (++i >= argc) usage (); - - printername = argv[i]; - *pargc -= 2; - continue; - } - if (!strcmp(arg,"-")) { - while (i