Code style cleanup in C++ example.

This commit is contained in:
Geenz 2015-04-01 08:59:27 -04:00
parent 4c07491db6
commit 5af3411513
6 changed files with 129 additions and 132 deletions

View File

@ -24,6 +24,7 @@ example_class::~example_class() {
}
const char* example_class::a() {
const char*
example_class::a() {
return "Hello world!";
}

View File

@ -25,7 +25,8 @@ public:
example_class();
~example_class();
const char* a();
const char*
a();
};
#endif /* defined(____example_class__) */

View File

@ -753,18 +753,15 @@ cli_register_cppfile(char *fpath, struct dirent *dp)
struct stat st;
char *ext, *opath;
if ((ext = strrchr(fpath, '.')) == NULL || strcmp(ext, ".cpp")) {
if ((ext = strrchr(fpath, '.')) == NULL || strcmp(ext, ".cpp"))
return;
}
if (stat(fpath, &st) == -1)
cli_fatal("stat(%s): %s", fpath, errno_s);
(void)cli_vasprintf(&opath, "%s/.objs/%s.o", rootdir, dp->d_name);
if (!cli_file_requires_build(&st, opath)) {
cli_add_cppfile(dp->d_name, fpath, opath, &st, 0);
return;
}
@ -778,9 +775,8 @@ cli_register_cfile(char *fpath, struct dirent *dp)
struct stat st;
char *ext, *opath;
if ((ext = strrchr(fpath, '.')) == NULL || strcmp(ext, ".c")) {
if ((ext = strrchr(fpath, '.')) == NULL || strcmp(ext, ".c"))
return;
}
if (stat(fpath, &st) == -1)
cli_fatal("stat(%s): %s", fpath, errno_s);
@ -788,7 +784,6 @@ cli_register_cfile(char *fpath, struct dirent *dp)
(void)cli_vasprintf(&opath, "%s/.objs/%s.o", rootdir, dp->d_name);
if (!cli_file_requires_build(&st, opath)) {
cli_add_cfile(dp->d_name, fpath, opath, &st, 0);
return;
}