Skip to content

Use pointer to const for strings that aren't/shouldn't be modified#6

Closed
criptych wants to merge 73 commits into
yaml:masterfrom
criptych:fix/const-char-pointer
Closed

Use pointer to const for strings that aren't/shouldn't be modified#6
criptych wants to merge 73 commits into
yaml:masterfrom
criptych:fix/const-char-pointer

Conversation

@criptych
Copy link
Copy Markdown
Contributor

A handful of functions that take char* (actually yaml_char_t*) arguments don't actually modify the string passed (they make an internal copy).

This patch adds a const qualifier to these arguments so the functions can be used safely with e.g. string constants or const* return values without unnecessary warnings and/or casts.

xitology added 30 commits May 26, 2006 21:46
Add basic reader fields to the parser structure.

Start implementing basic parser functions.
Reader is mostly done (though untested).
Add YAML_DECLARE to the API declarations (Thanks to Peter Murphy for suggestion).
Add a basic description of all tokens produced by the scanner.
xitology and others added 20 commits December 30, 2008 03:42
…potential simple key (yaml#156, thank to ppelletier(at)oblong(dot)com).
https://bitbucket.org/xi/libyaml/issue/10/wrapped-strings-cause-assert-failure

Commenting out the assert makes the scanner do the right thing and
results in just a simple parse failure.
@jcfr
Copy link
Copy Markdown
Contributor

jcfr commented Dec 6, 2017

Generally speaking, I think const correctness makes sense.

That said, this Pr should be rebased before we can move forward with the integration.

@perlpunk
Copy link
Copy Markdown
Member

I rebased this PR and created #140

@perlpunk
Copy link
Copy Markdown
Member

perlpunk commented Jun 6, 2019

thanks, merged #140!

@perlpunk perlpunk closed this Jun 6, 2019
@criptych criptych deleted the fix/const-char-pointer branch August 27, 2024 15:26
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.

7 participants