Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid newer clang-format issue #2682

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/on_push_clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ jobs:
source: '.'
exclude: './xmpsdk ./contrib'
extensions: 'c,h,cpp,hpp'
clangFormatVersion: 12
style: file
32 changes: 18 additions & 14 deletions samples/geotag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions src/jp2image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,8 @@ void Jp2Image::readMetadata() {
break;
}

default: {
default:
break;
}
}
lastBoxTypeRead = box.type;

Expand Down
3 changes: 1 addition & 2 deletions src/psdimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
break;
}

default: {
default:
break;
}
}
} // PsdImage::readResourceBlock

Expand Down
15 changes: 14 additions & 1 deletion src/xmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down