n-exch in log::log definition

11 views
Skip to first unread message

Nate Bargmann

unread,
May 13, 2012, 8:42:58 AM5/13/12
to so2...@googlegroups.com
I am studying the so2sdr source and am a bit puzzled about the use of
n_exch versus nExchange in the log::log constructor. Lines 33 to 36 of
log.cpp (so2sdr V 1.2.0) assign the value of n_exch to nExchange and
then compare it to a defined cpp constant of MAX_EXCH_FIELDS. All well
and good.

I'm puzzled as to why the code then creates the prefill array of bools
using n_exch rather than nExchange? It's probably harmless, but it
seems as though nExchange should be used here if for no other reason
than consistency.

Finally, since n_exch is not assigned to in the constructo, it seems
as though it could be declared a const. If nothing else, it could
probably be passed as a reference rather than by value.

What do you think?

73, de Nate >>

--

"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us

R. Torsten Clay

unread,
May 13, 2012, 11:57:53 AM5/13/12
to so2...@googlegroups.com
On Sun, May 13, 2012 at 12:42 PM, Nate Bargmann <n0...@n0nb.us> wrote:
I am studying the so2sdr source and am a bit puzzled about the use of
n_exch versus nExchange in the log::log constructor.  Lines 33 to 36 of
log.cpp (so2sdr V 1.2.0) assign the value of n_exch to nExchange and
then compare it to a defined cpp constant of MAX_EXCH_FIELDS.  All well
and good.

I'm puzzled as to why the code then creates the prefill array of bools
using n_exch rather than nExchange?  It's probably harmless, but it
seems as though nExchange should be used here if for no other reason
than consistency.


No reason- nExchange would be more consistent
 
Finally, since n_exch is not assigned to in the constructo, it seems
as though it could be declared a const.  If nothing else, it could
probably be passed as a reference rather than by value.


Yes

I uploaded 1.2.1. Some bug fixes, but it also has improvements calculating sunrise/set times and beam headings.

I will make a github repository for the development versions.

Tor
N4OGW

 
Reply all
Reply to author
Forward
0 new messages