Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 10988
Merged at revision: 11128
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 370 lines (+78/-69)
9 files modified
bin/zorbacmdproperties.cpp (+10/-4)
bin/zorbacmdproperties.h (+13/-4)
src/compiler/rewriter/rules/fold_rules.cpp (+2/-2)
src/context/static_context.cpp (+8/-5)
src/context/static_context.h (+39/-49)
src/unit_tests/CMakeLists.txt (+1/-2)
src/unit_tests/test_hashmaps.cpp (+2/-2)
src/unit_tests/unit_tests.cpp (+1/-1)
src/zorbaserialization/class_serializer.h (+2/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+133994@code.launchpad.net

Commit message

Added missing include in test_hashmaps.cpp; hopefully fixes compilation error on Windows

Description of the change

Added missing include in test_hashmaps.cpp; hopefully fixes compilation error on Windows

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
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 markos-scratch-2012-11-12T21-23-43.252Z 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 'bin/zorbacmdproperties.cpp'
2--- bin/zorbacmdproperties.cpp 2012-09-19 21:16:15 +0000
3+++ bin/zorbacmdproperties.cpp 2012-11-12 21:20:28 +0000
4@@ -68,7 +68,8 @@
5 std::string lVarName = lStr.substr(0, lPos);
6 std::string lValue = lStr.substr(lPos + 1);
7 bool lInlineFile = true;
8- if (lVarName.at(lVarName.size()-1) == ':') {
9+ if (lVarName.at(lVarName.size()-1) == ':')
10+ {
11 lInlineFile = false;
12 lVarName.resize(lVarName.size()-1); // remove the :
13 }
14@@ -80,7 +81,8 @@
15 }
16
17 for (std::vector<std::string>::const_iterator lIter = theOption.begin();
18- lIter != theOption.end(); ++lIter) {
19+ lIter != theOption.end(); ++lIter)
20+ {
21 size_t lEQual = lIter->find_last_of("=");
22 if (lEQual == std::string::npos)
23 return "option must be of the form {namespace}localname=value";
24@@ -93,8 +95,10 @@
25 lOption.value = lValue;
26 theStaticContextOptions.push_back(lOption);
27 }
28+
29 for (std::vector<std::string>::const_iterator lIter = theStopWords.begin();
30- lIter != theStopWords.end(); ++lIter) {
31+ lIter != theStopWords.end(); ++lIter)
32+ {
33 size_t lEQual = lIter->find(":=");
34 if (lEQual == std::string::npos)
35 return "Stop-words mapping must be of the form URI:=value";
36@@ -107,8 +111,10 @@
37 lMapping.value = lValue;
38 theStopWordsMapping.push_back(lMapping);
39 }
40+
41 for (std::vector<std::string>::const_iterator lIter = theThesaurus.begin();
42- lIter != theThesaurus.end(); ++lIter) {
43+ lIter != theThesaurus.end(); ++lIter)
44+ {
45 size_t lEQual = lIter->find(":=");
46 if (lEQual == std::string::npos)
47 return "Thesaurus mapping must be of the form URI:=value";
48
49=== modified file 'bin/zorbacmdproperties.h'
50--- bin/zorbacmdproperties.h 2012-09-19 21:16:15 +0000
51+++ bin/zorbacmdproperties.h 2012-11-12 21:20:28 +0000
52@@ -21,24 +21,33 @@
53
54 #include "zorbacmdproperties_base.h"
55
56-class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase {
57+class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase
58+{
59 public:
60- struct ExternalVariable {
61+ struct ExternalVariable
62+ {
63 std::string var_name;
64 std::string var_value;
65 bool inline_file;
66 };
67+
68 typedef std::vector<ExternalVariable> ExternalVars_t;
69- struct StaticContextOption {
70+
71+
72+ struct StaticContextOption
73+ {
74 std::string clark_qname;
75 std::string value;
76 };
77+
78 typedef std::vector<StaticContextOption> Options_t;
79
80- struct FullTextMapping {
81+ struct FullTextMapping
82+ {
83 std::string uri;
84 std::string value;
85 };
86+
87 typedef std::vector<FullTextMapping> FullText_t;
88
89 typedef std::vector<std::string> QueriesOrFiles_t;
90
91=== modified file 'src/compiler/rewriter/rules/fold_rules.cpp'
92--- src/compiler/rewriter/rules/fold_rules.cpp 2012-10-31 08:02:16 +0000
93+++ src/compiler/rewriter/rules/fold_rules.cpp 2012-11-12 21:20:28 +0000
94@@ -734,8 +734,8 @@
95 {
96 bool modified = false;
97 expr* newArg = partial_eval_return_clause(static_cast<flwor_expr*>(arg),
98- modified,
99- rCtx);
100+ modified,
101+ rCtx);
102
103 if (newArg != arg)
104 fo->set_arg(0, newArg);
105
106=== modified file 'src/context/static_context.cpp'
107--- src/context/static_context.cpp 2012-10-08 12:09:36 +0000
108+++ src/context/static_context.cpp 2012-11-12 21:20:28 +0000
109@@ -3460,11 +3460,13 @@
110 {
111 theOptionMap->insert(qname2, option);
112 }
113-
114 }
115
116-store::Item_t
117-static_context::parse_and_expand_qname(
118+
119+/***************************************************************************//**
120+
121+********************************************************************************/
122+store::Item_t static_context::parse_and_expand_qname(
123 const zstring& value,
124 const char* default_ns,
125 const QueryLoc& loc) const
126@@ -3502,7 +3504,7 @@
127
128 std::vector<store::Item_t>::iterator lIter;
129
130- if ( name == "error" )
131+ if (name == "error")
132 {
133 if ( lQName->getLocalName() == "all" )
134 {
135@@ -3513,11 +3515,12 @@
136 lIter != theWarningsAreErrors.end();
137 ++lIter )
138 {
139- if ( lQName->equals( (*lIter) ) )
140+ if (lQName->equals((*lIter)))
141 {
142 return;
143 }
144 }
145+
146 theWarningsAreErrors.push_back( lQName );
147 }
148 else if ( name == "disable" )
149
150=== modified file 'src/context/static_context.h'
151--- src/context/static_context.h 2012-10-08 12:09:36 +0000
152+++ src/context/static_context.h 2012-11-12 21:20:28 +0000
153@@ -727,13 +727,11 @@
154
155 void compute_base_uri();
156
157- zstring
158- resolve_relative_uri(
159+ zstring resolve_relative_uri(
160 const zstring& aUri,
161 bool aValidate = true) const;
162
163- zstring
164- resolve_relative_uri(
165+ zstring resolve_relative_uri(
166 const zstring& aRelativeUri,
167 const zstring& aBaseUri,
168 bool validate = true) const;
169@@ -758,33 +756,39 @@
170 * Given a URI, return a Resource for that URI.
171 * @param aEntityKind the expected kind of entity expected at this aUri
172 */
173- std::auto_ptr<internal::Resource> resolve_uri
174- (zstring const& aUri, internal::EntityData::Kind aEntityKind, zstring& oErrorMessage) const;
175+ std::auto_ptr<internal::Resource> resolve_uri(
176+ const zstring& aUri,
177+ internal::EntityData::Kind aEntityKind,
178+ zstring& oErrorMessage) const;
179
180 /**
181 * Given a URI, return a Resource for that URI.
182 * @param aEntityData an EntityData object to pass to the mappers/resolvers.
183 */
184- std::auto_ptr<internal::Resource> resolve_uri
185- (zstring const& aUri, internal::EntityData const& aEntityData, zstring& oErrorMessage) const;
186+ std::auto_ptr<internal::Resource> resolve_uri(
187+ const zstring& aUri,
188+ const internal::EntityData& aEntityData,
189+ zstring& oErrorMessage) const;
190
191 /**
192 * Given a URI, populate a vector with a list of component URIs. If
193 * no component URIs are available, the vector will be populated
194 * with (only) the input URI.
195 */
196- void get_component_uris
197- (zstring const& aUri, internal::EntityData::Kind aEntityKind,
198- std::vector<zstring>& oComponents) const;
199+ void get_component_uris(
200+ const zstring& aUri,
201+ internal::EntityData::Kind aEntityKind,
202+ std::vector<zstring>& oComponents) const;
203
204 /**
205 * Given a URI, populate a vector with a list of candidate URIs. If
206 * no candidate URIs are available, the vector will be populated
207 * with (only) the input URI.
208 */
209- void get_candidate_uris
210- (zstring const& aUri, internal::EntityData::Kind aEntityKind,
211- std::vector<zstring>& oComponents) const;
212+ void get_candidate_uris(
213+ const zstring& aUri,
214+ internal::EntityData::Kind aEntityKind,
215+ std::vector<zstring>& oComponents) const;
216
217 void set_uri_path(const std::vector<zstring>& aURIPath);
218
219@@ -991,6 +995,8 @@
220
221 bool lookup_option(const store::Item* qname, zstring& option) const;
222
223+ bool is_feature_set(feature::kind k) const { return (theFeatures & k) != 0; }
224+
225 protected:
226 void process_feature_option(
227 const zstring& value,
228@@ -1011,8 +1017,11 @@
229 parse_and_expand_qname(
230 const zstring& value,
231 const char* default_ns,
232- const QueryLoc& loc
233- ) const;
234+ const QueryLoc& loc) const;
235+
236+ void set_feature(feature::kind k) { theFeatures |= k; }
237+
238+ void unset_feature(feature::kind k) { theFeatures &= ~k; }
239
240 public:
241
242@@ -1070,19 +1079,15 @@
243 DecimalFormat_t get_decimal_format(const store::Item_t& qname);
244
245 #ifndef ZORBA_NO_FULL_TEXT
246- ftmatch_options const* get_match_options() const {
247- return theFTMatchOptions;
248- }
249+ ftmatch_options const* get_match_options() const { return theFTMatchOptions; }
250
251- void set_match_options( ftmatch_options *mo ) {
252- theFTMatchOptions = mo;
253- }
254+ void set_match_options(ftmatch_options* mo) { theFTMatchOptions = mo; }
255 #endif /* ZORBA_NO_FULL_TEXT */
256
257 //
258 // Merge in the static context of a module
259 //
260- void import_module (const static_context* module, const QueryLoc& loc);
261+ void import_module(const static_context* module, const QueryLoc& loc);
262
263 //
264 // Warnings
265@@ -1116,32 +1121,17 @@
266
267 private:
268
269- void apply_uri_mappers(zstring const& aUri,
270- internal::EntityData const* aEntityData,
271- internal::URIMapper::Kind aMapperKind,
272- std::vector<zstring>& oUris) const;
273-
274- void apply_url_resolvers(std::vector<zstring>& aUrls,
275- internal::EntityData const* aEntityData,
276- std::auto_ptr<internal::Resource>& oResource,
277- zstring& oErrorMessage) const;
278-
279-public:
280- bool is_feature_set( feature::kind k ) const
281- {
282- return (theFeatures & k) != 0;
283- }
284-
285- void set_feature( feature::kind k )
286- {
287- theFeatures |= k;
288- }
289-
290- void unset_feature( feature::kind k )
291- {
292- theFeatures &= ~k;
293- }
294-
295+ void apply_uri_mappers(
296+ zstring const& aUri,
297+ internal::EntityData const* aEntityData,
298+ internal::URIMapper::Kind aMapperKind,
299+ std::vector<zstring>& oUris) const;
300+
301+ void apply_url_resolvers(
302+ std::vector<zstring>& aUrls,
303+ internal::EntityData const* aEntityData,
304+ std::auto_ptr<internal::Resource>& oResource,
305+ zstring& oErrorMessage) const;
306 };
307
308
309
310=== modified file 'src/unit_tests/CMakeLists.txt'
311--- src/unit_tests/CMakeLists.txt 2012-10-27 01:38:33 +0000
312+++ src/unit_tests/CMakeLists.txt 2012-11-12 21:20:28 +0000
313@@ -25,8 +25,7 @@
314 test_uri.cpp
315 test_json_parser.cpp
316 test_fs_iterator.cpp
317-# test_hashmaps.cpp
318-# memory_manager.cpp
319+ test_hashmaps.cpp
320 )
321
322 IF (NOT ZORBA_NO_FULL_TEXT)
323
324=== modified file 'src/unit_tests/test_hashmaps.cpp'
325--- src/unit_tests/test_hashmaps.cpp 2012-09-19 05:15:49 +0000
326+++ src/unit_tests/test_hashmaps.cpp 2012-11-12 21:20:28 +0000
327@@ -9,7 +9,7 @@
328 #include "util/hashmap32.h"
329 #include "util/hashmap.h"
330 #include "util/unordered_map.h"
331-
332+#include "util/hash/hash.h"
333
334 namespace zorba {
335
336@@ -27,7 +27,7 @@
337 static uint32_t hash(uint64_t key)
338 {
339 #if 1
340- return key;
341+ return static_cast<uint32_t>(key);
342 #else
343 char buf[9];
344 buf[0] = (unsigned char)(key>>56);
345
346=== modified file 'src/unit_tests/unit_tests.cpp'
347--- src/unit_tests/unit_tests.cpp 2012-10-27 01:38:33 +0000
348+++ src/unit_tests/unit_tests.cpp 2012-11-12 21:20:28 +0000
349@@ -71,7 +71,7 @@
350 libunittests["unordered_set"] = test_unordered_set;
351 #endif /* ZORBA_HAVE_UNORDERED_SET */
352
353- // libunittests["hashmaps"] = test_hashmaps;
354+ libunittests["hashmaps"] = test_hashmaps;
355
356 libunittests["uri"] = runUriTest;
357
358
359=== modified file 'src/zorbaserialization/class_serializer.h'
360--- src/zorbaserialization/class_serializer.h 2012-09-19 21:16:15 +0000
361+++ src/zorbaserialization/class_serializer.h 2012-11-12 21:20:28 +0000
362@@ -29,6 +29,8 @@
363 #include <typeinfo>
364 #include <string.h>
365
366+#include <zorba/util/time.h>
367+
368 #include "zorbaserialization/archiver_consts.h"
369
370 namespace zorba

Subscribers

People subscribed via source and target branches