dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use preprocessor symbol VALUE_IF_MISSING.
[gedcom-parse.git]
/
gedcom
/
date.c
diff --git
a/gedcom/date.c
b/gedcom/date.c
index 4f61ccabbeace3c45f69f80671efc789203e12ad..a4853925294f2424f083aec639c152096fd51fc3 100644
(file)
--- a/
gedcom/date.c
+++ b/
gedcom/date.c
@@
-336,7
+336,7
@@
int numbers_to_strings(struct date *d)
if (d->day != -1)
sprintf(d->day_str, "%d", d->day);
if (d->day != -1)
sprintf(d->day_str, "%d", d->day);
- if (d->month
!= -1
)
+ if (d->month
> 0 && d->month <= max_month[d->cal]
)
strcpy(d->month_str, month_name[d->cal][d->month - 1]);
if (d->year_type == YEAR_SINGLE)
strcpy(d->month_str, month_name[d->cal][d->month - 1]);
if (d->year_type == YEAR_SINGLE)
@@
-383,7
+383,7
@@
int gedcom_normalize_date(Date_input input, struct date_value *val)
return result;
}
return result;
}
-struct date_value* gedcom_new_date_value(struct date_value* copy_from)
+struct date_value* gedcom_new_date_value(
const
struct date_value* copy_from)
{
struct date_value* dv_ptr;
dv_ptr = (struct date_value*) malloc(sizeof(struct date_value));
{
struct date_value* dv_ptr;
dv_ptr = (struct date_value*) malloc(sizeof(struct date_value));
@@
-429,7
+429,7
@@
struct date_value gedcom_parse_date(const char* line_value)
return dv_s;
}
return dv_s;
}
-void write_date(struct date* d)
+void write_date(
const
struct date* d)
{
if (! d->year_str[0] || d->year <= 0 || d->sdn1 <= 0)
gedcom_error(_("Date is not normalized: some fields are invalid"));
{
if (! d->year_str[0] || d->year <= 0 || d->sdn1 <= 0)
gedcom_error(_("Date is not normalized: some fields are invalid"));
@@
-455,7
+455,7
@@
void write_date(struct date* d)
}
}
}
}
-char* gedcom_date_to_string(struct date_value* val)
+char* gedcom_date_to_string(
const
struct date_value* val)
{
init_buffer(&date_buffer);
reset_buffer(&date_buffer);
{
init_buffer(&date_buffer);
reset_buffer(&date_buffer);