From 16dd3ac9989bbdc18c2d9e338970c19325d1f177 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Sun, 11 Jun 2023 11:43:44 +0100 Subject: [PATCH] Change AVRMEM * to const AVRMEM * where appropriate --- src/fileio.c | 6 +++--- src/libavrdude.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 40a443d2..480b63bc 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1449,7 +1449,7 @@ int fileio(int op, const char *filename, FILEFMT format, // Normalise segment address and length to be non-negative -int segmemt_normalise(AVRMEM *mem, Segment_t *segp) { +int segmemt_normalise(const AVRMEM *mem, Segment_t *segp) { int addr = segp->addr, len = segp->len, maxsize = mem->size; int digits = maxsize > 0x10000? 5: 4; @@ -1479,7 +1479,7 @@ int segmemt_normalise(AVRMEM *mem, Segment_t *segp) { static int fileio_segments_normalise(int oprwv, const char *filename, FILEFMT format, - const AVRPART *p, AVRMEM *mem, int n, Segment_t *seglist) { + const AVRPART *p, const AVRMEM *mem, int n, Segment_t *seglist) { int op, rc; FILE * f; @@ -1630,7 +1630,7 @@ static int fileio_segments_normalise(int oprwv, const char *filename, FILEFMT fo } int fileio_segments(int oprwv, const char *filename, FILEFMT format, - const AVRPART *p, AVRMEM *mem, int n, const Segment_t *list) { + const AVRPART *p, const AVRMEM *mem, int n, const Segment_t *list) { Segment_t *seglist = cfg_malloc(__func__, n*sizeof*seglist); memcpy(seglist, list, n*sizeof*seglist); diff --git a/src/libavrdude.h b/src/libavrdude.h index b5c0e7ed..4b57845a 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -1036,10 +1036,10 @@ int fileio_fmt_autodetect(const char *fname); int fileio(int oprwv, const char *filename, FILEFMT format, const AVRPART *p, const char *memtype, int size); -int segmemt_normalise(AVRMEM *mem, Segment_t *segp); +int segmemt_normalise(const AVRMEM *mem, Segment_t *segp); int fileio_segments(int oprwv, const char *filename, FILEFMT format, - const AVRPART *p, AVRMEM *mem, int n, const Segment_t *seglist); + const AVRPART *p, const AVRMEM *mem, int n, const Segment_t *seglist); #ifdef __cplusplus }