Remove unused and unread variables reported by cppcheck#3
Open
rcorsi wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Here is a command line to see the already reported unused variables. I'm using cppcheck 1.19 on Ubuntu 26.04 I was digging a little more and found a few unreadVariables too. I'll update the PR to include these too. |
Found with cppcheck 1.19 on Ubuntu 26.04
hathaway3
added a commit
to hathaway3/DriveWire
that referenced
this pull request
Jun 15, 2026
open_remote_stream stripped the port from the Host header, which is an RFC 7230 violation that some HTTP servers reject or misroute. It also returned None on any non-2xx response without logging, making a 404/400 from the remote sector server indistinguishable from an unreachable host. Include the non-default port in the Host header, and log the actual status line on non-2xx so remote-drive failures (defect DrPitre#2) and clone failures (defect DrPitre#3) are diagnosable from the on-device system log. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hathaway3
added a commit
to hathaway3/DriveWire
that referenced
this pull request
Jun 15, 2026
…able data Adds a level-2 log line when read_sector opens the socket (HTTP 2xx) but reads fewer than the expected bytes, recording read_bytes/expected. This pinpoints whether an on-device failure is a 404, an exception, a 0-byte read, or a truncated read — needed to confirm the readinto-vs-recv lead for defects DrPitre#2 and DrPitre#3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hathaway3
added a commit
to hathaway3/DriveWire
that referenced
this pull request
Jun 15, 2026
…tre#2) The raw lwIP socket's readinto(memoryview[pos:]) did not deliver the HTTP response body on the Pico, so every remote sector read returned no data and the CoCo saw I/O errors — even though the server returns a correct 200 + 2048 raw bytes (confirmed via curl). The remote file-listing path, which works on-device, reads with recv(); the broken sector/clone paths used readinto(). Switch read_sector to recv(), capped to the bytes still needed for the current sector so it never crosses a boundary. Adds a reassembly test that feeds the body in 100-byte chunks straddling sector boundaries and verifies correct per-sector reconstruction. Toward defect DrPitre#2; clone (DrPitre#3) shares the same readinto pattern and is addressed separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hathaway3
added a commit
to hathaway3/DriveWire
that referenced
this pull request
Jun 15, 2026
DrPitre#3) Same root cause as DrPitre#2: the clone download loop filled its 4KB buffer with sock.readinto(view[pos:to_read]), which did not deliver the body on-device, so cloning failed. Switch to recv() capped to the bytes still needed for the current block, matching read_sector and the working file-listing paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hathaway3
added a commit
to hathaway3/DriveWire
that referenced
this pull request
Jun 15, 2026
…DrPitre#3 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hathaway3
added a commit
to hathaway3/DriveWire
that referenced
this pull request
Jun 15, 2026
Move DrPitre#1/DrPitre#5/DrPitre#6/DrPitre#7/#8/#9/#10/#11/#12 and F2 to Fixed with commit refs, note DrPitre#2/DrPitre#3 pending on-device verification, and record why DrPitre#4 (server listen mode) and feature gaps F1/F3/F5 are deferred to an on-device pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found these unused variables by using the cppcheck tool.