fix compilation errors on 64bits architectures

* sizeof(unsigned int) != sizeof(size_t)
 * INT_MAX != LONG_MAX
This commit is contained in:
Benjamin Dauvergne 2013-09-08 21:23:30 +02:00
parent b6faccae0f
commit 05a01a8247
7 changed files with 7 additions and 7 deletions

View File

@ -153,7 +153,7 @@ xsdUnsignedShortParse(xmlChar *value, int *out) {
errno = 0;
l = strtol((char*)value, NULL, 10);
if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) ||
if (((l == INT_MIN || l == INT_MAX) && errno == ERANGE) ||
errno == EINVAL || l < 0 || l >= 65535) {
return FALSE;
}

View File

@ -639,7 +639,7 @@ lasso_query_verify_helper(const char *signed_content, const char *b64_signature,
xmlSecByte *signature = NULL;
int key_size = 0;
unsigned char *hmac_key = NULL;
unsigned int hmac_key_length = 0;
size_t hmac_key_length = 0;
const EVP_MD *md = NULL;
lasso_error_t rc = 0;
LassoSignatureMethod method = LASSO_SIGNATURE_METHOD_NONE;

View File

@ -1295,7 +1295,7 @@ snippet_set_value(LassoNode *node, LassoNodeClass *class, struct XmlSnippet *sni
value = SNIPPET_STRUCT_MEMBER_P(node, g_type, snippet);
if (snippet->type & SNIPPET_INTEGER) {
int val = strtol((char*)content, NULL, 10);
if (((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE)
if (((val == INT_MIN || val == INT_MAX) && errno == ERANGE)
|| errno == EINVAL || val < 0) {
if (snippet->type & SNIPPET_OPTIONAL_NEG) {
val = -1;

View File

@ -187,7 +187,7 @@ END_TEST
START_TEST(test09_test_deserialization)
{
char *content = NULL;
unsigned int len = 0;
size_t len = 0;
LassoNode *node;
g_file_get_contents(TESTSDATADIR "/response-1", &content, &len, NULL);

View File

@ -90,7 +90,7 @@ generateIdentityProviderContextDumpMemory()
char *metadata;
char *private_key;
char *certificate;
guint len;
size_t len;
char *ret;
g_file_get_contents(TESTSDATADIR "/idp1-la/metadata.xml", &metadata, &len, NULL);

View File

@ -93,7 +93,7 @@ generateIdentityProviderContextDumpMemory()
char *metadata = NULL;
char *private_key = NULL;
char *certificate = NULL;
guint len;
size_t len;
char *ret = NULL;
g_file_get_contents(TESTSDATADIR "/idp5-saml2/metadata.xml", &metadata, &len, NULL);

View File

@ -6,7 +6,7 @@
void load(char *file) {
LassoNode *node = NULL;
char *content;
guint len;
size_t len;
xmlNode *xmlnode;
g_file_get_contents(file, &content, &len, NULL);