aboutsummaryrefslogtreecommitdiffstats
path: root/icemulti/icemulti.cc
diff options
context:
space:
mode:
authorRoland Lutz <rlutz@hedmen.org>2017-08-14 13:59:55 +0200
committerRoland Lutz <rlutz@hedmen.org>2017-09-04 20:13:47 +0200
commitdd9ce3fcb5571d70e4ac7e17db58a797835572d1 (patch)
tree5d5780b5adf876aeedec76d330cc0b52f8f748f2 /icemulti/icemulti.cc
parent7dad1afe6d3e0f00b2033fdf8b83b83ae67db681 (diff)
downloadicestorm-dd9ce3fcb5571d70e4ac7e17db58a797835572d1.tar.gz
icestorm-dd9ce3fcb5571d70e4ac7e17db58a797835572d1.tar.bz2
icestorm-dd9ce3fcb5571d70e4ac7e17db58a797835572d1.zip
icemulti: Print image filenames along with offsets
Diffstat (limited to 'icemulti/icemulti.cc')
-rw-r--r--icemulti/icemulti.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/icemulti/icemulti.cc b/icemulti/icemulti.cc
index 03f1a68..7bfe25e 100644
--- a/icemulti/icemulti.cc
+++ b/icemulti/icemulti.cc
@@ -79,11 +79,12 @@ static void pad_to(std::ostream &ofs, uint32_t &file_offset, uint32_t target)
}
class Image {
- const char *filename;
std::ifstream ifs;
uint32_t offs;
public:
+ const char *const filename;
+
Image(const char *filename);
size_t size();
void write(std::ostream &ofs, uint32_t &file_offset);
@@ -91,7 +92,7 @@ public:
uint32_t offset() const { return offs; }
};
-Image::Image(const char *filename) : filename(filename), ifs(filename, std::ifstream::binary)
+Image::Image(const char *filename) : ifs(filename, std::ifstream::binary), filename(filename)
{
if (ifs.fail())
error("can't open input image `%s': %s\n", filename, strerror(errno));
@@ -267,7 +268,7 @@ int main(int argc, char **argv)
offs += images[i]->size();
align_offset(offs, align_bits);
if (print_offsets)
- fprintf(stderr, "Place image %d at %06x .. %06x.\n", i, int(images[i]->offset()), int(offs));
+ fprintf(stderr, "Place image %d at %06x .. %06x (`%s')\n", i, int(images[i]->offset()), int(offs), images[i]->filename);
}
// Populate headers