mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-24 16:50:34 +08:00
TinyBson - Compatibility with cpp compiler
Changed "private" keyword used for argument to "priv"
This commit is contained in:
@@ -111,7 +111,7 @@ read_double(bson_decoder_t decoder, double *d)
|
||||
}
|
||||
|
||||
int
|
||||
bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder_callback callback, void *private)
|
||||
bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder_callback callback, void *priv)
|
||||
{
|
||||
int32_t junk;
|
||||
|
||||
@@ -119,7 +119,7 @@ bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder_callback cal
|
||||
decoder->buf = NULL;
|
||||
decoder->dead = false;
|
||||
decoder->callback = callback;
|
||||
decoder->private = private;
|
||||
decoder->priv = priv;
|
||||
decoder->nesting = 1;
|
||||
decoder->pending = 0;
|
||||
decoder->node.type = BSON_UNDEFINED;
|
||||
@@ -135,7 +135,7 @@ bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder_callback cal
|
||||
|
||||
int
|
||||
bson_decoder_init_buf(bson_decoder_t decoder, void *buf, unsigned bufsize, bson_decoder_callback callback,
|
||||
void *private)
|
||||
void *priv)
|
||||
{
|
||||
int32_t len;
|
||||
|
||||
@@ -158,7 +158,7 @@ bson_decoder_init_buf(bson_decoder_t decoder, void *buf, unsigned bufsize, bson_
|
||||
|
||||
decoder->bufpos = 0;
|
||||
decoder->callback = callback;
|
||||
decoder->private = private;
|
||||
decoder->priv = priv;
|
||||
decoder->nesting = 1;
|
||||
decoder->pending = 0;
|
||||
decoder->node.type = BSON_UNDEFINED;
|
||||
@@ -305,7 +305,7 @@ bson_decoder_next(bson_decoder_t decoder)
|
||||
}
|
||||
|
||||
/* call the callback and pass its results back */
|
||||
return decoder->callback(decoder, decoder->private, &decoder->node);
|
||||
return decoder->callback(decoder, decoder->priv, &decoder->node);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -99,7 +99,7 @@ typedef struct bson_decoder_s *bson_decoder_t;
|
||||
*
|
||||
* The node callback function's return value is returned by bson_decoder_next.
|
||||
*/
|
||||
typedef int (* bson_decoder_callback)(bson_decoder_t decoder, void *private, bson_node_t node);
|
||||
typedef int (* bson_decoder_callback)(bson_decoder_t decoder, void *priv, bson_node_t node);
|
||||
|
||||
struct bson_decoder_s {
|
||||
/* file reader state */
|
||||
@@ -112,7 +112,7 @@ struct bson_decoder_s {
|
||||
|
||||
bool dead;
|
||||
bson_decoder_callback callback;
|
||||
void *private;
|
||||
void *priv;
|
||||
unsigned nesting;
|
||||
struct bson_node_s node;
|
||||
int32_t pending;
|
||||
@@ -124,10 +124,10 @@ struct bson_decoder_s {
|
||||
* @param decoder Decoder state structure to be initialised.
|
||||
* @param fd File to read BSON data from.
|
||||
* @param callback Callback to be invoked by bson_decoder_next
|
||||
* @param private Callback private data, stored in node.
|
||||
* @param priv Callback private data, stored in node.
|
||||
* @return Zero on success.
|
||||
*/
|
||||
__EXPORT int bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder_callback callback, void *private);
|
||||
__EXPORT int bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder_callback callback, void *priv);
|
||||
|
||||
/**
|
||||
* Initialise the decoder to read from a buffer in memory.
|
||||
@@ -138,11 +138,11 @@ __EXPORT int bson_decoder_init_file(bson_decoder_t decoder, int fd, bson_decoder
|
||||
* passed as zero if the buffer size should be extracted from the
|
||||
* BSON header only.
|
||||
* @param callback Callback to be invoked by bson_decoder_next
|
||||
* @param private Callback private data, stored in node.
|
||||
* @param priv Callback private data, stored in node.
|
||||
* @return Zero on success.
|
||||
*/
|
||||
__EXPORT int bson_decoder_init_buf(bson_decoder_t decoder, void *buf, unsigned bufsize, bson_decoder_callback callback,
|
||||
void *private);
|
||||
void *priv);
|
||||
|
||||
/**
|
||||
* Process the next node from the stream and invoke the callback.
|
||||
|
||||
Reference in New Issue
Block a user