summaryrefslogtreecommitdiffstats
path: root/net/base/nss_memio.c
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 21:59:59 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 21:59:59 +0000
commit0d219e8c64fd474737eb88737a8af3221893393a (patch)
treec9969053d0f2b364bb3970b9835ec7a8f51e5336 /net/base/nss_memio.c
parent74b9879d2ed5a67e2935703e171059d40924e462 (diff)
downloadchromium_src-0d219e8c64fd474737eb88737a8af3221893393a.zip
chromium_src-0d219e8c64fd474737eb88737a8af3221893393a.tar.gz
chromium_src-0d219e8c64fd474737eb88737a8af3221893393a.tar.bz2
Delete more unused functions in nss_memio.c.
Review URL: http://codereview.chromium.org/67142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/nss_memio.c')
-rw-r--r--net/base/nss_memio.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/net/base/nss_memio.c b/net/base/nss_memio.c
index e680815..bf61e0b 100644
--- a/net/base/nss_memio.c
+++ b/net/base/nss_memio.c
@@ -68,15 +68,9 @@ static void memio_buffer_new(struct memio_buffer *mb, int size);
/* Deallocate a memio_buffer allocated by memio_buffer_new. */
static void memio_buffer_destroy(struct memio_buffer *mb);
-/* How many bytes have been put into the buffer */
-static int memio_buffer_used(const struct memio_buffer *mb);
-
/* How many bytes can be read out of the buffer without wrapping */
static int memio_buffer_used_contiguous(const struct memio_buffer *mb);
-/* How many bytes can still be put into the buffer */
-static int memio_buffer_unused(const struct memio_buffer *mb);
-
/* How many bytes can be written into the buffer without wrapping */
static int memio_buffer_unused_contiguous(const struct memio_buffer *mb);
@@ -104,26 +98,12 @@ static void memio_buffer_destroy(struct memio_buffer *mb)
mb->tail = 0;
}
-/* How many bytes have been put into the buffer */
-static int memio_buffer_used(const struct memio_buffer *mb)
-{
- int n = mb->tail - mb->head;
- if (n < 0) n += mb->bufsize;
- return n;
-}
-
/* How many bytes can be read out of the buffer without wrapping */
static int memio_buffer_used_contiguous(const struct memio_buffer *mb)
{
return (((mb->tail >= mb->head) ? mb->tail : mb->bufsize) - mb->head);
}
-/* How many bytes can still be put into the buffer */
-static int memio_buffer_unused(const struct memio_buffer *mb)
-{
- return mb->bufsize - memio_buffer_used(mb) - 1;
-}
-
/* How many bytes can be written into the buffer without wrapping */
static int memio_buffer_unused_contiguous(const struct memio_buffer *mb)
{
@@ -468,45 +448,33 @@ int main()
memio_buffer_new(&mb, TEST_BUFLEN);
CHECKEQ(memio_buffer_unused_contiguous(&mb), TEST_BUFLEN-1);
- CHECKEQ(memio_buffer_unused(&mb), TEST_BUFLEN-1);
CHECKEQ(memio_buffer_used_contiguous(&mb), 0);
- CHECKEQ(memio_buffer_used(&mb), 0);
CHECKEQ(memio_buffer_put(&mb, "howdy", 5), 5);
CHECKEQ(memio_buffer_unused_contiguous(&mb), TEST_BUFLEN-1-5);
- CHECKEQ(memio_buffer_unused(&mb), TEST_BUFLEN-1-5);
CHECKEQ(memio_buffer_used_contiguous(&mb), 5);
- CHECKEQ(memio_buffer_used(&mb), 5);
CHECKEQ(memio_buffer_put(&mb, "!", 1), 1);
CHECKEQ(memio_buffer_unused_contiguous(&mb), 0);
- CHECKEQ(memio_buffer_unused(&mb), 0);
CHECKEQ(memio_buffer_used_contiguous(&mb), 6);
- CHECKEQ(memio_buffer_used(&mb), 6);
CHECKEQ(memio_buffer_get(&mb, buf, 6), 6);
CHECKEQ(memcmp(buf, "howdy!", 6), 0);
- CHECKEQ(memio_buffer_unused(&mb), TEST_BUFLEN-1);
CHECKEQ(memio_buffer_unused_contiguous(&mb), 1);
CHECKEQ(memio_buffer_used_contiguous(&mb), 0);
- CHECKEQ(memio_buffer_used(&mb), 0);
CHECKEQ(memio_buffer_put(&mb, "01234", 5), 5);
- CHECKEQ(memio_buffer_used(&mb), 5);
CHECKEQ(memio_buffer_used_contiguous(&mb), 1);
CHECKEQ(memio_buffer_unused_contiguous(&mb), TEST_BUFLEN-1-5);
- CHECKEQ(memio_buffer_unused(&mb), TEST_BUFLEN-1-5);
CHECKEQ(memio_buffer_put(&mb, "5", 1), 1);
CHECKEQ(memio_buffer_unused_contiguous(&mb), 0);
- CHECKEQ(memio_buffer_unused(&mb), 0);
CHECKEQ(memio_buffer_used_contiguous(&mb), 1);
- CHECKEQ(memio_buffer_used(&mb), 6);
/* TODO: add more cases */