1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-29 21:46:59 +03:00

Patched warning issued on SGI by Stephane.Conversy@lri.fr, Daniel.

This commit is contained in:
Daniel Veillard 1999-08-30 11:23:51 +00:00
parent b96e643849
commit c26087b870
6 changed files with 68 additions and 17 deletions

View File

@ -1,3 +1,8 @@
Mon Aug 30 13:22:26 CEST 1999
* parser.c valid.[ch] xpath.c: patched compilation warnings reported
on SGI by Stephane.Conversy@lri.fr
Sun Aug 29 22:27:29 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* all .h : changed the prototype declaration indent as in gtk

View File

@ -9,6 +9,11 @@
#ifndef __XML_VALID_H__
#define __XML_VALID_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "tree.h"
/**
@ -95,7 +100,8 @@ void xmlDumpNotationTable(xmlBufferPtr buf,
xmlNotationTablePtr table);
/* Element Content */
xmlElementContentPtr xmlNewElementContent (CHAR *name, int type);
xmlElementContentPtr xmlNewElementContent (CHAR *name,
xmlElementContentType type);
xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
void xmlFreeElementContent(xmlElementContentPtr cur);
@ -103,7 +109,7 @@ void xmlFreeElementContent(xmlElementContentPtr cur);
xmlElementPtr xmlAddElementDecl (xmlValidCtxtPtr ctxt,
xmlDtdPtr dtd,
const CHAR *name,
int type,
xmlElementContentType type,
xmlElementContentPtr content);
xmlElementTablePtr xmlCopyElementTable (xmlElementTablePtr table);
void xmlFreeElementTable (xmlElementTablePtr table);
@ -120,8 +126,8 @@ xmlAttributePtr xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
xmlDtdPtr dtd,
const CHAR *elem,
const CHAR *name,
int type,
int def,
xmlAttributeType type,
xmlAttributeDefault def,
const CHAR *defaultValue,
xmlEnumerationPtr tree);
xmlAttributeTablePtr xmlCopyAttributeTable (xmlAttributeTablePtr table);
@ -187,4 +193,8 @@ xmlNotationPtr xmlGetDtdNotationDesc (xmlDtdPtr dtd,
const CHAR *name);
xmlElementPtr xmlGetDtdElementDesc (xmlDtdPtr dtd,
const CHAR *name);
#ifdef __cplusplus
}
#endif
#endif /* __XML_VALID_H__ */

View File

