summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonelement.h
diff options
context:
space:
mode:
authorJani Monoses <jani@ubuntu.com>2012-03-26 15:58:31 +0300
committerAndy Schwerin <schwerin@10gen.com>2012-03-27 10:19:57 -0400
commit38712f421b93e9c329b7613557da48ac3235a68f (patch)
treeb7911c2f1afa02b56c92be6fc7efa83a26825993 /src/mongo/bson/bsonelement.h
parentb5a14dd396630e3429491d4abc256a54b7bfb595 (diff)
downloadmongo-38712f421b93e9c329b7613557da48ac3235a68f.tar.gz
Use signed char explicitly for BSONType()
On ARM and PowerPC char is unsigned by default. This breaks BSONtype() because the latter needs to represent -1 as well. Signed-off-by: Andy Schwerin <schwerin@10gen.com>
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r--src/mongo/bson/bsonelement.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index 4d018219177..c24e6844987 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -105,7 +105,7 @@ namespace mongo {
operator std::string() const { return toString(); }
/** Returns the type of the element */
- BSONType type() const { return (BSONType) *data; }
+ BSONType type() const { return (BSONType) *reinterpret_cast< const signed char * >(data); }
/** retrieve a field within this element
throws exception if *this is not an embedded object