lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master 0b00d05 1/4: Use C++17 static inline vari


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master 0b00d05 1/4: Use C++17 static inline variable initialization
Date: Tue, 18 Sep 2018 02:56:34 +0200

On Mon, 17 Sep 2018 20:48:32 -0400 (EDT) Greg Chicares <address@hidden> wrote:

GC> branch: master
GC> commit 0b00d058da9c560dda326f57c0f86ece40d2080b
GC> Author: Gregory W. Chicares <address@hidden>
GC> Commit: Gregory W. Chicares <address@hidden>
GC> 
GC>     Use C++17 static inline variable initialization
GC>     
GC>     Added a ctor for one class in order to make this work.
GC> ---
GC>  ledger_pdf_generator_wx.cpp | 35 ++++++++++++++++++-----------------
GC>  1 file changed, 18 insertions(+), 17 deletions(-)
GC> 
GC> diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
GC> index 2810f29..f96af77 100644
GC> --- a/ledger_pdf_generator_wx.cpp
GC> +++ b/ledger_pdf_generator_wx.cpp
GC> @@ -482,14 +482,20 @@ class html_cell_for_pdf_output : public wxHtmlCell
GC>      class pdf_context
GC>      {
GC>        public:
GC> +        pdf_context()
GC> +            :ledger_           (nullptr)
GC> +            ,writer_           (nullptr)
GC> +            ,interpolate_html_ (nullptr)
GC> +            {}

 Shouldn't {} be used above?

GC> -    static pdf_context pdf_context_for_html_output;
GC> +    static inline pdf_context pdf_context_for_html_output = {};
[...]
GC> +    // "-1" is invalid; use start_numbering() to change it.
GC> +    static inline int last_page_number_ = {-1};
GC> +    int               this_page_number_ = {0};
GC> +    int               extra_pages_      = {0};
GC>  };

 And didn't we also decide to standardize on "extra_pages_{0}", i.e. should
the equal signs be really used here?

 Sorry for these trivial comments, but after spending so much time on
replacing parenthesis with braces I'd like to avoid having to do it again
in the observable future...

VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]