Fix const assignment warnings#188
Merged
Merged
Conversation
More focused removal of blank between subfield and data
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate compiler warnings about assigning/modifying const data by tightening pointer constness and avoiding in-place string edits across a few parsing/caching paths.
Changes:
- Reordered includes to keep
config.hfirst in a test file. - Switched a MARC SAX test away from
xmlSAXUserParseMemoryto a push-parser context to avoid const-related warnings. - Reworked several string-splitting paths (SOLR scan term splitting, diagnostic URI parsing, MARC line subfield handling) to avoid modifying source buffers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_tpath.c | Moves includes below config.h to match typical include ordering. |
| test/test_marc_read_sax.c | Replaces in-memory SAX parsing with a libxml2 push parser context. |
| src/zoom-record-cache.c | Refactors diagnostic URI parsing to avoid in-place edits (but currently introduces a crash/logic bug). |
| src/solr.c | Avoids mutating facet term strings by using length-bounded duplication. |
| src/retrieval.c | Updates temporary pointers to const char * where appropriate. |
| src/marc_read_line.c | Attempts to avoid const warnings while removing a blank after subfield markers (but currently corrupts output). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.