replaced date parser by shorter but more complicated code
This commit is contained in:
parent
3ed83c1146
commit
f913976a44
@ -349,6 +349,9 @@ void scan_library_references(gpointer library_list_item, gpointer user)
|
|||||||
|
|
||||||
void gds_parse_date(const char *buffer, int length, struct gds_time_field *mod_date, struct gds_time_field *access_date)
|
void gds_parse_date(const char *buffer, int length, struct gds_time_field *mod_date, struct gds_time_field *access_date)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
struct gds_time_field *temp_date;
|
||||||
|
|
||||||
if (!access_date || !mod_date) {
|
if (!access_date || !mod_date) {
|
||||||
GDS_WARN("Date structures invalid");
|
GDS_WARN("Date structures invalid");
|
||||||
return;
|
return;
|
||||||
@ -359,32 +362,23 @@ void gds_parse_date(const char *buffer, int length, struct gds_time_field *mod_d
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod_date->year = gds_convert_unsigend_int16(buffer);
|
for (temp_date = mod_date; 1; temp_date = access_date) {
|
||||||
|
temp_date->year = gds_convert_unsigend_int16(buffer);
|
||||||
buffer += 2;
|
buffer += 2;
|
||||||
mod_date->month = gds_convert_unsigend_int16(buffer);
|
temp_date->month = gds_convert_unsigend_int16(buffer);
|
||||||
buffer += 2;
|
buffer += 2;
|
||||||
mod_date->day = gds_convert_unsigend_int16(buffer);
|
temp_date->day = gds_convert_unsigend_int16(buffer);
|
||||||
buffer += 2;
|
buffer += 2;
|
||||||
mod_date->hour = gds_convert_unsigend_int16(buffer);
|
temp_date->hour = gds_convert_unsigend_int16(buffer);
|
||||||
buffer += 2;
|
buffer += 2;
|
||||||
mod_date->minute = gds_convert_unsigend_int16(buffer);
|
temp_date->minute = gds_convert_unsigend_int16(buffer);
|
||||||
buffer += 2;
|
buffer += 2;
|
||||||
mod_date->second = gds_convert_unsigend_int16(buffer);
|
temp_date->second = gds_convert_unsigend_int16(buffer);
|
||||||
buffer += 2;
|
buffer += 2;
|
||||||
|
|
||||||
access_date->year = gds_convert_unsigend_int16(buffer);
|
if (temp_date == access_date)
|
||||||
buffer += 2;
|
break;
|
||||||
access_date->month = gds_convert_unsigend_int16(buffer);
|
}
|
||||||
buffer += 2;
|
|
||||||
access_date->day = gds_convert_unsigend_int16(buffer);
|
|
||||||
buffer += 2;
|
|
||||||
access_date->hour = gds_convert_unsigend_int16(buffer);
|
|
||||||
buffer += 2;
|
|
||||||
access_date->minute = gds_convert_unsigend_int16(buffer);
|
|
||||||
buffer += 2;
|
|
||||||
access_date->second = gds_convert_unsigend_int16(buffer);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int parse_gds_from_file(const char *filename, GList **library_list)
|
int parse_gds_from_file(const char *filename, GList **library_list)
|
||||||
|
Loading…
Reference in New Issue
Block a user