|
From: | Fred Wright |
Subject: | [gpsd-dev] Weirdness in gpsrinex |
Date: | Wed, 20 Mar 2019 12:35:45 -0700 (PDT) |
User-agent: | Alpine 2.21 (LRH 202 2017-01-01) |
I was looking into some warnings in gpsrinex, but ran across something where it's really unclear what the intent was. Both warnings relate to the obs_cnt array defined in lines 138-143.
One warning is just for the missing initializer braces. That one's easy - it should have two levels of brace rather than one (one for the array and one for the struct).
The weird one concerns the comparison in line 210 against the obs_cnts element. It looks like the obs_codes enum should be the type of the *index* to the obs_cnts array, but it shouldn't be the type of its *value*, which most likely should be unsigned int. Meanwhile, there's a separate unindexed count element which doesn't seem to be used anywhere.
The obvious fix is to fix the type of obs_cnts and remove the unused count element, but I'm not sure if there's something else going on that I'm missing.
Fred Wright
[Prev in Thread] | Current Thread | [Next in Thread] |