diff options
author | 2016-10-14 19:55:53 -0400 | |
---|---|---|
committer | 2016-10-14 19:55:53 -0400 | |
commit | e77c24ce766a3eeb60cdebbb7af7bc696912f001 (patch) | |
tree | f0a5e020029577038586b257c887a3998f89e70d /src/tools/imgtool/modules/macbin.cpp | |
parent | 66c451c66439e89dc7b460e522ddeb3902c4669c (diff) |
[Imgtool] Changed many 'imgtool::stream *' to 'imgtool::stream &'
Diffstat (limited to 'src/tools/imgtool/modules/macbin.cpp')
-rw-r--r-- | src/tools/imgtool/modules/macbin.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tools/imgtool/modules/macbin.cpp b/src/tools/imgtool/modules/macbin.cpp index ac61755996a..b18e6a70f80 100644 --- a/src/tools/imgtool/modules/macbin.cpp +++ b/src/tools/imgtool/modules/macbin.cpp @@ -63,7 +63,7 @@ static UINT32 pad128(UINT32 length) -static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream *destf) +static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf) { static const UINT32 attrs[] = { @@ -156,7 +156,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char place_integer_be(header, 123, 1, 0x81); place_integer_be(header, 124, 2, ccitt_crc16(0, header, 124)); - destf->write(header, sizeof(header)); + destf.write(header, sizeof(header)); if (data_fork) { @@ -164,7 +164,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char if (err) return err; - destf->fill(0, pad128(data_fork->size)); + destf.fill(0, pad128(data_fork->size)); } if (resource_fork) @@ -173,7 +173,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char if (err) return err; - destf->fill(0, pad128(resource_fork->size)); + destf.fill(0, pad128(resource_fork->size)); } return IMGTOOLERR_SUCCESS; @@ -182,7 +182,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char static imgtoolerr_t write_fork(imgtool::partition *partition, const char *filename, const char *fork, - imgtool::stream *sourcef, UINT64 pos, UINT64 fork_len, util::option_resolution *opts) + imgtool::stream &sourcef, UINT64 pos, UINT64 fork_len, util::option_resolution *opts) { imgtoolerr_t err = IMGTOOLERR_SUCCESS; imgtool::stream *mem_stream = NULL; @@ -197,13 +197,13 @@ static imgtoolerr_t write_fork(imgtool::partition *partition, const char *filena goto done; } - sourcef->seek(pos, SEEK_SET); - len = imgtool::stream::transfer(*mem_stream, *sourcef, fork_len); + sourcef.seek(pos, SEEK_SET); + len = imgtool::stream::transfer(*mem_stream, sourcef, fork_len); if (len < fork_len) mem_stream->fill(0, fork_len); mem_stream->seek(0, SEEK_SET); - err = partition->write_file(filename, fork, mem_stream, opts, NULL); + err = partition->write_file(filename, fork, *mem_stream, opts, NULL); if (err) goto done; } @@ -216,7 +216,7 @@ done: -static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream *sourcef, util::option_resolution *opts) +static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts) { static const UINT32 attrs[] = { @@ -254,7 +254,7 @@ static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const cha /* read in the header */ memset(header, 0, sizeof(header)); - sourcef->read(header, sizeof(header)); + sourcef.read(header, sizeof(header)); /* check magic and zero fill bytes */ if (header[0] != 0x00) @@ -266,7 +266,7 @@ static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const cha datafork_size = pick_integer_be(header, 83, 4); resourcefork_size = pick_integer_be(header, 87, 4); - total_size = sourcef->size(); + total_size = sourcef.size(); /* size of a MacBinary header is always 128 bytes */ if (total_size - pad128(datafork_size) - pad128(resourcefork_size) != 128) @@ -342,7 +342,7 @@ static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const cha -static imgtoolerr_t macbinary_checkstream(imgtool::stream *stream, imgtool_suggestion_viability_t *viability) +static imgtoolerr_t macbinary_checkstream(imgtool::stream &stream, imgtool_suggestion_viability_t *viability) { imgtoolerr_t err; |