diff options
author | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2007-01-08 18:33:55 +0000 |
---|---|---|
committer | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2007-01-08 18:33:55 +0000 |
commit | 9e9f969fe14268a58a6f09b7c7e5032e5a5a2a80 (patch) | |
tree | 9ef0415a94ff177bb4d21618166dc660d09c310c /src/api.c | |
parent | 183993927f9c928b5b60f8c9b8f9f199951a9b6b (diff) | |
download | libyaml-9e9f969fe14268a58a6f09b7c7e5032e5a5a2a80.tar.gz |
Eliminate some warnings and add more doxygen definitions.
git-svn-id: http://svn.pyyaml.org/libyaml/trunk@243 18f92427-320e-0410-9341-c67f048884a3
Diffstat (limited to 'src/api.c')
-rw-r--r-- | src/api.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1118,9 +1118,11 @@ yaml_document_delete(yaml_document_t *document) { struct { yaml_error_type_t error; - } context = { YAML_NO_ERROR }; + } context; yaml_tag_directive_t *tag_directive; + context.error = YAML_NO_ERROR; /* Eliminate a compliler warning. */ + assert(document); /* Non-NULL document object is expected. */ while (!STACK_EMPTY(&context, document->nodes)) { @@ -1159,12 +1161,12 @@ yaml_document_delete(yaml_document_t *document) */ YAML_DECLARE(yaml_node_t *) -yaml_document_get_node(yaml_document_t *document, int node) +yaml_document_get_node(yaml_document_t *document, int index) { assert(document); /* Non-NULL document object is expected. */ - if (node > 0 && document->nodes.start + node <= document->nodes.top) { - return document->nodes.start + node - 1; + if (index > 0 && document->nodes.start + index <= document->nodes.top) { + return document->nodes.start + index - 1; } return NULL; } @@ -1205,7 +1207,7 @@ yaml_document_add_scalar(yaml_document_t *document, assert(value); /* Non-NULL value is expected. */ if (!tag) { - tag = YAML_DEFAULT_SCALAR_TAG; + tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG; } if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; @@ -1257,7 +1259,7 @@ yaml_document_add_sequence(yaml_document_t *document, assert(document); /* Non-NULL document object is expected. */ if (!tag) { - tag = YAML_DEFAULT_SEQUENCE_TAG; + tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG; } if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; @@ -1302,7 +1304,7 @@ yaml_document_add_mapping(yaml_document_t *document, assert(document); /* Non-NULL document object is expected. */ if (!tag) { - tag = YAML_DEFAULT_MAPPING_TAG; + tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG; } if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; |