@@ -61,7 +61,7 @@
return 0;
}
-#else /* HAVE_XKEY_PROVIDER */
+#else /* HAVE_XKEY_PROVIDER */
static XKEY_EXTERNAL_SIGN_fn xkey_cng_sign;
@@ -145,11 +145,6 @@
free(cd);
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
-
/**
* Parse a hex string with optional embedded spaces into
* a byte array.
@@ -158,10 +153,10 @@
* @param capacity capacity of the byte array arr
* @returns the number of bytes parsed or 0 on error
*/
-int
-parse_hexstring(const char *p, unsigned char *arr, size_t capacity)
+static DWORD
+parse_hexstring(const char *p, unsigned char *arr, DWORD capacity)
{
- int i = 0;
+ DWORD i = 0;
for (; *p && i < capacity; p += 2)
{
/* skip spaces */
@@ -182,10 +177,6 @@
return i;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
static void *
decode_object(struct gc_arena *gc, LPCSTR struct_type, const CRYPT_OBJID_BLOB *val, DWORD flags,
DWORD *cb)
@@ -469,7 +469,7 @@
for (size_t i = 0; i < _countof(valid_str); i++)
{
- int len = parse_hexstring(valid_str[i], hash, _countof(hash));
+ DWORD len = parse_hexstring(valid_str[i], hash, _countof(hash));
assert_int_equal(len, sizeof(test_hash));
assert_memory_equal(hash, test_hash, sizeof(test_hash));
memset(hash, 0, _countof(hash));
@@ -477,7 +477,7 @@
for (size_t i = 0; i < _countof(invalid_str); i++)
{
- int len = parse_hexstring(invalid_str[i], hash, _countof(hash));
+ DWORD len = parse_hexstring(invalid_str[i], hash, _countof(hash));
assert_int_equal(len, 0);
}
}