X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Favoids_cpp_reserved.c;h=78ba6ca8b87fbecdbd7a23db1593d424f537ae22;hb=bdb8d75154d7aefe01788e5dd5adb11e3c943c11;hp=72b3604efa45478c4f8d59110d92bc37bca9880a;hpb=af5b1a18948345c5f9f9abf4eda3ab9fe0aa9a9f;p=ccan diff --git a/tools/ccanlint/tests/avoids_cpp_reserved.c b/tools/ccanlint/tests/avoids_cpp_reserved.c index 72b3604e..78ba6ca8 100644 --- a/tools/ccanlint/tests/avoids_cpp_reserved.c +++ b/tools/ccanlint/tests/avoids_cpp_reserved.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include #include @@ -52,7 +50,7 @@ static void check_headers_no_cpp(struct manifest *m, if (fd < 0) err(1, "Creating temporary file %s", tmpsrc); - contents = talloc_asprintf(tmpsrc, + contents = tal_fmt(tmpsrc, "#define alignas #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n" "#define class #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n" "#define constexpr #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n" @@ -85,7 +83,7 @@ static void check_headers_no_cpp(struct manifest *m, "#define using #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n" "#define virtual #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n" "#include \n", - m->basename, m->basename); + m->modname, m->basename); if (write(fd, contents, strlen(contents)) != strlen(contents)) err(1, "writing to temporary file %s", tmpsrc); close(fd); @@ -94,7 +92,7 @@ static void check_headers_no_cpp(struct manifest *m, tmpobj, &cmdout)) { score->score = score->total; } else { - score->error = talloc_asprintf(score, + score->error = tal_fmt(score, "Main header file with C++ names:\n%s", cmdout); }