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

Use int32_t in TimeValue #2280

Merged
merged 1 commit into from
Jul 27, 2022
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
20 changes: 10 additions & 10 deletions include/exiv2/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,16 +932,16 @@ class EXIV2API DateValue : public Value {
//! Default constructor.
DateValue();
//! Constructor
DateValue(int year, int month, int day);
DateValue(int32_t year, int32_t month, int32_t day);
//! Virtual destructor.
~DateValue() override = default;
//@}

//! Simple Date helper structure
struct EXIV2API Date {
int year{0}; //!< Year
int month{0}; //!< Month
int day{0}; //!< Day
int32_t year{0}; //!< Year
int32_t month{0}; //!< Month
int32_t day{0}; //!< Day
};

//! @name Manipulators
Expand Down Expand Up @@ -1025,7 +1025,7 @@ class EXIV2API TimeValue : public Value {
//! Default constructor.
TimeValue();
//! Constructor
TimeValue(int hour, int minute, int second = 0, int tzHour = 0, int tzMinute = 0);
TimeValue(int32_t hour, int32_t minute, int32_t second = 0, int32_t tzHour = 0, int32_t tzMinute = 0);

//! Virtual destructor.
~TimeValue() override = default;
Expand All @@ -1035,11 +1035,11 @@ class EXIV2API TimeValue : public Value {
struct Time {
Time() = default;

int hour{0}; //!< Hour
int minute{0}; //!< Minute
int second{0}; //!< Second
int tzHour{0}; //!< Hours ahead or behind UTC
int tzMinute{0}; //!< Minutes ahead or behind UTC
int32_t hour{0}; //!< Hour
int32_t minute{0}; //!< Minute
int32_t second{0}; //!< Second
int32_t tzHour{0}; //!< Hours ahead or behind UTC
int32_t tzMinute{0}; //!< Minutes ahead or behind UTC
};

//! @name Manipulators
Expand Down
4 changes: 2 additions & 2 deletions src/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ LangAltValue* LangAltValue::clone_() const {
DateValue::DateValue() : Value(date) {
}

DateValue::DateValue(int year, int month, int day) : Value(date) {
DateValue::DateValue(int32_t year, int32_t month, int32_t day) : Value(date) {
date_.year = year;
date_.month = month;
date_.day = day;
Expand Down Expand Up @@ -904,7 +904,7 @@ Rational DateValue::toRational(size_t n) const {
TimeValue::TimeValue() : Value(time) {
}

TimeValue::TimeValue(int hour, int minute, int second, int tzHour, int tzMinute) : Value(date) {
TimeValue::TimeValue(int32_t hour, int32_t minute, int32_t second, int32_t tzHour, int32_t tzMinute) : Value(date) {
time_.hour = hour;
time_.minute = minute;
time_.second = second;
Expand Down