Use correct length type for Abs*Group

This commit is contained in:
ISSOtm
2021-11-07 01:23:06 +01:00
parent f82603f196
commit b04e71ed34
3 changed files with 9 additions and 9 deletions

View File

@@ -1344,7 +1344,7 @@ constlist_8bit_entry : reloc_8bit_no_str {
}
| string {
uint8_t *output = malloc(strlen($1)); /* Cannot be larger than that */
uint32_t length = charmap_Convert($1, output);
size_t length = charmap_Convert($1, output);
sect_AbsByteGroup(output, length);
free(output);
@@ -1360,7 +1360,7 @@ constlist_16bit_entry : reloc_16bit_no_str {
}
| string {
uint8_t *output = malloc(strlen($1)); /* Cannot be larger than that */
uint32_t length = charmap_Convert($1, output);
size_t length = charmap_Convert($1, output);
sect_AbsWordGroup(output, length);
free(output);
@@ -1377,7 +1377,7 @@ constlist_32bit_entry : relocexpr_no_str {
| string {
// Charmaps cannot increase the length of a string
uint8_t *output = malloc(strlen($1));
uint32_t length = charmap_Convert($1, output);
size_t length = charmap_Convert($1, output);
sect_AbsLongGroup(output, length);
free(output);

View File

@@ -628,7 +628,7 @@ void sect_AbsByte(uint8_t b)
writebyte(b);
}
void sect_AbsByteGroup(uint8_t const *s, uint32_t length)
void sect_AbsByteGroup(uint8_t const *s, size_t length)
{
if (!checkcodesection())
return;
@@ -639,7 +639,7 @@ void sect_AbsByteGroup(uint8_t const *s, uint32_t length)
writebyte(*s++);
}
void sect_AbsWordGroup(uint8_t const *s, uint32_t length)
void sect_AbsWordGroup(uint8_t const *s, size_t length)
{
if (!checkcodesection())
return;
@@ -650,7 +650,7 @@ void sect_AbsWordGroup(uint8_t const *s, uint32_t length)
writeword(*s++);
}
void sect_AbsLongGroup(uint8_t const *s, uint32_t length)
void sect_AbsLongGroup(uint8_t const *s, size_t length)
{
if (!checkcodesection())
return;