projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fri Feb 11 00:08:36 2005 Ben Pfaff <blp@gnu.org>
[pspp]
/
src
/
data-in.c
diff --git
a/src/data-in.c
b/src/data-in.c
index 9bdda48cf3113877ee3f4c8c982522df17cac8fb..c082516d664efe45f39f6eaf31a1b439c0cdfb3b 100644
(file)
--- a/
src/data-in.c
+++ b/
src/data-in.c
@@
-18,14
+18,14
@@
02111-1307, USA. */
#include <config.h>
02111-1307, USA. */
#include <config.h>
-#include <assert.h>
+#include "data-in.h"
+#include "error.h"
#include <math.h>
#include <ctype.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include "data-in.h"
#include "error.h"
#include "getline.h"
#include "julcal/julcal.h"
#include "error.h"
#include "getline.h"
#include "julcal/julcal.h"
@@
-36,15
+36,13
@@
#include "str.h"
#include "var.h"
\f
#include "str.h"
#include "var.h"
\f
-#undef DEBUGGING
-/*#define DEBUGGING 1 */
#include "debug-print.h"
\f
/* Specialized error routine. */
static void dls_error (const struct data_in *, const char *format, ...)
#include "debug-print.h"
\f
/* Specialized error routine. */
static void dls_error (const struct data_in *, const char *format, ...)
-
__attribute__ ((format (printf, 2, 3))
);
+
PRINTF_FORMAT (2, 3
);
static void
dls_error (const struct data_in *i, const char *format, ...)
static void
dls_error (const struct data_in *i, const char *format, ...)
@@
-66,9
+64,9
@@
dls_error (const struct data_in *i, const char *format, ...)
struct error e;
struct string title;
struct error e;
struct string title;
- ds_init (
NULL,
&title, 64);
+ ds_init (&title, 64);
if (!getl_reading_script)
if (!getl_reading_script)
- ds_
concat
(&title, _("data-file error: "));
+ ds_
puts
(&title, _("data-file error: "));
if (i->f1 == i->f2)
ds_printf (&title, _("(column %d"), i->f1);
else
if (i->f1 == i->f2)
ds_printf (&title, _("(column %d"), i->f1);
else
@@
-77,7
+75,7
@@
dls_error (const struct data_in *i, const char *format, ...)
e.class = DE;
err_location (&e.where);
e.class = DE;
err_location (&e.where);
- e.title = ds_
value
(&title);
+ e.title = ds_
c_str
(&title);
e.text = buf;
err_vmsg (&e);
e.text = buf;
err_vmsg (&e);
@@
-142,16
+140,18
@@
parse_numeric (struct data_in *i)
if (*i->s == '-' || *i->s == '+')
i->s++;
}
if (*i->s == '-' || *i->s == '+')
i->s++;
}
+ else
+ sign = 1;
if (type != FMT_DOT)
{
if (type != FMT_DOT)
{
- decimal =
set_decimal
;
- grouping =
set_grouping
;
+ decimal =
get_decimal()
;
+ grouping =
get_grouping()
;
}
else
{
}
else
{
- decimal =
set_grouping
;
- grouping =
set_decimal
;
+ decimal =
get_grouping()
;
+ grouping =
get_decimal()
;
}
i->v->f = SYSMIS;
}
i->v->f = SYSMIS;
@@
-288,6
+288,7
@@
parse_N (struct data_in *i)
{
const unsigned char *cp;
{
const unsigned char *cp;
+ i->v->f = 0;
for (cp = i->s; cp < i->e; cp++)
{
if (!isdigit (*cp))
for (cp = i->s; cp < i->e; cp++)
{
if (!isdigit (*cp))
@@
-382,9
+383,10
@@
parse_Z (struct data_in *i)
if (!warned)
{
if (!warned)
{
- msg (MW, _("Quality of zoned decimal (Z) input format code is "
- "suspect. Check your results three times, report bugs "
- "to author."));
+ msg (MW,
+ _("Quality of zoned decimal (Z) input format code is "
+ "suspect. Check your results three times. Report bugs "
+ "to %s."),PACKAGE_BUGREPORT);
warned = 1;
}
}
warned = 1;
}
}
@@
-574,11
+576,6
@@
parse_A (struct data_in *i)
memset (i->v->s + len, ' ', i->format.w - len);
}
memset (i->v->s + len, ' ', i->format.w - len);
}
-#if __CHECKER__
- memset (i->v->s + i->format.w, '%',
- REM_RND_UP (i->format.w, MAX_SHORT_STRING));
-#endif
-
return 1;
}
return 1;
}
@@
-613,11
+610,6
@@
parse_AHEX (struct data_in *i)
memset (i->v->s + (i->e - i->s) / 2, ' ', (i->format.w - (i->e - i->s)) / 2);
}
memset (i->v->s + (i->e - i->s) / 2, ' ', (i->format.w - (i->e - i->s)) / 2);
}
-#if __CHECKER__
- memset (i->v->s + i->format.w / 2, '%',
- REM_RND_UP (i->format.w / 2, MAX_SHORT_STRING));
-#endif
-
return 1;
}
\f
return 1;
}
\f
@@
-1497,15
+1489,9
@@
default_result (struct data_in *i)
/* Default to SYSMIS or blanks. */
if (fmt->cat & FCAT_STRING)
/* Default to SYSMIS or blanks. */
if (fmt->cat & FCAT_STRING)
- {
-#if __CHECKER__
- memset (i->v->s, ' ', ROUND_UP (i->format.w, MAX_SHORT_STRING));
-#else
- memset (i->v->s, ' ', i->format.w);
-#endif
- }
+ memset (i->v->s, ' ', i->format.w);
else
else
- i->v->f =
set_blanks
;
+ i->v->f =
get_blanks()
;
}
int
}
int
@@
-1543,7
+1529,7
@@
data_in (struct data_in *i)
if (++cp == i->e)
{
if (++cp == i->e)
{
- i->v->f =
set_blanks
;
+ i->v->f =
get_blanks()
;
return 1;
}
}
return 1;
}
}