Merge lp:~zorba-coders/zorba/bug1083269 into lp:zorba

Proposed by Rodolfo Ochoa
Status: Merged
Approved by: Matthias Brantner
Approved revision: 11144
Merged at revision: 11145
Proposed branch: lp:~zorba-coders/zorba/bug1083269
Merge into: lp:zorba
Diff against target: 239 lines (+33/-24)
8 files modified
src/compiler/expression/expr_clone.cpp (+1/-0)
src/context/dynamic_context.cpp (+4/-1)
src/functions/func_schema_impl.cpp (+1/-0)
src/precompiled/stdafx.h (+4/-2)
src/unit_tests/test_hashmaps.cpp (+13/-15)
src/util/CMakeLists.txt (+1/-3)
src/util/hash/CMakeLists.txt (+6/-2)
src/util/hash/hash.cpp (+3/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug1083269
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Rodolfo Ochoa Approve
Paul J. Lucas Approve
Chris Hillery Approve
Review via email: mp+139125@code.launchpad.net

Commit message

Fix for errors on windows that avoid to be compiled.

Description of the change

Fix for errors on windows that avoid to be compiled. Read comments on bug.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

If you're going to change zstring to std::string, then change all occurrences of zstring to std::string.

review: Needs Fixing
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
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 bug1083269-2012-12-12T08-15-09.222Z 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. Got: 2 Approve, 2 Pending.

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug1083269 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1083269-2012-12-12T13-32-03.688Z is finished. The
  final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
lp:~zorba-coders/zorba/bug1083269 updated
11143. By Rodolfo Ochoa

Merging Paul changes

11144. By Rodolfo Ochoa

Restoring hash.h

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

Validation queue job bug1083269-2012-12-12T14-06-58.294Z 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. Got: 3 Approve, 1 Pending.

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 bug1083269-2012-12-12T16-24-52.863Z 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/compiler/expression/expr_clone.cpp'
2--- src/compiler/expression/expr_clone.cpp 2012-12-06 22:49:35 +0000
3+++ src/compiler/expression/expr_clone.cpp 2012-12-12 14:10:26 +0000
4@@ -14,6 +14,7 @@
5 * limitations under the License.
6 */
7
8+#include "stdafx.h"
9 #include "compiler/expression/expr_base.h"
10 #include "compiler/expression/update_exprs.h"
11 #include "compiler/expression/expr.h"
12
13=== modified file 'src/context/dynamic_context.cpp'
14--- src/context/dynamic_context.cpp 2012-10-22 17:08:12 +0000
15+++ src/context/dynamic_context.cpp 2012-12-12 14:10:26 +0000
16@@ -15,6 +15,10 @@
17 */
18 #include "stdafx.h"
19
20+#ifdef WIN32
21+#include <sys/types.h>
22+#include <sys/timeb.h>
23+#endif
24 #include "common/common.h"
25 #include <assert.h>
26 #include <time.h>
27@@ -23,7 +27,6 @@
28 #include <sys/time.h>
29 #include <unistd.h>
30 #endif
31-
32 #include "store/api/iterator.h"
33 #include "store/api/temp_seq.h"
34 #include "store/api/item_factory.h"
35
36=== modified file 'src/functions/func_schema_impl.cpp'
37--- src/functions/func_schema_impl.cpp 2012-10-15 13:35:59 +0000
38+++ src/functions/func_schema_impl.cpp 2012-12-12 14:10:26 +0000
39@@ -14,6 +14,7 @@
40 * limitations under the License.
41 */
42
43+#include "stdafx.h"
44 #include "functions/func_schema.h"
45
46 #include "compiler/expression/expr_base.h"
47
48=== modified file 'src/precompiled/stdafx.h'
49--- src/precompiled/stdafx.h 2012-10-08 12:09:36 +0000
50+++ src/precompiled/stdafx.h 2012-12-12 14:10:26 +0000
51@@ -29,6 +29,7 @@
52 #include <crtdefs.h>
53 #include <map>
54 #include <set>
55+ #include <sys/timeb.h>
56
57 #include "runtime/sequences/sequences.h"
58 #include "diagnostics/xquery_diagnostics.h"
59@@ -58,17 +59,19 @@
60 #include "zorbatypes/m_apm.h"
61 #include "zorbatypes/rclock.h"
62 #include "zorbatypes/schema_types.h"
63+//
64 #include "zorbatypes/timezone.h"
65 #include "zorbatypes/URI.h"
66 #include "zorbatypes/xerces_xmlcharray.h"
67 #include "zorbatypes/zorbatypes_decl.h"
68 #include "zorbatypes/zstring.h"
69 #include "zorbautils/condition.h"
70- #include "zorbautils/hashfun.h"
71+
72 #include "zorbautils/hashmap.h"
73 #include "zorbautils/hashmap_itemp.h"
74 #include "zorbautils/hashmap_zstring.h"
75 #include "zorbautils/hashset.h"
76+
77 #include "zorbautils/latch.h"
78 #include "zorbautils/locale.h"
79 #include "zorbautils/lock.h"
80@@ -83,6 +86,5 @@
81 #include "runtime/full_text/ftcontains_visitor.h"
82 #include "store/api/ft_token_iterator.h"
83 #include "store/naive/ft_token_store.h"
84-
85 #endif
86 /* vim:set et sw=2 ts=2: */
87
88=== modified file 'src/unit_tests/test_hashmaps.cpp'
89--- src/unit_tests/test_hashmaps.cpp 2012-11-12 21:17:32 +0000
90+++ src/unit_tests/test_hashmaps.cpp 2012-12-12 14:10:26 +0000
91@@ -1,3 +1,4 @@
92+#include "stdafx.h"
93
94 #include <cstdlib>
95 #include <stdio.h>
96@@ -48,12 +49,12 @@
97 class StrCompFunc
98 {
99 public:
100- static bool equal(const zstring& k1, const zstring& k2)
101+ static bool equal(const std::string& k1, const std::string& k2)
102 {
103 return k1 == k2;
104 }
105
106- static uint32_t hash(const zstring& key)
107+ static uint32_t hash(const std::string& key)
108 {
109 return hashfun::h32(key.c_str(), FNV_32_INIT);
110 }
111@@ -78,7 +79,7 @@
112 int_buf[i] = rand() % num;
113 }
114
115- zstring* str_buf = new zstring[num];
116+ std::string* str_buf = new std::string[num];
117
118 for (int i = 0; i < num; ++i)
119 {
120@@ -91,13 +92,13 @@
121
122
123 HashMap<uint64_t, int, IntCompFunc> map1(1024, false);
124- HashMap<zstring, int, StrCompFunc> map2(1024, false);
125+ HashMap<std::string, int, StrCompFunc> map2(1024, false);
126
127 std::unordered_map<uint64_t, int> map3(1024);
128- std::unordered_map<zstring, int> map4(1024);
129+ std::unordered_map<std::string, int> map4(1024);
130
131 hash64map<int> map5(1024, load_factor);
132- hashmap<zstring, int> map6(1024, load_factor);
133+ hashmap<std::string, int> map6(1024, load_factor);
134
135 map1.set_load_factor(load_factor);
136 map2.set_load_factor(load_factor);
137@@ -133,9 +134,8 @@
138
139 for (int i = 0; i < num; ++i)
140 {
141- zstring key = str_buf[i];
142 int value = 1;
143- (void)map2.insert(key, value);
144+ (void)map2.insert(str_buf[i], value);
145 }
146
147 zorba::time::walltime stopTime;
148@@ -144,7 +144,7 @@
149 double time = time::get_walltime_elapsed(startTime, stopTime);
150
151 std::cout << "Load factor = " << load_factor << std::endl
152- << "Num zstring insertions = " << num << std::endl
153+ << "Num string insertions = " << num << std::endl
154 << "HashMap entries = " << map2.size() << std::endl
155 << "HashMap buckets = " << map2.bucket_count() << std::endl
156 << "HashMap capacity = " << map2.capacity() << std::endl
157@@ -180,9 +180,8 @@
158
159 for (int i = 0; i < num; ++i)
160 {
161- zstring key = str_buf[i];
162 int value = 1;
163- (void)map4.insert(std::pair<zstring, int>(key, value));
164+ (void)map4.insert(std::pair<std::string, int>(str_buf[i], value));
165 }
166
167 zorba::time::walltime stopTime;
168@@ -191,7 +190,7 @@
169 double time = time::get_walltime_elapsed(startTime, stopTime);
170
171 std::cout << "Load factor = " << load_factor << std::endl
172- << "Num zstring insertions = " << num << std::endl
173+ << "Num string insertions = " << num << std::endl
174 << "UnorderedMap entries = " << map4.size() << std::endl
175 << "UnorderedMap buckets = " << map4.bucket_count() << std::endl
176 << "Time = " << time << std::endl;
177@@ -225,9 +224,8 @@
178
179 for (int i = 0; i < num; ++i)
180 {
181- zstring key = str_buf[i];
182 int value = 1;
183- (void)map6.put(key, value, false);
184+ (void)map6.put(str_buf[i], value, false);
185 }
186
187 zorba::time::walltime stopTime;
188@@ -236,7 +234,7 @@
189 double time = time::get_walltime_elapsed(startTime, stopTime);
190
191 std::cout << "Load factor = " << load_factor << std::endl
192- << "Num zstring insertions = " << num << std::endl
193+ << "Num string insertions = " << num << std::endl
194 << "hashmap entries = " << map6.size() << std::endl
195 << "Time = " << time << std::endl;
196 }
197
198=== modified file 'src/util/CMakeLists.txt'
199--- src/util/CMakeLists.txt 2012-10-08 12:09:36 +0000
200+++ src/util/CMakeLists.txt 2012-12-12 14:10:26 +0000
201@@ -51,6 +51,4 @@
202 HEADER_GROUP_SUBFOLDER(UTIL_SRCS fx)
203 HEADER_GROUP_SUBFOLDER(UTIL_SRCS win32)
204
205-IF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
206- ADD_SRC_SUBFOLDER(UTIL_SRCS hash UTIL_HASH_SRCS)
207-ENDIF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
208+ADD_SRC_SUBFOLDER(UTIL_SRCS hash UTIL_HASH_SRCS)
209
210=== modified file 'src/util/hash/CMakeLists.txt'
211--- src/util/hash/CMakeLists.txt 2012-05-24 16:19:28 +0000
212+++ src/util/hash/CMakeLists.txt 2012-12-12 14:10:26 +0000
213@@ -14,5 +14,9 @@
214
215 SET(UTIL_HASH_SRCS
216 hash.cpp
217- rehash_policy.cpp
218- )
219+)
220+
221+IF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
222+ LIST(APPEND UTIL_HASH_SRCS
223+ rehash_policy.cpp)
224+ENDIF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
225
226=== modified file 'src/util/hash/hash.cpp'
227--- src/util/hash/hash.cpp 2012-06-02 00:35:58 +0000
228+++ src/util/hash/hash.cpp 2012-12-12 14:10:26 +0000
229@@ -15,7 +15,9 @@
230 */
231
232 // standard
233-#include <limits>
234+#ifdef ZORBA_HASH_FN_PJW
235+# include <limits>
236+#endif /* ZORBA_HASH_FN_PJW */
237
238 // local
239 #include "hash.h"

Subscribers

People subscribed via source and target branches