git: d068b2c1ead2 - stable/13 - sort: remove unused function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 19 Oct 2022 08:01:31 UTC
The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d068b2c1ead2acab0d9fd93ee0cf7dd4d8366389 commit d068b2c1ead2acab0d9fd93ee0cf7dd4d8366389 Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2022-10-13 07:33:12 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2022-10-19 07:59:29 +0000 sort: remove unused function (cherry picked from commit e8815fb30b340108bc4b36ab46afa31f673948d0) --- usr.bin/sort/bwstring.c | 57 ------------------------------------------------- usr.bin/sort/bwstring.h | 2 -- 2 files changed, 59 deletions(-) diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c index 52173002986f..073a1280e2c1 100644 --- a/usr.bin/sort/bwstring.c +++ b/usr.bin/sort/bwstring.c @@ -322,63 +322,6 @@ bwsfree(const struct bwstring *s) sort_free(s); } -/* - * Copy content of src binary string to dst. - * If the capacity of the dst string is not sufficient, - * then the data is truncated. - */ -size_t -bwscpy(struct bwstring *dst, const struct bwstring *src) -{ - size_t nums = BWSLEN(src); - - if (nums > BWSLEN(dst)) - nums = BWSLEN(dst); - - if (mb_cur_max == 1) { - memcpy(dst->cdata.str, src->cdata.str, nums); - dst->cdata.len = nums; - dst->cdata.str[dst->cdata.len] = '\0'; - } else { - memcpy(dst->wdata.str, src->wdata.str, - SIZEOF_WCHAR_STRING(nums)); - dst->wdata.len = nums; - dst->wdata.str[nums] = L'\0'; - } - - return (nums); -} - -/* - * Copy content of src binary string to dst, - * with specified number of symbols to be copied. - * If the capacity of the dst string is not sufficient, - * then the data is truncated. - */ -struct bwstring * -bwsncpy(struct bwstring *dst, const struct bwstring *src, size_t size) -{ - size_t nums = BWSLEN(src); - - if (nums > BWSLEN(dst)) - nums = BWSLEN(dst); - if (nums > size) - nums = size; - - if (mb_cur_max == 1) { - memcpy(dst->cdata.str, src->cdata.str, nums); - dst->cdata.len = nums; - dst->cdata.str[nums] = '\0'; - } else { - memcpy(dst->wdata.str, src->wdata.str, - SIZEOF_WCHAR_STRING(nums)); - dst->wdata.len = nums; - dst->wdata.str[nums] = L'\0'; - } - - return (dst); -} - /* * Copy content of src binary string to dst, * with specified number of symbols to be copied. diff --git a/usr.bin/sort/bwstring.h b/usr.bin/sort/bwstring.h index 129d03ad14b7..0e837c40b266 100644 --- a/usr.bin/sort/bwstring.h +++ b/usr.bin/sort/bwstring.h @@ -91,8 +91,6 @@ struct bwstring *bwsdup(const struct bwstring *s); struct bwstring *bwssbdup(const wchar_t *str, size_t size); struct bwstring *bwscsbdup(const unsigned char *str, size_t size); void bwsfree(const struct bwstring *s); -size_t bwscpy(struct bwstring *dst, const struct bwstring *src); -struct bwstring *bwsncpy(struct bwstring *dst, const struct bwstring *src, size_t size); struct bwstring *bwsnocpy(struct bwstring *dst, const struct bwstring *src, size_t offset, size_t size); int bwscmp(const struct bwstring *bws1, const struct bwstring *bws2, size_t offset); int bwsncmp(const struct bwstring *bws1, const struct bwstring *bws2, size_t offset, size_t len);