[CDRIVER-508] Can't compile, static and non-static b64 functions Created: 23/Jan/15  Updated: 15/Dec/17  Resolved: 25/Feb/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.0.2
Fix Version/s: 1.1.0

Type: New Feature Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Unassigned
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-2429 Factor libbson and libmongoc base64 code Closed

 Description   

These 3 functions can't be static and non static at the same time:

int b64_ntop (uint8_t const *src, size_t srclength, char *target, size_t targsize);
void b64_initialize_rmap (void);
int b64_pton (char const *src, uint8_t *target, size_t targsize);

https://github.com/mongodb/mongo-c-driver/blob/master/src/mongoc/mongoc-b64-private.h#L29
https://github.com/mongodb/mongo-c-driver/blob/master/src/mongoc/mongoc-b64-private.h#L35
https://github.com/mongodb/mongo-c-driver/blob/master/src/mongoc/mongoc-b64-private.h#L38

https://github.com/mongodb/libbson/blob/master/src/bson/b64_ntop.h#L116
https://github.com/mongodb/libbson/blob/master/src/bson/b64_pton.h#L132
https://github.com/mongodb/libbson/blob/master/src/bson/b64_pton.h#L161

Please choose which one you prefer.

By the way, you have 2 definitions of Assert(), Base64 and Pad64 (one in b64_ntop.h and one in b64_pton.h). It would be better to put them in the same file.



 Comments   
Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'samantharitter', u'name': u'Samantha Ritter', u'email': u'samantha.ritter@10gen.com'}

Message: SDAM: port over missed changes from master:

Comment by Githook User [ 11/Mar/15 ]

Author:

{u'username': u'samantharitter', u'name': u'Samantha Ritter', u'email': u'samantha.ritter@10gen.com'}

Message: SDAM: port over missed changes from master:

Comment by Githook User [ 27/Jan/15 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey (hanumantmk)', u'email': u'jcarey@argv.me'}

Message: CDRIVER-508 namespace b64_ functions

We really shouldn't be kicking around non-static b64_ functions.
Namespace them all and let's be done with it.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/fcfe613be4083d62f26cbc66e954351a250f9018

Comment by Jerome Lebel [ 23/Jan/15 ]

I'm the author

Generated at Wed Feb 07 21:09:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.