[Imgtool] More formatting fixes

This commit is contained in:
Nathan Woods 2016-10-13 06:19:59 -04:00
parent 604885dfb8
commit 66c451c664

View File

@ -351,8 +351,8 @@ static imgtoolerr_t hp48_open(imgtool::image *img, imgtool::stream *stream)
} }
/* fully load image */ /* fully load image */
stream->seek(0, SEEK_SET ); stream->seek(0, SEEK_SET);
if ( stream->read(c->data, size ) < size ) if ( stream->read(c->data, size) < size )
{ {
return IMGTOOLERR_READERROR; return IMGTOOLERR_READERROR;
} }
@ -397,8 +397,8 @@ static void hp48_close(imgtool::image *img)
{ {
/* save image */ /* save image */
pack( c->data, c->data, 2 * c->size ); pack( c->data, c->data, 2 * c->size );
c->stream->seek(0, SEEK_SET ); c->stream->seek(0, SEEK_SET);
c->stream->write(c->data, c->size ); c->stream->write(c->data, c->size);
} }
/* clean up */ /* clean up */
@ -576,7 +576,7 @@ static imgtoolerr_t hp48_readfile(imgtool::partition *part,
return IMGTOOLERR_FILENOTFOUND; return IMGTOOLERR_FILENOTFOUND;
} }
pack( buf, p->data + start, size ); pack( buf, p->data + start, size );
destf->write(buf, bytesize ); destf->write(buf, bytesize);
free( buf ); free( buf );
return IMGTOOLERR_SUCCESS; return IMGTOOLERR_SUCCESS;
@ -622,7 +622,7 @@ static imgtoolerr_t hp48_writefile(imgtool::partition *part,
/* check header */ /* check header */
char head[8]; char head[8];
sourcef->read(head, 8 ); sourcef->read(head, 8);
if ( memcmp( head, hp48_prefix, 7) ) if ( memcmp( head, hp48_prefix, 7) )
{ {
return IMGTOOLERR_READERROR; return IMGTOOLERR_READERROR;
@ -649,7 +649,7 @@ static imgtoolerr_t hp48_writefile(imgtool::partition *part,
/* load file */ /* load file */
UINT8* buf = (UINT8*) malloc( filesize ); UINT8* buf = (UINT8*) malloc( filesize );
if ( !buf ) return IMGTOOLERR_NOSPACE; if ( !buf ) return IMGTOOLERR_NOSPACE;
sourcef->read(buf, filesize ); sourcef->read(buf, filesize);
/* store backup object */ /* store backup object */
int org = pos; int org = pos;