You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/09/20 12:24:55 UTC

DO NOT REPLY [Bug 12851] New: - passing -1 to unsigned parameter

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12851>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12851

passing -1 to unsigned parameter

           Summary: passing -1 to unsigned parameter
           Product: Xerces-C++
           Version: 2.1.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Build
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: gareth@decisionsoft.com


This is in the cvs tree.

XMLScanner.cpp: In method `bool XMLScanner::scanStartTag (bool &)':
XMLScanner.cpp:2977: warning: passing negative value `-1' for argument 
1 of `XMLAttr::XMLAttr (unsigned int, const XMLCh *, const XMLCh *, 
const XMLCh *, XMLAttDef::AttTypes, bool)'
XMLScanner.cpp:2990: warning: passing negative value `-1' for argument 
1 of `XMLAttr::set (unsigned int, const XMLCh *, const XMLCh *, const 
XMLCh *, XMLAttDef::AttTypes)'
XMLScanner.cpp:3113: warning: passing negative value `-1' for argument 
1 of `XMLAttr::XMLAttr (unsigned int, const XMLCh *, const XMLCh *, 
const XMLCh *, XMLAttDef::AttTypes, bool)'
XMLScanner.cpp:3127: warning: passing negative value `-1' for argument 
1 of `XMLAttr::set (unsigned int, const XMLCh *, const XMLCh *, const 
XMLCh *, XMLAttDef::AttTypes)'


I have had a look at the code and I think changing these to 0 is OK. I have
attached a patch that does this. If someone thinks that 0 is no good then please
say :)



patch:
Index: XMLScanner.cpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/xercesc/internal/XMLScanner.cpp,v
retrieving revision 1.21
diff -u -r1.21 XMLScanner.cpp
--- XMLScanner.cpp	16 Sep 2002 20:37:33 -0000	1.21
+++ XMLScanner.cpp	20 Sep 2002 10:12:32 -0000
@@ -2968,7 +2968,7 @@
             {
                 curAtt = new XMLAttr
                 (
-                    -1
+                    0
                     , fAttNameBuf.getRawBuffer()
                     , XMLUni::fgZeroLenString
                     , fAttValueBuf.getRawBuffer()
@@ -2982,7 +2982,7 @@
                 curAtt = fAttrList->elementAt(attCount);
                 curAtt->set
                 (
-                    -1
+                    0
                     , fAttNameBuf.getRawBuffer()
                     , XMLUni::fgZeroLenString
                     , fAttValueBuf.getRawBuffer()
@@ -3104,7 +3104,7 @@
                     {
                         curAtt = new XMLAttr
                         (
-                            -1
+                            0
                             , curDef.getFullName()
                             , XMLUni::fgZeroLenString
                             , curDef.getValue()
@@ -3119,7 +3119,7 @@
                         curAtt = fAttrList->elementAt(attCount);
                         curAtt->set
                         (
-                            -1
+                            0
                             , curDef.getFullName()
                             , XMLUni::fgZeroLenString
                             , curDef.getValue()
@@ -4557,4 +4557,4 @@
 void XMLScanner::resetCachedGrammarPool()
 {
     fGrammarResolver->resetCachedGrammar();
-}
\ No newline at end of file
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org