Skip to content

quieten compiler warnings - #890

Open
ourairquality wants to merge 1 commit into
rtklibexplorer:mainfrom
ourairquality:comp-warns-quieten
Open

quieten compiler warnings#890
ourairquality wants to merge 1 commit into
rtklibexplorer:mainfrom
ourairquality:comp-warns-quieten

Conversation

@ourairquality

Copy link
Copy Markdown

Building with Visual Studio, MSC, generated a lot of warnings that I had not seen with BCC. Significant issues were split out and this is the remainder of the changes to quieten them. Most are harmless expected coercion losses, but there was some odd code reworked.

Explicit type coercion.

@rtklibexplorer

Copy link
Copy Markdown
Owner

AI review flagged a couple of possible issues. Can you check them?

  1. rtksvrostat() (src/rtksvr.c): the SNR type change from int to double left a stray +0.5 behind from the old round-to-nearest-int pattern ((int)(SNR+0.5) → SNR+0.5). Now every displayed SNR is biased +0.5 dB-Hz. Should just be snr[i][j] = svr->obs[rcv][0].data[i].SNR[j];.
  2. writeserial()/writeseribuff() (src/stream.c): writeserial()'s buffer param is now const uint8_t *buff, but on the WIN32 path it passes that into writeseribuff(), which is still non-const. Reintroduces a discarded-qualifiers warning on Windows builds — writeseribuff should get the same const treatment.

Misc type coercion issues. Many related to the change of the obs_t SNR
from an int to a float that generate warnings with MSC.

rtksvrostat: change the SNR output argument from int to double,
and rework the callers. The obs_t SNR is now a float rather than an
integer.

str2time: The guard for the width was wrong. Change the start and width
arguments to be size_t to help avoid compiler warnings.

stream: deal with differences between unix-style and windows for
sockets and devices.
@ourairquality

Copy link
Copy Markdown
Author

Good points, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants