From 1447db81e0e6c74ab03a19602a2ca15beb085f16 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Sun, 15 Oct 2023 21:43:50 +0200 Subject: [PATCH] Remove unused code from 'shape' module --- src/shape.c | 52 ---------------------------------------------------- src/shape.h | 2 -- 2 files changed, 54 deletions(-) diff --git a/src/shape.c b/src/shape.c index 210d8ff2..8b7fead1 100644 --- a/src/shape.c +++ b/src/shape.c @@ -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. diff --git a/src/shape.h b/src/shape.h index e54e1364..a70da603 100644 --- a/src/shape.h +++ b/src/shape.h @@ -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);