aboutsummaryrefslogtreecommitdiff
path: root/src/depmap.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-05-23 13:20:03 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-05-23 13:20:03 +0300
commit19c12f9e35055e626823c9dd730bd847bfcd2cb4 (patch)
treea2cef89cf40a6bd65b1592d69499face14f683eb /src/depmap.c
parentbd19f38853dad5a89abada6ee5e7a23c65173894 (diff)
downloadpies-19c12f9e35055e626823c9dd730bd847bfcd2cb4.tar.gz
pies-19c12f9e35055e626823c9dd730bd847bfcd2cb4.tar.bz2
Update copyright years
Diffstat (limited to 'src/depmap.c')
-rw-r--r--src/depmap.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/depmap.c b/src/depmap.c
index cb50548..d2bf536 100644
--- a/src/depmap.c
+++ b/src/depmap.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies.
- Copyright (C) 2008-2013, 2016-2017 Sergey Poznyakoff
+ Copyright (C) 2008-2019 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,14 +50,14 @@ TC (unsigned *R, int n)
{
ccol = cword;
rowj = R;
-
+
while (rowj < relend)
{
if (*ccol & mask)
{
rp = rowi;
rend = (unsigned *) ((char *) rowj + rowsize);
-
+
while (rowj < rend)
*rowj++ |= *rp++;
}
@@ -65,10 +65,10 @@ TC (unsigned *R, int n)
{
rowj = (unsigned *) ((char *) rowj + rowsize);
}
-
+
ccol = (unsigned *) ((char *) ccol + rowsize);
}
-
+
mask <<= 1;
if (mask == 0)
{
@@ -85,12 +85,12 @@ struct pies_depmap
size_t rowlen; /* Length of a row in words */
unsigned r[1]; /* Data rows */
};
-
+
pies_depmap_t
depmap_alloc (size_t count)
{
size_t size = (count + BITS_PER_WORD - 1) / BITS_PER_WORD;
- pies_depmap_t dmap = grecs_zalloc (sizeof (*dmap) - 1
+ pies_depmap_t dmap = grecs_zalloc (sizeof (*dmap) - 1
+ count * size * sizeof (unsigned));
dmap->nrows = count;
dmap->rowlen = size;
@@ -102,7 +102,7 @@ static inline size_t
depmap_row_size (pies_depmap_t dpm)
{
return dpm->rowlen * sizeof (unsigned);
-}
+}
pies_depmap_t
depmap_copy (pies_depmap_t dpm)
@@ -158,9 +158,9 @@ depmap_next (pies_depmap_t dmap, pies_depmap_pos_t pos)
pos->coord[pos->dir]++)
if (depmap_isset (dmap, pos->coord[0], pos->coord[1]))
break;
-
+
return pos->coord[pos->dir] == dmap->nrows ?
- (size_t) -1 : pos->coord[pos->dir];
+ (size_t) -1 : pos->coord[pos->dir];
}
size_t
@@ -188,7 +188,7 @@ depmap_remove (pies_depmap_t dmap, size_t n)
if (n < dmap->nrows - 1)
{
size_t i, j;
-
+
/* Remove nth row */
memmove (depmap_rowptr (dmap, n), depmap_rowptr (dmap, n + 1),
(dmap->nrows - n - 1) * depmap_row_size (dmap));

Return to:

Send suggestions and report system problems to the System administrator.