From f716a2ec13c8d165d850e2723c65bb78b28c943f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 26 Sep 2024 18:50:59 -0700 Subject: [PATCH 1/5] remove private.h This is used nowhere. Signed-off-by: Rosen Penev (cherry picked from commit 10accd32b3b21eb0f06e868d2ba85fdcbfdbe9d7) --- cmake/Doxyfile.in | 1 - src/private.h | 208 ---------------------------------------------- 2 files changed, 209 deletions(-) delete mode 100644 src/private.h diff --git a/cmake/Doxyfile.in b/cmake/Doxyfile.in index 3c90731936..d333b8df26 100644 --- a/cmake/Doxyfile.in +++ b/cmake/Doxyfile.in @@ -830,7 +830,6 @@ EXCLUDE = @ROOTDIR@/samples/Jzon.h \ @ROOTDIR@/src/getopt.hpp \ @ROOTDIR@/src/localtime.c \ @ROOTDIR@/src/fff.h \ - @ROOTDIR@/src/private.h \ @ROOTDIR@/src/timegm.h \ @ROOTDIR@/src/tzfile.h \ @ROOTDIR@/src/unused.h \ diff --git a/src/private.h b/src/private.h deleted file mode 100644 index 1a562f1810..0000000000 --- a/src/private.h +++ /dev/null @@ -1,208 +0,0 @@ -/*! - @file private.h - @brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/ -*/ -#ifndef PRIVATE_H - -#define PRIVATE_H - -/* -** This file is in the public domain, so clarified as of -** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). -*/ - -/* -** This header is for use ONLY with the time conversion code. -** There is no guarantee that it will remain unchanged, -** or that it will remain at all. -** Do NOT copy it to any system include directory. -** Thank you! -*/ - -/* -** ID -*/ - -#ifndef lint -#ifndef NOID -static char privatehid[] = "@(#)private.h 7.53"; -#endif /* !defined NOID */ -#endif /* !defined lint */ - -/* ahu: moved required preprocessor symbols to config.h */ - -/* ahu: disable warnings */ -#ifdef _MSC_VER -// disable warning 'uses old-style declarator' C4131 -#pragma warning(disable : 4131) -#endif - -/* -** Nested includes -*/ - -#include "errno.h" -#include "limits.h" /* for CHAR_BIT */ -#include "stdio.h" -#include "stdlib.h" -#include "string.h" -#include "sys/types.h" /* for time_t */ -#include "time.h" - -/* ahu: added io.h for MSVC */ -#ifdef _MSC_VER -#include "io.h" -#endif - -/* ahu: deleted include libintl.h */ - -/* ahu: deleted include sys/wait.h and WIFEXITED, WEXITSTATUS macros */ - -#if EXV_HAVE_UNISTD_H - 0 -#include "unistd.h" /* for F_OK and R_OK */ -#endif /* EXV_HAVE_UNISTD_H - 0 */ - -#if !(EXV_HAVE_UNISTD_H - 0) -#ifndef F_OK -#define F_OK 0 -#endif /* !defined F_OK */ -#ifndef R_OK -#define R_OK 4 -#endif /* !defined R_OK */ -#endif /* !(EXV_HAVE_UNISTD_H - 0) */ - -/* Unlike 's isdigit, this also works if c < 0 | c > UCHAR_MAX. */ -#define is_digit(c) ((unsigned)(c) - '0' <= 9) - -/* -** Workarounds for compilers/systems. -*/ - -/* -** SunOS 4.1.1 cc lacks prototypes. -*/ - -#ifndef P -#ifdef __STDC__ -#define P(x) x -#endif /* defined __STDC__ */ -#ifndef __STDC__ -#define P(x) () -#endif /* !defined __STDC__ */ -#endif /* !defined P */ - -/* -** SunOS 4.1.1 headers lack EXIT_SUCCESS. -*/ - -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif /* !defined EXIT_SUCCESS */ - -/* -** SunOS 4.1.1 headers lack EXIT_FAILURE. -*/ - -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif /* !defined EXIT_FAILURE */ - -/* -** SunOS 4.1.1 headers lack FILENAME_MAX. -*/ - -#ifndef FILENAME_MAX - -#ifndef MAXPATHLEN -#ifdef unix -#include "sys/param.h" -#endif /* defined unix */ -#endif /* !defined MAXPATHLEN */ - -#ifdef MAXPATHLEN -#define FILENAME_MAX MAXPATHLEN -#endif /* defined MAXPATHLEN */ -#ifndef MAXPATHLEN -#define FILENAME_MAX 1024 /* Pure guesswork */ -#endif /* !defined MAXPATHLEN */ - -#endif /* !defined FILENAME_MAX */ - -/* ahu: deleted unlink declaration and remove define */ - -/* ahu: deleted errno declaration */ - -/* ahu: deleted private function declarations */ - -/* -** Finally, some convenience items. -*/ - -#ifndef TRUE -#define TRUE 1 -#endif /* !defined TRUE */ - -#ifndef FALSE -#define FALSE 0 -#endif /* !defined FALSE */ - -#ifndef TYPE_BIT -#define TYPE_BIT(type) (sizeof(type) * CHAR_BIT) -#endif /* !defined TYPE_BIT */ - -#ifndef TYPE_SIGNED -#define TYPE_SIGNED(type) (((type)-1) < 0) -#endif /* !defined TYPE_SIGNED */ - -#ifndef INT_STRLEN_MAXIMUM -/* -** 302 / 1000 is log10(2.0) rounded up. -** Subtract one for the sign bit if the type is signed; -** add one for integer division truncation; -** add one more for a minus sign if the type is signed. -*/ -#define INT_STRLEN_MAXIMUM(type) ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type)) -#endif /* !defined INT_STRLEN_MAXIMUM */ - -/* -** INITIALIZE(x) -*/ - -#ifndef GNUC_or_lint -#ifdef lint -#define GNUC_or_lint -#endif /* defined lint */ -#ifndef lint -#ifdef __GNUC__ -#define GNUC_or_lint -#endif /* defined __GNUC__ */ -#endif /* !defined lint */ -#endif /* !defined GNUC_or_lint */ - -#ifndef INITIALIZE -#ifdef GNUC_or_lint -#define INITIALIZE(x) ((x) = 0) -#endif /* defined GNUC_or_lint */ -#ifndef GNUC_or_lint -#define INITIALIZE(x) -#endif /* !defined GNUC_or_lint */ -#endif /* !defined INITIALIZE */ - -/* ahu: deleted definition of _(msgid) macro */ - -#ifndef TZ_DOMAIN -#define TZ_DOMAIN "tz" -#endif /* !defined TZ_DOMAIN */ - -#if HAVE_INCOMPATIBLE_CTIME_R -#undef asctime_r -#undef ctime_r -char* asctime_r P((struct tm const*, char*)); -char* ctime_r P((time_t const*, char*)); -#endif /* HAVE_INCOMPATIBLE_CTIME_R */ - -/* -** UNIX was a registered trademark of The Open Group in 2003. -*/ - -#endif /* !defined PRIVATE_H */ From f0a5efdf9d1e64893724c23188b6dc490ec55be9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 26 Sep 2024 18:53:06 -0700 Subject: [PATCH 2/5] remove ending comment for structs Causes issues with newer clang-format. Signed-off-by: Rosen Penev (cherry picked from commit 52a081a4d0c2716e84dc1caff64021d3054a42b4) --- include/exiv2/datasets.hpp | 2 +- include/exiv2/tags.hpp | 2 +- include/exiv2/value.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exiv2/datasets.hpp b/include/exiv2/datasets.hpp index 5872a5c444..71854ba01c 100644 --- a/include/exiv2/datasets.hpp +++ b/include/exiv2/datasets.hpp @@ -39,7 +39,7 @@ struct EXIV2API DataSet { TypeId type_; //!< Exiv2 default type uint16_t recordId_; //!< Record id const char* photoshop_; //!< Photoshop string -}; // struct DataSet +}; //! IPTC dataset reference, implemented as a static class. class EXIV2API IptcDataSets { diff --git a/include/exiv2/tags.hpp b/include/exiv2/tags.hpp index 1eae8b0abd..0950ed7230 100644 --- a/include/exiv2/tags.hpp +++ b/include/exiv2/tags.hpp @@ -231,7 +231,7 @@ struct EXIV2API TagInfo { TypeId typeId_; //!< Type id int16_t count_; //!< The number of values (not bytes!), 0=any, -1=count not known. PrintFct printFct_; //!< Pointer to tag print function -}; // struct TagInfo +}; //! Access to Exif group and tag lists and misc. tag reference methods, implemented as a static class. class EXIV2API ExifTags { diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 721a93f5ef..b7abc27782 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -468,7 +468,7 @@ class EXIV2API CommentValue : public StringValueBase { CharsetId charsetId_; //!< Charset id const char* name_; //!< Name of the charset const char* code_; //!< Code of the charset - }; // struct CharsetTable + }; //! Charset information lookup functions. Implemented as a static class. class EXIV2API CharsetInfo { From ad8676c8fac80a6105afeaacc5a56f8d61d7e95d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 26 Sep 2024 18:54:36 -0700 Subject: [PATCH 3/5] use auto for lambda Seems to cause issues with newer clang-format. Signed-off-by: Rosen Penev (cherry picked from commit 7bd48d96fdf20710044ff0d9432237434377583d) --- src/bmffimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bmffimage.cpp b/src/bmffimage.cpp index 5e59336f7c..752c72cc0b 100644 --- a/src/bmffimage.cpp +++ b/src/bmffimage.cpp @@ -91,8 +91,8 @@ std::string BmffImage::toAscii(uint32_t n) { // show 0 as _ std::replace(result.begin(), result.end(), '\0', '_'); // show non 7-bit printable ascii as . - std::replace_if( - result.begin(), result.end(), [](char c) { return c < 32 || c > 126; }, '.'); + auto f = [](char c) { return c < 32 || c > 126; }; + std::replace_if(result.begin(), result.end(), f, '.'); return result; } From 20aa69bf17092b1f70d9923f6b0b69f6bc45420b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 26 Sep 2024 18:56:32 -0700 Subject: [PATCH 4/5] get rid of + when using << The former causes issues with newer clang-format. Signed-off-by: Rosen Penev (cherry picked from commit 7fe36b8b22259379a24bf07994fa20c1ac02c10c) --- src/convert.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/convert.cpp b/src/convert.cpp index ed097eed14..a588dd2d8f 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -1051,7 +1051,7 @@ void Converter::cnvXmpFlash(const char* from, const char* to) { value |= fired & 1; #ifndef SUPPRESS_WARNINGS else - EXV_WARNING << "Failed to convert " << std::string(from) + "/exif:Fired" + EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Fired" << " to " << to << "\n"; #endif } @@ -1062,7 +1062,7 @@ void Converter::cnvXmpFlash(const char* from, const char* to) { value |= (ret & 3) << 1; #ifndef SUPPRESS_WARNINGS else - EXV_WARNING << "Failed to convert " << std::string(from) + "/exif:Return" + EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Return" << " to " << to << "\n"; #endif } @@ -1073,7 +1073,7 @@ void Converter::cnvXmpFlash(const char* from, const char* to) { value |= (mode & 3) << 3; #ifndef SUPPRESS_WARNINGS else - EXV_WARNING << "Failed to convert " << std::string(from) + "/exif:Mode" + EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Mode" << " to " << to << "\n"; #endif } @@ -1084,7 +1084,7 @@ void Converter::cnvXmpFlash(const char* from, const char* to) { value |= (function & 1) << 5; #ifndef SUPPRESS_WARNINGS else - EXV_WARNING << "Failed to convert " << std::string(from) + "/exif:Function" + EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Function" << " to " << to << "\n"; #endif } @@ -1096,7 +1096,7 @@ void Converter::cnvXmpFlash(const char* from, const char* to) { value |= (red & 1) << 6; #ifndef SUPPRESS_WARNINGS else - EXV_WARNING << "Failed to convert " << std::string(from) + "/exif:RedEyeMode" + EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:RedEyeMode" << " to " << to << "\n"; #endif } From 5aa59a0e61a47f395bddb3c945da679f6f82cf53 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 26 Sep 2024 19:06:15 -0700 Subject: [PATCH 5/5] fff: remove pointless comments A lot of these are wrong anyway, when adding static_assert, a lot fail. Signed-off-by: Rosen Penev (cherry picked from commit 1e80c286ba0ced1b730e5bc12dc3e82e5689cfd9) --- src/fff.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fff.h b/src/fff.h index 25987ba298..9a280ced4e 100644 --- a/src/fff.h +++ b/src/fff.h @@ -282,7 +282,7 @@ struct OBJECT_PAR_T { float relHum; //!< relative humidity long reserved[4]; //!< For future use - should be set to 0 -}; //!< sizeof struct == 48 bytes +}; struct TEMP_CALIB_T { long Reserved1[2]; @@ -344,7 +344,7 @@ struct TEMPSENSOR_DATA_T { char pzTSName[SYSIMG_NAMELEN + 1]; ULONG captureTime; //!< TS updated; time in seconds since 1970-01-01 00:00 ULONG captureMilliTime; //!< TS updated; Milliseconds since last second -}; //!< sizeof struct == 28 bytes +}; /** Detector parameter struct */ struct DETECTOR_PARAM_T { @@ -360,7 +360,7 @@ struct EXTENDED_IMAGEINFO_T { DETECTOR_PARAM_T detectorPars[20]; //!< Currently used detector parameters like //! used bias, offsets. Usage is camera //! dependent -}; //!< sizeof struct == 960 bytes +}; struct _bidata_t { GEOMETRIC_INFO_T GeometricInfo; // 32 bytes