mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Use correct length type for Abs*Group
This commit is contained in:
@@ -61,9 +61,9 @@ void sect_EndUnion(void);
|
|||||||
void sect_CheckUnionClosed(void);
|
void sect_CheckUnionClosed(void);
|
||||||
|
|
||||||
void sect_AbsByte(uint8_t b);
|
void sect_AbsByte(uint8_t b);
|
||||||
void sect_AbsByteGroup(uint8_t const *s, uint32_t length);
|
void sect_AbsByteGroup(uint8_t const *s, size_t length);
|
||||||
void sect_AbsWordGroup(uint8_t const *s, uint32_t length);
|
void sect_AbsWordGroup(uint8_t const *s, size_t length);
|
||||||
void sect_AbsLongGroup(uint8_t const *s, uint32_t length);
|
void sect_AbsLongGroup(uint8_t const *s, size_t length);
|
||||||
void sect_Skip(uint32_t skip, bool ds);
|
void sect_Skip(uint32_t skip, bool ds);
|
||||||
void sect_String(char const *s);
|
void sect_String(char const *s);
|
||||||
void sect_RelByte(struct Expression *expr, uint32_t pcShift);
|
void sect_RelByte(struct Expression *expr, uint32_t pcShift);
|
||||||
|
|||||||
@@ -1344,7 +1344,7 @@ constlist_8bit_entry : reloc_8bit_no_str {
|
|||||||
}
|
}
|
||||||
| string {
|
| string {
|
||||||
uint8_t *output = malloc(strlen($1)); /* Cannot be larger than that */
|
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);
|
sect_AbsByteGroup(output, length);
|
||||||
free(output);
|
free(output);
|
||||||
@@ -1360,7 +1360,7 @@ constlist_16bit_entry : reloc_16bit_no_str {
|
|||||||
}
|
}
|
||||||
| string {
|
| string {
|
||||||
uint8_t *output = malloc(strlen($1)); /* Cannot be larger than that */
|
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);
|
sect_AbsWordGroup(output, length);
|
||||||
free(output);
|
free(output);
|
||||||
@@ -1377,7 +1377,7 @@ constlist_32bit_entry : relocexpr_no_str {
|
|||||||
| string {
|
| string {
|
||||||
// Charmaps cannot increase the length of a string
|
// Charmaps cannot increase the length of a string
|
||||||
uint8_t *output = malloc(strlen($1));
|
uint8_t *output = malloc(strlen($1));
|
||||||
uint32_t length = charmap_Convert($1, output);
|
size_t length = charmap_Convert($1, output);
|
||||||
|
|
||||||
sect_AbsLongGroup(output, length);
|
sect_AbsLongGroup(output, length);
|
||||||
free(output);
|
free(output);
|
||||||
|
|||||||
@@ -628,7 +628,7 @@ void sect_AbsByte(uint8_t b)
|
|||||||
writebyte(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())
|
if (!checkcodesection())
|
||||||
return;
|
return;
|
||||||
@@ -639,7 +639,7 @@ void sect_AbsByteGroup(uint8_t const *s, uint32_t length)
|
|||||||
writebyte(*s++);
|
writebyte(*s++);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sect_AbsWordGroup(uint8_t const *s, uint32_t length)
|
void sect_AbsWordGroup(uint8_t const *s, size_t length)
|
||||||
{
|
{
|
||||||
if (!checkcodesection())
|
if (!checkcodesection())
|
||||||
return;
|
return;
|
||||||
@@ -650,7 +650,7 @@ void sect_AbsWordGroup(uint8_t const *s, uint32_t length)
|
|||||||
writeword(*s++);
|
writeword(*s++);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sect_AbsLongGroup(uint8_t const *s, uint32_t length)
|
void sect_AbsLongGroup(uint8_t const *s, size_t length)
|
||||||
{
|
{
|
||||||
if (!checkcodesection())
|
if (!checkcodesection())
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user