Skip to content

Commit

Permalink
Merge Richard Cohen's 'cleanup' into master.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Jan 24, 2023
2 parents 705ad0f + 6927535 commit f6919e6
Show file tree
Hide file tree
Showing 37 changed files with 36 additions and 325 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -627,7 +627,7 @@ if (XCODE_VERSION)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${LIBDIR_BUILD}/gnucash)
endif()

# For binarines
# For binaries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (XCODE_VERSION)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
Expand Down
13 changes: 0 additions & 13 deletions bindings/business-core.i
Expand Up @@ -18,19 +18,6 @@
* *
\********************************************************************/

#if defined(SWIGGUILE)
%{
/* Disable -Waddress. GCC 4.2 warns (and fails to compile with -Werror) when
* passing the address of a guid on the stack to QOF_BOOK_LOOKUP_ENTITY via
* gncInvoiceLookup and friends. When the macro gets inlined, the compiler
* emits a warning that the guid null pointer test is always true.
*/
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
# pragma GCC diagnostic warning "-Waddress"
#endif
%}
#endif

%rename(gncOwnerReturnGUID) gncOwnerRetGUID;

%inline %{
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/dialog-totd.c
Expand Up @@ -103,7 +103,7 @@ gnc_new_tip_number (TotdDialog *totd_dialog, gint offset)
*/
if (tip_list[current_tip_number])
tip_components = g_strsplit(tip_list[current_tip_number], "|", 0);
/* If the tip is empty, g_strisplit will return an empty list. This
/* If the tip is empty, g_strsplit will return an empty list. This
* shouldn't normally happen, but make sure we don't crash just in
* case */
if (tip_components == NULL)
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/gnc-date-edit.c
Expand Up @@ -1057,7 +1057,7 @@ gnc_date_edit_get_date_internal (GNCDateEdit *gde)

if (!date_was_valid)
{
/* Hm... no valid date. What should we do not? As a hacky workaround we
/* Hm... no valid date. What should we do now? As a hacky workaround we
revert to today's date. Alternatively we can return some value that
signals that we don't get a valid date, but all callers of this
function will have to check this. Alas, I'm too lazy to do this here. */
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/gnc-main-window.cpp
Expand Up @@ -1331,7 +1331,7 @@ gnc_main_window_quit(GncMainWindow *window)
GList *w, *next;

/* This is not a typical list iteration. There is a possibility
* that the window maybe removed from the active_windows list so
* that the window may be removed from the active_windows list so
* we have to cache the 'next' pointer before executing any code
* in the loop. */
for (w = active_windows; w; w = next)
Expand Down
3 changes: 3 additions & 0 deletions gnucash/gnome/assistant-hierarchy.cpp
Expand Up @@ -1431,6 +1431,9 @@ on_finish (GtkAssistant *gtkassistant,
ENTER (" ");
com = gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT(data->currency_selector));

if (!gnc_using_equity_type_opening_balance_account (gnc_get_current_book()))
gnc_set_use_equity_type_opening_balance_account (gnc_get_current_book());

if (data->our_account_tree)
{
gnc_account_foreach_descendant (data->our_account_tree,
Expand Down
9 changes: 0 additions & 9 deletions gnucash/gnome/business-urls.c
Expand Up @@ -45,15 +45,6 @@
#include "dialog-invoice.h"
#include "dialog-job.h"

/* Disable -Waddress. GCC 4.2 warns (and fails to compile with -Werror) when
* passing the address of a guid on the stack to QOF_BOOK_LOOKUP_ENTITY via
* gncInvoiceLookup and friends. When the macro gets inlined, the compiler
* emits a warning that the guid null pointer test is always true.
*/
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
# pragma GCC diagnostic warning "-Waddress"
#endif

#define HANDLE_TYPE(URL_TYPE_STR,OBJ_TYPE) { \
QofBook *book; \
GncGUID guid; \
Expand Down
9 changes: 0 additions & 9 deletions gnucash/gnome/dialog-invoice.c
Expand Up @@ -80,15 +80,6 @@
#include "dialog-transfer.h"
#include "gnc-uri-utils.h"

/* Disable -Waddress. GCC 4.2 warns (and fails to compile with -Werror) when
* passing the address of a guid on the stack to QOF_BOOK_LOOKUP_ENTITY via
* gncInvoiceLookup and friends. When the macro gets inlined, the compiler
* emits a warning that the guid null pointer test is always true.
*/
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
# pragma GCC diagnostic warning "-Waddress"
#endif

#define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice"
#define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice"

Expand Down
4 changes: 4 additions & 0 deletions gnucash/gnome/gnc-plugin-page-register.c
Expand Up @@ -527,6 +527,10 @@ gnc_plugin_page_register_new_common (GNCLedgerDisplay* ledger)
if (!gnc_features_check_used (gnc_get_current_book(), GNC_FEATURE_REG_SORT_FILTER))
gnc_features_set_used (gnc_get_current_book(), GNC_FEATURE_REG_SORT_FILTER);

// added for version 4.14 onwards
if (!gnc_using_equity_type_opening_balance_account (gnc_get_current_book()))
gnc_set_use_equity_type_opening_balance_account (gnc_get_current_book());

/* Is there an existing page? */
gsr = gnc_ledger_display_get_user_data (ledger);
if (gsr)
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnucash.cpp
Expand Up @@ -280,7 +280,7 @@ Gnucash::Gnucash::start ([[maybe_unused]] int argc, [[maybe_unused]] char **argv
Gnucash::CoreApp::start();

/* Now the module files are looked up, which might cause some library
initialization to be run, hence gtk must be initialized b*eforehand. */
initialization to be run, hence gtk must be initialized beforehand. */
gnc_module_system_init();

gnc_gui_init();
Expand Down
4 changes: 1 addition & 3 deletions gnucash/import-export/log-replay/gnc-log-replay.c
Expand Up @@ -109,9 +109,7 @@ static char *olds;
returning a 0 length valid string between two consecutive ocurence of delim.
It will also return a 0 length string instead of NULL when it reaches the end of s
*/
static char * my_strtok (s, delim)
char *s;
const char *delim;
static char * my_strtok (char *s, const char *delim)
{
char *token;
/*DEBUG("strtok(): Start...");*/
Expand Down
2 changes: 1 addition & 1 deletion gnucash/import-export/qif-imp/assistant-qif-import.c
Expand Up @@ -2119,7 +2119,7 @@ gnc_ui_qif_import_account_prepare (GtkAssistant *assistant, gpointer user_data)
if (wind->ask_date_format && wind->date_format)
qif_import_reparse_dates (wind);

/* make sure there is a file selected, may of come back */
/* make sure there is a file selected, may have come back */
if (wind->selected_file == SCM_BOOL_F)
{
GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
Expand Down
6 changes: 6 additions & 0 deletions gnucash/report/commodity-utilities.scm
Expand Up @@ -229,6 +229,12 @@
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
(all-splits (get-all-splits currency-accounts end-date))
(interesting-splits (sort (filter interesting-split? all-splits) date<?))
(commodity-list (sort-and-delete-duplicates
commodity-list
(lambda (a b)
(gnc:string-locale<? (gnc-commodity-get-unique-name a)
(gnc-commodity-get-unique-name b)))
gnc-commodity-equal))
(work-to-do (length commodity-list)))
(map
(lambda (c work-done)
Expand Down
11 changes: 8 additions & 3 deletions gnucash/report/reports/standard/balsheet-pnl.scm
Expand Up @@ -738,12 +738,17 @@ also show overall period profit & loss."))

;; generate an exchange-fn for date, and cache its result.
(get-date-exchange-fn
(let ((h (make-hash-table)))
(let ((h (make-hash-table))
(commodities (sort-and-delete-duplicates
(map xaccAccountGetCommodity accounts)
(lambda (a b)
(gnc:string-locale<? (gnc-commodity-get-unique-name a)
(gnc-commodity-get-unique-name b)))
gnc-commodity-equal)))
(lambda (date)
(or (hashv-ref h date)
(let ((exchangefn (gnc:case-exchange-time-fn
price-source common-currency
(map xaccAccountGetCommodity accounts)
price-source common-currency commodities
date #f #f)))
(hashv-set! h date exchangefn)
exchangefn)))))
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/app-utils/QuickFill.h
Expand Up @@ -75,7 +75,7 @@ void gnc_quickfill_purge (QuickFill *qf);
*/
const char * gnc_quickfill_string (QuickFill *qf);

/** Return the subnode of the tree whose strings all hold 'wc' as
/** Return the subnode of the tree whose strings all hold 'c' as
* the next letter. That is, if 'qf' holds all strings starting
* with the letter 'a', and we ask for the letter 'b', then this
* routine will return the node holding all strings that start
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
Expand Up @@ -553,7 +553,7 @@ GncDbiSqlConnection::quote_string (const std::string& unquoted_str)


/** Check if the dbi connection is valid. If not attempt to re-establish it
* Returns TRUE is there is a valid connection in the end or FALSE otherwise
* Returns TRUE if there is a valid connection in the end or FALSE otherwise
*/
bool
GncDbiSqlConnection::verify () noexcept
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/backend/dbi/gnc-dbisqlconnection.hpp
Expand Up @@ -76,7 +76,7 @@ class GncDbiSqlConnection : public GncSqlConnection
set_error(ERR_BACKEND_NO_ERR, 0, false);
}
/** Check if the dbi connection is valid. If not attempt to re-establish it
* Returns TRUE is there is a valid connection in the end or FALSE otherwise
* Returns TRUE if there is a valid connection in the end or FALSE otherwise
*/
bool verify() noexcept override;
bool retry_connection(const char* msg) noexcept override;
Expand Down
2 changes: 0 additions & 2 deletions libgnucash/core-utils/CMakeLists.txt
Expand Up @@ -11,7 +11,6 @@ set (core_utils_SOURCES
gnc-filepath-utils.cpp
gnc-gkeyfile-utils.c
gnc-glib-utils.c
gnc-jalali.c
gnc-locale-utils.c
gnc-locale-utils.cpp
gnc-path.c
Expand All @@ -29,7 +28,6 @@ set(core_utils_noinst_HEADERS
gnc-filepath-utils.h
gnc-gkeyfile-utils.h
gnc-glib-utils.h
gnc-jalali.h
gnc-locale-utils.h
gnc-locale-utils.hpp
gnc-path.h
Expand Down

0 comments on commit f6919e6

Please sign in to comment.