gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon Jan 9 17:37:21 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/fb9947b7 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e92e7d0b (commit)
	from  https://github.com/Gnucash/gnucash/commit/e4d0abb4 (commit)



commit fb9947b7b605db08e750a1c3e2592a083d7314b4
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 9 14:36:06 2023 -0800

    Rename GncDateTime's ymd to gnc_ymd to avoid a name conflict with Carbon.

diff --git a/libgnucash/engine/gnc-datetime.cpp b/libgnucash/engine/gnc-datetime.cpp
index ea1df6018..d030f8e09 100644
--- a/libgnucash/engine/gnc-datetime.cpp
+++ b/libgnucash/engine/gnc-datetime.cpp
@@ -318,7 +318,7 @@ public:
     GncDateImpl(const std::string str, const std::string fmt);
 
     void today() { m_greg = boost::gregorian::day_clock::local_day(); }
-    ymd year_month_day() const;
+    gnc_ymd year_month_day() const;
     std::string format(const char* format) const;
     std::string format_zulu(const char* format) const {
 	return this->format(format);
@@ -601,7 +601,7 @@ GncDateImpl::GncDateImpl(const std::string str, const std::string fmt) :
                   std::stoi (what.str("DAY")));
 }
 
-ymd
+gnc_ymd
 GncDateImpl::year_month_day() const
 {
     auto boost_ymd = m_greg.year_month_day();
@@ -738,7 +738,7 @@ GncDate::format(const char* format)
     return m_impl->format(format);
 }
 
-ymd
+gnc_ymd
 GncDate::year_month_day() const
 {
     return m_impl->year_month_day();
diff --git a/libgnucash/engine/gnc-datetime.hpp b/libgnucash/engine/gnc-datetime.hpp
index cd19628fa..c3c0aab17 100644
--- a/libgnucash/engine/gnc-datetime.hpp
+++ b/libgnucash/engine/gnc-datetime.hpp
@@ -35,7 +35,7 @@ typedef struct
     int year;  //1400-9999
     int month; //1-12
     int day; //1-31
-} ymd;
+} gnc_ymd;
 
 enum class DayPart {
     start,    // 00:00 local
@@ -272,10 +272,10 @@ class GncDate
         GncDate& operator=(GncDate&&);
         /** Set the date object to the computer clock's current day. */
         void today();
-        /** Get the year, month, and day from the date as a ymd.
-         *  @return ymd struct
+        /** Get the year, month, and day from the date as a gnc_ymd.
+         *  @return gnc_ymd struct
          */
-        ymd year_month_day() const;
+        gnc_ymd year_month_day() const;
         /** Format the GncDate into a std::string
          *  @param format A cstr describing the way the date and time are
          *  presented. Code letters preceded with % stand in for arguments;
diff --git a/libgnucash/engine/test/gtest-gnc-datetime.cpp b/libgnucash/engine/test/gtest-gnc-datetime.cpp
index 939876d7b..7a5128d6b 100644
--- a/libgnucash/engine/test/gtest-gnc-datetime.cpp
+++ b/libgnucash/engine/test/gtest-gnc-datetime.cpp
@@ -340,7 +340,7 @@ TEST(gnc_datetime_constructors, test_struct_tm_constructor)
 
 TEST(gnc_datetime_constructors, test_gncdate_start_constructor)
 {
-    const ymd aymd = { 2017, 04, 20 };
+    const gnc_ymd aymd = { 2017, 04, 20 };
     GncDateTime atime(GncDate(aymd.year, aymd.month, aymd.day), DayPart::start);
     //Skipping timezone information as this can't be controlled.
     EXPECT_EQ(atime.format("%d-%m-%Y %H:%M:%S"), "20-04-2017 00:00:00");
@@ -358,8 +358,8 @@ TEST(gnc_datetime_constructors, test_gncdate_start_constructor)
  */
 TEST(gnc_datetime_constructors, test_gncdate_BST_transition)
 {
-    const ymd begins = {2018, 03, 25};
-    const ymd ends = {2018, 10, 28};
+    const gnc_ymd begins = {2018, 03, 25};
+    const gnc_ymd ends = {2018, 10, 28};
 #ifdef __MINGW32__
     TimeZoneProvider tzp{"GMT Standard Time"};
 #else
@@ -375,7 +375,7 @@ TEST(gnc_datetime_constructors, test_gncdate_BST_transition)
 
 TEST(gnc_datetime_constructors, test_gncdate_end_constructor)
 {
-    const ymd aymd = { 2046, 11, 06 };
+    const gnc_ymd aymd = { 2046, 11, 06 };
     GncDateTime atime(GncDate(aymd.year, aymd.month, aymd.day), DayPart::end);
     //Skipping timezone information as this can't be controlled.
     EXPECT_EQ(atime.format("%d-%m-%Y %H:%M:%S"), "06-11-2046 23:59:59");
@@ -486,11 +486,11 @@ TEST(gnc_datetime_constructors, test_gncdate_neutral_constructor)
     TimeZoneProvider tzp_la("America/Los_Angeles");
 #endif
     _set_tzp(tzp_la);
-    const ymd aymd = { 2017, 04, 20 };
+    const gnc_ymd aymd = { 2017, 04, 20 };
     GncDateTime atime(GncDate(aymd.year, aymd.month, aymd.day), DayPart::neutral);
     time64 date{1492685940};
     GncDateTime gncdt(date); /* 20 Apr 2017 10:59:00 Z */
-    /* The ymd constructor sets the time of day at 10:59:00 for
+    /* The gnc_ymd constructor sets the time of day at 10:59:00 for
      * timezones between UTC-10 and UTC+13. For other timezones the
      * time of day is adjusted to ensure a consistent date and the
      * adjustment invalidates the test, so skip it.
@@ -509,8 +509,8 @@ TEST(gnc_datetime_constructors, test_gncdate_neutral_constructor)
 
 TEST(gnc_datetime_constructors, test_neutral_across_timezones)
 {
-    const ymd begins = {2018, 03, 05};
-    const ymd ends = {2018, 03, 15};
+    const gnc_ymd begins = {2018, 03, 05};
+    const gnc_ymd ends = {2018, 03, 15};
     const time64 ten_days = 864000;
 #ifdef __MINGW32__
     TimeZoneProvider tzp_lon{"GMT Standard Time"};

commit e92e7d0b2e5c014c499a78cd61bce8d5fdb03ad0
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 9 14:32:52 2023 -0800

    Add the Info.plist created in 1a906b00a to the dist.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d783a8713..a9074bb31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -851,7 +851,7 @@ set_local_dist(toplvl_DIST ${toplvl_DIST_local})
 
 set(ALL_DIST ${bindings_DIST} ${borrowed_DIST} ${cmake_DIST} ${common_DIST} ${data_DIST}
     ${doc_DIST} ${gnucash_DIST} ${libgnucash_DIST} ${packaging_DIST}
-    ${po_DIST} ${test_templates_DIST} ${toplvl_DIST} ${util_DIST})
+    ${po_DIST} ${test_templates_DIST} ${toplvl_DIST} ${util_DIST} Info.plist)
 
 
 if (BUILDING_FROM_VCS)



Summary of changes:
 CMakeLists.txt                                |  2 +-
 libgnucash/engine/gnc-datetime.cpp            |  6 +++---
 libgnucash/engine/gnc-datetime.hpp            |  8 ++++----
 libgnucash/engine/test/gtest-gnc-datetime.cpp | 16 ++++++++--------
 4 files changed, 16 insertions(+), 16 deletions(-)



More information about the gnucash-changes mailing list