m.severity = MSG_S_WARNING;
m.text = ds_cstr (&text);
m.where.file_name = NULL;
- m.where.line_number = -1;
+ m.where.line_number = 0;
msg_emit (&m);
}
/* 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 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
}
/* Returns the line number in the source file from which the
- previous line was originally obtained, or -1 if none. */
+ previous line was originally obtained, or 0 if none. */
static int
do_repeat_location (const struct getl_interface *interface)
{
struct repeat_line *line = current_line (interface);
- return line ? line->line_number : -1;
+ return line ? line->line_number : 0;
}
m.severity = MSG_S_ERROR;
va_start (args, format);
m.text = xvasprintf (format, args);
+ m.where.file_name = NULL;
+ m.where.line_number = 0;
va_end (args);
msg_emit (&m);
static int
location (const struct getl_interface *i UNUSED)
{
- return -1;
+ return 0;
}
return s->interface->name (s->interface);
}
-/* Returns the location within the current source, or -1 if there is
- no current source */
+/* Returns the line number within the current source, or 0 if there is no
+ current source. */
int
getl_source_location (const struct source_stream *ss)
{
const struct getl_source *s = current_source (ss);
if ( ll_is_empty (&ss->sources) )
- return -1;
+ return 0;
if ( !s->interface->location )
- return -1;
+ return 0;
return s->interface->location (s->interface);
}
m.severity = msg_class_to_severity (class);
va_start (args, format);
m.text = xvasprintf (format, args);
+ m.where.file_name = NULL;
+ m.where.line_number = 0;
va_end (args);
msg_emit (&m);
{
if (m->where.file_name)
ds_put_format (&s, "%s:", m->where.file_name);
- if (m->where.line_number != -1)
+ if (m->where.line_number > 0)
ds_put_format (&s, "%d:", m->where.line_number);
ds_put_char (&s, ' ');
}
m.category = MSG_C_GENERAL;
m.severity = MSG_S_NOTE;
m.where.file_name = NULL;
- m.where.line_number = -1;
+ m.where.line_number = 0;
m.text = s;
msg_handler (&m);
free (s);
else
{
m->where.file_name = NULL;
- m->where.line_number = -1;
+ m->where.line_number = 0;
}
if (!messages_disabled)
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2010 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
/* A file location. */
struct msg_locator
{
- char *file_name; /* File name. */
- int line_number; /* Line number. */
+ char *file_name; /* File name (NULL if none). */
+ int line_number; /* Line number (0 if none). */
};
/* A message. */