From ff6169a266e5cd14f8ce0e1874981a92c51e07e5 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Mon, 6 Mar 2017 15:39:36 +0000 Subject: [PATCH] - fix include guard warning - additional debug comments --- src/stubser/stubser.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/stubser/stubser.c b/src/stubser/stubser.c index 10e3e3c..1a3f37c 100644 --- a/src/stubser/stubser.c +++ b/src/stubser/stubser.c @@ -236,11 +236,11 @@ STATIC int8_t createStub(char *aOutput, char *aNoSuffix, cfunction_list_t *aFunc fprintf(cfile, " * - generated by stubser -"NEWLINES" */" NEWLINES NEWLINES); fprintf(cheader, "/* @file %s"NEWLINES, gnu_basename(cHeaderName)); - fprintf(cheader, " * @details"NEWLINES" * This is a stub header for CUnit.\\n"NEWLINES); + fprintf(cheader, " * @details"NEWLINES" * This is a stub header.\\n"NEWLINES); fprintf(cheader, " * - generated by stubser -"NEWLINES" */" NEWLINES NEWLINES); - fprintf(cheader, "#ifndef _INCLUDE_%s_H"NEWLINES, aNoSuffix); - fprintf(cheader, "#define _INCLUDE_%s_H"NEWLINES NEWLINES, aNoSuffix); + fprintf(cheader, "#ifndef _STUB_%s_H"NEWLINES, aNoSuffix); + fprintf(cheader, "#define _STUB_%s_H"NEWLINES NEWLINES, aNoSuffix); function = aFunctionList->head; while (function) @@ -249,7 +249,7 @@ STATIC int8_t createStub(char *aOutput, char *aNoSuffix, cfunction_list_t *aFunc function = function->next; } - fprintf(cheader, NEWLINES"#endif // _INCLUDE_%s_H"NEWLINES, aNoSuffix); + fprintf(cheader, NEWLINES"#endif // _STUB_%s_H"NEWLINES, aNoSuffix); free(cFileName); free(cHeaderName); @@ -276,10 +276,14 @@ int stubser_createStub(char *path, char* aNoSuffix, char *aOutput) DEBUG_LOG_APPEND(1, "\n"); if (0 != ret) { +#if isDebugLevel(1) + printf(STUB_CONSOLE_PARSE_ERROR_S2, path, ret); +#else printf(STUB_CONSOLE_PARSE_ERROR_S2, gnu_basename(path), ret); +#endif if (-2 == ret) { - printf(" Block removal error\n"); + printf(" Block removal error (likely nested comments).\n"); } else if (-3 == ret) { @@ -288,8 +292,11 @@ int stubser_createStub(char *path, char* aNoSuffix, char *aOutput) ret = -1; goto end_stubser_createStub; } +#if isDebugLevel(1) + printf(STUB_CONSOLE_PARSE_OK_S1, path); +#else printf(STUB_CONSOLE_PARSE_OK_S1, gnu_basename(path)); - +#endif sprintf(fileName, "%s/stub_%s", aOutput, aNoSuffix); ret = createStub(fileName, aNoSuffix, &functionList); if (0 != ret)