aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-24 10:09:16 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-24 10:09:16 +0200
commitf620d685afb1e9ea45f1fe78463d1d7796a40f0d (patch)
tree11159782057b57df7afa783377bf62b6ef4ca093
parentm (diff)
downloadhungarian-algorithm-n3-f620d685afb1e9ea45f1fe78463d1d7796a40f0d.tar.gz
hungarian-algorithm-n3-f620d685afb1e9ea45f1fe78463d1d7796a40f0d.tar.bz2
hungarian-algorithm-n3-f620d685afb1e9ea45f1fe78463d1d7796a40f0d.tar.xz
portability
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--hungarian.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hungarian.c b/hungarian.c
index e981066..fdc7a7a 100644
--- a/hungarian.c
+++ b/hungarian.c
@@ -69,7 +69,7 @@ typedef struct
/**
* The set of all limbs, a limb consist of 64 bits
*/
- cell* limbs;
+ llong* limbs;
/**
* Singleton array with the index of the first non-zero limb
@@ -108,7 +108,7 @@ size_t lb(llong x) __attribute__((const));
-void print(cell** t, size_t n, size_t m, long** assignment);
+void print(cell** t, size_t n, size_t m, ssize_t** assignment);
int main(int argc, char** argv)
{
@@ -191,7 +191,7 @@ void print(cell** t, size_t n, size_t m, ssize_t** assignment)
for (j = 0; j < m; j++)
{
if (*(*(assigned + i) + j))
- printf("\033[%lim", 30 + *(*(assigned + i) + j));
+ printf("\033[%im", (int)(30 + *(*(assigned + i) + j)));
printf("%5li%s\033[m ", (cell)(*(*(t + i) + j)), (*(*(assigned + i) + j) ? "^" : " "));
}
printf("\n\n");
@@ -629,9 +629,9 @@ BitSet new_BitSet(size_t size)
c++;
this.limbs = malloc(c * sizeof(llong));
- this.prev = malloc((c + 1) * sizeof(long));
- this.next = malloc((c + 1) * sizeof(long));
- *(this.first = malloc(sizeof(long))) = 0;
+ this.prev = malloc((c + 1) * sizeof(size_t));
+ this.next = malloc((c + 1) * sizeof(size_t));
+ *(this.first = malloc(sizeof(size_t))) = 0;
size_t i;
for (i = 0; i < c; i++)