X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpostscript.c;h=f2bb3400aaed277c80fc1bdb90653ac7dc96475f;hb=d5fd364b203a2a84e5034b6ff5ac5d6c4412edb7;hp=11473f6488faaa94de282739ecd556232a3d5ec7;hpb=4de79b34b329d1da6cdeb145993d3efd911e2967;p=pspp-builds.git diff --git a/src/postscript.c b/src/postscript.c index 11473f64..f2bb3400 100644 --- a/src/postscript.c +++ b/src/postscript.c @@ -40,10 +40,10 @@ #include "font.h" #include "getl.h" #include "getline.h" +#include "glob.h" #include "hash.h" #include "main.h" #include "misc.h" -#include "misc.h" #include "output.h" #include "som.h" #include "version.h" @@ -320,7 +320,7 @@ ps_preopen_driver (struct outp_driver *this) assert (this->driver_open == 0); msg (VM (1), _("PostScript driver initializing as `%s'..."), this->name); - this->ext = x = xmalloc (sizeof (struct ps_driver_ext)); + this->ext = x = xmalloc (sizeof *x); this->res = PSUS; this->horiz = this->vert = 1; this->width = this->length = 0; @@ -1488,7 +1488,7 @@ quote_ps_name (char *dest, const char *string) const char *sp; for (sp = string; *sp; sp++) - switch (*(unsigned char *) sp) + switch (*sp) { case 'a': case 'f': @@ -1563,7 +1563,7 @@ quote_ps_name (char *dest, const char *string) *dp++ = '<'; for (sp = string; *sp && dp < &dest[256]; sp++) { - sprintf (dp, "%02x", *(unsigned char *) sp); + sprintf (dp, "%02x", (unsigned char) *sp); dp += 2; } return stpcpy (dp, ">cvn"); @@ -1588,7 +1588,7 @@ quote_ps_string (char *dest, const char *string) dp = stpcpy (dp, "\\("); else if (*sp == ')') dp = stpcpy (dp, "\\)"); - else if (*sp < 32 || *((unsigned char *) sp) > 127) + else if (*sp < 32 || (unsigned char) *sp > 127) dp = spprintf (dp, "\\%3o", *sp); else *dp++ = *sp; @@ -1902,7 +1902,7 @@ line (struct outp_driver *this, int type, int ind, int dep1, int dep2) if ((*f)->ndep >= (*f)->mdep) { (*f)->mdep += 16; - *f = xrealloc (*f, (sizeof **f + sizeof (int[2]) * ((*f)->mdep - 1))); + *f = xrealloc (*f, sizeof **f + sizeof (int[2]) * ((*f)->mdep - 1)); } (*f)->dep[(*f)->ndep][0] = dep1; (*f)->dep[(*f)->ndep][1] = dep2; @@ -2105,7 +2105,7 @@ draw_headers (struct outp_driver *this) int rh_width; char buf[128]; - sprintf (buf, _("%s - Page %d"), curdate, ext->page_number); + sprintf (buf, _("%s - Page %d"), get_start_date (), ext->page_number); rh_width = text_width (this, buf); out_text_plain (this, buf, this->width - this->prop_em_width - rh_width, @@ -2466,7 +2466,7 @@ write_text (struct outp_driver *this, if (TEST_BIT (literal_chars[ext->data], cp->ch)) *lp++ = cp->ch; else - switch (cp->ch) + switch ((char) cp->ch) { case '(': lp = stpcpy (lp, "\\("); @@ -2735,7 +2735,7 @@ text (struct outp_driver *this, struct outp_text *t, int draw) } else { - buf = xrealloc (buf, sizeof *buf * buf_len * 2); + buf = xnrealloc (buf, buf_len * 2, sizeof *buf); buf_loc = buf + buf_len; buf_end = buf + buf_len * 2; }