@@ -4904,30 +4904,30 @@ static PyNumberMethods dec_number_methods =
49044904static PyMethodDef dec_methods [] =
49054905{
49064906 /* Unary arithmetic functions, optional context arg */
4907- { "exp" , ( PyCFunction )( void ( * )( void )) dec_mpd_qexp , METH_VARARGS |METH_KEYWORDS , doc_exp },
4908- { "ln" , ( PyCFunction )( void ( * )( void )) dec_mpd_qln , METH_VARARGS |METH_KEYWORDS , doc_ln },
4909- { "log10" , ( PyCFunction )( void ( * )( void )) dec_mpd_qlog10 , METH_VARARGS |METH_KEYWORDS , doc_log10 },
4910- { "next_minus" , ( PyCFunction )( void ( * )( void )) dec_mpd_qnext_minus , METH_VARARGS |METH_KEYWORDS , doc_next_minus },
4911- { "next_plus" , ( PyCFunction )( void ( * )( void )) dec_mpd_qnext_plus , METH_VARARGS |METH_KEYWORDS , doc_next_plus },
4912- { "normalize" , ( PyCFunction )( void ( * )( void )) dec_mpd_qreduce , METH_VARARGS |METH_KEYWORDS , doc_normalize },
4913- { "to_integral" , ( PyCFunction )( void ( * )( void )) PyDec_ToIntegralValue , METH_VARARGS |METH_KEYWORDS , doc_to_integral },
4914- { "to_integral_exact" , ( PyCFunction )( void ( * )( void )) PyDec_ToIntegralExact , METH_VARARGS |METH_KEYWORDS , doc_to_integral_exact },
4915- { "to_integral_value" , ( PyCFunction )( void ( * )( void )) PyDec_ToIntegralValue , METH_VARARGS |METH_KEYWORDS , doc_to_integral_value },
4916- { "sqrt" , ( PyCFunction )( void ( * )( void )) dec_mpd_qsqrt , METH_VARARGS |METH_KEYWORDS , doc_sqrt },
4907+ { "exp" , _PyCFunction_CAST ( dec_mpd_qexp ) , METH_VARARGS |METH_KEYWORDS , doc_exp },
4908+ { "ln" , _PyCFunction_CAST ( dec_mpd_qln ) , METH_VARARGS |METH_KEYWORDS , doc_ln },
4909+ { "log10" , _PyCFunction_CAST ( dec_mpd_qlog10 ) , METH_VARARGS |METH_KEYWORDS , doc_log10 },
4910+ { "next_minus" , _PyCFunction_CAST ( dec_mpd_qnext_minus ) , METH_VARARGS |METH_KEYWORDS , doc_next_minus },
4911+ { "next_plus" , _PyCFunction_CAST ( dec_mpd_qnext_plus ) , METH_VARARGS |METH_KEYWORDS , doc_next_plus },
4912+ { "normalize" , _PyCFunction_CAST ( dec_mpd_qreduce ) , METH_VARARGS |METH_KEYWORDS , doc_normalize },
4913+ { "to_integral" , _PyCFunction_CAST ( PyDec_ToIntegralValue ) , METH_VARARGS |METH_KEYWORDS , doc_to_integral },
4914+ { "to_integral_exact" , _PyCFunction_CAST ( PyDec_ToIntegralExact ) , METH_VARARGS |METH_KEYWORDS , doc_to_integral_exact },
4915+ { "to_integral_value" , _PyCFunction_CAST ( PyDec_ToIntegralValue ) , METH_VARARGS |METH_KEYWORDS , doc_to_integral_value },
4916+ { "sqrt" , _PyCFunction_CAST ( dec_mpd_qsqrt ) , METH_VARARGS |METH_KEYWORDS , doc_sqrt },
49174917
49184918 /* Binary arithmetic functions, optional context arg */
4919- { "compare" , ( PyCFunction )( void ( * )( void )) dec_mpd_qcompare , METH_VARARGS |METH_KEYWORDS , doc_compare },
4920- { "compare_signal" , ( PyCFunction )( void ( * )( void )) dec_mpd_qcompare_signal , METH_VARARGS |METH_KEYWORDS , doc_compare_signal },
4921- { "max" , ( PyCFunction )( void ( * )( void )) dec_mpd_qmax , METH_VARARGS |METH_KEYWORDS , doc_max },
4922- { "max_mag" , ( PyCFunction )( void ( * )( void )) dec_mpd_qmax_mag , METH_VARARGS |METH_KEYWORDS , doc_max_mag },
4923- { "min" , ( PyCFunction )( void ( * )( void )) dec_mpd_qmin , METH_VARARGS |METH_KEYWORDS , doc_min },
4924- { "min_mag" , ( PyCFunction )( void ( * )( void )) dec_mpd_qmin_mag , METH_VARARGS |METH_KEYWORDS , doc_min_mag },
4925- { "next_toward" , ( PyCFunction )( void ( * )( void )) dec_mpd_qnext_toward , METH_VARARGS |METH_KEYWORDS , doc_next_toward },
4926- { "quantize" , ( PyCFunction )( void ( * )( void )) dec_mpd_qquantize , METH_VARARGS |METH_KEYWORDS , doc_quantize },
4927- { "remainder_near" , ( PyCFunction )( void ( * )( void )) dec_mpd_qrem_near , METH_VARARGS |METH_KEYWORDS , doc_remainder_near },
4919+ { "compare" , _PyCFunction_CAST ( dec_mpd_qcompare ) , METH_VARARGS |METH_KEYWORDS , doc_compare },
4920+ { "compare_signal" , _PyCFunction_CAST ( dec_mpd_qcompare_signal ) , METH_VARARGS |METH_KEYWORDS , doc_compare_signal },
4921+ { "max" , _PyCFunction_CAST ( dec_mpd_qmax ) , METH_VARARGS |METH_KEYWORDS , doc_max },
4922+ { "max_mag" , _PyCFunction_CAST ( dec_mpd_qmax_mag ) , METH_VARARGS |METH_KEYWORDS , doc_max_mag },
4923+ { "min" , _PyCFunction_CAST ( dec_mpd_qmin ) , METH_VARARGS |METH_KEYWORDS , doc_min },
4924+ { "min_mag" , _PyCFunction_CAST ( dec_mpd_qmin_mag ) , METH_VARARGS |METH_KEYWORDS , doc_min_mag },
4925+ { "next_toward" , _PyCFunction_CAST ( dec_mpd_qnext_toward ) , METH_VARARGS |METH_KEYWORDS , doc_next_toward },
4926+ { "quantize" , _PyCFunction_CAST ( dec_mpd_qquantize ) , METH_VARARGS |METH_KEYWORDS , doc_quantize },
4927+ { "remainder_near" , _PyCFunction_CAST ( dec_mpd_qrem_near ) , METH_VARARGS |METH_KEYWORDS , doc_remainder_near },
49284928
49294929 /* Ternary arithmetic functions, optional context arg */
4930- { "fma" , ( PyCFunction )( void ( * )( void )) dec_mpd_qfma , METH_VARARGS |METH_KEYWORDS , doc_fma },
4930+ { "fma" , _PyCFunction_CAST ( dec_mpd_qfma ) , METH_VARARGS |METH_KEYWORDS , doc_fma },
49314931
49324932 /* Boolean functions, no context arg */
49334933 { "is_canonical" , dec_mpd_iscanonical , METH_NOARGS , doc_is_canonical },
@@ -4940,8 +4940,8 @@ static PyMethodDef dec_methods [] =
49404940 { "is_zero" , dec_mpd_iszero , METH_NOARGS , doc_is_zero },
49414941
49424942 /* Boolean functions, optional context arg */
4943- { "is_normal" , ( PyCFunction )( void ( * )( void )) dec_mpd_isnormal , METH_VARARGS |METH_KEYWORDS , doc_is_normal },
4944- { "is_subnormal" , ( PyCFunction )( void ( * )( void )) dec_mpd_issubnormal , METH_VARARGS |METH_KEYWORDS , doc_is_subnormal },
4943+ { "is_normal" , _PyCFunction_CAST ( dec_mpd_isnormal ) , METH_VARARGS |METH_KEYWORDS , doc_is_normal },
4944+ { "is_subnormal" , _PyCFunction_CAST ( dec_mpd_issubnormal ) , METH_VARARGS |METH_KEYWORDS , doc_is_subnormal },
49454945
49464946 /* Unary functions, no context arg */
49474947 { "adjusted" , dec_mpd_adjexp , METH_NOARGS , doc_adjusted },
@@ -4954,24 +4954,24 @@ static PyMethodDef dec_methods [] =
49544954 { "copy_negate" , dec_mpd_qcopy_negate , METH_NOARGS , doc_copy_negate },
49554955
49564956 /* Unary functions, optional context arg */
4957- { "logb" , ( PyCFunction )( void ( * )( void )) dec_mpd_qlogb , METH_VARARGS |METH_KEYWORDS , doc_logb },
4958- { "logical_invert" , ( PyCFunction )( void ( * )( void )) dec_mpd_qinvert , METH_VARARGS |METH_KEYWORDS , doc_logical_invert },
4959- { "number_class" , ( PyCFunction )( void ( * )( void )) dec_mpd_class , METH_VARARGS |METH_KEYWORDS , doc_number_class },
4960- { "to_eng_string" , ( PyCFunction )( void ( * )( void )) dec_mpd_to_eng , METH_VARARGS |METH_KEYWORDS , doc_to_eng_string },
4957+ { "logb" , _PyCFunction_CAST ( dec_mpd_qlogb ) , METH_VARARGS |METH_KEYWORDS , doc_logb },
4958+ { "logical_invert" , _PyCFunction_CAST ( dec_mpd_qinvert ) , METH_VARARGS |METH_KEYWORDS , doc_logical_invert },
4959+ { "number_class" , _PyCFunction_CAST ( dec_mpd_class ) , METH_VARARGS |METH_KEYWORDS , doc_number_class },
4960+ { "to_eng_string" , _PyCFunction_CAST ( dec_mpd_to_eng ) , METH_VARARGS |METH_KEYWORDS , doc_to_eng_string },
49614961
49624962 /* Binary functions, optional context arg for conversion errors */
4963- { "compare_total" , ( PyCFunction )( void ( * )( void )) dec_mpd_compare_total , METH_VARARGS |METH_KEYWORDS , doc_compare_total },
4964- { "compare_total_mag" , ( PyCFunction )( void ( * )( void )) dec_mpd_compare_total_mag , METH_VARARGS |METH_KEYWORDS , doc_compare_total_mag },
4965- { "copy_sign" , ( PyCFunction )( void ( * )( void )) dec_mpd_qcopy_sign , METH_VARARGS |METH_KEYWORDS , doc_copy_sign },
4966- { "same_quantum" , ( PyCFunction )( void ( * )( void )) dec_mpd_same_quantum , METH_VARARGS |METH_KEYWORDS , doc_same_quantum },
4963+ { "compare_total" , _PyCFunction_CAST ( dec_mpd_compare_total ) , METH_VARARGS |METH_KEYWORDS , doc_compare_total },
4964+ { "compare_total_mag" , _PyCFunction_CAST ( dec_mpd_compare_total_mag ) , METH_VARARGS |METH_KEYWORDS , doc_compare_total_mag },
4965+ { "copy_sign" , _PyCFunction_CAST ( dec_mpd_qcopy_sign ) , METH_VARARGS |METH_KEYWORDS , doc_copy_sign },
4966+ { "same_quantum" , _PyCFunction_CAST ( dec_mpd_same_quantum ) , METH_VARARGS |METH_KEYWORDS , doc_same_quantum },
49674967
49684968 /* Binary functions, optional context arg */
4969- { "logical_and" , ( PyCFunction )( void ( * )( void )) dec_mpd_qand , METH_VARARGS |METH_KEYWORDS , doc_logical_and },
4970- { "logical_or" , ( PyCFunction )( void ( * )( void )) dec_mpd_qor , METH_VARARGS |METH_KEYWORDS , doc_logical_or },
4971- { "logical_xor" , ( PyCFunction )( void ( * )( void )) dec_mpd_qxor , METH_VARARGS |METH_KEYWORDS , doc_logical_xor },
4972- { "rotate" , ( PyCFunction )( void ( * )( void )) dec_mpd_qrotate , METH_VARARGS |METH_KEYWORDS , doc_rotate },
4973- { "scaleb" , ( PyCFunction )( void ( * )( void )) dec_mpd_qscaleb , METH_VARARGS |METH_KEYWORDS , doc_scaleb },
4974- { "shift" , ( PyCFunction )( void ( * )( void )) dec_mpd_qshift , METH_VARARGS |METH_KEYWORDS , doc_shift },
4969+ { "logical_and" , _PyCFunction_CAST ( dec_mpd_qand ) , METH_VARARGS |METH_KEYWORDS , doc_logical_and },
4970+ { "logical_or" , _PyCFunction_CAST ( dec_mpd_qor ) , METH_VARARGS |METH_KEYWORDS , doc_logical_or },
4971+ { "logical_xor" , _PyCFunction_CAST ( dec_mpd_qxor ) , METH_VARARGS |METH_KEYWORDS , doc_logical_xor },
4972+ { "rotate" , _PyCFunction_CAST ( dec_mpd_qrotate ) , METH_VARARGS |METH_KEYWORDS , doc_rotate },
4973+ { "scaleb" , _PyCFunction_CAST ( dec_mpd_qscaleb ) , METH_VARARGS |METH_KEYWORDS , doc_scaleb },
4974+ { "shift" , _PyCFunction_CAST ( dec_mpd_qshift ) , METH_VARARGS |METH_KEYWORDS , doc_shift },
49754975
49764976 /* Miscellaneous */
49774977 { "from_float" , dec_from_float , METH_O |METH_CLASS , doc_from_float },
@@ -5609,7 +5609,7 @@ static PyMethodDef context_methods [] =
56095609 { "subtract" , ctx_mpd_qsub , METH_VARARGS , doc_ctx_subtract },
56105610
56115611 /* Binary or ternary arithmetic functions */
5612- { "power" , ( PyCFunction )( void ( * )( void )) ctx_mpd_qpow , METH_VARARGS |METH_KEYWORDS , doc_ctx_power },
5612+ { "power" , _PyCFunction_CAST ( ctx_mpd_qpow ) , METH_VARARGS |METH_KEYWORDS , doc_ctx_power },
56135613
56145614 /* Ternary arithmetic functions */
56155615 { "fma" , ctx_mpd_qfma , METH_VARARGS , doc_ctx_fma },
@@ -5727,7 +5727,7 @@ static PyMethodDef _decimal_methods [] =
57275727{
57285728 { "getcontext" , (PyCFunction )PyDec_GetCurrentContext , METH_NOARGS , doc_getcontext },
57295729 { "setcontext" , (PyCFunction )PyDec_SetCurrentContext , METH_O , doc_setcontext },
5730- { "localcontext" , ( PyCFunction )( void ( * )( void )) ctxmanager_new , METH_VARARGS |METH_KEYWORDS , doc_localcontext },
5730+ { "localcontext" , _PyCFunction_CAST ( ctxmanager_new ) , METH_VARARGS |METH_KEYWORDS , doc_localcontext },
57315731#ifdef EXTRA_FUNCTIONALITY
57325732 { "IEEEContext" , (PyCFunction )ieee_context , METH_O , doc_ieee_context },
57335733#endif
0 commit comments