aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/der_cmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asn1/der_cmp.c')
-rw-r--r--lib/asn1/der_cmp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/asn1/der_cmp.c b/lib/asn1/der_cmp.c
index 468ccb2d040c..f4612c469f60 100644
--- a/lib/asn1/der_cmp.c
+++ b/lib/asn1/der_cmp.c
@@ -37,7 +37,7 @@ int
der_heim_oid_cmp(const heim_oid *p, const heim_oid *q)
{
if (p->length != q->length)
- return p->length - q->length;
+ return (int)(p->length - q->length);
return memcmp(p->components,
q->components,
p->length * sizeof(*p->components));
@@ -48,7 +48,7 @@ der_heim_octet_string_cmp(const heim_octet_string *p,
const heim_octet_string *q)
{
if (p->length != q->length)
- return p->length - q->length;
+ return (int)(p->length - q->length);
return memcmp(p->data, q->data, p->length);
}
@@ -70,12 +70,13 @@ int
der_heim_bit_string_cmp(const heim_bit_string *p,
const heim_bit_string *q)
{
- int i, r1, r2;
+ int r1, r2;
+ size_t i;
if (p->length != q->length)
- return p->length - q->length;
+ return (int)(p->length - q->length);
i = memcmp(p->data, q->data, p->length / 8);
if (i)
- return i;
+ return (int)i;
if ((p->length % 8) == 0)
return 0;
i = (p->length / 8);
@@ -94,7 +95,7 @@ der_heim_integer_cmp(const heim_integer *p,
if (p->negative != q->negative)
return q->negative - p->negative;
if (p->length != q->length)
- return p->length - q->length;
+ return (int)(p->length - q->length);
return memcmp(p->data, q->data, p->length);
}
@@ -102,7 +103,7 @@ int
der_heim_bmp_string_cmp(const heim_bmp_string *p, const heim_bmp_string *q)
{
if (p->length != q->length)
- return p->length - q->length;
+ return (int)(p->length - q->length);
return memcmp(p->data, q->data, q->length * sizeof(q->data[0]));
}
@@ -111,6 +112,6 @@ der_heim_universal_string_cmp(const heim_universal_string *p,
const heim_universal_string *q)
{
if (p->length != q->length)
- return p->length - q->length;
+ return (int)(p->length - q->length);
return memcmp(p->data, q->data, q->length * sizeof(q->data[0]));
}