summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/imgtool/modules/mac.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-10-14 19:55:53 -0400
committer Nathan Woods <npwoods@mess.org>2016-10-14 19:55:53 -0400
commite77c24ce766a3eeb60cdebbb7af7bc696912f001 (patch)
treef0a5e020029577038586b257c887a3998f89e70d /src/tools/imgtool/modules/mac.cpp
parent66c451c66439e89dc7b460e522ddeb3902c4669c (diff)
[Imgtool] Changed many 'imgtool::stream *' to 'imgtool::stream &'
Diffstat (limited to 'src/tools/imgtool/modules/mac.cpp')
-rw-r--r--src/tools/imgtool/modules/mac.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tools/imgtool/modules/mac.cpp b/src/tools/imgtool/modules/mac.cpp
index 98775a400b2..d51a3cf3539 100644
--- a/src/tools/imgtool/modules/mac.cpp
+++ b/src/tools/imgtool/modules/mac.cpp
@@ -1542,7 +1542,7 @@ struct mfs_dirref
-static imgtoolerr_t mfs_image_create(imgtool::image *image, imgtool::stream *stream, util::option_resolution *opts)
+static imgtoolerr_t mfs_image_create(imgtool::image *image, imgtool::stream &stream, util::option_resolution *opts)
{
imgtoolerr_t err;
UINT8 buffer[512];
@@ -1606,7 +1606,7 @@ static imgtoolerr_t mfs_image_create(imgtool::image *image, imgtool::stream *str
Return imgtool error code
*/
-static imgtoolerr_t mfs_image_open(imgtool::image *image, imgtool::stream *stream)
+static imgtoolerr_t mfs_image_open(imgtool::image *image, imgtool::stream &stream)
{
imgtoolerr_t err;
struct mac_l2_imgref *l2_img;
@@ -3033,7 +3033,7 @@ static int hfs_catKey_compare(const void *p1, const void *p2)
Return imgtool error code
*/
-static imgtoolerr_t hfs_image_open(imgtool::image *image, imgtool::stream *stream)
+static imgtoolerr_t hfs_image_open(imgtool::image *image, imgtool::stream &stream)
{
imgtoolerr_t err;
struct mac_l2_imgref *l2_img;
@@ -5277,8 +5277,8 @@ static void mac_image_info(imgtool::image *img, char *string, size_t len);
static imgtoolerr_t mac_image_beginenum(imgtool::directory *enumeration, const char *path);
static imgtoolerr_t mac_image_nextenum(imgtool::directory *enumeration, imgtool_dirent *ent);
static imgtoolerr_t mac_image_freespace(imgtool::partition *partition, UINT64 *size);
-static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream *destf);
-static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream *sourcef, util::option_resolution *writeoptions);
+static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf);
+static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions);
#ifdef UNUSED_FUNCTION
/*
@@ -5610,7 +5610,7 @@ static imgtoolerr_t mac_get_comment(struct mac_l2_imgref *image, mac_str255 file
/*
Extract a file from a disk image.
*/
-static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream *destf)
+static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &destf)
{
imgtoolerr_t err;
imgtool::image *img = &partition->image();
@@ -5650,7 +5650,7 @@ static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char
err = mac_file_read(&fileref, run_len, buf);
if (err)
return err;
- if (destf->write(buf, run_len) != run_len)
+ if (destf.write(buf, run_len) != run_len)
return IMGTOOLERR_WRITEERROR;
i += run_len;
}
@@ -5661,7 +5661,7 @@ static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char
/*
Add a file to a disk image.
*/
-static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream *sourcef, util::option_resolution *writeoptions)
+static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
{
imgtool::image *img = &partition->image();
struct mac_l2_imgref *image = get_imgref(img);
@@ -5694,7 +5694,7 @@ static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const cha
memset(&cat_info, 0, sizeof(cat_info));
set_UINT32BE(&cat_info.flFinderInfo.type, 0x3F3F3F3F);
set_UINT32BE(&cat_info.flFinderInfo.creator, 0x3F3F3F3F);
- fork_len = sourcef->size();
+ fork_len = sourcef.size();
/*comment[0] = get_UINT16BE(header.comment_len);*/ /* comment length */
/* Next two fields are set to 0 with MFS volumes. IIRC, 0 normally
means system script: I don't think MFS stores the file name script code
@@ -5726,7 +5726,7 @@ static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const cha
run_len = fork_len - i;
if (run_len > 512)
run_len = 512;
- if (sourcef->read(buf, run_len) != run_len)
+ if (sourcef.read(buf, run_len) != run_len)
return IMGTOOLERR_READERROR;
err = mac_file_write(&fileref, run_len, buf);
if (err)
@@ -6213,7 +6213,7 @@ static imgtoolerr_t mac_image_geticoninfo(imgtool::partition *partition, const c
}
/* read in the resource fork */
- err = mac_image_readfile(partition, path, "RESOURCE_FORK", stream);
+ err = mac_image_readfile(partition, path, "RESOURCE_FORK", *stream);
if (err)
goto done;
resource_fork = stream->getptr();