From dac73b73d6fcf5a79f3c2ce3917935c04fc3ef08 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 6 Jul 2023 15:33:58 -0700 Subject: [PATCH] avoid newer clang-format issue More readable anyway. Also remove specific version. Problems have been fixed already. All versions should work the same now. Signed-off-by: Rosen Penev --- .github/workflows/on_push_clang_format.yml | 1 - samples/geotag.cpp | 32 ++++++++++++---------- src/xmp.cpp | 15 +++++++++- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/on_push_clang_format.yml b/.github/workflows/on_push_clang_format.yml index 17b2f8e9ee..54aaf94154 100644 --- a/.github/workflows/on_push_clang_format.yml +++ b/.github/workflows/on_push_clang_format.yml @@ -13,5 +13,4 @@ jobs: source: '.' exclude: './xmpsdk ./contrib' extensions: 'c,h,cpp,hpp' - clangFormatVersion: 12 style: file diff --git a/samples/geotag.cpp b/samples/geotag.cpp index 00f01a83f0..9c6581ffe8 100644 --- a/samples/geotag.cpp +++ b/samples/geotag.cpp @@ -62,10 +62,14 @@ class Options { virtual ~Options() = default; }; -enum { resultOK = 0, resultSyntaxError, resultSelectFailed }; +enum { + resultOK = 0, + resultSyntaxError, + resultSelectFailed, +}; -enum // keyword indices -{ +// keyword indices +enum { kwHELP = 0, kwVERSION, kwDST, @@ -75,13 +79,10 @@ enum // keyword indices kwADJUST, kwTZ, kwDELTA, - kwMAX // manages keyword array - , - kwNEEDVALUE // bogus keywords for error reporting - , - kwSYNTAX // -- ditto -- - , - kwNOVALUE = -kwVERBOSE // keywords <= kwNOVALUE are flags (no value needed) + kwMAX, // manages keyword array + kwNEEDVALUE, // bogus keywords for error reporting + kwSYNTAX, // -- ditto -- + kwNOVALUE = -kwVERBOSE, // keywords <= kwNOVALUE are flags (no value needed) }; // file types supported @@ -625,10 +626,13 @@ int getFileType(std::string& path, Options& options) { return getFileType(path.c_str(), options); } int getFileType(const char* path, Options& options) { - return readXML(path, options) ? typeXML - : readDir(path, options) ? typeDirectory - : readImage(path, options) ? typeImage - : readFile(path, options); + if (readXML(path, options)) + return typeXML; + if (readDir(path, options)) + return typeDirectory; + if (readImage(path, options)) + return typeImage; + return readFile(path, options); } int version(const char* program) { diff --git a/src/xmp.cpp b/src/xmp.cpp index 99c8103d8b..a517f78e7a 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -1004,7 +1004,20 @@ void printNode(const std::string& schemaNs, const std::string& propPath, const s std::cout << "ashisabsals\n" << "lcqqtrgqlai\n"; } - enum { alia = 0, sche, hasq, isqu, stru, arra, abag, aseq, aalt, lang, simp, len }; + enum { + alia = 0, + sche, + hasq, + isqu, + stru, + arra, + abag, + aseq, + aalt, + lang, + simp, + len, + }; std::string opts(len, '.'); if (XMP_PropIsAlias(opt))