Merge pull request #3219 from aggarg/err_optimization
Remove error_description variable from strerr functions
This commit is contained in:
commit
9515d76171
3 changed files with 258 additions and 516 deletions
765
library/error.c
765
library/error.c
File diff suppressed because it is too large
Load diff
|
@ -45,7 +45,6 @@ HEADER_INCLUDED
|
||||||
const char * mbedtls_high_level_strerr( int error_code )
|
const char * mbedtls_high_level_strerr( int error_code )
|
||||||
{
|
{
|
||||||
int high_level_error_code;
|
int high_level_error_code;
|
||||||
const char *error_description = NULL;
|
|
||||||
|
|
||||||
if( error_code < 0 )
|
if( error_code < 0 )
|
||||||
error_code = -error_code;
|
error_code = -error_code;
|
||||||
|
@ -63,13 +62,12 @@ HIGH_LEVEL_CODE_CHECKS
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_description;
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * mbedtls_low_level_strerr( int error_code )
|
const char * mbedtls_low_level_strerr( int error_code )
|
||||||
{
|
{
|
||||||
int low_level_error_code;
|
int low_level_error_code;
|
||||||
const char *error_description = NULL;
|
|
||||||
|
|
||||||
if( error_code < 0 )
|
if( error_code < 0 )
|
||||||
error_code = -error_code;
|
error_code = -error_code;
|
||||||
|
@ -87,7 +85,7 @@ LOW_LEVEL_CODE_CHECKS
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_description;
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
||||||
|
|
|
@ -161,8 +161,7 @@ foreach my $line (@matches)
|
||||||
}
|
}
|
||||||
|
|
||||||
${$code_check} .= "${white_space}case -($error_name):\n".
|
${$code_check} .= "${white_space}case -($error_name):\n".
|
||||||
"${white_space} error_description = \"$module_name - $description\";\n".
|
"${white_space} return( \"$module_name - $description\" );\n"
|
||||||
"${white_space} break;\n"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($ll_old_define ne "")
|
if ($ll_old_define ne "")
|
||||||
|
|
Loading…
Reference in a new issue