mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
saa: make saa_wleb128[us]() take appropriate types; recode
Make saa_wleb128[us]() take uint64_t and int64_t, respectively, rather than int. Notably, if saa_wleb128u() were to receive negative int, it would have looped forever. Recode these functions in a style more consistent with NASM code in general, and possibly a bit simpler. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
9fdc7eab6e
commit
8d4733962e
2 changed files with 51 additions and 48 deletions
|
|
@ -57,8 +57,8 @@ void saa_write8(struct SAA *s, uint8_t v);
|
|||
void saa_write16(struct SAA *s, uint16_t v);
|
||||
void saa_write32(struct SAA *s, uint32_t v);
|
||||
void saa_write64(struct SAA *s, uint64_t v);
|
||||
void saa_wleb128u(struct SAA *, int); /* write unsigned LEB128 value */
|
||||
void saa_wleb128s(struct SAA *, int); /* write signed LEB128 value */
|
||||
void saa_writeaddr(struct SAA *, uint64_t, size_t);
|
||||
void saa_wleb128u(struct SAA *, uint64_t v); /* unsigned LEB128 value */
|
||||
void saa_wleb128s(struct SAA *, int64_t v); /* signed LEB128 value */
|
||||
void saa_writeaddr(struct SAA *, uint64_t, size_t); /* specific size integer */
|
||||
|
||||
#endif /* NASM_SAA_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue