numericx_translate() return true

* numericx_translate() was returning EXIT_SUCCESS in case of success.
   Doohh! Now it is return true, in case of success.

   Ajust doxygen comment accordingly.

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
This commit is contained in:
Daniel Santos 2022-03-19 07:35:32 +00:00
parent aa172de2cf
commit fcc6c957bf
2 changed files with 4 additions and 4 deletions

4
cli.c
View File

@ -143,7 +143,7 @@ main(int argc, char* argv[])
switch( status ) switch( status )
{ {
case EINVAL: case EINVAL:
fprintf(stderr, "error: %s: %s. Resulting string variable has to be NULL.\n", fprintf(stderr, "error: %s: %s. Resulting string argument value has to be NULL.\n",
PROG_NAME, strerror(EINVAL)); PROG_NAME, strerror(EINVAL));
break; break;
case EDOM: case EDOM:
@ -154,7 +154,7 @@ main(int argc, char* argv[])
fprintf(stderr, "error: %s: Unrepresentable void number.\n", PROG_NAME); fprintf(stderr, "error: %s: Unrepresentable void number.\n", PROG_NAME);
break; break;
} }
if( !(status == EXIT_SUCCESS) ) if( !(status == true) )
{ {
fprintf(stderr, "error: %s: Incapable of translating.\n", PROG_NAME); fprintf(stderr, "error: %s: Incapable of translating.\n", PROG_NAME);
free(from); free(from);

View File

@ -357,7 +357,7 @@ is_number_void(char* number, char* void_numeral, bool is_infinite)
* @return EINVAL if argument of result_string is not NULL. * @return EINVAL if argument of result_string is not NULL.
* @return EDOM if number doesn't belong to the 'from' numerical system. * @return EDOM if number doesn't belong to the 'from' numerical system.
* @return ERANGE if the resulting number cannot be represented, because of a 'from' void number and a lack of void number in 'to'. * @return ERANGE if the resulting number cannot be represented, because of a 'from' void number and a lack of void number in 'to'.
* @return EXIT_SUCCESS in case of success. * @return true in case of success.
*/ */
int int
numericx_translate(char* from, bool from_units_on_the_end, bool from_first_number_void, bool from_infinite_base, char* to, bool to_units_on_the_end, bool to_first_number_void, bool to_infinite_base, char* number_arg, char** result_string) numericx_translate(char* from, bool from_units_on_the_end, bool from_first_number_void, bool from_infinite_base, char* to, bool to_units_on_the_end, bool to_first_number_void, bool to_infinite_base, char* number_arg, char** result_string)
@ -442,5 +442,5 @@ numericx_translate(char* from, bool from_units_on_the_end, bool from_first_numbe
free_numeral(result); free_numeral(result);
free(number); free(number);
return EXIT_SUCCESS; return true;
} }