Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions linear-assignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
* The parameter `cost` is the cost matrix: the cost to assign column j to row
* i is `cost[j + column_count * i].
*/
void compute_assignment(int column_count, int row_count, int *cost,
void compute_assignment(size_t column_count, size_t row_count, int *cost,
int *column2row, int *row2column)
{
int *v, *d;
int *free_row, free_count = 0, saved_free_count, *pred, *col;
int i, j, phase;
size_t i, j;
int phase;

if (column_count < 2) {
memset(column2row, 0, sizeof(int) * column_count);
Expand All @@ -30,8 +31,8 @@
ALLOC_ARRAY(v, column_count);

/* column reduction */
for (j = column_count - 1; j >= 0; j--) {
int i1 = 0;
for (j = column_count; j-- > 0; ) {
size_t i1 = 0;

for (i = 1; i < row_count; i++)
if (COST(j, i1) > COST(j, i))
Expand Down Expand Up @@ -59,13 +60,13 @@
else {
int min = COST(!j1, i) - v[!j1];
for (j = 1; j < column_count; j++)
if (j != j1 && min > COST(j, i) - v[j])

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / win build

linear-assignment.c:63:39: comparison of integer expressions of different signedness: 'size_t' {aka 'long long unsigned int'} and 'int' [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora:latest)

linear-assignment.c:63:39: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

linear-assignment.c:63:11: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

linear-assignment.c:63:11: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu:20.04)

linear-assignment.c:63:11: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu:rolling)

linear-assignment.c:63:39: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-breaking-changes (ubuntu:rolling)

linear-assignment.c:63:39: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

linear-assignment.c:63:11: comparison of integer expressions of different signedness: 'size_t' {aka 'unsigned int'} and 'int' [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu:rolling)

linear-assignment.c:63:39: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

linear-assignment.c:63:11: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu:rolling)

linear-assignment.c:63:11: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu:rolling)

linear-assignment.c:63:11: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]

Check failure on line 63 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu:rolling)

linear-assignment.c:63:11: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
min = COST(j, i) - v[j];
v[j1] -= min;
}
}

if (free_count ==

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / win build

linear-assignment.c:69:24: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long long unsigned int'} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora:latest)

linear-assignment.c:69:24: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

linear-assignment.c:69:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

linear-assignment.c:69:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu:20.04)

linear-assignment.c:69:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu:rolling)

linear-assignment.c:69:24: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-breaking-changes (ubuntu:rolling)

linear-assignment.c:69:24: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

linear-assignment.c:69:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu:rolling)

linear-assignment.c:69:24: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

linear-assignment.c:69:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu:rolling)

linear-assignment.c:69:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu:rolling)

linear-assignment.c:69:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 69 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu:rolling)

linear-assignment.c:69:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
(column_count < row_count ? row_count - column_count : 0)) {
free(v);
free(free_row);
Expand Down Expand Up @@ -132,8 +133,9 @@
for (free_count = 0; free_count < saved_free_count; free_count++) {
int i1 = free_row[free_count], low = 0, up = 0, last, k;
int min, c, u1;
int j;

for (j = 0; j < column_count; j++) {

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / win build

linear-assignment.c:138:31: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long long unsigned int'} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora:latest)

linear-assignment.c:138:31: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

linear-assignment.c:138:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

linear-assignment.c:138:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu:20.04)

linear-assignment.c:138:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu:rolling)

linear-assignment.c:138:31: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-breaking-changes (ubuntu:rolling)

linear-assignment.c:138:31: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

linear-assignment.c:138:17: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu:rolling)

linear-assignment.c:138:31: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

linear-assignment.c:138:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu:rolling)

linear-assignment.c:138:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu:rolling)

linear-assignment.c:138:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 138 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu:rolling)

linear-assignment.c:138:17: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
d[j] = COST(j, i1) - v[j];
pred[j] = i1;
col[j] = j;
Expand All @@ -143,7 +145,7 @@
do {
last = low;
min = d[col[up++]];
for (k = up; k < column_count; k++) {

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / win build

linear-assignment.c:148:40: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long long unsigned int'} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora:latest)

linear-assignment.c:148:40: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

linear-assignment.c:148:19: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

linear-assignment.c:148:19: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu:20.04)

linear-assignment.c:148:19: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu:rolling)

linear-assignment.c:148:40: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-breaking-changes (ubuntu:rolling)

linear-assignment.c:148:40: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

linear-assignment.c:148:19: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu:rolling)

linear-assignment.c:148:40: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

linear-assignment.c:148:19: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu:rolling)

linear-assignment.c:148:19: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu:rolling)

linear-assignment.c:148:19: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 148 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu:rolling)

linear-assignment.c:148:19: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
j = col[k];
c = d[j];
if (c <= min) {
Expand All @@ -165,7 +167,7 @@

i = column2row[j1];
u1 = COST(j1, i) - v[j1] - min;
for (k = up; k < column_count; k++) {

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / win build

linear-assignment.c:170:48: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long long unsigned int'} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora:latest)

linear-assignment.c:170:48: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

linear-assignment.c:170:20: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

linear-assignment.c:170:20: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu:20.04)

linear-assignment.c:170:20: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu:rolling)

linear-assignment.c:170:48: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-breaking-changes (ubuntu:rolling)

linear-assignment.c:170:48: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

linear-assignment.c:170:20: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu:rolling)

linear-assignment.c:170:48: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

linear-assignment.c:170:20: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu:rolling)

linear-assignment.c:170:20: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu:rolling)

linear-assignment.c:170:20: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 170 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu:rolling)

linear-assignment.c:170:20: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
j = col[k];
c = COST(j, i) - v[j] - u1;
if (c < d[j]) {
Expand Down Expand Up @@ -196,7 +198,7 @@
i = pred[j];
column2row[j] = i;
SWAP(j, row2column[i]);
} while (i1 != i);

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / win build

linear-assignment.c:201:29: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long long unsigned int'} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora:latest)

linear-assignment.c:201:29: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

linear-assignment.c:201:15: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

linear-assignment.c:201:15: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu:20.04)

linear-assignment.c:201:15: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu:rolling)

linear-assignment.c:201:29: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-breaking-changes (ubuntu:rolling)

linear-assignment.c:201:29: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

linear-assignment.c:201:15: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu:rolling)

linear-assignment.c:201:29: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

linear-assignment.c:201:15: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu:rolling)

linear-assignment.c:201:15: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu:rolling)

linear-assignment.c:201:15: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Check failure on line 201 in linear-assignment.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu:rolling)

linear-assignment.c:201:15: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
}

free(col);
Expand Down
2 changes: 1 addition & 1 deletion linear-assignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* assignments (-1 for unassigned, which can happen only if column_count !=
* row_count).
*/
void compute_assignment(int column_count, int row_count, int *cost,
void compute_assignment(size_t column_count, size_t row_count, int *cost,
int *column2row, int *row2column);

/* The maximal cost in the cost matrix (to prevent integer overflows). */
Expand Down
4 changes: 2 additions & 2 deletions range-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ static int diffsize(const char *a, const char *b)
static void get_correspondences(struct string_list *a, struct string_list *b,
int creation_factor)
{
int n = a->nr + b->nr;
size_t n = a->nr + b->nr;
int *cost, c, *a2b, *b2a;
int i, j;
size_t i, j;

ALLOC_ARRAY(cost, st_mult(n, n));
ALLOC_ARRAY(a2b, n);
Expand Down
Loading