~ubuntu-branches/ubuntu/precise/xerces-c/precise-security

« back to all changes in this revision

Viewing changes to src/xercesc/util/XMLDateTime.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-02-06 16:46:23 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100206164623-xbntkcs6ks20nboa
Tags: 3.1.0-1
* New upstream release
* Updated standards version to 3.8.4.  No changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
 
18
18
/*
19
 
 * $Id: XMLDateTime.cpp 881733 2009-11-18 11:44:47Z borisk $
 
19
 * $Id: XMLDateTime.cpp 901107 2010-01-20 08:45:02Z borisk $
20
20
 */
21
21
 
22
22
// ---------------------------------------------------------------------------
63
63
                                         , UTC_NEG_CHAR
64
64
                                         , chNull};
65
65
 
66
 
static const int YMD_MIN_SIZE    = 10;   // CCYY-MM-DD
67
 
static const int YMONTH_MIN_SIZE = 7;    // CCYY_MM
68
 
static const int TIME_MIN_SIZE   = 8;    // hh:mm:ss
69
 
static const int TIMEZONE_SIZE   = 5;    // hh:mm
70
 
static const int DAY_SIZE        = 5;    // ---DD
71
 
//static const int MONTH_SIZE      = 6;    // --MM--
72
 
static const int MONTHDAY_SIZE   = 7;    // --MM-DD
 
66
static const XMLSize_t YMD_MIN_SIZE    = 10;   // CCYY-MM-DD
 
67
static const XMLSize_t YMONTH_MIN_SIZE = 7;    // CCYY_MM
 
68
static const XMLSize_t TIME_MIN_SIZE   = 8;    // hh:mm:ss
 
69
static const XMLSize_t TIMEZONE_SIZE   = 5;    // hh:mm
 
70
static const XMLSize_t DAY_SIZE        = 5;    // ---DD
 
71
//static const XMLSize_t MONTH_SIZE      = 6;    // --MM--
 
72
static const XMLSize_t MONTHDAY_SIZE   = 7;    // --MM-DD
73
73
static const int NOT_FOUND       = -1;
74
74
 
75
75
//define constants to be used in assigning default values for
865
865
        designator = true;
866
866
    }
867
867
 
868
 
    if ( (fEnd == endDate) &&   // 'T' absent
 
868
    if ( (fEnd == XMLSize_t (endDate)) &&   // 'T' absent
869
869
         (fStart != fEnd)   )   // something after Day
870
870
    {
871
871
        ThrowXMLwithMemMgr1(SchemaDateTimeException
874
874
                , fMemoryManager);
875
875
    }
876
876
 
877
 
    if ( fEnd != endDate ) // 'T' present
 
877
    if ( fEnd != XMLSize_t (endDate) ) // 'T' present
878
878
    {
879
879
        //scan hours, minutes, seconds
880
880
        //
1068
1068
            fMiliSecond = parseMiliSecond(fStart, sign);  //get ms between UTC sign and fEnd
1069
1069
        }
1070
1070
        }
1071
 
    else if(sign == 0 || sign != fStart)
 
1071
    else if(sign == 0 || XMLSize_t (sign) != fStart)
1072
1072
    {
1073
1073
        // seconds has more than 2 digits
1074
1074
        ThrowXMLwithMemMgr1(SchemaDateTimeException