Skip to content

Commit

Permalink
MAINT: Fix warnings in radixsort.c.src: comparing integers of differe…
Browse files Browse the repository at this point in the history
…nt signs

Eliminate many compiler warnings of the form:

    numpy/core/src/npysort/radixsort.c.src:61:23: warning: comparison of integers of different signs: 'npy_intp' (aka 'long') and 'unsigned long' [-Wsign-compare]
            for (l = 0; l < sizeof(npy_ubyte); l++) {
                        ~ ^ ~~~~~~~~~~~~~~~~~
    numpy/core/src/npysort/radixsort.c.src:66:19: warning: comparison of integers of different signs: 'npy_intp' (aka 'long') and 'unsigned long' [-Wsign-compare]
        for (l = 0; l < sizeof(npy_ubyte); l++) {
                    ~ ^ ~~~~~~~~~~~~~~~~~
  • Loading branch information
WarrenWeckesser committed Jun 15, 2019
1 parent 9f8401f commit 156d547
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions numpy/core/src/npysort/radixsort.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ nth_byte_@suff@(@type@ key, npy_intp l) {
radixsort0_@suff@(@type@ *arr, @type@ *aux, npy_intp num)
{
npy_intp cnt[sizeof(@type@)][1 << 8] = { { 0 } };
npy_intp i, l;
npy_intp i;
size_t l;
@type@ key0 = KEY_OF(arr[0]);
npy_intp ncols = 0;
size_t ncols = 0;
npy_ubyte cols[sizeof(@type@)];

for (i = 0; i < num; i++) {
Expand Down Expand Up @@ -139,9 +140,10 @@ npy_intp*
aradixsort0_@suff@(@type@ *arr, npy_intp *aux, npy_intp *tosort, npy_intp num)
{
npy_intp cnt[sizeof(@type@)][1 << 8] = { { 0 } };
npy_intp i, l;
npy_intp i;
size_t l;
@type@ key0 = KEY_OF(arr[0]);
npy_intp ncols = 0;
size_t ncols = 0;
npy_ubyte cols[sizeof(@type@)];

for (i = 0; i < num; i++) {
Expand Down

0 comments on commit 156d547

Please sign in to comment.