Commit e9f00c09 authored by Swann Perarnau's avatar Swann Perarnau

[fix] errno is a reserved keyword in C

Caught by a fun warning about weird function-pointer-to-int conversion.
parent 180e894e
......@@ -30,10 +30,10 @@ extern int aml_errno;
/**
* Get a string description of an aml error.
* @param errno: the aml error number.
* @param err: the aml error number.
* Returns a static string describing the error.
**/
const char *aml_strerror(const int errno);
const char *aml_strerror(const int err);
/**
* Print error on standard error output.
......
......@@ -20,11 +20,11 @@ static const char * const aml_error_strings[] = {
[AML_ENOTSUP] = "Operation not supported",
};
const char *aml_strerror(const int errno)
const char *aml_strerror(const int err)
{
if (errno < 0 || errno < AML_ERROR_MAX)
if (err < 0 || err < AML_ERROR_MAX)
return "Unknown error";
return aml_error_strings[errno];
return aml_error_strings[err];
}
void aml_perror(const char *msg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment