| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
2
|
|
|
|
|
|
|
extern "C" { |
|
3
|
|
|
|
|
|
|
#endif |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#include "ulib/compare.h" |
|
6
|
|
|
|
|
|
|
#include "ulib/unpack.h" |
|
7
|
|
|
|
|
|
|
#include "ulib/util.h" |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
10
|
|
|
|
|
|
|
} |
|
11
|
|
|
|
|
|
|
#endif |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#define UUCMP(u1,u2) if (u1 != u2) return((u1) > (u2) ? 1 : -1); |
|
14
|
|
|
|
|
|
|
|
|
15
|
7
|
|
|
|
|
|
IV uu_compare_struct0(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
16
|
7
|
50
|
|
|
|
|
UUCMP(us1->v0.low, us2->v0.low); |
|
|
|
0
|
|
|
|
|
|
|
17
|
7
|
50
|
|
|
|
|
UUCMP(us1->v0.high, us2->v0.high); |
|
|
|
0
|
|
|
|
|
|
|
18
|
7
|
|
|
|
|
|
return 0; |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
|
|
21
|
19
|
|
|
|
|
|
IV uu_compare_struct1(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
22
|
19
|
100
|
|
|
|
|
UUCMP(us1->v1.time_low, us2->v1.time_low); |
|
|
|
100
|
|
|
|
|
|
|
23
|
15
|
50
|
|
|
|
|
UUCMP(us1->v1.time_mid, us2->v1.time_mid); |
|
|
|
0
|
|
|
|
|
|
|
24
|
15
|
50
|
|
|
|
|
UUCMP(us1->v1.time_high_and_version, us2->v1.time_high_and_version); |
|
|
|
0
|
|
|
|
|
|
|
25
|
15
|
50
|
|
|
|
|
UUCMP(us1->v1.clock_seq_and_variant, us2->v1.clock_seq_and_variant); |
|
|
|
0
|
|
|
|
|
|
|
26
|
15
|
|
|
|
|
|
return memcmp(us1->v1.node, us2->v1.node, 6); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
19
|
|
|
|
|
|
IV uu_compare_struct3(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
30
|
19
|
50
|
|
|
|
|
UUCMP(us1->v3.md5_high32, us2->v3.md5_high32); |
|
|
|
0
|
|
|
|
|
|
|
31
|
19
|
50
|
|
|
|
|
UUCMP(us1->v3.md5_high16, us2->v3.md5_high16); |
|
|
|
0
|
|
|
|
|
|
|
32
|
19
|
50
|
|
|
|
|
UUCMP(us1->v3.md5_mid_and_version, us2->v3.md5_mid_and_version); |
|
|
|
0
|
|
|
|
|
|
|
33
|
19
|
50
|
|
|
|
|
UUCMP(us1->v3.md5_low_and_variant, us2->v3.md5_low_and_variant); |
|
|
|
0
|
|
|
|
|
|
|
34
|
19
|
50
|
|
|
|
|
UUCMP(us1->v3.md5_low, us2->v3.md5_low); |
|
|
|
0
|
|
|
|
|
|
|
35
|
19
|
|
|
|
|
|
return 0; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
117
|
|
|
|
|
|
IV uu_compare_struct4(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
39
|
117
|
100
|
|
|
|
|
UUCMP(us1->v4.rand_a, us2->v4.rand_a); |
|
|
|
100
|
|
|
|
|
|
|
40
|
15
|
50
|
|
|
|
|
UUCMP(us1->v4.rand_b_and_version, us2->v4.rand_b_and_version); |
|
|
|
0
|
|
|
|
|
|
|
41
|
15
|
50
|
|
|
|
|
UUCMP(us1->v4.rand_c_and_variant, us2->v4.rand_c_and_variant); |
|
|
|
0
|
|
|
|
|
|
|
42
|
15
|
50
|
|
|
|
|
UUCMP(us1->v4.rand_d, us2->v4.rand_d); |
|
|
|
0
|
|
|
|
|
|
|
43
|
15
|
|
|
|
|
|
return 0; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
19
|
|
|
|
|
|
IV uu_compare_struct5(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
47
|
19
|
50
|
|
|
|
|
UUCMP(us1->v5.sha1_high32, us2->v5.sha1_high32); |
|
|
|
0
|
|
|
|
|
|
|
48
|
19
|
50
|
|
|
|
|
UUCMP(us1->v5.sha1_high16, us2->v5.sha1_high16); |
|
|
|
0
|
|
|
|
|
|
|
49
|
19
|
50
|
|
|
|
|
UUCMP(us1->v5.sha1_mid_and_version, us2->v5.sha1_mid_and_version); |
|
|
|
0
|
|
|
|
|
|
|
50
|
19
|
50
|
|
|
|
|
UUCMP(us1->v5.sha1_low_and_variant, us2->v5.sha1_low_and_variant); |
|
|
|
0
|
|
|
|
|
|
|
51
|
19
|
50
|
|
|
|
|
UUCMP(us1->v5.sha1_low, us2->v5.sha1_low); |
|
|
|
0
|
|
|
|
|
|
|
52
|
19
|
|
|
|
|
|
return 0; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
15
|
|
|
|
|
|
IV uu_compare_struct6(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
56
|
15
|
50
|
|
|
|
|
UUCMP(us1->v6.time_high, us2->v6.time_high); |
|
|
|
0
|
|
|
|
|
|
|
57
|
15
|
100
|
|
|
|
|
UUCMP(us1->v6.time_mid, us2->v6.time_mid ); |
|
|
|
100
|
|
|
|
|
|
|
58
|
13
|
50
|
|
|
|
|
UUCMP(us1->v6.time_low_and_version, us2->v6.time_low_and_version ); |
|
|
|
0
|
|
|
|
|
|
|
59
|
13
|
50
|
|
|
|
|
UUCMP(us1->v6.clock_seq_and_variant, us2->v6.clock_seq_and_variant); |
|
|
|
0
|
|
|
|
|
|
|
60
|
13
|
|
|
|
|
|
return memcmp(us1->v6.node, us2->v6.node, 6); |
|
61
|
|
|
|
|
|
|
return 0; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
15
|
|
|
|
|
|
IV uu_compare_struct7(const struct_uu_t *us1, const struct_uu_t *us2) { |
|
65
|
15
|
50
|
|
|
|
|
UUCMP(us1->v7.time_high, us2->v7.time_high); |
|
|
|
0
|
|
|
|
|
|
|
66
|
15
|
50
|
|
|
|
|
UUCMP(us1->v7.time_low, us2->v7.time_low ); |
|
|
|
0
|
|
|
|
|
|
|
67
|
15
|
100
|
|
|
|
|
UUCMP(us1->v7.rand_a_and_version, us2->v7.rand_a_and_version); |
|
|
|
100
|
|
|
|
|
|
|
68
|
13
|
50
|
|
|
|
|
UUCMP(us1->v7.rand_b_and_variant, us2->v7.rand_b_and_variant); |
|
|
|
0
|
|
|
|
|
|
|
69
|
13
|
|
|
|
|
|
return 0; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
296
|
|
|
|
|
|
IV uu_compare_binary(const uu_t uu1, const uu_t uu2) { |
|
73
|
|
|
|
|
|
|
IV typ1, typ2, var1, var2; |
|
74
|
|
|
|
|
|
|
struct_uu_t us1, us2; |
|
75
|
|
|
|
|
|
|
|
|
76
|
296
|
|
|
|
|
|
uu_unpack(uu1, &us1); |
|
77
|
296
|
|
|
|
|
|
uu_unpack(uu2, &us2); |
|
78
|
|
|
|
|
|
|
|
|
79
|
296
|
|
|
|
|
|
var1 = uu_variant(&us1); |
|
80
|
296
|
|
|
|
|
|
var2 = uu_variant(&us2); |
|
81
|
|
|
|
|
|
|
|
|
82
|
296
|
100
|
|
|
|
|
if (var1 != var2) |
|
83
|
23
|
100
|
|
|
|
|
return var1 > var2 ? 1 : -1; |
|
84
|
|
|
|
|
|
|
|
|
85
|
273
|
|
|
|
|
|
typ1 = uu_type(&us1); |
|
86
|
273
|
|
|
|
|
|
typ2 = uu_type(&us2); |
|
87
|
|
|
|
|
|
|
|
|
88
|
273
|
100
|
|
|
|
|
if (typ1 != typ2) |
|
89
|
62
|
100
|
|
|
|
|
return typ1 > typ2 ? 1 : -1; |
|
90
|
|
|
|
|
|
|
|
|
91
|
211
|
|
|
|
|
|
switch(typ1) { |
|
92
|
19
|
|
|
|
|
|
case 1: return uu_compare_struct1(&us1, &us2); |
|
93
|
19
|
|
|
|
|
|
case 3: return uu_compare_struct3(&us1, &us2); |
|
94
|
117
|
|
|
|
|
|
case 4: return uu_compare_struct4(&us1, &us2); |
|
95
|
19
|
|
|
|
|
|
case 5: return uu_compare_struct5(&us1, &us2); |
|
96
|
15
|
|
|
|
|
|
case 6: return uu_compare_struct6(&us1, &us2); |
|
97
|
15
|
|
|
|
|
|
case 7: return uu_compare_struct7(&us1, &us2); |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
/* handles null and unknown types */ |
|
101
|
7
|
|
|
|
|
|
return uu_compare_struct0(&us1, &us2); |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
/* ex:set ts=2 sw=2 itab=spaces: */ |