projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
expressions: Add support for 2- and 3-operand RND function.
[pspp]
/
src
/
output
/
measure.c
diff --git
a/src/output/measure.c
b/src/output/measure.c
index 60894f1cc25f81b3b21ae862ee646e0ac1d3c0ac..35e5fb3f451814cad4197bda4529b55a34055dc0 100644
(file)
--- a/
src/output/measure.c
+++ b/
src/output/measure.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011
, 2012, 2014
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
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
@@
-24,12
+24,14
@@
#if HAVE_LC_PAPER
#include <langinfo.h>
#endif
#if HAVE_LC_PAPER
#include <langinfo.h>
#endif
+#include <stdint.h>
#include <stdlib.h>
#include "data/file-name.h"
#include "libpspp/str.h"
#include <stdlib.h>
#include "data/file-name.h"
#include "libpspp/str.h"
-#include "gl/error.h"
+#include "gl/c-strcase.h"
+#include "libpspp/message.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-63,7
+65,7
@@
measure_dimension (const char *dimen)
return raw * factor;
syntax_error:
return raw * factor;
syntax_error:
-
error (0, 0
, _("`%s' is not a valid length."), dimen);
+
msg (ME
, _("`%s' is not a valid length."), dimen);
return -1;
}
return -1;
}
@@
-91,7
+93,7
@@
measure_paper (const char *size, int *h, int *v)
/* Treat string that starts with digit as explicit size. */
ok = parse_paper_size (size, h, v);
if (!ok)
/* Treat string that starts with digit as explicit size. */
ok = parse_paper_size (size, h, v);
if (!ok)
-
error (0, 0
, _("syntax error in paper size `%s'"), size);
+
msg (ME
, _("syntax error in paper size `%s'"), size);
}
else
{
}
else
{
@@
-135,7
+137,7
@@
parse_unit (const char *unit)
unit += strspn (unit, CC_SPACES);
for (p = units; p < units + sizeof units / sizeof *units; p++)
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;
}
return p->factor;
return 0.0;
}
@@
-228,7
+230,7
@@
get_standard_paper_size (struct substring name, int *h, int *v)
assert (ok);
return ok;
}
assert (ok);
return ok;
}
-
error (0, 0
, _("unknown paper type `%.*s'"),
+
msg (ME
, _("unknown paper type `%.*s'"),
(int) ss_length (name), ss_data (name));
return false;
}
(int) ss_length (name), ss_data (name));
return false;
}
@@
-246,7
+248,7
@@
read_paper_conf (const char *file_name, int *h, int *v)
file = fopen (file_name, "r");
if (file == NULL)
{
file = fopen (file_name, "r");
if (file == NULL)
{
-
error (0,
errno, _("error opening input file `%s'"), file_name);
+
msg_error (
errno, _("error opening input file `%s'"), file_name);
return false;
}
return false;
}
@@
-257,7
+259,7
@@
read_paper_conf (const char *file_name, int *h, int *v)
if (!ds_read_config_line (&line, &line_number, file))
{
if (ferror (file))
if (!ds_read_config_line (&line, &line_number, file))
{
if (ferror (file))
-
error (0,
errno, _("error reading file `%s'"), file_name);
+
msg_error (
errno, _("error reading file `%s'"), file_name);
break;
}
break;
}
@@
-274,7
+276,7
@@
read_paper_conf (const char *file_name, int *h, int *v)
fclose (file);
ds_destroy (&line);
fclose (file);
ds_destroy (&line);
-
error (0, 0
, _("paper size file `%s' does not state a paper size"),
+
msg (ME
, _("paper size file `%s' does not state a paper size"),
file_name);
return false;
}
file_name);
return false;
}
@@
-296,8
+298,8
@@
get_default_paper_size (int *h, int *v)
#if HAVE_LC_PAPER
/* LC_PAPER is a non-standard glibc extension. */
#if HAVE_LC_PAPER
/* LC_PAPER is a non-standard glibc extension. */
- *h = (int) nl_langinfo(_NL_PAPER_WIDTH) * (72000 / 25.4);
- *v = (int) nl_langinfo(_NL_PAPER_HEIGHT) * (72000 / 25.4);
+ *h = (int
ptr_t
) nl_langinfo(_NL_PAPER_WIDTH) * (72000 / 25.4);
+ *v = (int
ptr_t
) nl_langinfo(_NL_PAPER_HEIGHT) * (72000 / 25.4);
if (*h > 0 && *v > 0)
return true;
#endif
if (*h > 0 && *v > 0)
return true;
#endif