-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/vector: reading files with 'struct Map_info*' objects is technically not const #2894
lib/vector: reading files with 'struct Map_info*' objects is technically not const #2894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine. Fixing of those two functions in read.c should fix failing tests.
Co-authored-by: Māris Nartišs <[email protected]>
Re: even only reading file modifies the file object. I mentioned this issue in #2809 (comment) relating a similar problem reading raster files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good for me. Lets merge and move on.
…lly not const (OSGeo#2894) The qualifier is removed from the API and code using it. Co-authored-by: Māris Nartišs <[email protected]>
Addressing -Wdeprecated-non-prototype compiler warnings and adding missing prototypes in
lib/vector/Vlib/read.c
, reveals API errors in lib functions passingstruct Map_info *
as const. Reading vector files does in fact modify the Map_info struct, therefore theconst
qualifier is not technically correct. Correcting this API in lib cascades through quite a few files, but functionally this doesn't change anything.Alternative to this may be to separate the file reading variables to a separate "read object", but that will modify the API in a very drastic way and would be anything but trivial.