Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libyaml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
libraries
libyaml
Commits
6727331451f4
Commit
6727331451f4
authored
9 years ago
by
criptych
Browse files
Options
Downloads
Patches
Plain Diff
Use pointer to const for strings that aren't/shouldn't be modified
parent
343836e99b74
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/yaml.h
+8
-8
8 additions, 8 deletions
include/yaml.h
src/api.c
+11
-11
11 additions, 11 deletions
src/api.c
with
19 additions
and
19 deletions
include/yaml.h
+
8
−
8
View file @
67273314
...
@@ -552,7 +552,7 @@
...
@@ -552,7 +552,7 @@
*/
*/
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_alias_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
);
yaml_alias_event_initialize
(
yaml_event_t
*
event
,
const
yaml_char_t
*
anchor
);
/**
/**
* Create a SCALAR event.
* Create a SCALAR event.
...
@@ -578,8 +578,8 @@
...
@@ -578,8 +578,8 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_scalar_event_initialize
(
yaml_event_t
*
event
,
yaml_scalar_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
,
yaml_char_t
*
tag
,
const
yaml_char_t
*
anchor
,
const
yaml_char_t
*
tag
,
yaml_char_t
*
value
,
int
length
,
const
yaml_char_t
*
value
,
int
length
,
int
plain_implicit
,
int
quoted_implicit
,
int
plain_implicit
,
int
quoted_implicit
,
yaml_scalar_style_t
style
);
yaml_scalar_style_t
style
);
...
@@ -601,7 +601,7 @@
...
@@ -601,7 +601,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_sequence_start_event_initialize
(
yaml_event_t
*
event
,
yaml_sequence_start_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
,
yaml_char_t
*
tag
,
int
implicit
,
const
yaml_char_t
*
anchor
,
const
yaml_char_t
*
tag
,
int
implicit
,
yaml_sequence_style_t
style
);
yaml_sequence_style_t
style
);
/**
/**
...
@@ -633,7 +633,7 @@
...
@@ -633,7 +633,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_mapping_start_event_initialize
(
yaml_event_t
*
event
,
yaml_mapping_start_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
,
yaml_char_t
*
tag
,
int
implicit
,
const
yaml_char_t
*
anchor
,
const
yaml_char_t
*
tag
,
int
implicit
,
yaml_mapping_style_t
style
);
yaml_mapping_style_t
style
);
/**
/**
...
@@ -896,7 +896,7 @@
...
@@ -896,7 +896,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_document_add_scalar
(
yaml_document_t
*
document
,
yaml_document_add_scalar
(
yaml_document_t
*
document
,
yaml_char_t
*
tag
,
yaml_char_t
*
value
,
int
length
,
const
yaml_char_t
*
tag
,
const
yaml_char_t
*
value
,
int
length
,
yaml_scalar_style_t
style
);
yaml_scalar_style_t
style
);
/**
/**
...
@@ -913,7 +913,7 @@
...
@@ -913,7 +913,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_document_add_sequence
(
yaml_document_t
*
document
,
yaml_document_add_sequence
(
yaml_document_t
*
document
,
yaml_char_t
*
tag
,
yaml_sequence_style_t
style
);
const
yaml_char_t
*
tag
,
yaml_sequence_style_t
style
);
/**
/**
* Create a MAPPING node and attach it to the document.
* Create a MAPPING node and attach it to the document.
...
@@ -929,7 +929,7 @@
...
@@ -929,7 +929,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_document_add_mapping
(
yaml_document_t
*
document
,
yaml_document_add_mapping
(
yaml_document_t
*
document
,
yaml_char_t
*
tag
,
yaml_mapping_style_t
style
);
const
yaml_char_t
*
tag
,
yaml_mapping_style_t
style
);
/**
/**
* Add an item to a SEQUENCE node.
* Add an item to a SEQUENCE node.
...
...
This diff is collapsed.
Click to expand it.
src/api.c
+
11
−
11
View file @
67273314
...
@@ -623,5 +623,5 @@
...
@@ -623,5 +623,5 @@
*/
*/
static
int
static
int
yaml_check_utf8
(
yaml_char_t
*
start
,
size_t
length
)
yaml_check_utf8
(
const
yaml_char_t
*
start
,
size_t
length
)
{
{
...
@@ -627,6 +627,6 @@
...
@@ -627,6 +627,6 @@
{
{
yaml_char_t
*
end
=
start
+
length
;
const
yaml_char_t
*
end
=
start
+
length
;
yaml_char_t
*
pointer
=
start
;
const
yaml_char_t
*
pointer
=
start
;
while
(
pointer
<
end
)
{
while
(
pointer
<
end
)
{
unsigned
char
octet
;
unsigned
char
octet
;
...
@@ -794,7 +794,7 @@
...
@@ -794,7 +794,7 @@
*/
*/
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_alias_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
)
yaml_alias_event_initialize
(
yaml_event_t
*
event
,
const
yaml_char_t
*
anchor
)
{
{
yaml_mark_t
mark
=
{
0
,
0
,
0
};
yaml_mark_t
mark
=
{
0
,
0
,
0
};
yaml_char_t
*
anchor_copy
=
NULL
;
yaml_char_t
*
anchor_copy
=
NULL
;
...
@@ -819,8 +819,8 @@
...
@@ -819,8 +819,8 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_scalar_event_initialize
(
yaml_event_t
*
event
,
yaml_scalar_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
,
yaml_char_t
*
tag
,
const
yaml_char_t
*
anchor
,
const
yaml_char_t
*
tag
,
yaml_char_t
*
value
,
int
length
,
const
yaml_char_t
*
value
,
int
length
,
int
plain_implicit
,
int
quoted_implicit
,
int
plain_implicit
,
int
quoted_implicit
,
yaml_scalar_style_t
style
)
yaml_scalar_style_t
style
)
{
{
...
@@ -873,7 +873,7 @@
...
@@ -873,7 +873,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_sequence_start_event_initialize
(
yaml_event_t
*
event
,
yaml_sequence_start_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
,
yaml_char_t
*
tag
,
int
implicit
,
const
yaml_char_t
*
anchor
,
const
yaml_char_t
*
tag
,
int
implicit
,
yaml_sequence_style_t
style
)
yaml_sequence_style_t
style
)
{
{
yaml_mark_t
mark
=
{
0
,
0
,
0
};
yaml_mark_t
mark
=
{
0
,
0
,
0
};
...
@@ -928,7 +928,7 @@
...
@@ -928,7 +928,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_mapping_start_event_initialize
(
yaml_event_t
*
event
,
yaml_mapping_start_event_initialize
(
yaml_event_t
*
event
,
yaml_char_t
*
anchor
,
yaml_char_t
*
tag
,
int
implicit
,
const
yaml_char_t
*
anchor
,
const
yaml_char_t
*
tag
,
int
implicit
,
yaml_mapping_style_t
style
)
yaml_mapping_style_t
style
)
{
{
yaml_mark_t
mark
=
{
0
,
0
,
0
};
yaml_mark_t
mark
=
{
0
,
0
,
0
};
...
@@ -1193,7 +1193,7 @@
...
@@ -1193,7 +1193,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_document_add_scalar
(
yaml_document_t
*
document
,
yaml_document_add_scalar
(
yaml_document_t
*
document
,
yaml_char_t
*
tag
,
yaml_char_t
*
value
,
int
length
,
const
yaml_char_t
*
tag
,
const
yaml_char_t
*
value
,
int
length
,
yaml_scalar_style_t
style
)
yaml_scalar_style_t
style
)
{
{
struct
{
struct
{
...
@@ -1243,7 +1243,7 @@
...
@@ -1243,7 +1243,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_document_add_sequence
(
yaml_document_t
*
document
,
yaml_document_add_sequence
(
yaml_document_t
*
document
,
yaml_char_t
*
tag
,
yaml_sequence_style_t
style
)
const
yaml_char_t
*
tag
,
yaml_sequence_style_t
style
)
{
{
struct
{
struct
{
yaml_error_type_t
error
;
yaml_error_type_t
error
;
...
@@ -1288,7 +1288,7 @@
...
@@ -1288,7 +1288,7 @@
YAML_DECLARE
(
int
)
YAML_DECLARE
(
int
)
yaml_document_add_mapping
(
yaml_document_t
*
document
,
yaml_document_add_mapping
(
yaml_document_t
*
document
,
yaml_char_t
*
tag
,
yaml_mapping_style_t
style
)
const
yaml_char_t
*
tag
,
yaml_mapping_style_t
style
)
{
{
struct
{
struct
{
yaml_error_type_t
error
;
yaml_error_type_t
error
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment