Have main() return a value

This commit is contained in:
Frank Denis 2015-05-27 12:41:43 +02:00
parent 2f9920c71f
commit 9c613c2e0c
11 changed files with 22 additions and 43 deletions

View File

@ -65,14 +65,11 @@ auth(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == auth() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return auth() != 0;
}

View File

@ -117,14 +117,11 @@ box(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == box() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return box() != 0;
}

View File

@ -144,14 +144,11 @@ box(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == box() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return box() != 0;
}

View File

@ -46,12 +46,12 @@ generichash(void)
}
int
main(int argc, char **argv)
main(void)
{
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
generichash();
exit(EXIT_SUCCESS);
return 0;
}

View File

@ -55,12 +55,12 @@ generichashstream(void)
}
int
main(int argc, char **argv)
main(void)
{
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
generichashstream();
exit(EXIT_SUCCESS);
return 0;
}

View File

@ -38,12 +38,12 @@ hash(void)
}
int
main(int argc, char **argv)
main(void)
{
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
hash();
exit(EXIT_SUCCESS);
return 0;
}

View File

@ -69,14 +69,11 @@ onetimeauth(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == onetimeauth() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return onetimeauth() != 0;
}

View File

@ -97,14 +97,11 @@ secretbox(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == secretbox() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return secretbox() != 0;
}

View File

@ -43,12 +43,12 @@ shorthash(void)
}
int
main(int argc, char **argv)
main(void)
{
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
shorthash();
exit(EXIT_SUCCESS);
return 0;
}

View File

@ -84,14 +84,11 @@ sign(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == sign() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return sign() != 0;
}

View File

@ -77,14 +77,11 @@ stream(void)
}
int
main(int argc, char **argv)
main(void)
{
int r;
sodium_init();
printf("Using LibSodium %s\n", sodium_version_string());
r = (0 == stream() ? EXIT_SUCCESS : EXIT_FAILURE);
exit(r);
return stream() != 0;
}