mirror of https://github.com/YosysHQ/icestorm.git
icemulti: Remove class `Header'
This commit is contained in:
parent
4cb0dcbffa
commit
29cd829eb3
|
|
@ -121,11 +121,6 @@ void Image::write(std::ostream &ofs, uint32_t &file_offset)
|
||||||
write_file(ofs, file_offset, ifs, filename);
|
write_file(ofs, file_offset, ifs, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
class Header {
|
|
||||||
public:
|
|
||||||
Image const *image;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void write_header(std::ostream &ofs, uint32_t &file_offset,
|
static void write_header(std::ostream &ofs, uint32_t &file_offset,
|
||||||
Image const *image, bool coldboot)
|
Image const *image, bool coldboot)
|
||||||
{
|
{
|
||||||
|
|
@ -193,7 +188,7 @@ int main(int argc, char **argv)
|
||||||
int image_count = 0;
|
int image_count = 0;
|
||||||
int align_bits = 0;
|
int align_bits = 0;
|
||||||
bool align_first = false;
|
bool align_first = false;
|
||||||
Header headers[NUM_HEADERS];
|
Image *header_images[NUM_HEADERS];
|
||||||
std::unique_ptr<Image> images[NUM_IMAGES];
|
std::unique_ptr<Image> images[NUM_IMAGES];
|
||||||
const char *outfile_name = NULL;
|
const char *outfile_name = NULL;
|
||||||
|
|
||||||
|
|
@ -275,10 +270,10 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// Populate headers
|
// Populate headers
|
||||||
for (int i=0; i<image_count; i++)
|
for (int i=0; i<image_count; i++)
|
||||||
headers[i + 1].image = &*images[i];
|
header_images[i + 1] = &*images[i];
|
||||||
headers[0].image = headers[por_image + 1].image;
|
header_images[0] = header_images[por_image + 1];
|
||||||
for (int i=image_count; i < NUM_IMAGES; i++)
|
for (int i=image_count; i < NUM_IMAGES; i++)
|
||||||
headers[i + 1].image = headers[0].image;
|
header_images[i + 1] = header_images[0];
|
||||||
|
|
||||||
std::ofstream ofs;
|
std::ofstream ofs;
|
||||||
std::ostream *osp;
|
std::ostream *osp;
|
||||||
|
|
@ -296,7 +291,7 @@ int main(int argc, char **argv)
|
||||||
for (int i=0; i<NUM_HEADERS; i++)
|
for (int i=0; i<NUM_HEADERS; i++)
|
||||||
{
|
{
|
||||||
pad_to(*osp, file_offset, i * HEADER_SIZE);
|
pad_to(*osp, file_offset, i * HEADER_SIZE);
|
||||||
write_header(*osp, file_offset, headers[i].image, i == 0 && coldboot);
|
write_header(*osp, file_offset, header_images[i], i == 0 && coldboot);
|
||||||
}
|
}
|
||||||
for (int i=0; i<image_count; i++)
|
for (int i=0; i<image_count; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue