Warning fixes, part of bug 88623 (Clean up Transformiix code). r=sicking, sr=jst.

This commit is contained in:
peterv%netscape.com 2001-07-02 09:24:58 +00:00
parent c548890d4d
commit 4f9a746cf6
13 changed files with 21 additions and 112 deletions

View File

@ -246,7 +246,7 @@ nsSyncLoader::LoadDocument(nsIURI* documentURI, nsIDOMDocument **_retval)
JSContext* cx;
if (NS_SUCCEEDED(rv) && cc) {
rv = cc->GetJSContext(&cx);
if (NS_FAILED(rv)) NS_ERROR_FAILURE;
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
}
else {
NS_WITH_SERVICE(nsIAppShellService, appshellSvc, kAppShellServiceCID, &rv);

View File

@ -27,7 +27,7 @@
* Eric Du, duxy@leyou.com.cn
* -- added fix for FreeBSD
*
* $Id: Double.cpp,v 1.5 2001/06/26 14:07:45 peterv%netscape.com Exp $
* $Id: Double.cpp,v 1.6 2001/07/02 09:24:01 peterv%netscape.com Exp $
*/
#include "primitives.h"
@ -147,7 +147,6 @@ MBool Double::isNaN() {
double Double::toDouble(const String& src) {
double dbl = 0.0;
double fraction = 1.0;
double multiplier = 10.0;
PRInt32 idx = 0;

View File

@ -45,7 +45,7 @@
* URIUtils
* A set of utilities for handling URIs
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.15 $ $Date: 2001/06/26 14:10:10 $
* @version $Revision: 1.16 $ $Date: 2001/07/02 09:24:52 $
**/
#ifdef TX_EXE
@ -253,8 +253,6 @@ istream* URIUtils::openStream(ParsedURI* uri) {
return inStream;
} //-- openStream
/* */
URIUtils::ParsedURI* URIUtils::parseURI(const String& uri) {
ParsedURI* uriTokens = new ParsedURI;
@ -349,41 +347,4 @@ URIUtils::ParsedURI* URIUtils::parseURI(const String& uri) {
return uriTokens;
} //-- parseURI
/**
*
**
void URIUtils::test(const String& str) {
cout << "parsing: " << str << endl;
ParsedURI* uri = parseURI(str);
cout << "protocol : " << uri->protocol << endl;
cout << "host : " << uri->host << endl;
cout << "port : " << uri->port << endl;
cout << "path : " << uri->path << endl;
cout << "malformed: " << uri->isMalformed << endl;
delete uri;
} //-- test
/**
* The test class for the URIUtils
**
void main(int argc, char** argv) {
URIUtils::test("file:///c|\\test");
URIUtils::test("http://my.domain.com");
URIUtils::test("my.domain.com");
URIUtils::test("http://my.domain.com:80");
URIUtils::test("http://my.domain.com:88/foo.html");
String url("http://my.domain.com:88/foo.html");
String docBase;
URIUtils::getDocumentBase(url, docBase);
cout << "url : " << url <<endl;
cout << "document base: " << docBase <<endl;
String localPart("foo.html");
url.clear();
URIUtils::resolveHref(localPart, docBase, url);
cout << "local part : " << localPart << endl;
cout << "resolved url : " << url << endl;
}
*/
#endif

View File

@ -26,7 +26,7 @@
/**
* XMLDOMUtils
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.17 $ $Date: 2001/06/26 14:10:15 $
* @version $Revision: 1.18 $ $Date: 2001/07/02 09:24:58 $
**/
#include "XMLDOMUtils.h"
@ -143,7 +143,6 @@ void XMLDOMUtils::getNodeValue(Node* node, String* target) {
if (!node) return;
int nodeType = node->getNodeType();
Element* element = 0;
switch ( nodeType ) {
case Node::ATTRIBUTE_NODE :

View File

@ -246,7 +246,7 @@ nsSyncLoader::LoadDocument(nsIURI* documentURI, nsIDOMDocument **_retval)
JSContext* cx;
if (NS_SUCCEEDED(rv) && cc) {
rv = cc->GetJSContext(&cx);
if (NS_FAILED(rv)) NS_ERROR_FAILURE;
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
}
else {
NS_WITH_SERVICE(nsIAppShellService, appshellSvc, kAppShellServiceCID, &rv);

View File

@ -161,8 +161,6 @@ void DOMHelper::addParentReference(Node* child, Node* parent) {
void DOMHelper::continueIndexing(Node* node) {
if (!node) return;
TxObjectWrapper* wrapper = 0;
//-- get indexing information
Document* doc = 0;
if (node->getNodeType() == Node::DOCUMENT_NODE)
@ -252,7 +250,8 @@ int DOMHelper::getChildNumber(Node* node) {
case Node::ATTRIBUTE_NODE:
break;
default:
while (tmp = tmp->getPreviousSibling()) ++c;
while ((tmp = tmp->getPreviousSibling()))
++c;
break;
}

View File

@ -24,7 +24,7 @@
* Marina Mechtcheriakova, mmarina@mindspring.com
* -- added lang() implementation
*
* $Id: BooleanFunctionCall.cpp,v 1.7 2001/04/08 14:35:34 peterv%netscape.com Exp $
* $Id: BooleanFunctionCall.cpp,v 1.8 2001/07/02 09:23:49 peterv%netscape.com Exp $
*/
#include "FunctionLib.h"
@ -33,7 +33,7 @@
/**
* Creates a default BooleanFunctionCall, which always evaluates to False
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
* @version $Revision: 1.7 $ $Date: 2001/04/08 14:35:34 $
* @version $Revision: 1.8 $ $Date: 2001/07/02 09:23:49 $
**/
BooleanFunctionCall::BooleanFunctionCall() : FunctionCall(XPathNames::FALSE_FN) {
this->type = TX_FALSE;
@ -75,7 +75,6 @@ ExprResult* BooleanFunctionCall::evaluate(Node* context, ContextState* cs) {
MBool result = MB_FALSE;
ListIterator* iter = params.iterator();
int argc = params.getLength();
Expr* param = 0;
String err;

View File

@ -30,7 +30,7 @@
* -- fixed bug in ::parsePredicates,
* made sure we continue looking for more predicates.
*
* $Id: ExprParser.cpp,v 1.14 2001/06/30 13:54:29 sicking%bigfoot.com Exp $
* $Id: ExprParser.cpp,v 1.15 2001/07/02 09:24:06 peterv%netscape.com Exp $
*/
/**
@ -38,7 +38,7 @@
* This class is used to parse XSL Expressions
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
* @see ExprLexer
* @version $Revision: 1.14 $ $Date: 2001/06/30 13:54:29 $
* @version $Revision: 1.15 $ $Date: 2001/07/02 09:24:06 $
**/
#include "ExprParser.h"
@ -797,8 +797,6 @@ MBool ExprParser::isNodeTypeToken(Token* token) {
**/
MBool ExprParser::parsePredicates(PredicateList* predicateList, ExprLexer& lexer) {
String* errorMsg = 0;
while (lexer.peek()->type == Token::L_BRACKET) {
//-- eat Token
lexer.nextToken();

View File

@ -19,7 +19,7 @@
* Keith Visco, kvisco@ziplink.net
* -- original author.
*
* $Id: ExtensionFunctionCall.cpp,v 1.1 2000/04/19 10:35:59 kvisco%ziplink.net Exp $
* $Id: ExtensionFunctionCall.cpp,v 1.2 2001/07/02 09:24:10 peterv%netscape.com Exp $
*/
#include "FunctionLib.h"
@ -67,8 +67,6 @@ ExprResult* ExtensionFunctionCall::evaluate(Node* context, ContextState* cs) {
//copy parameters
ListIterator* iter = params.iterator();
Expr* param = 0;
while (iter->hasNext()) {
fnCall->addParam( new ExprWrapper( (Expr*) iter->next() ) );
}

View File

@ -25,7 +25,7 @@
* Nisheeth Ranjan, nisheeth@netscape.com
* -- implemented rint function, which was not available on Windows.
*
* $Id: NumberFunctionCall.cpp,v 1.12 2001/04/08 14:33:21 peterv%netscape.com Exp $
* $Id: NumberFunctionCall.cpp,v 1.13 2001/07/02 09:24:20 peterv%netscape.com Exp $
*/
/*
@ -94,7 +94,6 @@ static double rint(double r)
ExprResult* NumberFunctionCall::evaluate(Node* context, ContextState* cs) {
NumberResult* result = 0;
ListIterator* iter = params.iterator();
int argc = params.getLength();
Expr* param = 0;
String err;

View File

@ -29,7 +29,7 @@
* - foo//bar would not match properly if there was more than
* one node in the NodeSet (nodes) on the final iteration
*
* $Id: PathExpr.cpp,v 1.7 2001/06/30 13:54:33 sicking%bigfoot.com Exp $
* $Id: PathExpr.cpp,v 1.8 2001/07/02 09:24:32 peterv%netscape.com Exp $
*/
#include "Expr.h"
@ -242,7 +242,7 @@ MBool PathExpr::matches(Node* node, Node* context, ContextState* cs)
case ANCESTOR_OP:
{
Node* ancestor = node;
while (ancestor = cs->getParentNode(ancestor)) {
while ((ancestor = cs->getParentNode(ancestor))) {
if (pxi->expr->matches(node, ancestor, cs))
return MB_TRUE;
}
@ -286,7 +286,7 @@ MBool PathExpr::matches(Node* node, Node* context, ContextState* cs)
case ANCESTOR_OP:
{
Node* parent = tnode;
while (parent = cs->getParentNode(parent)) {
while ((parent = cs->getParentNode(parent))) {
if (pxi->expr->matches(tnode, parent, cs))
tmpNodes.add(parent);
}

View File

@ -21,14 +21,14 @@
* Keith Visco, kvisco@ziplink.net
* -- original author.
*
* $Id: StringFunctionCall.cpp,v 1.10 2001/06/26 14:09:23 peterv%netscape.com Exp $
* $Id: StringFunctionCall.cpp,v 1.11 2001/07/02 09:24:39 peterv%netscape.com Exp $
*/
/**
* StringFunctionCall
* A representation of the XPath String funtions
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
* @version $Revision: 1.10 $ $Date: 2001/06/26 14:09:23 $
* @version $Revision: 1.11 $ $Date: 2001/07/02 09:24:39 $
**/
#include "FunctionLib.h"
@ -123,7 +123,7 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
// Leading & Trailing Whitespace
resultStr.trim();
MBool hasSpace = MB_FALSE;
PRInt32 lastchar=-1, dest=0;
PRInt32 dest=0;
String normed(resultStr.length());
UNICODE_CHAR current;
for (PRInt32 src=0; src<resultStr.length(); src++) {
@ -252,7 +252,6 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
PRInt32 size = src.length();
UNICODE_CHAR* chars = src.toUnicode(new UNICODE_CHAR[size]);
src.clear();
PRInt32 newIdx = 0;
PRInt32 i;
for (i = 0; i < size; i++) {
PRInt32 idx = oldChars.indexOf(chars[i]);

View File

@ -21,13 +21,13 @@
* Keith Visco, kvisco@ziplink.net
* -- original author.
*
* $Id: Numbering.cpp,v 1.2 2001/04/08 14:40:02 peterv%netscape.com Exp $
* $Id: Numbering.cpp,v 1.3 2001/07/02 09:24:26 peterv%netscape.com Exp $
*/
/**
* Numbering methods
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.2 $ $Date: 2001/04/08 14:40:02 $
* @version $Revision: 1.3 $ $Date: 2001/07/02 09:24:26 $
**/
#include "Numbering.h"
@ -152,45 +152,3 @@ NodeSet* Numbering::getAncestorsOrSelf
}
return nodeSet;
} //-- fromAncestorsOrSelf
/**
* Retrieves all nodes that come before the given element
* at any level in the document that match the count pattern of
* this XSLNumber starting from the closest element that matches
* the from pattern
* @param element the element to find the nearest ancestor of
* @return a List of all matching nodes
**
NodeSet* Numbering::getAnyPreviousNodes
( PatternExpr* patternExpr, Node* context, ProcessorState* ps)
{
NodeSet* nodes = new NodeSet();
Node* current = context;
while (current) {
// Check from MatchExpr
if ((from != null) && from.matches(element,element,ps))
return nodes;
// Check count MatchExpr
if (matchExpr.matches(element, element, ps))
nodes.add(element);
Node sibling = element;
while ( (sibling = sibling.getPreviousSibling()) != null) {
if (sibling.getNodeType() == Node.ELEMENT_NODE) break;
}
if (sibling == null) {
Node parent = element.getParentNode();
if (parent.getNodeType() != Node.ELEMENT_NODE) break;
element = (Element)parent;
}
else element = (Element)sibling;
}
return nodes;
} //-- getAnyPreviousNodes
/* */