Skip to content

Commit

Permalink
Remove unused code from 'shape' module
Browse files Browse the repository at this point in the history
  • Loading branch information
tsjensen committed Oct 15, 2023
1 parent 15be1f3 commit 1447db8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
52 changes: 0 additions & 52 deletions src/shape.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,58 +307,6 @@ size_t widest(const sentry_t *sarr, const int n, ...)



shape_t leftmost(const int aside, const int cnt)
/*
* Return leftmost existing shape in specification for side aside
* (BTOP or BBOT), skipping cnt shapes. Corners are not considered.
*
* RETURNS: shape if shape was found
* NUM_SHAPES on error (e.g. cnt too high)
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
{
int c = 0;
int s;

if (cnt < 0) {
return NUM_SHAPES;
}

if (aside == BTOP) {
s = 0;
do {
++s;
while (s < SHAPES_PER_SIDE - 1 &&
isempty(opt.design->shape + north_side[s])) {
++s;
}
if (s == SHAPES_PER_SIDE - 1) {
return NUM_SHAPES;
}
} while (c++ < cnt);
return north_side[s];
}

else if (aside == BBOT) {
s = SHAPES_PER_SIDE - 1;
do {
--s;
while (s && isempty(opt.design->shape + south_side[s])) {
--s;
}
if (!s) {
return NUM_SHAPES;
}
} while (c++ < cnt);
return south_side[s];
}

return NUM_SHAPES;
}



/**
* Return true if the shapes on the given side consist entirely of spaces - and spaces only, tabs are considered
* non-empty.
Expand Down
2 changes: 0 additions & 2 deletions src/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ int isdeepempty (const sentry_t *shape);
size_t highest (const sentry_t *sarr, const int n, ...);
size_t widest (const sentry_t *sarr, const int n, ...);

shape_t leftmost (const int aside, const int cnt);

int empty_side (sentry_t *sarr, const int aside);


Expand Down

0 comments on commit 1447db8

Please sign in to comment.