Lines Matching refs:one
24 timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) in timelib_diff() argument
33 if (one->sse > two->sse) { in timelib_diff()
35 two = one; in timelib_diff()
36 one = swp; in timelib_diff()
42 if (one->zone_type == 3 && two->zone_type == 3 in timelib_diff()
43 && (strcmp(one->tz_info->name, two->tz_info->name) == 0) in timelib_diff()
44 && (one->z != two->z)) in timelib_diff()
46 dst_corr = two->z - one->z; in timelib_diff()
52 memcpy(&one_backup, one, sizeof(one_backup)); in timelib_diff()
55 timelib_apply_localtime(one, 0); in timelib_diff()
58 rt->y = two->y - one->y; in timelib_diff()
59 rt->m = two->m - one->m; in timelib_diff()
60 rt->d = two->d - one->d; in timelib_diff()
61 rt->h = two->h - one->h; in timelib_diff()
62 rt->i = two->i - one->i; in timelib_diff()
63 rt->s = two->s - one->s; in timelib_diff()
64 if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) { in timelib_diff()
69 rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400)); in timelib_diff()
71 timelib_do_rel_normalize(rt->invert ? one : two, rt); in timelib_diff()
74 if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) { in timelib_diff()
75 if (two->sse < one->sse + 86400 - dst_corr) { in timelib_diff()
85 memcpy(one, &one_backup, sizeof(one_backup)); in timelib_diff()