* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
/* we can't determine the number of sections that we'll have to create ahead of time,
* so we locally hold them until parsing is finished */
- int filesize;
+ size_t filesize;
int retval;
retval = fileio_size(fileio, &filesize);
if (retval != ERROR_OK)
uint8_t cal_checksum = 0;
size_t bytes_read = 0;
+ if (lpszLine[0] == '#')
+ continue;
+
if (sscanf(&lpszLine[bytes_read], ":%2" SCNx32 "%4" SCNx32 "%2" SCNx32, &count,
&address, &record_type) != 3)
return ERROR_IMAGE_FORMAT_ERROR;
* so we locally hold them until parsing is finished */
int retval;
- int filesize;
+ size_t filesize;
retval = fileio_size(fileio, &filesize);
if (retval != ERROR_OK)
return retval;
retval = fileio_open(&image_binary->fileio, url, FILEIO_READ, FILEIO_BINARY);
if (retval != ERROR_OK)
return retval;
- int filesize;
+ size_t filesize;
retval = fileio_size(&image_binary->fileio, &filesize);
if (retval != ERROR_OK) {
fileio_close(&image_binary->fileio);
}
} else if (image->type == IMAGE_BUILDER) {
image->num_sections = 0;
+ image->base_address_set = 0;
image->sections = NULL;
image->type_private = NULL;
}
return ERROR_OK;
}
-int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t *data)
+int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t const *data)
{
struct imagesection *section;