From a77488bab4732c30044b04e97d13707e03825bdf Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 10 Sep 2012 19:14:49 +0100 Subject: unsigned long -> uint32_t, signed long and long -> int32_t, plus collateral fixes. Test suite does not pass --- src/core/attr.c | 8 ++++---- src/core/characterdata.c | 20 ++++++++++---------- src/core/characterdata.h | 12 ++++++------ src/core/element.c | 16 ++++++++-------- src/core/implementation.c | 2 +- src/core/namednodemap.c | 4 ++-- src/core/namednodemap.h | 4 ++-- src/core/node.c | 6 +++--- src/core/nodelist.c | 8 ++++---- src/core/text.c | 4 ++-- src/core/text.h | 2 +- 11 files changed, 43 insertions(+), 43 deletions(-) (limited to 'src/core') diff --git a/src/core/attr.c b/src/core/attr.c index 9db04b6..d9e2b07 100644 --- a/src/core/attr.c +++ b/src/core/attr.c @@ -36,7 +36,7 @@ struct dom_attr { dom_attr_type type; /**< The type of this attribute */ union { - unsigned long lvalue; + uint32_t lvalue; unsigned short svalue; bool bvalue; } value; /**< The special type value of this attribute */ @@ -204,7 +204,7 @@ dom_attr_type dom_attr_get_type(dom_attr *a) * DOM_ATTR_WRONG_TYPE_ERR if the attribute node is not a integer * attribute */ -dom_exception dom_attr_get_integer(dom_attr *a, unsigned long *value) +dom_exception dom_attr_get_integer(dom_attr *a, uint32_t *value) { if (a->type != DOM_ATTR_INTEGER) return DOM_ATTR_WRONG_TYPE_ERR; @@ -223,7 +223,7 @@ dom_exception dom_attr_get_integer(dom_attr *a, unsigned long *value) * DOM_ATTR_WRONG_TYPE_ERR if the attribute node is not a integer * attribute */ -dom_exception dom_attr_set_integer(dom_attr *a, unsigned long value) +dom_exception dom_attr_set_integer(dom_attr *a, uint32_t value) { struct dom_document *doc; struct dom_node_internal *ele; @@ -507,7 +507,7 @@ dom_exception _dom_attr_get_value(struct dom_attr *attr, return err; } - /* No longer need textual representation */ + /* No int32_ter need textual representation */ dom_string_unref(tr); /* Finished with previous value */ diff --git a/src/core/characterdata.c b/src/core/characterdata.c index 0883444..c46a5c6 100644 --- a/src/core/characterdata.c +++ b/src/core/characterdata.c @@ -159,7 +159,7 @@ dom_exception _dom_characterdata_set_data(struct dom_characterdata *cdata, * \return DOM_NO_ERR. */ dom_exception _dom_characterdata_get_length(struct dom_characterdata *cdata, - unsigned long *length) + uint32_t *length) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; @@ -192,13 +192,13 @@ dom_exception _dom_characterdata_get_length(struct dom_characterdata *cdata, * this implementation; dom_strings are unbounded. */ dom_exception _dom_characterdata_substring_data( - struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, dom_string **data) + struct dom_characterdata *cdata, uint32_t offset, + uint32_t count, dom_string **data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; uint32_t len, end; - if ((signed long) offset < 0 || (signed long) count < 0) { + if ((int32_t) offset < 0 || (int32_t) count < 0) { return DOM_INDEX_SIZE_ERR; } @@ -273,7 +273,7 @@ dom_exception _dom_characterdata_append_data(struct dom_characterdata *cdata, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::cdata is readonly. */ dom_exception _dom_characterdata_insert_data(struct dom_characterdata *cdata, - unsigned long offset, dom_string *data) + uint32_t offset, dom_string *data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; dom_string *temp; @@ -286,7 +286,7 @@ dom_exception _dom_characterdata_insert_data(struct dom_characterdata *cdata, return DOM_NO_MODIFICATION_ALLOWED_ERR; } - if ((signed long) offset < 0) { + if ((int32_t) offset < 0) { return DOM_INDEX_SIZE_ERR; } @@ -335,7 +335,7 @@ dom_exception _dom_characterdata_insert_data(struct dom_characterdata *cdata, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::cdata is readonly. */ dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, - unsigned long offset, unsigned long count) + uint32_t offset, uint32_t count) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; dom_string *temp; @@ -349,7 +349,7 @@ dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, return DOM_NO_MODIFICATION_ALLOWED_ERR; } - if ((signed long) offset < 0 || (signed long) count < 0) { + if ((int32_t) offset < 0 || (int32_t) count < 0) { return DOM_INDEX_SIZE_ERR; } @@ -404,7 +404,7 @@ dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::cdata is readonly. */ dom_exception _dom_characterdata_replace_data(struct dom_characterdata *cdata, - unsigned long offset, unsigned long count, + uint32_t offset, uint32_t count, dom_string *data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; @@ -418,7 +418,7 @@ dom_exception _dom_characterdata_replace_data(struct dom_characterdata *cdata, return DOM_NO_MODIFICATION_ALLOWED_ERR; } - if ((signed long) offset < 0 || (signed long) count < 0) { + if ((int32_t) offset < 0 || (int32_t) count < 0) { return DOM_INDEX_SIZE_ERR; } diff --git a/src/core/characterdata.h b/src/core/characterdata.h index 23be9c9..0b0889c 100644 --- a/src/core/characterdata.h +++ b/src/core/characterdata.h @@ -34,18 +34,18 @@ dom_exception _dom_characterdata_get_data(struct dom_characterdata *cdata, dom_exception _dom_characterdata_set_data(struct dom_characterdata *cdata, dom_string *data); dom_exception _dom_characterdata_get_length(struct dom_characterdata *cdata, - unsigned long *length); + uint32_t *length); dom_exception _dom_characterdata_substring_data( - struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, dom_string **data); + struct dom_characterdata *cdata, uint32_t offset, + uint32_t count, dom_string **data); dom_exception _dom_characterdata_append_data(struct dom_characterdata *cdata, dom_string *data); dom_exception _dom_characterdata_insert_data(struct dom_characterdata *cdata, - unsigned long offset, dom_string *data); + uint32_t offset, dom_string *data); dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, - unsigned long offset, unsigned long count); + uint32_t offset, uint32_t count); dom_exception _dom_characterdata_replace_data(struct dom_characterdata *cdata, - unsigned long offset, unsigned long count, + uint32_t offset, uint32_t count, dom_string *data); dom_exception _dom_characterdata_get_text_content( dom_node_internal *node, diff --git a/src/core/element.c b/src/core/element.c index 8908968..df40eaf 100644 --- a/src/core/element.c +++ b/src/core/element.c @@ -485,7 +485,7 @@ static dom_exception _dom_element_set_id_attr(struct dom_element *element, /* The operation set for namednodemap */ static dom_exception attributes_get_length(void *priv, - unsigned long *length); + uint32_t *length); static dom_exception attributes_get_named_item(void *priv, dom_string *name, struct dom_node **node); static dom_exception attributes_set_named_item(void *priv, @@ -494,7 +494,7 @@ static dom_exception attributes_remove_named_item( void *priv, dom_string *name, struct dom_node **node); static dom_exception attributes_item(void *priv, - unsigned long index, struct dom_node **node); + uint32_t index, struct dom_node **node); static dom_exception attributes_get_named_item_ns( void *priv, dom_string *namespace, dom_string *localname, struct dom_node **node); @@ -739,7 +739,7 @@ dom_exception _dom_element_get_attribute_node(struct dom_element *element, * \param attr The attribute node to add * \param result Pointer to location to receive previous node * \return DOM_NO_ERR on success, - * DOM_WRONG_DOCUMENT_ERR if ::attr does not belong to the + * DOM_WRONG_DOCUMENT_ERR if ::attr does not beint32_t to the * same document as ::element, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::element is readonly, * DOM_INUSE_ATTRIBUTE_ERR if ::attr is already an attribute @@ -944,7 +944,7 @@ dom_exception _dom_element_get_attribute_node_ns(struct dom_element *element, * \param attr The attribute node to add * \param result Pointer to location to recieve previous node * \return DOM_NO_ERR on success, - * DOM_WRONG_DOCUMENT_ERR if ::attr does not belong to the + * DOM_WRONG_DOCUMENT_ERR if ::attr does not beint32_t to the * same document as ::element, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::element is readonly, * DOM_INUSE_ATTRIBUTE_ERR if ::attr is already an attribute @@ -1843,7 +1843,7 @@ dom_exception _dom_element_get_attr_node(struct dom_element *element, * \param attr The attribute node to add * \param result Pointer to location to receive previous node * \return DOM_NO_ERR on success, - * DOM_WRONG_DOCUMENT_ERR if ::attr does not belong to the + * DOM_WRONG_DOCUMENT_ERR if ::attr does not beint32_t to the * same document as ::element, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::element is readonly, * DOM_INUSE_ATTRIBUTE_ERR if ::attr is already an attribute @@ -1869,7 +1869,7 @@ dom_exception _dom_element_set_attr_node(struct dom_element *element, /** \todo validate name */ - /* Ensure element and attribute belong to the same document */ + /* Ensure element and attribute beint32_t to the same document */ if (e->owner != attr_node->owner) return DOM_WRONG_DOCUMENT_ERR; @@ -2226,7 +2226,7 @@ dom_exception _dom_element_get_id(struct dom_element *ele, dom_string **id) /* Implementation function for NamedNodeMap, see core/namednodemap.h for * details */ -dom_exception attributes_get_length(void *priv, unsigned long *length) +dom_exception attributes_get_length(void *priv, uint32_t *length) { dom_element *e = (dom_element *) priv; @@ -2283,7 +2283,7 @@ dom_exception attributes_remove_named_item( /* Implementation function for NamedNodeMap, see core/namednodemap.h for * details */ dom_exception attributes_item(void *priv, - unsigned long index, struct dom_node **node) + uint32_t index, struct dom_node **node) { dom_attr_list * match = NULL; unsigned int num = index + 1; diff --git a/src/core/implementation.c b/src/core/implementation.c index 26908f2..6041c22 100644 --- a/src/core/implementation.c +++ b/src/core/implementation.c @@ -266,7 +266,7 @@ dom_exception dom_implementation_create_document( return err; } - /* No longer interested in inserted node */ + /* No int32_ter interested in inserted node */ dom_node_unref(inserted); /* Done with element */ diff --git a/src/core/namednodemap.c b/src/core/namednodemap.c index f68cd3b..ada7e90 100644 --- a/src/core/namednodemap.c +++ b/src/core/namednodemap.c @@ -117,7 +117,7 @@ void dom_namednodemap_unref(dom_namednodemap *map) * \return DOM_NO_ERR. */ dom_exception dom_namednodemap_get_length(dom_namednodemap *map, - unsigned long *length) + uint32_t *length) { assert(map->opt != NULL); return map->opt->namednodemap_get_length(map->priv, length); @@ -209,7 +209,7 @@ dom_exception _dom_namednodemap_remove_named_item( * should unref the node once it has finished with it. */ dom_exception _dom_namednodemap_item(dom_namednodemap *map, - unsigned long index, dom_node **node) + uint32_t index, dom_node **node) { assert(map->opt != NULL); return map->opt->namednodemap_item(map->priv, index, node); diff --git a/src/core/namednodemap.h b/src/core/namednodemap.h index 079294c..62e5858 100644 --- a/src/core/namednodemap.h +++ b/src/core/namednodemap.h @@ -19,7 +19,7 @@ struct dom_namednodemap; struct nnm_operation { dom_exception (*namednodemap_get_length)(void *priv, - unsigned long *length); + uint32_t *length); dom_exception (*namednodemap_get_named_item)(void *priv, dom_string *name, struct dom_node **node); @@ -32,7 +32,7 @@ struct nnm_operation { struct dom_node **node); dom_exception (*namednodemap_item)(void *priv, - unsigned long index, struct dom_node **node); + uint32_t index, struct dom_node **node); dom_exception (*namednodemap_get_named_item_ns)( void *priv, dom_string *namespace, diff --git a/src/core/node.c b/src/core/node.c index ca8fd72..b14f4fa 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -167,7 +167,7 @@ dom_exception _dom_node_initialise(dom_node_internal *node, node->previous = NULL; node->next = NULL; - /* Note: nodes do not reference the document to which they belong, + /* Note: nodes do not reference the document to which they beint32_t, * as this would result in the document never being destroyed once * the client has finished with it. The document will be aware of * any nodes that it owns through 2 mechanisms: @@ -783,7 +783,7 @@ dom_exception _dom_node_insert_before(dom_node_internal *node, * also need to set its owner. */ if (node->type == DOM_DOCUMENT_NODE && new_child->type == DOM_DOCUMENT_TYPE_NODE) { - /* See long comment in _dom_node_initialise as to why + /* See int32_t comment in _dom_node_initialise as to why * we don't ref the document here */ new_child->owner = (struct dom_document *) node; } @@ -1277,7 +1277,7 @@ dom_exception _dom_node_set_prefix(dom_node_internal *node, return DOM_NO_MODIFICATION_ALLOWED_ERR; } - /* No longer want existing prefix */ + /* No int32_ter want existing prefix */ if (node->prefix != NULL) { dom_string_unref(node->prefix); } diff --git a/src/core/nodelist.c b/src/core/nodelist.c index 8ce9475..e2a1435 100644 --- a/src/core/nodelist.c +++ b/src/core/nodelist.c @@ -196,10 +196,10 @@ void dom_nodelist_unref(dom_nodelist *list) * \param length Pointer to location to receive length * \return DOM_NO_ERR. */ -dom_exception dom_nodelist_get_length(dom_nodelist *list, unsigned long *length) +dom_exception dom_nodelist_get_length(dom_nodelist *list, uint32_t *length) { dom_node_internal *cur = list->root->first_child; - unsigned long len = 0; + uint32_t len = 0; /* Traverse data structure */ while (cur != NULL) { @@ -300,10 +300,10 @@ dom_exception dom_nodelist_get_length(dom_nodelist *list, unsigned long *length) * should unref the node once it has finished with it. */ dom_exception _dom_nodelist_item(dom_nodelist *list, - unsigned long index, dom_node **node) + uint32_t index, dom_node **node) { dom_node_internal *cur = list->root->first_child; - unsigned long count = 0; + uint32_t count = 0; /* Traverse data structure */ while (cur != NULL) { diff --git a/src/core/text.c b/src/core/text.c index 532ee13..94718a2 100644 --- a/src/core/text.c +++ b/src/core/text.c @@ -178,12 +178,12 @@ void _dom_text_finalise(dom_text *text) * once it has finished with it. */ dom_exception _dom_text_split_text(dom_text *text, - unsigned long offset, dom_text **result) + uint32_t offset, dom_text **result) { dom_node_internal *t = (dom_node_internal *) text; dom_string *value; dom_text *res; - unsigned long len; + uint32_t len; dom_exception err; if (_dom_node_readonly(t)) { diff --git a/src/core/text.h b/src/core/text.h index 1cc5b1e..26424ce 100644 --- a/src/core/text.h +++ b/src/core/text.h @@ -43,7 +43,7 @@ void _dom_text_finalise(dom_text *text); /* Virtual functions for dom_text */ dom_exception _dom_text_split_text(dom_text *text, - unsigned long offset, dom_text **result); + uint32_t offset, dom_text **result); dom_exception _dom_text_get_is_element_content_whitespace( dom_text *text, bool *result); dom_exception _dom_text_get_whole_text(dom_text *text, -- cgit v1.2.3