projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up pref.h.orig and deal with the consequences.
[pspp]
/
src
/
data-in.c
diff --git
a/src/data-in.c
b/src/data-in.c
index 04c035d4f66fe2eb57f80d0e7ad7e56abb9d8243..586e74f37353e86f5821dce769275f07ca342340 100644
(file)
--- a/
src/data-in.c
+++ b/
src/data-in.c
@@
-18,6
+18,7
@@
02111-1307, USA. */
#include <config.h>
02111-1307, USA. */
#include <config.h>
+#include "data-in.h"
#include <assert.h>
#include <math.h>
#include <ctype.h>
#include <assert.h>
#include <math.h>
#include <ctype.h>
@@
-25,7
+26,6
@@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.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, ...)
@@
-288,6
+286,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
+381,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;
}
}
@@
-451,14
+451,13
@@
parse_IB (struct data_in *i)
/* We want the data to be in big-endian format. If this is a
little-endian machine, reverse the byte order. */
/* We want the data to be in big-endian format. If this is a
little-endian machine, reverse the byte order. */
- if (endian == LITTLE)
- {
- memcpy (buf, i->s, i->e - i->s);
- mm_reverse (buf, i->e - i->s);
- p = buf;
- }
- else
- p = i->s;
+#ifdef WORDS_BIGENDIAN
+ p = i->s;
+#else
+ memcpy (buf, i->s, i->e - i->s);
+ mm_reverse (buf, i->e - i->s);
+ p = buf;
+#endif
/* If the value is negative, we need to logical-NOT each value
before adding it. */
/* If the value is negative, we need to logical-NOT each value
before adding it. */
@@
-492,12
+491,13
@@
parse_PIB (struct data_in *i)
int j;
i->v->f = 0.0;
int j;
i->v->f = 0.0;
- if (endian == BIG)
- for (j = 0; j < i->e - i->s; j++)
- i->v->f = i->v->f * 256.0 + i->s[j];
- else
- for (j = i->e - i->s - 1; j >= 0; j--)
- i->v->f = i->v->f * 256.0 + i->s[j];
+#if WORDS_BIGENDIAN
+ for (j = 0; j < i->e - i->s; j++)
+ i->v->f = i->v->f * 256.0 + i->s[j];
+#else
+ for (j = i->e - i->s - 1; j >= 0; j--)
+ i->v->f = i->v->f * 256.0 + i->s[j];
+#endif
if (i->format.d)
i->v->f /= pow (10.0, i->format.d);
if (i->format.d)
i->v->f /= pow (10.0, i->format.d);
@@
-574,11
+574,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
+608,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,13
+1487,7
@@
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
i->v->f = set_blanks;
}
else
i->v->f = set_blanks;
}