PYTHON-3728 Simplify convert_codec_options signature (#1225)

This commit is contained in:
Shane Harvey 2023-06-09 13:08:56 -07:00 committed by GitHub
parent 7146be01ae
commit 0bce579b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -599,8 +599,7 @@ fail:
* Return 1 on success. options->document_class is a new reference.
* Return 0 on failure.
*/
int convert_codec_options(PyObject* self, PyObject* options_obj, void* p) {
codec_options_t* options = (codec_options_t*)p;
int convert_codec_options(PyObject* self, PyObject* options_obj, codec_options_t* options) {
PyObject* type_registry_obj = NULL;
long type_marker;
@ -613,8 +612,9 @@ int convert_codec_options(PyObject* self, PyObject* options_obj, void* p) {
&options->unicode_decode_error_handler,
&options->tzinfo,
&type_registry_obj,
&options->datetime_conversion))
&options->datetime_conversion)) {
return 0;
}
type_marker = _type_marker(options->document_class,
GETSTATE(self)->_type_marker_str);

View File

@ -93,7 +93,7 @@ typedef struct codec_options_t {
#define _cbson_convert_codec_options_INDEX 4
#define _cbson_convert_codec_options_RETURN int
#define _cbson_convert_codec_options_PROTO (PyObject* self, PyObject* options_obj, void* p)
#define _cbson_convert_codec_options_PROTO (PyObject* self, PyObject* options_obj, codec_options_t* options)
#define _cbson_destroy_codec_options_INDEX 5
#define _cbson_destroy_codec_options_RETURN void