X Tutup
Skip to content

Commit a06371e

Browse files
committed
Fixes for Doxygen + code formatting
1 parent 9ae5929 commit a06371e

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

cli/cppcheckexecutor.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ static int filterException(int code, PEXCEPTION_POINTERS ex)
349349
code);
350350
break;
351351
}
352-
fprintf(stderr, "Please report this to the cppcheck developers!\n");
353352
return EXCEPTION_EXECUTE_HANDLER;
354353
}
355354
#endif
@@ -360,14 +359,13 @@ static int filterException(int code, PEXCEPTION_POINTERS ex)
360359
* TODO Check for multi-threading issues!
361360
*
362361
*/
363-
int CppCheckExecutor::check_wrapper(CppCheck& cppCheck, int argc, const char* const argv[])
362+
int CppCheckExecutor::check_wrapper(CppCheck& cppcheck, int argc, const char* const argv[])
364363
{
365364
#ifdef USE_WINDOWS_SEH
366365
__try {
367-
return check_internal(cppCheck, argc, argv);
366+
return check_internal(cppcheck, argc, argv);
368367
} __except (filterException(GetExceptionCode(), GetExceptionInformation())) {
369368
// reporting to stdout may not be helpful within a GUI application..
370-
fprintf(stderr, "Internal error\n");
371369
fprintf(stderr, "Please report this to the cppcheck developers!\n");
372370
return -1;
373371
}
@@ -379,18 +377,18 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppCheck, int argc, const char* co
379377
for (std::size_t s=0; s<GetArrayLength(listofsignals); ++s) {
380378
sigaction(listofsignals[s].signalnumber, &act, NULL);
381379
}
382-
return check_internal(cppCheck, argc, argv);
380+
return check_internal(cppcheck, argc, argv);
383381
#else
384-
return check_internal(cppCheck, argc, argv);
382+
return check_internal(cppcheck, argc, argv);
385383
#endif
386384
}
387385

388386
/*
389387
* That is a method which gets called from check_wrapper
390388
* */
391-
int CppCheckExecutor::check_internal(CppCheck& cppCheck, int /*argc*/, const char* const argv[])
389+
int CppCheckExecutor::check_internal(CppCheck& cppcheck, int /*argc*/, const char* const argv[])
392390
{
393-
Settings& settings = cppCheck.settings();
391+
Settings& settings = cppcheck.settings();
394392
_settings = &settings;
395393
bool std = settings.library.load(argv[0], "std.cfg");
396394
bool posix = true;
@@ -436,7 +434,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppCheck, int /*argc*/, const cha
436434
for (std::map<std::string, std::size_t>::const_iterator i = _files.begin(); i != _files.end(); ++i) {
437435
if (!_settings->library.markupFile(i->first)
438436
|| !_settings->library.processMarkupAfterCode(i->first)) {
439-
returnValue += cppCheck.check(i->first);
437+
returnValue += cppcheck.check(i->first);
440438
processedsize += i->second;
441439
if (!settings._errorsOnly)
442440
reportStatus(c + 1, _files.size(), processedsize, totalfilesize);
@@ -448,15 +446,15 @@ int CppCheckExecutor::check_internal(CppCheck& cppCheck, int /*argc*/, const cha
448446
// c/cpp files have been parsed and checked
449447
for (std::map<std::string, std::size_t>::const_iterator i = _files.begin(); i != _files.end(); ++i) {
450448
if (_settings->library.markupFile(i->first) && _settings->library.processMarkupAfterCode(i->first)) {
451-
returnValue += cppCheck.check(i->first);
449+
returnValue += cppcheck.check(i->first);
452450
processedsize += i->second;
453451
if (!settings._errorsOnly)
454452
reportStatus(c + 1, _files.size(), processedsize, totalfilesize);
455453
c++;
456454
}
457455
}
458456

459-
cppCheck.checkFunctionUsage();
457+
cppcheck.checkFunctionUsage();
460458
} else if (!ThreadExecutor::isEnabled()) {
461459
std::cout << "No thread support yet implemented for this platform." << std::endl;
462460
} else {
@@ -469,7 +467,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppCheck, int /*argc*/, const cha
469467
reportUnmatchedSuppressions(settings.nomsg.getUnmatchedGlobalSuppressions());
470468

471469
if (!settings.checkConfiguration) {
472-
cppCheck.tooManyConfigsError("",0U);
470+
cppcheck.tooManyConfigsError("",0U);
473471

474472
if (settings.isEnabled("missingInclude") && Preprocessor::missingIncludeFlag) {
475473
const std::list<ErrorLogger::ErrorMessage::FileLocation> callStack;

cli/cppcheckexecutor.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,16 @@ class CppCheckExecutor : public ErrorLogger {
112112
* Wrapper around check_internal
113113
* - installs optional platform dependent signal handling
114114
*
115+
* * @param cppcheck cppcheck instance
116+
* @param argc from main()
117+
* @param argv from main()
115118
**/
116-
int check_wrapper(CppCheck& cppCheck, int argc, const char* const argv[]);
119+
int check_wrapper(CppCheck& cppcheck, int argc, const char* const argv[]);
117120

118121
/**
119122
* Starts the checking.
120123
*
124+
* @param cppcheck cppcheck instance
121125
* @param argc from main()
122126
* @param argv from main()
123127
* @return EXIT_FAILURE if arguments are invalid or no input files
@@ -126,7 +130,7 @@ class CppCheckExecutor : public ErrorLogger {
126130
* given value is returned instead of default 0.
127131
* If no errors are found, 0 is returned.
128132
*/
129-
int check_internal(CppCheck& cppCheck, int argc, const char* const argv[]);
133+
int check_internal(CppCheck& cppcheck, int argc, const char* const argv[]);
130134
/**
131135
* Pointer to current settings; set while check() is running.
132136
*/

test/testnullpointer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,20 +2538,20 @@ class TestNullPointer : public TestFixture {
25382538

25392539
void nullpointerFputc() {
25402540
check("int main () {\n"
2541-
"FILE *fp = fopen(\"file.txt\", \"w+\");\n"
2542-
"fputc(000, fp); \n"
2543-
"fclose(fp);\n"
2544-
"return 0 ;\n"
2545-
"}\n");
2541+
"FILE *fp = fopen(\"file.txt\", \"w+\");\n"
2542+
"fputc(000, fp); \n"
2543+
"fclose(fp);\n"
2544+
"return 0 ;\n"
2545+
"}\n");
25462546
ASSERT_EQUALS("", errout.str());
25472547

25482548
check("int main () {\n"
2549-
"FILE *fp = fopen(\"file.txt\", \"w+\");\n"
2550-
"char *nullstring=0;"
2551-
"fputc(*nullstring, fp); \n"
2552-
"fclose(fp);\n"
2553-
"return 0 ;\n"
2554-
"}\n");
2549+
"FILE *fp = fopen(\"file.txt\", \"w+\");\n"
2550+
"char *nullstring=0;"
2551+
"fputc(*nullstring, fp); \n"
2552+
"fclose(fp);\n"
2553+
"return 0 ;\n"
2554+
"}\n");
25552555
ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference: nullstring\n", errout.str());
25562556
}
25572557
};

0 commit comments

Comments
 (0)
X Tutup