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
=== modified file 'bin/zorbacmdproperties.cpp'
--- bin/zorbacmdproperties.cpp 2012-09-19 21:16:15 +0000
+++ bin/zorbacmdproperties.cpp 2012-11-12 21:20:28 +0000
@@ -68,7 +68,8 @@
68 std::string lVarName = lStr.substr(0, lPos);68 std::string lVarName = lStr.substr(0, lPos);
69 std::string lValue = lStr.substr(lPos + 1);69 std::string lValue = lStr.substr(lPos + 1);
70 bool lInlineFile = true;70 bool lInlineFile = true;
71 if (lVarName.at(lVarName.size()-1) == ':') {71 if (lVarName.at(lVarName.size()-1) == ':')
72 {
72 lInlineFile = false;73 lInlineFile = false;
73 lVarName.resize(lVarName.size()-1); // remove the :74 lVarName.resize(lVarName.size()-1); // remove the :
74 }75 }
@@ -80,7 +81,8 @@
80 }81 }
8182
82 for (std::vector<std::string>::const_iterator lIter = theOption.begin();83 for (std::vector<std::string>::const_iterator lIter = theOption.begin();
83 lIter != theOption.end(); ++lIter) {84 lIter != theOption.end(); ++lIter)
85 {
84 size_t lEQual = lIter->find_last_of("=");86 size_t lEQual = lIter->find_last_of("=");
85 if (lEQual == std::string::npos)87 if (lEQual == std::string::npos)
86 return "option must be of the form {namespace}localname=value";88 return "option must be of the form {namespace}localname=value";
@@ -93,8 +95,10 @@
93 lOption.value = lValue;95 lOption.value = lValue;
94 theStaticContextOptions.push_back(lOption);96 theStaticContextOptions.push_back(lOption);
95 }97 }
98
96 for (std::vector<std::string>::const_iterator lIter = theStopWords.begin();99 for (std::vector<std::string>::const_iterator lIter = theStopWords.begin();
97 lIter != theStopWords.end(); ++lIter) {100 lIter != theStopWords.end(); ++lIter)
101 {
98 size_t lEQual = lIter->find(":=");102 size_t lEQual = lIter->find(":=");
99 if (lEQual == std::string::npos)103 if (lEQual == std::string::npos)
100 return "Stop-words mapping must be of the form URI:=value";104 return "Stop-words mapping must be of the form URI:=value";
@@ -107,8 +111,10 @@
107 lMapping.value = lValue;111 lMapping.value = lValue;
108 theStopWordsMapping.push_back(lMapping);112 theStopWordsMapping.push_back(lMapping);
109 }113 }
114
110 for (std::vector<std::string>::const_iterator lIter = theThesaurus.begin();115 for (std::vector<std::string>::const_iterator lIter = theThesaurus.begin();
111 lIter != theThesaurus.end(); ++lIter) {116 lIter != theThesaurus.end(); ++lIter)
117 {
112 size_t lEQual = lIter->find(":=");118 size_t lEQual = lIter->find(":=");
113 if (lEQual == std::string::npos)119 if (lEQual == std::string::npos)
114 return "Thesaurus mapping must be of the form URI:=value";120 return "Thesaurus mapping must be of the form URI:=value";
115121
=== modified file 'bin/zorbacmdproperties.h'
--- bin/zorbacmdproperties.h 2012-09-19 21:16:15 +0000
+++ bin/zorbacmdproperties.h 2012-11-12 21:20:28 +0000
@@ -21,24 +21,33 @@
2121
22#include "zorbacmdproperties_base.h"22#include "zorbacmdproperties_base.h"
2323
24class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase {24class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase
25{
25public:26public:
26 struct ExternalVariable {27 struct ExternalVariable
28 {
27 std::string var_name;29 std::string var_name;
28 std::string var_value;30 std::string var_value;
29 bool inline_file;31 bool inline_file;
30 };32 };
33
31 typedef std::vector<ExternalVariable> ExternalVars_t;34 typedef std::vector<ExternalVariable> ExternalVars_t;
32 struct StaticContextOption {35
36
37 struct StaticContextOption
38 {
33 std::string clark_qname;39 std::string clark_qname;
34 std::string value;40 std::string value;
35 };41 };
42
36 typedef std::vector<StaticContextOption> Options_t;43 typedef std::vector<StaticContextOption> Options_t;
3744
38 struct FullTextMapping {45 struct FullTextMapping
46 {
39 std::string uri;47 std::string uri;
40 std::string value;48 std::string value;
41 };49 };
50
42 typedef std::vector<FullTextMapping> FullText_t;51 typedef std::vector<FullTextMapping> FullText_t;
4352
44 typedef std::vector<std::string> QueriesOrFiles_t;53 typedef std::vector<std::string> QueriesOrFiles_t;
4554
=== modified file 'src/compiler/rewriter/rules/fold_rules.cpp'
--- src/compiler/rewriter/rules/fold_rules.cpp 2012-10-31 08:02:16 +0000
+++ src/compiler/rewriter/rules/fold_rules.cpp 2012-11-12 21:20:28 +0000
@@ -734,8 +734,8 @@
734 {734 {
735 bool modified = false;735 bool modified = false;
736 expr* newArg = partial_eval_return_clause(static_cast<flwor_expr*>(arg),736 expr* newArg = partial_eval_return_clause(static_cast<flwor_expr*>(arg),
737 modified,737 modified,
738 rCtx);738 rCtx);
739739
740 if (newArg != arg)740 if (newArg != arg)
741 fo->set_arg(0, newArg);741 fo->set_arg(0, newArg);
742742
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2012-10-08 12:09:36 +0000
+++ src/context/static_context.cpp 2012-11-12 21:20:28 +0000
@@ -3460,11 +3460,13 @@
3460 {3460 {
3461 theOptionMap->insert(qname2, option);3461 theOptionMap->insert(qname2, option);
3462 }3462 }
3463
3464}3463}
34653464
3466store::Item_t3465
3467static_context::parse_and_expand_qname(3466/***************************************************************************//**
3467
3468********************************************************************************/
3469store::Item_t static_context::parse_and_expand_qname(
3468 const zstring& value,3470 const zstring& value,
3469 const char* default_ns,3471 const char* default_ns,
3470 const QueryLoc& loc) const3472 const QueryLoc& loc) const
@@ -3502,7 +3504,7 @@
35023504
3503 std::vector<store::Item_t>::iterator lIter;3505 std::vector<store::Item_t>::iterator lIter;
35043506
3505 if ( name == "error" )3507 if (name == "error")
3506 {3508 {
3507 if ( lQName->getLocalName() == "all" )3509 if ( lQName->getLocalName() == "all" )
3508 {3510 {
@@ -3513,11 +3515,12 @@
3513 lIter != theWarningsAreErrors.end();3515 lIter != theWarningsAreErrors.end();
3514 ++lIter )3516 ++lIter )
3515 {3517 {
3516 if ( lQName->equals( (*lIter) ) )3518 if (lQName->equals((*lIter)))
3517 {3519 {
3518 return;3520 return;
3519 }3521 }
3520 }3522 }
3523
3521 theWarningsAreErrors.push_back( lQName );3524 theWarningsAreErrors.push_back( lQName );
3522 }3525 }
3523 else if ( name == "disable" )3526 else if ( name == "disable" )
35243527
=== modified file 'src/context/static_context.h'
--- src/context/static_context.h 2012-10-08 12:09:36 +0000
+++ src/context/static_context.h 2012-11-12 21:20:28 +0000
@@ -727,13 +727,11 @@
727727
728 void compute_base_uri();728 void compute_base_uri();
729729
730 zstring730 zstring resolve_relative_uri(
731 resolve_relative_uri(
732 const zstring& aUri,731 const zstring& aUri,
733 bool aValidate = true) const;732 bool aValidate = true) const;
734733
735 zstring734 zstring resolve_relative_uri(
736 resolve_relative_uri(
737 const zstring& aRelativeUri,735 const zstring& aRelativeUri,
738 const zstring& aBaseUri,736 const zstring& aBaseUri,
739 bool validate = true) const;737 bool validate = true) const;
@@ -758,33 +756,39 @@
758 * Given a URI, return a Resource for that URI.756 * Given a URI, return a Resource for that URI.
759 * @param aEntityKind the expected kind of entity expected at this aUri757 * @param aEntityKind the expected kind of entity expected at this aUri
760 */758 */
761 std::auto_ptr<internal::Resource> resolve_uri759 std::auto_ptr<internal::Resource> resolve_uri(
762 (zstring const& aUri, internal::EntityData::Kind aEntityKind, zstring& oErrorMessage) const;760 const zstring& aUri,
761 internal::EntityData::Kind aEntityKind,
762 zstring& oErrorMessage) const;
763763
764 /**764 /**
765 * Given a URI, return a Resource for that URI.765 * Given a URI, return a Resource for that URI.
766 * @param aEntityData an EntityData object to pass to the mappers/resolvers.766 * @param aEntityData an EntityData object to pass to the mappers/resolvers.
767 */767 */
768 std::auto_ptr<internal::Resource> resolve_uri768 std::auto_ptr<internal::Resource> resolve_uri(
769 (zstring const& aUri, internal::EntityData const& aEntityData, zstring& oErrorMessage) const;769 const zstring& aUri,
770 const internal::EntityData& aEntityData,
771 zstring& oErrorMessage) const;
770772
771 /**773 /**
772 * Given a URI, populate a vector with a list of component URIs. If774 * Given a URI, populate a vector with a list of component URIs. If
773 * no component URIs are available, the vector will be populated775 * no component URIs are available, the vector will be populated
774 * with (only) the input URI.776 * with (only) the input URI.
775 */777 */
776 void get_component_uris778 void get_component_uris(
777 (zstring const& aUri, internal::EntityData::Kind aEntityKind,779 const zstring& aUri,
778 std::vector<zstring>& oComponents) const;780 internal::EntityData::Kind aEntityKind,
781 std::vector<zstring>& oComponents) const;
779782
780 /**783 /**
781 * Given a URI, populate a vector with a list of candidate URIs. If784 * Given a URI, populate a vector with a list of candidate URIs. If
782 * no candidate URIs are available, the vector will be populated785 * no candidate URIs are available, the vector will be populated
783 * with (only) the input URI.786 * with (only) the input URI.
784 */787 */
785 void get_candidate_uris788 void get_candidate_uris(
786 (zstring const& aUri, internal::EntityData::Kind aEntityKind,789 const zstring& aUri,
787 std::vector<zstring>& oComponents) const;790 internal::EntityData::Kind aEntityKind,
791 std::vector<zstring>& oComponents) const;
788792
789 void set_uri_path(const std::vector<zstring>& aURIPath);793 void set_uri_path(const std::vector<zstring>& aURIPath);
790794
@@ -991,6 +995,8 @@
991995
992 bool lookup_option(const store::Item* qname, zstring& option) const;996 bool lookup_option(const store::Item* qname, zstring& option) const;
993997
998 bool is_feature_set(feature::kind k) const { return (theFeatures & k) != 0; }
999
994protected:1000protected:
995 void process_feature_option(1001 void process_feature_option(
996 const zstring& value,1002 const zstring& value,
@@ -1011,8 +1017,11 @@
1011 parse_and_expand_qname(1017 parse_and_expand_qname(
1012 const zstring& value,1018 const zstring& value,
1013 const char* default_ns,1019 const char* default_ns,
1014 const QueryLoc& loc1020 const QueryLoc& loc) const;
1015 ) const;1021
1022 void set_feature(feature::kind k) { theFeatures |= k; }
1023
1024 void unset_feature(feature::kind k) { theFeatures &= ~k; }
10161025
1017public:1026public:
10181027
@@ -1070,19 +1079,15 @@
1070 DecimalFormat_t get_decimal_format(const store::Item_t& qname);1079 DecimalFormat_t get_decimal_format(const store::Item_t& qname);
10711080
1072#ifndef ZORBA_NO_FULL_TEXT1081#ifndef ZORBA_NO_FULL_TEXT
1073 ftmatch_options const* get_match_options() const {1082 ftmatch_options const* get_match_options() const { return theFTMatchOptions; }
1074 return theFTMatchOptions;
1075 }
10761083
1077 void set_match_options( ftmatch_options *mo ) {1084 void set_match_options(ftmatch_options* mo) { theFTMatchOptions = mo; }
1078 theFTMatchOptions = mo;
1079 }
1080#endif /* ZORBA_NO_FULL_TEXT */1085#endif /* ZORBA_NO_FULL_TEXT */
10811086
1082 //1087 //
1083 // Merge in the static context of a module1088 // Merge in the static context of a module
1084 //1089 //
1085 void import_module (const static_context* module, const QueryLoc& loc);1090 void import_module(const static_context* module, const QueryLoc& loc);
10861091
1087 //1092 //
1088 // Warnings1093 // Warnings
@@ -1116,32 +1121,17 @@
11161121
1117private:1122private:
11181123
1119 void apply_uri_mappers(zstring const& aUri,1124 void apply_uri_mappers(
1120 internal::EntityData const* aEntityData,1125 zstring const& aUri,
1121 internal::URIMapper::Kind aMapperKind,1126 internal::EntityData const* aEntityData,
1122 std::vector<zstring>& oUris) const;1127 internal::URIMapper::Kind aMapperKind,
11231128 std::vector<zstring>& oUris) const;
1124 void apply_url_resolvers(std::vector<zstring>& aUrls,1129
1125 internal::EntityData const* aEntityData,1130 void apply_url_resolvers(
1126 std::auto_ptr<internal::Resource>& oResource,1131 std::vector<zstring>& aUrls,
1127 zstring& oErrorMessage) const;1132 internal::EntityData const* aEntityData,
11281133 std::auto_ptr<internal::Resource>& oResource,
1129public:1134 zstring& oErrorMessage) const;
1130 bool is_feature_set( feature::kind k ) const
1131 {
1132 return (theFeatures & k) != 0;
1133 }
1134
1135 void set_feature( feature::kind k )
1136 {
1137 theFeatures |= k;
1138 }
1139
1140 void unset_feature( feature::kind k )
1141 {
1142 theFeatures &= ~k;
1143 }
1144
1145};1135};
11461136
11471137
11481138
=== modified file 'src/unit_tests/CMakeLists.txt'
--- src/unit_tests/CMakeLists.txt 2012-10-27 01:38:33 +0000
+++ src/unit_tests/CMakeLists.txt 2012-11-12 21:20:28 +0000
@@ -25,8 +25,7 @@
25 test_uri.cpp25 test_uri.cpp
26 test_json_parser.cpp26 test_json_parser.cpp
27 test_fs_iterator.cpp27 test_fs_iterator.cpp
28# test_hashmaps.cpp28 test_hashmaps.cpp
29# memory_manager.cpp
30)29)
3130
32IF (NOT ZORBA_NO_FULL_TEXT)31IF (NOT ZORBA_NO_FULL_TEXT)
3332
=== modified file 'src/unit_tests/test_hashmaps.cpp'
--- src/unit_tests/test_hashmaps.cpp 2012-09-19 05:15:49 +0000
+++ src/unit_tests/test_hashmaps.cpp 2012-11-12 21:20:28 +0000
@@ -9,7 +9,7 @@
9#include "util/hashmap32.h"9#include "util/hashmap32.h"
10#include "util/hashmap.h"10#include "util/hashmap.h"
11#include "util/unordered_map.h"11#include "util/unordered_map.h"
1212#include "util/hash/hash.h"
1313
14namespace zorba {14namespace zorba {
1515
@@ -27,7 +27,7 @@
27 static uint32_t hash(uint64_t key)27 static uint32_t hash(uint64_t key)
28 {28 {
29#if 129#if 1
30 return key;30 return static_cast<uint32_t>(key);
31#else31#else
32 char buf[9];32 char buf[9];
33 buf[0] = (unsigned char)(key>>56);33 buf[0] = (unsigned char)(key>>56);
3434
=== modified file 'src/unit_tests/unit_tests.cpp'
--- src/unit_tests/unit_tests.cpp 2012-10-27 01:38:33 +0000
+++ src/unit_tests/unit_tests.cpp 2012-11-12 21:20:28 +0000
@@ -71,7 +71,7 @@
71 libunittests["unordered_set"] = test_unordered_set;71 libunittests["unordered_set"] = test_unordered_set;
72#endif /* ZORBA_HAVE_UNORDERED_SET */72#endif /* ZORBA_HAVE_UNORDERED_SET */
7373
74 // libunittests["hashmaps"] = test_hashmaps;74 libunittests["hashmaps"] = test_hashmaps;
7575
76 libunittests["uri"] = runUriTest;76 libunittests["uri"] = runUriTest;
7777
7878
=== modified file 'src/zorbaserialization/class_serializer.h'
--- src/zorbaserialization/class_serializer.h 2012-09-19 21:16:15 +0000
+++ src/zorbaserialization/class_serializer.h 2012-11-12 21:20:28 +0000
@@ -29,6 +29,8 @@
29#include <typeinfo>29#include <typeinfo>
30#include <string.h>30#include <string.h>
3131
32#include <zorba/util/time.h>
33
32#include "zorbaserialization/archiver_consts.h"34#include "zorbaserialization/archiver_consts.h"
3335
34namespace zorba36namespace zorba

Subscribers

People subscribed via source and target branches