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
=== modified file 'src/compiler/expression/expr_clone.cpp'
--- src/compiler/expression/expr_clone.cpp 2012-12-06 22:49:35 +0000
+++ src/compiler/expression/expr_clone.cpp 2012-12-12 14:10:26 +0000
@@ -14,6 +14,7 @@
14 * limitations under the License.14 * limitations under the License.
15 */15 */
1616
17#include "stdafx.h"
17#include "compiler/expression/expr_base.h"18#include "compiler/expression/expr_base.h"
18#include "compiler/expression/update_exprs.h"19#include "compiler/expression/update_exprs.h"
19#include "compiler/expression/expr.h"20#include "compiler/expression/expr.h"
2021
=== modified file 'src/context/dynamic_context.cpp'
--- src/context/dynamic_context.cpp 2012-10-22 17:08:12 +0000
+++ src/context/dynamic_context.cpp 2012-12-12 14:10:26 +0000
@@ -15,6 +15,10 @@
15 */15 */
16#include "stdafx.h"16#include "stdafx.h"
1717
18#ifdef WIN32
19#include <sys/types.h>
20#include <sys/timeb.h>
21#endif
18#include "common/common.h"22#include "common/common.h"
19#include <assert.h>23#include <assert.h>
20#include <time.h>24#include <time.h>
@@ -23,7 +27,6 @@
23#include <sys/time.h>27#include <sys/time.h>
24#include <unistd.h>28#include <unistd.h>
25#endif29#endif
26
27#include "store/api/iterator.h"30#include "store/api/iterator.h"
28#include "store/api/temp_seq.h"31#include "store/api/temp_seq.h"
29#include "store/api/item_factory.h"32#include "store/api/item_factory.h"
3033
=== modified file 'src/functions/func_schema_impl.cpp'
--- src/functions/func_schema_impl.cpp 2012-10-15 13:35:59 +0000
+++ src/functions/func_schema_impl.cpp 2012-12-12 14:10:26 +0000
@@ -14,6 +14,7 @@
14 * limitations under the License.14 * limitations under the License.
15 */15 */
1616
17#include "stdafx.h"
17#include "functions/func_schema.h"18#include "functions/func_schema.h"
1819
19#include "compiler/expression/expr_base.h"20#include "compiler/expression/expr_base.h"
2021
=== modified file 'src/precompiled/stdafx.h'
--- src/precompiled/stdafx.h 2012-10-08 12:09:36 +0000
+++ src/precompiled/stdafx.h 2012-12-12 14:10:26 +0000
@@ -29,6 +29,7 @@
29 #include <crtdefs.h>29 #include <crtdefs.h>
30 #include <map>30 #include <map>
31 #include <set>31 #include <set>
32 #include <sys/timeb.h>
3233
33 #include "runtime/sequences/sequences.h"34 #include "runtime/sequences/sequences.h"
34 #include "diagnostics/xquery_diagnostics.h"35 #include "diagnostics/xquery_diagnostics.h"
@@ -58,17 +59,19 @@
58 #include "zorbatypes/m_apm.h"59 #include "zorbatypes/m_apm.h"
59 #include "zorbatypes/rclock.h"60 #include "zorbatypes/rclock.h"
60 #include "zorbatypes/schema_types.h"61 #include "zorbatypes/schema_types.h"
62//
61 #include "zorbatypes/timezone.h"63 #include "zorbatypes/timezone.h"
62 #include "zorbatypes/URI.h"64 #include "zorbatypes/URI.h"
63 #include "zorbatypes/xerces_xmlcharray.h"65 #include "zorbatypes/xerces_xmlcharray.h"
64 #include "zorbatypes/zorbatypes_decl.h"66 #include "zorbatypes/zorbatypes_decl.h"
65 #include "zorbatypes/zstring.h"67 #include "zorbatypes/zstring.h"
66 #include "zorbautils/condition.h"68 #include "zorbautils/condition.h"
67 #include "zorbautils/hashfun.h"69
68 #include "zorbautils/hashmap.h"70 #include "zorbautils/hashmap.h"
69 #include "zorbautils/hashmap_itemp.h"71 #include "zorbautils/hashmap_itemp.h"
70 #include "zorbautils/hashmap_zstring.h"72 #include "zorbautils/hashmap_zstring.h"
71 #include "zorbautils/hashset.h"73 #include "zorbautils/hashset.h"
74
72 #include "zorbautils/latch.h"75 #include "zorbautils/latch.h"
73 #include "zorbautils/locale.h"76 #include "zorbautils/locale.h"
74 #include "zorbautils/lock.h"77 #include "zorbautils/lock.h"
@@ -83,6 +86,5 @@
83 #include "runtime/full_text/ftcontains_visitor.h"86 #include "runtime/full_text/ftcontains_visitor.h"
84 #include "store/api/ft_token_iterator.h"87 #include "store/api/ft_token_iterator.h"
85 #include "store/naive/ft_token_store.h"88 #include "store/naive/ft_token_store.h"
86
87#endif89#endif
88/* vim:set et sw=2 ts=2: */90/* vim:set et sw=2 ts=2: */
8991
=== modified file 'src/unit_tests/test_hashmaps.cpp'
--- src/unit_tests/test_hashmaps.cpp 2012-11-12 21:17:32 +0000
+++ src/unit_tests/test_hashmaps.cpp 2012-12-12 14:10:26 +0000
@@ -1,3 +1,4 @@
1#include "stdafx.h"
12
2#include <cstdlib>3#include <cstdlib>
3#include <stdio.h>4#include <stdio.h>
@@ -48,12 +49,12 @@
48class StrCompFunc49class StrCompFunc
49{50{
50public:51public:
51 static bool equal(const zstring& k1, const zstring& k2) 52 static bool equal(const std::string& k1, const std::string& k2)
52 {53 {
53 return k1 == k2;54 return k1 == k2;
54 }55 }
5556
56 static uint32_t hash(const zstring& key)57 static uint32_t hash(const std::string& key)
57 { 58 {
58 return hashfun::h32(key.c_str(), FNV_32_INIT);59 return hashfun::h32(key.c_str(), FNV_32_INIT);
59 }60 }
@@ -78,7 +79,7 @@
78 int_buf[i] = rand() % num;79 int_buf[i] = rand() % num;
79 }80 }
8081
81 zstring* str_buf = new zstring[num];82 std::string* str_buf = new std::string[num];
8283
83 for (int i = 0; i < num; ++i)84 for (int i = 0; i < num; ++i)
84 {85 {
@@ -91,13 +92,13 @@
9192
9293
93 HashMap<uint64_t, int, IntCompFunc> map1(1024, false);94 HashMap<uint64_t, int, IntCompFunc> map1(1024, false);
94 HashMap<zstring, int, StrCompFunc> map2(1024, false);95 HashMap<std::string, int, StrCompFunc> map2(1024, false);
9596
96 std::unordered_map<uint64_t, int> map3(1024);97 std::unordered_map<uint64_t, int> map3(1024);
97 std::unordered_map<zstring, int> map4(1024);98 std::unordered_map<std::string, int> map4(1024);
9899
99 hash64map<int> map5(1024, load_factor);100 hash64map<int> map5(1024, load_factor);
100 hashmap<zstring, int> map6(1024, load_factor);101 hashmap<std::string, int> map6(1024, load_factor);
101102
102 map1.set_load_factor(load_factor);103 map1.set_load_factor(load_factor);
103 map2.set_load_factor(load_factor);104 map2.set_load_factor(load_factor);
@@ -133,9 +134,8 @@
133134
134 for (int i = 0; i < num; ++i)135 for (int i = 0; i < num; ++i)
135 {136 {
136 zstring key = str_buf[i];
137 int value = 1;137 int value = 1;
138 (void)map2.insert(key, value);138 (void)map2.insert(str_buf[i], value);
139 }139 }
140140
141 zorba::time::walltime stopTime;141 zorba::time::walltime stopTime;
@@ -144,7 +144,7 @@
144 double time = time::get_walltime_elapsed(startTime, stopTime); 144 double time = time::get_walltime_elapsed(startTime, stopTime);
145145
146 std::cout << "Load factor = " << load_factor << std::endl146 std::cout << "Load factor = " << load_factor << std::endl
147 << "Num zstring insertions = " << num << std::endl147 << "Num string insertions = " << num << std::endl
148 << "HashMap entries = " << map2.size() << std::endl148 << "HashMap entries = " << map2.size() << std::endl
149 << "HashMap buckets = " << map2.bucket_count() << std::endl149 << "HashMap buckets = " << map2.bucket_count() << std::endl
150 << "HashMap capacity = " << map2.capacity() << std::endl150 << "HashMap capacity = " << map2.capacity() << std::endl
@@ -180,9 +180,8 @@
180180
181 for (int i = 0; i < num; ++i)181 for (int i = 0; i < num; ++i)
182 {182 {
183 zstring key = str_buf[i];
184 int value = 1;183 int value = 1;
185 (void)map4.insert(std::pair<zstring, int>(key, value));184 (void)map4.insert(std::pair<std::string, int>(str_buf[i], value));
186 }185 }
187186
188 zorba::time::walltime stopTime;187 zorba::time::walltime stopTime;
@@ -191,7 +190,7 @@
191 double time = time::get_walltime_elapsed(startTime, stopTime); 190 double time = time::get_walltime_elapsed(startTime, stopTime);
192191
193 std::cout << "Load factor = " << load_factor << std::endl192 std::cout << "Load factor = " << load_factor << std::endl
194 << "Num zstring insertions = " << num << std::endl193 << "Num string insertions = " << num << std::endl
195 << "UnorderedMap entries = " << map4.size() << std::endl194 << "UnorderedMap entries = " << map4.size() << std::endl
196 << "UnorderedMap buckets = " << map4.bucket_count() << std::endl195 << "UnorderedMap buckets = " << map4.bucket_count() << std::endl
197 << "Time = " << time << std::endl;196 << "Time = " << time << std::endl;
@@ -225,9 +224,8 @@
225224
226 for (int i = 0; i < num; ++i)225 for (int i = 0; i < num; ++i)
227 {226 {
228 zstring key = str_buf[i];
229 int value = 1;227 int value = 1;
230 (void)map6.put(key, value, false);228 (void)map6.put(str_buf[i], value, false);
231 }229 }
232230
233 zorba::time::walltime stopTime;231 zorba::time::walltime stopTime;
@@ -236,7 +234,7 @@
236 double time = time::get_walltime_elapsed(startTime, stopTime); 234 double time = time::get_walltime_elapsed(startTime, stopTime);
237235
238 std::cout << "Load factor = " << load_factor << std::endl236 std::cout << "Load factor = " << load_factor << std::endl
239 << "Num zstring insertions = " << num << std::endl237 << "Num string insertions = " << num << std::endl
240 << "hashmap entries = " << map6.size() << std::endl238 << "hashmap entries = " << map6.size() << std::endl
241 << "Time = " << time << std::endl;239 << "Time = " << time << std::endl;
242 }240 }
243241
=== modified file 'src/util/CMakeLists.txt'
--- src/util/CMakeLists.txt 2012-10-08 12:09:36 +0000
+++ src/util/CMakeLists.txt 2012-12-12 14:10:26 +0000
@@ -51,6 +51,4 @@
51HEADER_GROUP_SUBFOLDER(UTIL_SRCS fx)51HEADER_GROUP_SUBFOLDER(UTIL_SRCS fx)
52HEADER_GROUP_SUBFOLDER(UTIL_SRCS win32)52HEADER_GROUP_SUBFOLDER(UTIL_SRCS win32)
5353
54IF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))54ADD_SRC_SUBFOLDER(UTIL_SRCS hash UTIL_HASH_SRCS)
55 ADD_SRC_SUBFOLDER(UTIL_SRCS hash UTIL_HASH_SRCS)
56ENDIF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
5755
=== modified file 'src/util/hash/CMakeLists.txt'
--- src/util/hash/CMakeLists.txt 2012-05-24 16:19:28 +0000
+++ src/util/hash/CMakeLists.txt 2012-12-12 14:10:26 +0000
@@ -14,5 +14,9 @@
1414
15SET(UTIL_HASH_SRCS15SET(UTIL_HASH_SRCS
16 hash.cpp16 hash.cpp
17 rehash_policy.cpp17)
18 )18
19IF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
20 LIST(APPEND UTIL_HASH_SRCS
21 rehash_policy.cpp)
22ENDIF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET))
1923
=== modified file 'src/util/hash/hash.cpp'
--- src/util/hash/hash.cpp 2012-06-02 00:35:58 +0000
+++ src/util/hash/hash.cpp 2012-12-12 14:10:26 +0000
@@ -15,7 +15,9 @@
15 */15 */
1616
17// standard17// standard
18#include <limits>18#ifdef ZORBA_HASH_FN_PJW
19# include <limits>
20#endif /* ZORBA_HASH_FN_PJW */
1921
20// local22// local
21#include "hash.h"23#include "hash.h"

Subscribers

People subscribed via source and target branches