X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fmeasure.c;h=faeef969b09b247e4b4d3a7f468e35a2039bccbe;hb=ba075ea761f61f0491422a555de568adc4891563;hp=8f6e666f667a83086dae4bd31274bf19387c3170;hpb=dfd1972f7bcb550a4fc3b05dbe7e71d12334b0a7;p=pspp diff --git a/src/output/measure.c b/src/output/measure.c index 8f6e666f66..faeef969b0 100644 --- a/src/output/measure.c +++ b/src/output/measure.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,18 +16,20 @@ #include -#include +#include "output/measure.h" +#include #include #include #if HAVE_LC_PAPER #include #endif -#include #include -#include +#include "data/file-name.h" +#include "libpspp/str.h" +#include "gl/c-strcase.h" #include "gl/error.h" #include "gettext.h" @@ -50,7 +52,7 @@ measure_dimension (const char *dimen) char *tail; /* Number. */ - raw = strtod (dimen, &tail); + raw = c_strtod (dimen, &tail); if (raw < 0.0) goto syntax_error; @@ -134,7 +136,7 @@ parse_unit (const char *unit) unit += strspn (unit, CC_SPACES); for (p = units; p < units + sizeof units / sizeof *units; p++) - if (!strcasecmp (unit, p->name)) + if (!c_strcasecmp (unit, p->name)) return p->factor; return 0.0; } @@ -150,7 +152,7 @@ parse_paper_size (const char *size, int *h, int *v) char *tail; /* Width. */ - raw_h = strtod (size, &tail); + raw_h = c_strtod (size, &tail); if (raw_h <= 0.0) return false; @@ -158,7 +160,7 @@ parse_paper_size (const char *size, int *h, int *v) tail += strspn (tail, CC_SPACES "x,"); /* Length. */ - raw_v = strtod (tail, &tail); + raw_v = c_strtod (tail, &tail); if (raw_v <= 0.0) return false; @@ -245,7 +247,7 @@ read_paper_conf (const char *file_name, int *h, int *v) file = fopen (file_name, "r"); if (file == NULL) { - error (0, errno, _("error opening \"%s\""), file_name); + error (0, errno, _("error opening input file `%s'"), file_name); return false; } @@ -256,7 +258,7 @@ read_paper_conf (const char *file_name, int *h, int *v) if (!ds_read_config_line (&line, &line_number, file)) { if (ferror (file)) - error (0, errno, _("error reading \"%s\""), file_name); + error (0, errno, _("error reading file `%s'"), file_name); break; } @@ -273,7 +275,7 @@ read_paper_conf (const char *file_name, int *h, int *v) fclose (file); ds_destroy (&line); - error (0, 0, _("paper size file \"%s\" does not state a paper size"), + error (0, 0, _("paper size file `%s' does not state a paper size"), file_name); return false; }