Repository: numpy/numpy
File: numpy/_core/src/umath/_scaled_float_dtype.c (C)

Code before:
        .nin = 1,
        .nout = 1,
        .dtypes = sort_dtypes,
        .slots = sort_slots,
    };
    sort_spec.name = "sfloat_sort";
    sort_spec.casting = NPY_NO_CASTING;
    sort_spec.flags = NPY_METH_NO_FLOATINGPOINT_ERRORS;

    PyArray_DTypeMeta *argsort_dtypes[2] = {&PyArray_SFloatDType, &PyArray_IntpDType};
    PyType_Slot argsort_slots[3] = {
        {NPY_METH_resolve_descriptors, &sfloat_argsort_resolve_descriptors},
        {NPY_METH_get_loop, &sfloat_argsort_get_loop},
        {0, NULL}
    };
    PyArrayMethod_Spec argsort_spec = {
        .nin = 1,
        .nout = 1,
        .dtypes = argsort_dtypes,
        .slots = argsort_slots,
    };
    argsort_spec.name = "sfloat_argsort";
    argsort_spec.casting = NPY_NO_CASTING;
    argsort_spec.flags = NPY_METH_NO_FLOATINGPOINT_ERRORS;

    PyUFunc_LoopSlot loops[5] = {
        {"multiply", &multiply_spec},
        {"add", &add_spec},
        {"sort", &sort_spec},
        {"argsort", &argsort_spec},
        {NULL, NULL}
    };
    if (PyUFunc_AddLoopsFromSpecs(loops) < 0) {
        return -1;
    }

    /* N.B.: Wrapping isn't actually correct if scaling can be negative */
    if (sfloat_add_wrapping_loop("hypot", multiply_dtypes) < 0) {
        return -1;
    }

    /*
     * Add a promoter for both directions of multiply with double.
     */
    int res;
    PyArray_DTypeMeta *double_DType = &PyArray_DoubleDType;

    PyArray_DTypeMeta *promoter_dtypes[3] = {
            &PyArray_SFloatDType, double_DType, NULL};

    PyObject *promoter = PyCapsule_New(

Review comment (suggestion):
```suggestion
    PyUFunc_LoopSlot loops[] = {
```

Code after:
        .dtypes = sort_dtypes,
        .slots = sort_slots,
    };
    sort_spec.name = "sfloat_sort";
    sort_spec.casting = NPY_NO_CASTING;
    sort_spec.flags = NPY_METH_NO_FLOATINGPOINT_ERRORS;

    PyArray_DTypeMeta *argsort_dtypes[2] = {&PyArray_SFloatDType, &PyArray_IntpDType};
    PyType_Slot argsort_slots[3] = {
        {NPY_METH_resolve_descriptors, &sfloat_argsort_resolve_descriptors},
        {NPY_METH_get_loop, &sfloat_argsort_get_loop},
        {0, NULL}
    };
    PyArrayMethod_Spec argsort_spec = {
        .nin = 1,
        .nout = 1,
        .dtypes = argsort_dtypes,
        .slots = argsort_slots,
    };
    argsort_spec.name = "sfloat_argsort";
    argsort_spec.casting = NPY_NO_CASTING;
    argsort_spec.flags = NPY_METH_NO_FLOATINGPOINT_ERRORS;

    PyUFunc_LoopSlot loops[] = {
        {"multiply", &multiply_spec},
        {"add", &add_spec},
        {"sort", &sort_spec},
        {"argsort", &argsort_spec},
        {NULL, NULL}
    };
    if (PyUFunc_AddLoopsFromSpecs(loops) < 0) {
        return -1;
    }

    /* N.B.: Wrapping isn't actually correct if scaling can be negative */
    if (sfloat_add_wrapping_loop("hypot", all_sfloat_dtypes) < 0) {
        return -1;
    }

    /*
     * Add a promoter for both directions of multiply with double.
     */
    int res = -1;
    PyArray_DTypeMeta *double_DType = &PyArray_DoubleDType;

    PyArray_DTypeMeta *promoter_dtypes[3] = {
            &PyArray_SFloatDType, double_DType, NULL};

    PyObject *promoter = PyCapsule_New(
            &promote_to_sfloat, "numpy._ufunc_promoter", NULL);
    if (promoter == NULL) {