Skip to content

Commit 0bce579

Browse files
authored
PYTHON-3728 Simplify convert_codec_options signature (#1225)
1 parent 7146be0 commit 0bce579

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bson/_cbsonmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,7 @@ int cbson_convert_type_registry(PyObject* registry_obj, type_registry_t* registr
599599
* Return 1 on success. options->document_class is a new reference.
600600
* Return 0 on failure.
601601
*/
602-
int convert_codec_options(PyObject* self, PyObject* options_obj, void* p) {
603-
codec_options_t* options = (codec_options_t*)p;
602+
int convert_codec_options(PyObject* self, PyObject* options_obj, codec_options_t* options) {
604603
PyObject* type_registry_obj = NULL;
605604
long type_marker;
606605

@@ -613,8 +612,9 @@ int convert_codec_options(PyObject* self, PyObject* options_obj, void* p) {
613612
&options->unicode_decode_error_handler,
614613
&options->tzinfo,
615614
&type_registry_obj,
616-
&options->datetime_conversion))
615+
&options->datetime_conversion)) {
617616
return 0;
617+
}
618618

619619
type_marker = _type_marker(options->document_class,
620620
GETSTATE(self)->_type_marker_str);

bson/_cbsonmodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ typedef struct codec_options_t {
9393

9494
#define _cbson_convert_codec_options_INDEX 4
9595
#define _cbson_convert_codec_options_RETURN int
96-
#define _cbson_convert_codec_options_PROTO (PyObject* self, PyObject* options_obj, void* p)
96+
#define _cbson_convert_codec_options_PROTO (PyObject* self, PyObject* options_obj, codec_options_t* options)
9797

9898
#define _cbson_destroy_codec_options_INDEX 5
9999
#define _cbson_destroy_codec_options_RETURN void

0 commit comments

Comments
 (0)