EINA_SAFETY_ON_NULL_RETURN_VAL(str, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(num, EINA_FALSE);
- const long sul = strtoul(str, &end, base);
+ const unsigned long sul = strtoul(str, &end, base);
errsv = errno;
EINA_SAFETY_ON_TRUE_RETURN_VAL((end == str), EINA_FALSE); /* given string is not a decimal number */
EINA_SAFETY_ON_TRUE_RETURN_VAL(('\0' != *end), EINA_FALSE); /* given string has extra characters */
EINA_SAFETY_ON_TRUE_RETURN_VAL(((ULONG_MAX == sul) && (ERANGE == errsv)), EINA_FALSE); /* out of range of type unsigned long */
- *num = (int)sul;
+ *num = sul;
return EINA_TRUE;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(str, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(num, EINA_FALSE);
- const long sul = strtoul(str, &end, base);
+ const unsigned long sul = strtoul(str, &end, base);
errsv = errno;
EINA_SAFETY_ON_TRUE_RETURN_VAL((end == str), EINA_FALSE); /* given string is not a decimal number */
EINA_SAFETY_ON_TRUE_RETURN_VAL(('\0' != *end), EINA_FALSE); /* given string has extra characters */
EINA_SAFETY_ON_TRUE_RETURN_VAL(((ULONG_MAX == sul) && (ERANGE == errsv)), EINA_FALSE); /* out of range of type unsigned long */
- *num = (int)sul;
+ *num = sul;
return EINA_TRUE;
}