zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #26517
[Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba
Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba.
Commit message:
Misc fixes.
Requested reviews:
Paul J. Lucas (paul-lucas)
For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/201083
Misc fixes.
--
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/201083
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/item.h'
--- include/zorba/item.h 2013-09-26 07:38:44 +0000
+++ include/zorba/item.h 2014-01-09 19:18:47 +0000
@@ -418,7 +418,7 @@
* @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Object).
*/
Item
- getObjectValue(String aName) const;
+ getObjectValue(String const &aName) const;
/**
* Checks whether the item's content is streamable.
=== modified file 'include/zorba/util/base64_stream.h'
--- include/zorba/util/base64_stream.h 2013-08-05 22:23:16 +0000
+++ include/zorba/util/base64_stream.h 2014-01-09 19:18:47 +0000
@@ -269,11 +269,10 @@
* @param stream The stream to attach the base64::streambuf to. If the
* stream already has a base64::streambuf attached to it, this contructor
* does nothing.
- * @param charset The name of the character encoding to convert from/to.
* @return \c true only if a base64::streambuf was attached.
*/
- bool attach( StreamType &stream, char const *charset ) {
- if ( base64::attach( stream, charset ) ) {
+ bool attach( StreamType &stream ) {
+ if ( base64::attach( stream ) ) {
stream_ = &stream;
return true;
}
=== modified file 'src/api/item.cpp'
--- src/api/item.cpp 2013-08-01 17:38:35 +0000
+++ src/api/item.cpp 2014-01-09 19:18:47 +0000
@@ -534,7 +534,7 @@
Item
-Item::getObjectValue(String aName) const
+Item::getObjectValue(String const &aName) const
{
ITEM_TRY
SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
=== modified file 'src/diagnostics/dict.cpp'
--- src/diagnostics/dict.cpp 2013-08-02 18:34:59 +0000
+++ src/diagnostics/dict.cpp 2014-01-09 19:18:47 +0000
@@ -68,9 +68,15 @@
char const* lookup( char const *key ) {
typedef pair<entry const*,entry const*> range_type;
+ //
+ // It's possible an exception was thrown after shutdown has already started
+ // in which case the GlobalEnvironment no longer exists.
+ //
+ GlobalEnvironment const *const genv = GENV_PTR;
+ iso639_1::type lang = genv ? genv->get_host_lang() : locale::get_host_lang();
static entry const *begin, *end;
- if ( !begin && !get_dict( GENV.get_host_lang(), &begin, &end ) )
+ if ( !begin && !get_dict( lang, &begin, &end ) )
SET_DICT( en, begin, end );
entry entry_to_find;
=== modified file 'src/system/globalenv.h'
--- src/system/globalenv.h 2013-09-24 09:48:50 +0000
+++ src/system/globalenv.h 2014-01-09 19:18:47 +0000
@@ -102,6 +102,11 @@
return *m_globalEnv;
}
+ static GlobalEnvironment* getInstancePtr()
+ {
+ return m_globalEnv;
+ }
+
public:
~GlobalEnvironment();
@@ -151,6 +156,7 @@
#define GENV GlobalEnvironment::getInstance()
+#define GENV_PTR GlobalEnvironment::getInstancePtr()
#define GENV_TYPESYSTEM GlobalEnvironment::getInstance().getRootTypeManager()
=== modified file 'src/unit_tests/test_base64_streambuf.cpp'
--- src/unit_tests/test_base64_streambuf.cpp 2013-06-11 23:38:49 +0000
+++ src/unit_tests/test_base64_streambuf.cpp 2014-01-09 19:18:47 +0000
@@ -100,6 +100,13 @@
return b64_str == expected_b64_str;
}
+static void test_instantiate() {
+ base64::auto_attach<ostream> aao;
+ (void)aao;
+ base64::stream<ostream> b64os;
+ (void)b64os;
+}
+
static bool test_put( test const *t ) {
ostringstream oss;
{ // local scope
@@ -128,6 +135,8 @@
namespace UnitTests {
int test_base64_streambuf( int, char*[] ) {
+ test_instantiate();
+
int test_no = 0;
for ( test const *t = tests; t->raw_str; ++t, ++test_no ) {
ASSERT_TRUE_AND_NO_EXCEPTION( test_no, test_getline( t ) );
Follow ups