@ -4658,7 +4658,7 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) {
while ((CUR == 0) && (ctxt->inputNr > 1))
xmlPopInput(ctxt);
if ((CUR_PTR == check) && (cons = ctxt->input->consumed)) {
if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"xmlParseDocTypeDecl: error detected in Markup declaration\n");
@ -5146,15 +5146,20 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
const CHAR *openTag = CUR_PTR;
CHAR *name;
xmlParserNodeInfo node_info;
xmlNodePtr ret;
/* Capture start position */
node_info.begin_pos = CUR_PTR - ctxt->input->base;
node_info.begin_line = ctxt->input->line;
if (ctxt->record_info) {
node_info.begin_pos = ctxt->input->consumed +
(CUR_PTR - ctxt->input->base);
node_info.begin_line = ctxt->input->line;
}
name = xmlParseStartTag(ctxt);
if (name == NULL) {
return;
}
ret = ctxt->node;
/*
* [ VC: Root Element Type ]
@ -5188,6 +5193,17 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
*/
nodePop(ctxt);
free(name);
/*
* Capture end position and add node
*/
if ( ret != NULL && ctxt->record_info ) {
node_info.end_pos = ctxt->input->consumed +
(CUR_PTR - ctxt->input->base);
node_info.end_line = ctxt->input->line;
node_info.node = ret;
xmlParserAddNodeInfo(ctxt, &node_info);
}
return;
}
@ -5214,6 +5230,17 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
*/
xmlParseEndTag(ctxt, name);
free(name);
/*
* Capture end position and add node
*/
if ( ret != NULL && ctxt->record_info ) {
node_info.end_pos = ctxt->input->consumed +
(CUR_PTR - ctxt->input->base);
node_info.end_line = ctxt->input->line;
node_info.node = ret;
xmlParserAddNodeInfo(ctxt, &node_info);
}
}
/**

View File

@ -43,7 +43,7 @@ xmlAttributePtr xmlScanAttributeDecl(xmlDtdPtr dtd, const CHAR *elem);
* Returns NULL if not, othervise the new element content structure
*/
xmlElementContentPtr
xmlNewElementContent(CHAR *name, int type) {
xmlNewElementContent(CHAR *name, xmlElementContentType type) {
xmlElementContentPtr ret;
switch(type) {
@ -296,7 +296,7 @@ xmlCreateElementTable(void) {
*/
xmlElementPtr
xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *name,
int type, xmlElementContentPtr content) {
xmlElementContentType type, xmlElementContentPtr content) {
xmlElementPtr ret, cur;
xmlElementTablePtr table;
int i;
@ -741,8 +741,9 @@ xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
*/
xmlAttributePtr
xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const CHAR *elem,
const CHAR *name, int type, int def,
const CHAR *defaultValue, xmlEnumerationPtr tree) {
const CHAR *name, xmlAttributeType type,
xmlAttributeDefault def, const CHAR *defaultValue,
xmlEnumerationPtr tree) {
xmlAttributePtr ret, cur;
xmlAttributeTablePtr table;
xmlElementPtr elemDef;

18
valid.h
View File

@ -9,6 +9,11 @@
#ifndef __XML_VALID_H__
#define __XML_VALID_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "tree.h"
/**
@ -95,7 +100,8 @@ void xmlDumpNotationTable(xmlBufferPtr buf,
xmlNotationTablePtr table);
/* Element Content */
xmlElementContentPtr xmlNewElementContent (CHAR *name, int type);
xmlElementContentPtr xmlNewElementContent (CHAR *name,
xmlElementContentType type);
xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
void xmlFreeElementContent(xmlElementContentPtr cur);
@ -103,7 +109,7 @@ void xmlFreeElementContent(xmlElementContentPtr cur);
xmlElementPtr xmlAddElementDecl (xmlValidCtxtPtr ctxt,
xmlDtdPtr dtd,
const CHAR *name,
int type,
xmlElementContentType type,
xmlElementContentPtr content);
xmlElementTablePtr xmlCopyElementTable (xmlElementTablePtr table);
void xmlFreeElementTable (xmlElementTablePtr table);
@ -120,8 +126,8 @@ xmlAttributePtr xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
xmlDtdPtr dtd,
const CHAR *elem,
const CHAR *name,
int type,
int def,
xmlAttributeType type,
xmlAttributeDefault def,
const CHAR *defaultValue,
xmlEnumerationPtr tree);
xmlAttributeTablePtr xmlCopyAttributeTable (xmlAttributeTablePtr table);
@ -187,4 +193,8 @@ xmlNotationPtr xmlGetDtdNotationDesc (xmlDtdPtr dtd,
const CHAR *name);
xmlElementPtr xmlGetDtdElementDesc (xmlDtdPtr dtd,
const CHAR *name);
#ifdef __cplusplus
}
#endif
#endif /* __XML_VALID_H__ */

View File

@ -3930,11 +3930,9 @@ xmlXPathEvalBasis(xmlXPathParserContextPtr ctxt) {
int nodetest = NODE_TEST_NONE;
int nodetype = 0;
xmlNodeSetPtr newset = NULL;
int attribute = 0;
if (CUR == '@') {
NEXT;
attribute = 1;
axis = AXIS_ATTRIBUTE;
goto parse_NodeTest;
} else if (CUR == '*') {