Skip to content

Commit

Permalink
avoid newer clang-format issue
Browse files Browse the repository at this point in the history
More readable anyway.

Also remove specific version. Problems have been fixed already. All
versions should work the same now.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jul 10, 2023
1 parent 50eca16 commit 7477293
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
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

0 comments on commit 7477293

Please sign in to comment.