Skip to content

Commit b0df529

Browse files
author
Christian Hergert
committed
cursor: cleanup some gcc warnings.
1 parent a5203e1 commit b0df529

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

mongoc/mongoc-cursor-array-private.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@
2020

2121

2222
#include <bson.h>
23+
2324
#include "mongoc-cursor-private.h"
2425

26+
2527
BSON_BEGIN_DECLS
2628

29+
2730
void
28-
_mongoc_cursor_array_init (mongoc_cursor_t *cursor);
31+
_mongoc_cursor_array_init (mongoc_cursor_t *cursor)
32+
BSON_GNUC_INTERNAL;
33+
2934

3035
BSON_END_DECLS
3136

mongoc/mongoc-cursor-array.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define _GNU_SOURCE
1919

2020
#include "mongoc-cursor.h"
21+
#include "mongoc-cursor-array-private.h"
2122
#include "mongoc-cursor-private.h"
2223
#include "mongoc-client-private.h"
2324
#include "mongoc-counters-private.h"
@@ -30,7 +31,8 @@
3031
#undef MONGOC_LOG_DOMAIN
3132
#define MONGOC_LOG_DOMAIN "cursor-array"
3233

33-
typedef struct mongoc_cursor_array
34+
35+
typedef struct
3436
{
3537
const bson_t *result;
3638
bson_bool_t has_array;
@@ -143,13 +145,11 @@ _mongoc_cursor_array_more (mongoc_cursor_t *cursor)
143145
}
144146

145147

146-
static mongoc_cursor_interface_t _mongoc_cursor_array = {
147-
&_mongoc_cursor_array_clone,
148-
&_mongoc_cursor_array_destroy,
149-
&_mongoc_cursor_array_more,
150-
&_mongoc_cursor_array_next,
151-
NULL,
152-
NULL,
148+
static mongoc_cursor_interface_t gMongocCursorArray = {
149+
_mongoc_cursor_array_clone,
150+
_mongoc_cursor_array_destroy,
151+
_mongoc_cursor_array_more,
152+
_mongoc_cursor_array_next,
153153
};
154154

155155

@@ -160,7 +160,7 @@ _mongoc_cursor_array_init (mongoc_cursor_t *cursor)
160160

161161
cursor->interface_data = _mongoc_cursor_array_new ();
162162

163-
memcpy (&cursor->interface, &_mongoc_cursor_array,
163+
memcpy (&cursor->interface, &gMongocCursorArray,
164164
sizeof (mongoc_cursor_interface_t));
165165

166166
EXIT;

mongoc/mongoc-cursor-cursorid-private.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@
2020

2121

2222
#include <bson.h>
23+
2324
#include "mongoc-cursor-private.h"
2425

26+
2527
BSON_BEGIN_DECLS
2628

29+
2730
void
28-
_mongoc_cursor_cursorid_init (mongoc_cursor_t *cursor);
31+
_mongoc_cursor_cursorid_init (mongoc_cursor_t *cursor)
32+
BSON_GNUC_INTERNAL;
33+
2934

3035
BSON_END_DECLS
3136

mongoc/mongoc-cursor-cursorid.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "mongoc-cursor.h"
2121
#include "mongoc-cursor-private.h"
22+
#include "mongoc-cursor-cursorid-private.h"
2223
#include "mongoc-client-private.h"
2324
#include "mongoc-counters-private.h"
2425
#include "mongoc-error.h"
@@ -30,7 +31,8 @@
3031
#undef MONGOC_LOG_DOMAIN
3132
#define MONGOC_LOG_DOMAIN "cursor-cursorid"
3233

33-
typedef struct mongoc_cursor_cursorid
34+
35+
typedef struct
3436
{
3537
bson_bool_t has_cursor;
3638
} mongoc_cursor_cursorid_t;
@@ -118,13 +120,11 @@ _mongoc_cursor_cursorid_clone (const mongoc_cursor_t *cursor)
118120
}
119121

120122

121-
static mongoc_cursor_interface_t _mongoc_cursor_cursorid = {
122-
&_mongoc_cursor_cursorid_clone,
123-
&_mongoc_cursor_cursorid_destroy,
124-
NULL,
125-
&_mongoc_cursor_cursorid_next,
126-
NULL,
123+
static mongoc_cursor_interface_t gMongocCursorCursorid = {
124+
_mongoc_cursor_cursorid_clone,
125+
_mongoc_cursor_cursorid_destroy,
127126
NULL,
127+
_mongoc_cursor_cursorid_next,
128128
};
129129

130130

@@ -135,7 +135,7 @@ _mongoc_cursor_cursorid_init (mongoc_cursor_t *cursor)
135135

136136
cursor->interface_data = _mongoc_cursor_cursorid_new ();
137137

138-
memcpy (&cursor->interface, &_mongoc_cursor_cursorid,
138+
memcpy (&cursor->interface, &gMongocCursorCursorid,
139139
sizeof (mongoc_cursor_interface_t));
140140

141141
EXIT;

0 commit comments

Comments
 (0)