projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
categoricals: Make parameter to categoricals_done() const.
[pspp-builds.git]
/
src
/
data
/
calendar.c
diff --git
a/src/data/calendar.c
b/src/data/calendar.c
index eb9e67250a733394739f997ab1c7b504627b1b50..ef6aa6755e4a922171fa863020091cf8094e5405 100644
(file)
--- a/
src/data/calendar.c
+++ b/
src/data/calendar.c
@@
-52,8
+52,7
@@
raw_gregorian_to_offset (int y, int m, int d)
Gregorian calendar. Returns SYSMIS for dates before 14 Oct
1582. */
double
Gregorian calendar. Returns SYSMIS for dates before 14 Oct
1582. */
double
-calendar_gregorian_to_offset (int y, int m, int d,
- calendar_error_func *error, void *aux)
+calendar_gregorian_to_offset (int y, int m, int d, char **errorp)
{
/* Normalize year. */
if (y >= 0 && y < 100)
{
/* Normalize year. */
if (y >= 0 && y < 100)
@@
-78,7
+77,9
@@
calendar_gregorian_to_offset (int y, int m, int d,
}
else
{
}
else
{
- error (aux, _("Month %d is not in acceptable range of 0 to 13."), m);
+ if (errorp != NULL)
+ *errorp = xasprintf (_("Month %d is not in acceptable range of "
+ "0 to 13."), m);
return SYSMIS;
}
}
return SYSMIS;
}
}
@@
-86,19
+87,24
@@
calendar_gregorian_to_offset (int y, int m, int d,
/* Normalize day. */
if (d < 0 || d > 31)
{
/* Normalize day. */
if (d < 0 || d > 31)
{
- error (aux, _("Day %d is not in acceptable range of 0 to 31."), d);
+ if (errorp != NULL)
+ *errorp = xasprintf (_("Day %d is not in acceptable range of "
+ "0 to 31."), d);
return SYSMIS;
}
/* Validate date. */
if (y < 1582 || (y == 1582 && (m < 10 || (m == 10 && d < 15))))
{
return SYSMIS;
}
/* Validate date. */
if (y < 1582 || (y == 1582 && (m < 10 || (m == 10 && d < 15))))
{
- error (aux, _("Date %04d-%d-%d is before the earliest acceptable "
- "date of 1582-10-15."), y, m, d);
+ if (errorp != NULL)
+ *errorp = xasprintf (_("Date %04d-%d-%d is before the earliest "
+ "acceptable date of 1582-10-15."), y, m, d);
return SYSMIS;
}
/* Calculate offset. */
return SYSMIS;
}
/* Calculate offset. */
+ if (errorp != NULL)
+ *errorp = NULL;
return raw_gregorian_to_offset (y, m, d);
}
return raw_gregorian_to_offset (y, m, d);
}