projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed behaviour of oneway when presented with missing values
[pspp]
/
src
/
output.c
diff --git
a/src/output.c
b/src/output.c
index b804978d6d1d4567be2f56b4938ea1a94e8951f7..e33172e21d39c50e4bb54f309d02beb0a9faa2f2 100644
(file)
--- a/
src/output.c
+++ b/
src/output.c
@@
-19,13
+19,12
@@
#include <config.h>
#include "output.h"
#include <config.h>
#include "output.h"
-#include
<assert.h>
+#include
"error.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include "alloc.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include "alloc.h"
-#include "approx.h"
#include "devind.h"
#include "error.h"
#include "filename.h"
#include "devind.h"
#include "error.h"
#include "filename.h"
@@
-75,7
+74,7
@@
char *outp_subtitle;
/* A set of OUTP_DEV_* bits indicating the devices that are
disabled. */
/* A set of OUTP_DEV_* bits indicating the devices that are
disabled. */
-int disabled_devices;
+
static
int disabled_devices;
static void destroy_driver (struct outp_driver *);
static void configure_driver (char *);
static void destroy_driver (struct outp_driver *);
static void configure_driver (char *);
@@
-207,12
+206,12
@@
find_defn_value (const char *key)
return d->value;
if (!strcmp (key, "viewwidth"))
{
return d->value;
if (!strcmp (key, "viewwidth"))
{
- sprintf (buf, "%d",
set_viewwidth
);
+ sprintf (buf, "%d",
get_viewwidth()
);
return buf;
}
else if (!strcmp (key, "viewlength"))
{
return buf;
}
else if (!strcmp (key, "viewlength"))
{
- sprintf (buf, "%d",
set_viewlength
);
+ sprintf (buf, "%d",
get_viewlength()
);
return buf;
}
else
return buf;
}
else
@@
-289,7
+288,7
@@
outp_read_devices (void)
where.line_number = 0;
err_push_file_locator (&where);
where.line_number = 0;
err_push_file_locator (&where);
- ds_init (
NULL,
&line, 128);
+ ds_init (&line, 128);
if (init_fn == NULL)
{
if (init_fn == NULL)
{
@@
-316,7
+315,7
@@
outp_read_devices (void)
msg (ME, _("Reading %s: %s."), init_fn, strerror (errno));
break;
}
msg (ME, _("Reading %s: %s."), init_fn, strerror (errno));
break;
}
- for (cp = ds_
value
(&line); isspace ((unsigned char) *cp); cp++);
+ for (cp = ds_
c_str
(&line); isspace ((unsigned char) *cp); cp++);
if (!strncmp ("define", cp, 6) && isspace ((unsigned char) cp[6]))
outp_configure_macro (&cp[7]);
else if (*cp)
if (!strncmp ("define", cp, 6) && isspace ((unsigned char) cp[6]))
outp_configure_macro (&cp[7]);
else if (*cp)
@@
-456,7
+455,7
@@
outp_done (void)
void
outp_list_classes (void)
{
void
outp_list_classes (void)
{
- int width =
set_viewwidth
;
+ int width =
get_viewwidth()
;
struct outp_driver_class_list *c;
printf (_("Driver classes:\n\t"));
struct outp_driver_class_list *c;
printf (_("Driver classes:\n\t"));
@@
-466,7
+465,7
@@
outp_list_classes (void)
if ((int) strlen (c->class->name) + 1 > width)
{
printf ("\n\t");
if ((int) strlen (c->class->name) + 1 > width)
{
printf ("\n\t");
- width =
set_viewwidth
- 8;
+ width =
get_viewwidth()
- 8;
}
else
putc (' ', stdout);
}
else
putc (' ', stdout);
@@
-512,7
+511,7
@@
tokener (void)
while (*prog && *prog != quote)
{
if (*prog != '\\')
while (*prog && *prog != quote)
{
if (*prog != '\\')
- ds_putc
har
(&op_tokstr, *prog++);
+ ds_putc (&op_tokstr, *prog++);
else
{
int c;
else
{
int c;
@@
-589,15
+588,16
@@
tokener (void)
break;
default:
msg (IS, _("Syntax error in string constant."));
break;
default:
msg (IS, _("Syntax error in string constant."));
+ continue;
}
}
- ds_putc
har
(&op_tokstr, (unsigned char) c);
+ ds_putc (&op_tokstr, (unsigned char) c);
}
}
prog++;
}
else
while (*prog && !isspace ((unsigned char) *prog) && *prog != '=')
}
}
prog++;
}
else
while (*prog && !isspace ((unsigned char) *prog) && *prog != '=')
- ds_putc
har
(&op_tokstr, *prog++);
+ ds_putc (&op_tokstr, *prog++);
op_token = 'a';
}
op_token = 'a';
}
@@
-612,7
+612,7
@@
parse_options (char *s, struct outp_driver * d)
prog = s;
op_token = -1;
prog = s;
op_token = -1;
- ds_init (
NULL,
&op_tokstr, 64);
+ ds_init (&op_tokstr, 64);
while (tokener ())
{
char key[65];
while (tokener ())
{
char key[65];
@@
-624,7
+624,7
@@
parse_options (char *s, struct outp_driver * d)
}
ds_truncate (&op_tokstr, 64);
}
ds_truncate (&op_tokstr, 64);
- strcpy (key, ds_
value
(&op_tokstr));
+ strcpy (key, ds_
c_str
(&op_tokstr));
tokener ();
if (op_token != '=')
tokener ();
if (op_token != '=')
@@
-959,7
+959,7
@@
outp_evaluate_dimension (char *dimen, char **tail)
if (c <= 0.0 || ptail == s)
goto lossage;
s = ptail;
if (c <= 0.0 || ptail == s)
goto lossage;
s = ptail;
- if (
approx_eq (c, 0.0)
)
+ if (
c == 0.0
)
goto lossage;
if (value > 0)
value += b / c;
goto lossage;
if (value > 0)
value += b / c;
@@
-971,7
+971,7
@@
outp_evaluate_dimension (char *dimen, char **tail)
double b;
s = &ptail[1];
b = strtod (s, &ptail);
double b;
s = &ptail[1];
b = strtod (s, &ptail);
- if (
approx_le (b, 0.0)
|| ptail == s)
+ if (
b <= 0.0
|| ptail == s)
goto lossage;
s = ptail;
value /= b;
goto lossage;
s = ptail;
value /= b;
@@
-1030,7
+1030,7
@@
outp_evaluate_dimension (char *dimen, char **tail)
ptail += 2;
value *= factor;
}
ptail += 2;
value *= factor;
}
- if (
approx_lt (value, 0.0)
)
+ if (
value <= 0.0
)
goto lossage;
if (tail)
*tail = ptail;
goto lossage;
if (tail)
*tail = ptail;
@@
-1150,7
+1150,7
@@
outp_get_paper_size (char *size, int *h, int *v)
where.filename = pprsz_fn;
where.line_number = 0;
err_push_file_locator (&where);
where.filename = pprsz_fn;
where.line_number = 0;
err_push_file_locator (&where);
- ds_init (
NULL,
&line, 128);
+ ds_init (&line, 128);
if (pprsz_fn == NULL)
{
if (pprsz_fn == NULL)
{
@@
-1176,7
+1176,7
@@
outp_get_paper_size (char *size, int *h, int *v)
msg (ME, _("Reading %s: %s."), pprsz_fn, strerror (errno));
break;
}
msg (ME, _("Reading %s: %s."), pprsz_fn, strerror (errno));
break;
}
- for (cp = ds_
value
(&line); isspace ((unsigned char) *cp); cp++);
+ for (cp = ds_
c_str
(&line); isspace ((unsigned char) *cp); cp++);
if (*cp == 0)
continue;
if (*cp != '"')
if (*cp == 0)
continue;
if (*cp != '"')