Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.
Commit message: Added missing include in test_hashmaps.cpp; hopefully fixes compilation error on Windows Requested reviews: Markos Zaharioudakis (markos-za) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/133994 Added missing include in test_hashmaps.cpp; hopefully fixes compilation error on Windows -- https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/133994 Your team Zorba Coders is subscribed to branch lp:zorba.
=== 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 @@ std::string lVarName = lStr.substr(0, lPos); std::string lValue = lStr.substr(lPos + 1); bool lInlineFile = true; - if (lVarName.at(lVarName.size()-1) == ':') { + if (lVarName.at(lVarName.size()-1) == ':') + { lInlineFile = false; lVarName.resize(lVarName.size()-1); // remove the : } @@ -80,7 +81,8 @@ } for (std::vector<std::string>::const_iterator lIter = theOption.begin(); - lIter != theOption.end(); ++lIter) { + lIter != theOption.end(); ++lIter) + { size_t lEQual = lIter->find_last_of("="); if (lEQual == std::string::npos) return "option must be of the form {namespace}localname=value"; @@ -93,8 +95,10 @@ lOption.value = lValue; theStaticContextOptions.push_back(lOption); } + for (std::vector<std::string>::const_iterator lIter = theStopWords.begin(); - lIter != theStopWords.end(); ++lIter) { + lIter != theStopWords.end(); ++lIter) + { size_t lEQual = lIter->find(":="); if (lEQual == std::string::npos) return "Stop-words mapping must be of the form URI:=value"; @@ -107,8 +111,10 @@ lMapping.value = lValue; theStopWordsMapping.push_back(lMapping); } + for (std::vector<std::string>::const_iterator lIter = theThesaurus.begin(); - lIter != theThesaurus.end(); ++lIter) { + lIter != theThesaurus.end(); ++lIter) + { size_t lEQual = lIter->find(":="); if (lEQual == std::string::npos) return "Thesaurus mapping must be of the form URI:=value"; === 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 @@ #include "zorbacmdproperties_base.h" -class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase { +class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase +{ public: - struct ExternalVariable { + struct ExternalVariable + { std::string var_name; std::string var_value; bool inline_file; }; + typedef std::vector<ExternalVariable> ExternalVars_t; - struct StaticContextOption { + + + struct StaticContextOption + { std::string clark_qname; std::string value; }; + typedef std::vector<StaticContextOption> Options_t; - struct FullTextMapping { + struct FullTextMapping + { std::string uri; std::string value; }; + typedef std::vector<FullTextMapping> FullText_t; typedef std::vector<std::string> QueriesOrFiles_t; === 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 @@ { bool modified = false; expr* newArg = partial_eval_return_clause(static_cast<flwor_expr*>(arg), - modified, - rCtx); + modified, + rCtx); if (newArg != arg) fo->set_arg(0, newArg); === 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 @@ { theOptionMap->insert(qname2, option); } - } -store::Item_t -static_context::parse_and_expand_qname( + +/***************************************************************************//** + +********************************************************************************/ +store::Item_t static_context::parse_and_expand_qname( const zstring& value, const char* default_ns, const QueryLoc& loc) const @@ -3502,7 +3504,7 @@ std::vector<store::Item_t>::iterator lIter; - if ( name == "error" ) + if (name == "error") { if ( lQName->getLocalName() == "all" ) { @@ -3513,11 +3515,12 @@ lIter != theWarningsAreErrors.end(); ++lIter ) { - if ( lQName->equals( (*lIter) ) ) + if (lQName->equals((*lIter))) { return; } } + theWarningsAreErrors.push_back( lQName ); } else if ( name == "disable" ) === 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 @@ void compute_base_uri(); - zstring - resolve_relative_uri( + zstring resolve_relative_uri( const zstring& aUri, bool aValidate = true) const; - zstring - resolve_relative_uri( + zstring resolve_relative_uri( const zstring& aRelativeUri, const zstring& aBaseUri, bool validate = true) const; @@ -758,33 +756,39 @@ * Given a URI, return a Resource for that URI. * @param aEntityKind the expected kind of entity expected at this aUri */ - std::auto_ptr<internal::Resource> resolve_uri - (zstring const& aUri, internal::EntityData::Kind aEntityKind, zstring& oErrorMessage) const; + std::auto_ptr<internal::Resource> resolve_uri( + const zstring& aUri, + internal::EntityData::Kind aEntityKind, + zstring& oErrorMessage) const; /** * Given a URI, return a Resource for that URI. * @param aEntityData an EntityData object to pass to the mappers/resolvers. */ - std::auto_ptr<internal::Resource> resolve_uri - (zstring const& aUri, internal::EntityData const& aEntityData, zstring& oErrorMessage) const; + std::auto_ptr<internal::Resource> resolve_uri( + const zstring& aUri, + const internal::EntityData& aEntityData, + zstring& oErrorMessage) const; /** * Given a URI, populate a vector with a list of component URIs. If * no component URIs are available, the vector will be populated * with (only) the input URI. */ - void get_component_uris - (zstring const& aUri, internal::EntityData::Kind aEntityKind, - std::vector<zstring>& oComponents) const; + void get_component_uris( + const zstring& aUri, + internal::EntityData::Kind aEntityKind, + std::vector<zstring>& oComponents) const; /** * Given a URI, populate a vector with a list of candidate URIs. If * no candidate URIs are available, the vector will be populated * with (only) the input URI. */ - void get_candidate_uris - (zstring const& aUri, internal::EntityData::Kind aEntityKind, - std::vector<zstring>& oComponents) const; + void get_candidate_uris( + const zstring& aUri, + internal::EntityData::Kind aEntityKind, + std::vector<zstring>& oComponents) const; void set_uri_path(const std::vector<zstring>& aURIPath); @@ -991,6 +995,8 @@ bool lookup_option(const store::Item* qname, zstring& option) const; + bool is_feature_set(feature::kind k) const { return (theFeatures & k) != 0; } + protected: void process_feature_option( const zstring& value, @@ -1011,8 +1017,11 @@ parse_and_expand_qname( const zstring& value, const char* default_ns, - const QueryLoc& loc - ) const; + const QueryLoc& loc) const; + + void set_feature(feature::kind k) { theFeatures |= k; } + + void unset_feature(feature::kind k) { theFeatures &= ~k; } public: @@ -1070,19 +1079,15 @@ DecimalFormat_t get_decimal_format(const store::Item_t& qname); #ifndef ZORBA_NO_FULL_TEXT - ftmatch_options const* get_match_options() const { - return theFTMatchOptions; - } + ftmatch_options const* get_match_options() const { return theFTMatchOptions; } - void set_match_options( ftmatch_options *mo ) { - theFTMatchOptions = mo; - } + void set_match_options(ftmatch_options* mo) { theFTMatchOptions = mo; } #endif /* ZORBA_NO_FULL_TEXT */ // // Merge in the static context of a module // - void import_module (const static_context* module, const QueryLoc& loc); + void import_module(const static_context* module, const QueryLoc& loc); // // Warnings @@ -1116,32 +1121,17 @@ private: - void apply_uri_mappers(zstring const& aUri, - internal::EntityData const* aEntityData, - internal::URIMapper::Kind aMapperKind, - std::vector<zstring>& oUris) const; - - void apply_url_resolvers(std::vector<zstring>& aUrls, - internal::EntityData const* aEntityData, - std::auto_ptr<internal::Resource>& oResource, - zstring& oErrorMessage) const; - -public: - bool is_feature_set( feature::kind k ) const - { - return (theFeatures & k) != 0; - } - - void set_feature( feature::kind k ) - { - theFeatures |= k; - } - - void unset_feature( feature::kind k ) - { - theFeatures &= ~k; - } - + void apply_uri_mappers( + zstring const& aUri, + internal::EntityData const* aEntityData, + internal::URIMapper::Kind aMapperKind, + std::vector<zstring>& oUris) const; + + void apply_url_resolvers( + std::vector<zstring>& aUrls, + internal::EntityData const* aEntityData, + std::auto_ptr<internal::Resource>& oResource, + zstring& oErrorMessage) const; }; === 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 @@ test_uri.cpp test_json_parser.cpp test_fs_iterator.cpp -# test_hashmaps.cpp -# memory_manager.cpp + test_hashmaps.cpp ) IF (NOT ZORBA_NO_FULL_TEXT) === 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 @@ #include "util/hashmap32.h" #include "util/hashmap.h" #include "util/unordered_map.h" - +#include "util/hash/hash.h" namespace zorba { @@ -27,7 +27,7 @@ static uint32_t hash(uint64_t key) { #if 1 - return key; + return static_cast<uint32_t>(key); #else char buf[9]; buf[0] = (unsigned char)(key>>56); === 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 @@ libunittests["unordered_set"] = test_unordered_set; #endif /* ZORBA_HAVE_UNORDERED_SET */ - // libunittests["hashmaps"] = test_hashmaps; + libunittests["hashmaps"] = test_hashmaps; libunittests["uri"] = runUriTest; === 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 @@ #include <typeinfo> #include <string.h> +#include <zorba/util/time.h> + #include "zorbaserialization/archiver_consts.h" namespace zorba
-- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp