Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2005, 1:40:28 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new tinyXML-lib installed (v-2.3.4)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/tinyxml/tinyxmlparser.cc

    r4261 r4491  
    2525#include "tinyxml.h"
    2626#include <ctype.h>
     27#include <stddef.h>
    2728
    2829//#define DEBUG_PARSER
     
    5051//                              ef bf bf
    5152
    52 const char TIXML_UTF_LEAD_0 = (const char)0xef;
    53 const char TIXML_UTF_LEAD_1 = (const char)0xbb;
    54 const char TIXML_UTF_LEAD_2 = (const char)0xbf;
     53const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
     54const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
     55const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
    5556
    5657const int TiXmlBase::utf8ByteTable[256] =
     
    117118
    118119
    119 /*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding )
     120/*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ )
    120121{
    121122        // This will only work for low-ascii, everything else is assumed to be a valid
     
    138139
    139140
    140 /*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding )
     141/*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ )
    141142{
    142143        // This will only work for low-ascii, everything else is assumed to be a valid
     
    202203        while ( p < now )
    203204        {
     205                // Treat p as unsigned, so we have a happy compiler.
     206                const unsigned char* pU = (const unsigned char*)p;
     207
    204208                // Code contributed by Fletcher Dunn: (modified by lee)
    205                 switch (*p) {
     209                switch (*pU) {
    206210                        case 0:
    207211                                // We *should* never get here, but in case we do, don't
     
    253257                                                // In these cases, don't advance the column. These are
    254258                                                // 0-width spaces.
    255                                                 if ( *(p+1)==TIXML_UTF_LEAD_1 && *(p+2)==TIXML_UTF_LEAD_2 )
     259                                                if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 )
    256260                                                        p += 3;
    257                                                 else if ( *(p+1)==(char)(0xbf) && *(p+2)==(char)(0xbe) )
     261                                                else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU )
    258262                                                        p += 3;
    259                                                 else if ( *(p+1)==(char)(0xbf) && *(p+2)==(char)(0xbf) )
     263                                                else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU )
    260264                                                        p += 3;
    261265                                                else
     
    309313                while ( *p )
    310314                {
     315                        const unsigned char* pU = (const unsigned char*)p;
     316                       
    311317                        // Skip the stupid Microsoft UTF-8 Byte order marks
    312                         if (    *(p+0)==TIXML_UTF_LEAD_0
    313                                  && *(p+1)==TIXML_UTF_LEAD_1
    314                                  && *(p+2)==TIXML_UTF_LEAD_2 )
     318                        if (    *(pU+0)==TIXML_UTF_LEAD_0
     319                                 && *(pU+1)==TIXML_UTF_LEAD_1
     320                                 && *(pU+2)==TIXML_UTF_LEAD_2 )
    315321                        {
    316322                                p += 3;
    317323                                continue;
    318324                        }
    319                         else if(*(p+0)==TIXML_UTF_LEAD_0
    320                                  && *(p+1)==(const char) 0xbf
    321                                  && *(p+2)==(const char) 0xbe )
     325                        else if(*(pU+0)==TIXML_UTF_LEAD_0
     326                                 && *(pU+1)==0xbfU
     327                                 && *(pU+2)==0xbeU )
    322328                        {
    323329                                p += 3;
    324330                                continue;
    325331                        }
    326                         else if(*(p+0)==TIXML_UTF_LEAD_0
    327                                  && *(p+1)==(const char) 0xbf
    328                                  && *(p+2)==(const char) 0xbf )
     332                        else if(*(pU+0)==TIXML_UTF_LEAD_0
     333                                 && *(pU+1)==0xbfU
     334                                 && *(pU+2)==0xbfU )
    329335                        {
    330336                                p += 3;
     
    421427        {
    422428                unsigned long ucs = 0;
    423                 //*ME:  warning C4244: convert '__w64 int' to 'unsigned'
    424                 //*ME:  Use size_t instead of unsigned (pointer-arithmetic)
    425                 size_t delta = 0;
     429                ptrdiff_t delta = 0;
    426430                unsigned mult = 1;
    427431
     
    708712        {
    709713                // Check for the Microsoft UTF-8 lead bytes.
    710                 if (    *(p+0) && *(p+0) == TIXML_UTF_LEAD_0
    711                          && *(p+1) && *(p+1) == TIXML_UTF_LEAD_1
    712                          && *(p+2) && *(p+2) == TIXML_UTF_LEAD_2 )
     714                const unsigned char* pU = (const unsigned char*)p;
     715                if (    *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0
     716                         && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1
     717                         && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 )
    713718                {
    714719                        encoding = TIXML_ENCODING_UTF8;
Note: See TracChangeset for help on using the changeset viewer.