Skip to content

Commit 2706e72

Browse files
author
Christian Hergert
committed
cursor: fix warning with -Wshadow on older RHEL
1 parent c4f9cff commit 2706e72

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/mongoc/mongoc-cursor.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -759,34 +759,34 @@ mongoc_cursor_clone (const mongoc_cursor_t *cursor)
759759
mongoc_cursor_t *
760760
_mongoc_cursor_clone (const mongoc_cursor_t *cursor)
761761
{
762-
mongoc_cursor_t *clone;
762+
mongoc_cursor_t *_clone;
763763

764764
ENTRY;
765765

766766
BSON_ASSERT (cursor);
767767

768-
clone = bson_malloc0 (sizeof *clone);
768+
_clone = bson_malloc0 (sizeof *_clone);
769769

770-
clone->client = cursor->client;
771-
clone->is_command = cursor->is_command;
772-
clone->flags = cursor->flags;
773-
clone->skip = cursor->skip;
774-
clone->batch_size = cursor->batch_size;
775-
clone->limit = cursor->limit;
776-
clone->nslen = cursor->nslen;
770+
_clone->client = cursor->client;
771+
_clone->is_command = cursor->is_command;
772+
_clone->flags = cursor->flags;
773+
_clone->skip = cursor->skip;
774+
_clone->batch_size = cursor->batch_size;
775+
_clone->limit = cursor->limit;
776+
_clone->nslen = cursor->nslen;
777777

778778
if (cursor->read_prefs) {
779-
clone->read_prefs = mongoc_read_prefs_copy (cursor->read_prefs);
779+
_clone->read_prefs = mongoc_read_prefs_copy (cursor->read_prefs);
780780
}
781781

782-
bson_copy_to (&cursor->query, &clone->query);
783-
bson_copy_to (&cursor->fields, &clone->fields);
782+
bson_copy_to (&cursor->query, &_clone->query);
783+
bson_copy_to (&cursor->fields, &_clone->fields);
784784

785-
bson_strncpy (clone->ns, cursor->ns, sizeof clone->ns);
785+
bson_strncpy (_clone->ns, cursor->ns, sizeof _clone->ns);
786786

787-
_mongoc_buffer_init (&clone->buffer, NULL, 0, NULL);
787+
_mongoc_buffer_init (&_clone->buffer, NULL, 0, NULL);
788788

789789
mongoc_counter_cursors_active_inc ();
790790

791-
RETURN(clone);
791+
RETURN (_clone);
792792
}

0 commit comments

Comments
 (0)