1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Review and change dom_string specific uint16_t value to size_t

This commit is contained in:
Jonas Fonseca 2005-12-10 22:24:30 +01:00 committed by Jonas Fonseca
parent c1136b8791
commit 458fc5ee79
3 changed files with 8 additions and 8 deletions

View File

@ -217,7 +217,7 @@ get_dom_node_map_entry(struct dom_node_list *list, enum dom_node_type type,
struct dom_node *
init_dom_node_(unsigned char *file, int line,
struct dom_node *parent, enum dom_node_type type,
unsigned char *string, uint16_t length)
unsigned char *string, size_t length)
{
#ifdef DEBUG_MEMLEAK
struct dom_node *node = debug_mem_calloc(file, line, 1, sizeof(*node));

View File

@ -248,7 +248,7 @@ get_dom_node_map_entry(struct dom_node_list *node_map,
struct dom_node *
init_dom_node_(unsigned char *file, int line,
struct dom_node *parent, enum dom_node_type type,
unsigned char *string, uint16_t length);
unsigned char *string, size_t length);
#define init_dom_node(type, string, length) init_dom_node_(__FILE__, __LINE__, NULL, type, string, length)
#define add_dom_node(parent, type, string, length) init_dom_node_(__FILE__, __LINE__, parent, type, string, length)
@ -257,7 +257,7 @@ init_dom_node_(unsigned char *file, int line,
static inline struct dom_node *
add_dom_attribute(struct dom_node *parent, unsigned char *string, int length,
unsigned char *value, uint16_t valuelen)
unsigned char *value, size_t valuelen)
{
struct dom_node *node = add_dom_node(parent, DOM_NODE_ATTRIBUTE, string, length);
@ -270,7 +270,7 @@ add_dom_attribute(struct dom_node *parent, unsigned char *string, int length,
static inline struct dom_node *
add_dom_proc_instruction(struct dom_node *parent, unsigned char *string, int length,
unsigned char *instruction, uint16_t instructionlen)
unsigned char *instruction, size_t instructionlen)
{
struct dom_node *node = add_dom_node(parent, DOM_NODE_PROCESSING_INSTRUCTION, string, length);

View File

@ -28,7 +28,7 @@ static inline struct dom_node *
add_sgml_document(struct dom_stack *stack, struct uri *uri)
{
unsigned char *string = struri(uri);
int length = strlen(string);
size_t length = strlen(string);
struct dom_node *node = init_dom_node(DOM_NODE_DOCUMENT, string, length);
return node ? push_dom_node(stack, node) : node;
@ -70,7 +70,7 @@ add_sgml_attribute(struct dom_stack *stack,
struct sgml_parser *parser = stack->parser;
struct dom_node *parent = get_dom_stack_top(stack)->node;
unsigned char *value = valtoken ? valtoken->string : NULL;
uint16_t valuelen = valtoken ? valtoken->length : 0;
size_t valuelen = valtoken ? valtoken->length : 0;
struct sgml_node_info *info;
struct dom_node *node;
@ -102,11 +102,11 @@ add_sgml_proc_instruction(struct dom_stack *stack, struct scanner_token *token)
/* Anything before the separator becomes the target name ... */
unsigned char *name = token->string;
int namelen = separator ? separator - token->string : token->length;
size_t namelen = separator ? separator - token->string : token->length;
/* ... and everything after the instruction value. */
unsigned char *value = separator ? separator + 1 : NULL;
int valuelen = value ? token->length - namelen - 1 : 0;
size_t valuelen = value ? token->length - namelen - 1 : 0;
node = add_dom_proc_instruction(parent, name, namelen, value, valuelen);
if (!node) return NULL;