Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba.

Requested reviews:
  Paul J. Lucas (paul-lucas)

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/161770

Fixed ASCII testing (although it's not clear how it worked up until now on Mac 
OS X).
-- 
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/161770
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/common/shared_types.h'
--- src/common/shared_types.h	2013-02-07 17:24:36 +0000
+++ src/common/shared_types.h	2013-05-01 03:59:31 +0000
@@ -121,9 +121,6 @@
 class GMonthDay;
 class GDay;
 class GMonth;
-class xqpString;
-class xqpStringStore;
-typedef rchandle<xqpStringStore> xqpStringStore_t;
 typedef rchandle<DateTime> DateTime_t;
 typedef rchandle<Date> Date_t;
 typedef rchandle<Time> Time_t;

=== modified file 'src/util/ascii_util.h'
--- src/util/ascii_util.h	2013-03-26 00:11:11 +0000
+++ src/util/ascii_util.h	2013-05-01 03:59:31 +0000
@@ -118,12 +118,7 @@
  */
 template<typename CharType> inline
 bool is_alpha( CharType c ) {
-#ifdef WIN32
-  // Windows' isalpha() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && isalpha( c );
-#else
-  return isalpha( c );
-#endif
+  return is_ascii( c ) && isalpha( c );
 }
 
 /**
@@ -137,12 +132,7 @@
  */
 template<typename CharType> inline
 bool is_alnum( CharType c ) {
-#ifdef WIN32
-  // Windows' isalpha() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && isalnum( c );
-#else
-  return isalnum( c );
-#endif
+  return is_ascii( c ) && isalnum( c );
 }
 
 /**
@@ -156,12 +146,7 @@
  */
 template<typename CharType> inline
 bool is_cntrl( CharType c ) {
-#ifdef WIN32
-  // Windows' iscntrl() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && iscntrl( c );
-#else
-  return iscntrl( c );
-#endif
+  return is_ascii( c ) && iscntrl( c );
 }
 
 /**
@@ -175,12 +160,7 @@
  */
 template<typename CharType> inline
 bool is_digit( CharType c ) {
-#ifdef WIN32
-  // Windows' isdigit() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && isdigit( c );
-#else
-  return isdigit( c );
-#endif
+  return is_ascii( c ) && isdigit( c );
 }
 
 /**
@@ -194,12 +174,7 @@
  */
 template<typename CharType> inline
 bool is_print( CharType c ) {
-#ifdef WIN32
-  // Windows' isprint() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && isprint( c );
-#else
-  return isprint( c );
-#endif
+  return is_ascii( c ) && isprint( c );
 }
 
 /**
@@ -213,12 +188,7 @@
  */
 template<typename CharType> inline
 bool is_punct( CharType c ) {
-#ifdef WIN32
-  // Windows' ispunct() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && ispunct( c );
-#else
-  return ispunct( c );
-#endif
+  return is_ascii( c ) && ispunct( c );
 }
 
 /**
@@ -232,12 +202,7 @@
  */
 template<typename CharType> inline
 bool is_space( CharType c ) {
-#ifdef WIN32
-  // Windows' isspace() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && isspace( c );
-#else
-  return isspace( c );
-#endif
+  return is_ascii( c ) && isspace( c );
 }
 
 /**
@@ -270,12 +235,7 @@
  */
 template<typename CharType> inline
 bool is_xdigit( CharType c ) {
-#ifdef WIN32
-  // Windows' isxdigit() implementation crashes for non-ASCII characters.
-  return __isascii( c ) && isxdigit( c );
-#else
-  return isxdigit( c );
-#endif
+  return is_ascii( c ) && isxdigit( c );
 }
 
 ////////// begins/ends_with ///////////////////////////////////////////////////

=== modified file 'src/util/utf8_util.tcc'
--- src/util/utf8_util.tcc	2013-04-20 00:50:38 +0000
+++ src/util/utf8_util.tcc	2013-05-01 03:59:31 +0000
@@ -33,12 +33,12 @@
 template<class StringType> back_html_uri_insert_iterator<StringType>&
 back_html_uri_insert_iterator<StringType>::operator=( value_type c ) {
   char const dec2hex[] = "0123456789ABCDEF";
-  unsigned u = c & 0xFF;
-  if ( !isprint( u ) ) {
+  unsigned u = c & 0xFFu;
+  if ( !ascii::is_print( u ) ) {
     utf8::encoded_char_type ec;
     utf8::size_type const bytes = utf8::encode( c, ec );
     for ( size_type i = 0; i < bytes; ++i ) {
-      u = ec[i] & 0xFF;
+      u = ec[i] & 0xFFu;
       buf_[1] = dec2hex[ u >> 4 ];
       buf_[2] = dec2hex[ u & 0x0F ];
       this->container->append( buf_, 3 );
@@ -52,13 +52,13 @@
 template<class StringType> back_iri_insert_iterator<StringType>&
 back_iri_insert_iterator<StringType>::operator=( value_type c ) {
   char const dec2hex[] = "0123456789ABCDEF";
-  unsigned u = c & 0xFF;
+  unsigned u = c & 0xFFu;
   if ( unicode::is_ucschar( c ) || unicode::is_iprivate( c ) ||
        unicode::is_invalid_in_iri( c ) ) {
     utf8::encoded_char_type ec;
     utf8::size_type const bytes = utf8::encode( c, ec );
     for ( size_type i = 0; i < bytes; ++i ) {
-      u = ec[i] & 0xFF;;
+      u = ec[i] & 0xFFu;
       buf_[1] = dec2hex[ u >> 4 ];
       buf_[2] = dec2hex[ u & 0x0F ];
       this->container->append( buf_, 3 );

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to