Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 11195
Merged at revision: 11424
Proposed branch: lp:~paul-lucas/zorba/pjl-misc
Merge into: lp:zorba
Diff against target: 165 lines (+13/-56)
3 files modified
src/common/shared_types.h (+0/-3)
src/util/ascii_util.h (+8/-48)
src/util/utf8_util.tcc (+5/-5)
To merge this branch: bzr merge lp:~paul-lucas/zorba/pjl-misc
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+161770@code.launchpad.net

Commit message

1. Fixed ASCII testing (although it's not clear how it worked up until now on Mac OS X).
2. Removed remnants of xqpString types.

Description of the change

1. Fixed ASCII testing (although it's not clear how it worked up until now on Mac OS X).
2. Removed remnants of xqpString types.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job pjl-misc-2013-05-01T04-04-52.812Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job pjl-misc-2013-05-01T15-23-50.11Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/common/shared_types.h'
2--- src/common/shared_types.h 2013-02-07 17:24:36 +0000
3+++ src/common/shared_types.h 2013-05-01 03:59:31 +0000
4@@ -121,9 +121,6 @@
5 class GMonthDay;
6 class GDay;
7 class GMonth;
8-class xqpString;
9-class xqpStringStore;
10-typedef rchandle<xqpStringStore> xqpStringStore_t;
11 typedef rchandle<DateTime> DateTime_t;
12 typedef rchandle<Date> Date_t;
13 typedef rchandle<Time> Time_t;
14
15=== modified file 'src/util/ascii_util.h'
16--- src/util/ascii_util.h 2013-03-26 00:11:11 +0000
17+++ src/util/ascii_util.h 2013-05-01 03:59:31 +0000
18@@ -118,12 +118,7 @@
19 */
20 template<typename CharType> inline
21 bool is_alpha( CharType c ) {
22-#ifdef WIN32
23- // Windows' isalpha() implementation crashes for non-ASCII characters.
24- return __isascii( c ) && isalpha( c );
25-#else
26- return isalpha( c );
27-#endif
28+ return is_ascii( c ) && isalpha( c );
29 }
30
31 /**
32@@ -137,12 +132,7 @@
33 */
34 template<typename CharType> inline
35 bool is_alnum( CharType c ) {
36-#ifdef WIN32
37- // Windows' isalpha() implementation crashes for non-ASCII characters.
38- return __isascii( c ) && isalnum( c );
39-#else
40- return isalnum( c );
41-#endif
42+ return is_ascii( c ) && isalnum( c );
43 }
44
45 /**
46@@ -156,12 +146,7 @@
47 */
48 template<typename CharType> inline
49 bool is_cntrl( CharType c ) {
50-#ifdef WIN32
51- // Windows' iscntrl() implementation crashes for non-ASCII characters.
52- return __isascii( c ) && iscntrl( c );
53-#else
54- return iscntrl( c );
55-#endif
56+ return is_ascii( c ) && iscntrl( c );
57 }
58
59 /**
60@@ -175,12 +160,7 @@
61 */
62 template<typename CharType> inline
63 bool is_digit( CharType c ) {
64-#ifdef WIN32
65- // Windows' isdigit() implementation crashes for non-ASCII characters.
66- return __isascii( c ) && isdigit( c );
67-#else
68- return isdigit( c );
69-#endif
70+ return is_ascii( c ) && isdigit( c );
71 }
72
73 /**
74@@ -194,12 +174,7 @@
75 */
76 template<typename CharType> inline
77 bool is_print( CharType c ) {
78-#ifdef WIN32
79- // Windows' isprint() implementation crashes for non-ASCII characters.
80- return __isascii( c ) && isprint( c );
81-#else
82- return isprint( c );
83-#endif
84+ return is_ascii( c ) && isprint( c );
85 }
86
87 /**
88@@ -213,12 +188,7 @@
89 */
90 template<typename CharType> inline
91 bool is_punct( CharType c ) {
92-#ifdef WIN32
93- // Windows' ispunct() implementation crashes for non-ASCII characters.
94- return __isascii( c ) && ispunct( c );
95-#else
96- return ispunct( c );
97-#endif
98+ return is_ascii( c ) && ispunct( c );
99 }
100
101 /**
102@@ -232,12 +202,7 @@
103 */
104 template<typename CharType> inline
105 bool is_space( CharType c ) {
106-#ifdef WIN32
107- // Windows' isspace() implementation crashes for non-ASCII characters.
108- return __isascii( c ) && isspace( c );
109-#else
110- return isspace( c );
111-#endif
112+ return is_ascii( c ) && isspace( c );
113 }
114
115 /**
116@@ -270,12 +235,7 @@
117 */
118 template<typename CharType> inline
119 bool is_xdigit( CharType c ) {
120-#ifdef WIN32
121- // Windows' isxdigit() implementation crashes for non-ASCII characters.
122- return __isascii( c ) && isxdigit( c );
123-#else
124- return isxdigit( c );
125-#endif
126+ return is_ascii( c ) && isxdigit( c );
127 }
128
129 ////////// begins/ends_with ///////////////////////////////////////////////////
130
131=== modified file 'src/util/utf8_util.tcc'
132--- src/util/utf8_util.tcc 2013-04-20 00:50:38 +0000
133+++ src/util/utf8_util.tcc 2013-05-01 03:59:31 +0000
134@@ -33,12 +33,12 @@
135 template<class StringType> back_html_uri_insert_iterator<StringType>&
136 back_html_uri_insert_iterator<StringType>::operator=( value_type c ) {
137 char const dec2hex[] = "0123456789ABCDEF";
138- unsigned u = c & 0xFF;
139- if ( !isprint( u ) ) {
140+ unsigned u = c & 0xFFu;
141+ if ( !ascii::is_print( u ) ) {
142 utf8::encoded_char_type ec;
143 utf8::size_type const bytes = utf8::encode( c, ec );
144 for ( size_type i = 0; i < bytes; ++i ) {
145- u = ec[i] & 0xFF;
146+ u = ec[i] & 0xFFu;
147 buf_[1] = dec2hex[ u >> 4 ];
148 buf_[2] = dec2hex[ u & 0x0F ];
149 this->container->append( buf_, 3 );
150@@ -52,13 +52,13 @@
151 template<class StringType> back_iri_insert_iterator<StringType>&
152 back_iri_insert_iterator<StringType>::operator=( value_type c ) {
153 char const dec2hex[] = "0123456789ABCDEF";
154- unsigned u = c & 0xFF;
155+ unsigned u = c & 0xFFu;
156 if ( unicode::is_ucschar( c ) || unicode::is_iprivate( c ) ||
157 unicode::is_invalid_in_iri( c ) ) {
158 utf8::encoded_char_type ec;
159 utf8::size_type const bytes = utf8::encode( c, ec );
160 for ( size_type i = 0; i < bytes; ++i ) {
161- u = ec[i] & 0xFF;;
162+ u = ec[i] & 0xFFu;
163 buf_[1] = dec2hex[ u >> 4 ];
164 buf_[2] = dec2hex[ u & 0x0F ];
165 this->container->append( buf_, 3 );

Subscribers

People subscribed via source and target branches