summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2022-12-14 19:32:31 -0500
committer AJR <ajrhacker@users.noreply.github.com>2022-12-14 19:32:31 -0500
commit95a3d1d20d71608a2e93fcaf91ad2218a8be06d2 (patch)
tree10b1471fb32e3d5fc73f2d2875cc940a884edf1f /src/tools
parent55b6acf504f58f9b03992d902d8dc6d83a65d000 (diff)
imgtool/stream: Remove some unused functions
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/imgtool/stream.cpp75
-rw-r--r--src/tools/imgtool/stream.h5
2 files changed, 0 insertions, 80 deletions
diff --git a/src/tools/imgtool/stream.cpp b/src/tools/imgtool/stream.cpp
index bd9ea3bd286..05f105afbc2 100644
--- a/src/tools/imgtool/stream.cpp
+++ b/src/tools/imgtool/stream.cpp
@@ -22,7 +22,6 @@
#include <cstdio>
#include <cstring>
-#include <zlib.h> // for crc32
namespace imgtool {
@@ -485,28 +484,6 @@ uint64_t stream::size() const
//-------------------------------------------------
-// getptr
-//-------------------------------------------------
-
-void *stream::getptr()
-{
- void *ptr;
-
- switch(imgtype)
- {
- case IMG_MEM:
- ptr = buffer;
- break;
-
- default:
- ptr = nullptr;
- break;
- }
- return ptr;
-}
-
-
-//-------------------------------------------------
// seek
//-------------------------------------------------
@@ -575,58 +552,6 @@ uint64_t stream::transfer_all(stream &dest, stream &source)
//-------------------------------------------------
-// crc
-//-------------------------------------------------
-
-int stream::crc(unsigned long *result)
-{
- size_t sz;
- void *ptr;
-
- switch(imgtype)
- {
- case IMG_MEM:
- *result = crc32(0, (unsigned char *) buffer, (size_t) filesize);
- break;
-
- default:
- sz = size();
- ptr = malloc(sz);
- if (!ptr)
- return IMGTOOLERR_OUTOFMEMORY;
- seek(0, SEEK_SET);
- if (read(ptr, sz) != sz)
- {
- free(ptr);
- return IMGTOOLERR_READERROR;
- }
- *result = crc32(0, (const Bytef*)ptr, sz);
- free(ptr);
- break;
- }
- return 0;
-}
-
-
-//-------------------------------------------------
-// file_crc
-//-------------------------------------------------
-
-int stream::file_crc(const char *fname, unsigned long *result)
-{
- int err;
- stream::ptr f;
-
- f = stream::open(fname, OSD_FOPEN_READ);
- if (!f)
- return IMGTOOLERR_FILENOTFOUND;
-
- err = f->crc(result);
- return err;
-}
-
-
-//-------------------------------------------------
// fill
//-------------------------------------------------
diff --git a/src/tools/imgtool/stream.h b/src/tools/imgtool/stream.h
index 36872e33c2a..8083dbac9d9 100644
--- a/src/tools/imgtool/stream.h
+++ b/src/tools/imgtool/stream.h
@@ -40,7 +40,6 @@ public:
uint64_t size() const;
int seek(int64_t pos, int where);
uint64_t tell();
- void *getptr();
uint32_t putc(char c);
uint32_t puts(const char *s);
uint32_t printf(const char *fmt, ...) ATTR_PRINTF(2, 3);
@@ -52,10 +51,6 @@ public:
// fills sz bytes with b
uint64_t fill(unsigned char b, uint64_t sz);
- // returns the CRC of a file
- int crc(unsigned long *result);
- static int file_crc(const char *fname, unsigned long *result);
-
// returns whether a stream is read only or not
bool is_read_only();