diff options
Diffstat (limited to 'bson/bsonobjbuilder.h')
-rw-r--r-- | bson/bsonobjbuilder.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bson/bsonobjbuilder.h b/bson/bsonobjbuilder.h index 86a52ac..f89d225 100644 --- a/bson/bsonobjbuilder.h +++ b/bson/bsonobjbuilder.h @@ -469,17 +469,14 @@ namespace mongo { Use BinDataGeneral if you don't care about the type. @param data the byte array */ - BSONObjBuilder& appendBinData( const StringData& fieldName, int len, BinDataType type, const char *data ) { + BSONObjBuilder& appendBinData( const StringData& fieldName, int len, BinDataType type, const void *data ) { _b.appendNum( (char) BinData ); _b.appendStr( fieldName ); _b.appendNum( len ); _b.appendNum( (char) type ); - _b.appendBuf( (void *) data, len ); + _b.appendBuf( data, len ); return *this; } - BSONObjBuilder& appendBinData( const StringData& fieldName, int len, BinDataType type, const unsigned char *data ) { - return appendBinData(fieldName, len, type, (const char *) data); - } /** Subtype 2 is deprecated. @@ -487,13 +484,13 @@ namespace mongo { @param data a byte array @param len the length of data */ - BSONObjBuilder& appendBinDataArrayDeprecated( const char * fieldName , const char * data , int len ) { + BSONObjBuilder& appendBinDataArrayDeprecated( const char * fieldName , const void * data , int len ) { _b.appendNum( (char) BinData ); _b.appendStr( fieldName ); _b.appendNum( len + 4 ); _b.appendNum( (char)0x2 ); _b.appendNum( len ); - _b.appendBuf( (void *) data, len ); + _b.appendBuf( data, len ); return *this; } |