diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-01-20 00:39:43 +0000 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-01-20 00:39:43 +0000 |
commit | 7d986adf37220e1981a707745b784b078de4e3bc (patch) | |
tree | 831dea5f470c0c6b3c373f38d3a5f0354bc22600 /compiler_and_linker/FrontEnd/Common | |
parent | 4d670146b4054e11e90227f96a3a1c66410e8d0b (diff) | |
download | MWCC-7d986adf37220e1981a707745b784b078de4e3bc.tar.gz MWCC-7d986adf37220e1981a707745b784b078de4e3bc.zip |
fix various inaccuracies exposed by the mach ppc plugin
Diffstat (limited to 'compiler_and_linker/FrontEnd/Common')
-rw-r--r-- | compiler_and_linker/FrontEnd/Common/CompilerTools.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/compiler_and_linker/FrontEnd/Common/CompilerTools.c b/compiler_and_linker/FrontEnd/Common/CompilerTools.c index 272cd81..1a3e995 100644 --- a/compiler_and_linker/FrontEnd/Common/CompilerTools.c +++ b/compiler_and_linker/FrontEnd/Common/CompilerTools.c @@ -190,8 +190,8 @@ void AppendGListWord(GList *gl, SInt16 theword) { ptr = *gl->data + gl->size; gl->size += 2; - *(ptr++) = ((unsigned char *) &theword)[0]; - *(ptr++) = ((unsigned char *) &theword)[1]; + *(ptr++) = ((char *) &theword)[0]; + *(ptr++) = ((char *) &theword)[1]; } void AppendGListTargetEndianWord(GList *gl, SInt16 theword) { @@ -205,8 +205,8 @@ void AppendGListTargetEndianWord(GList *gl, SInt16 theword) { ptr = *gl->data + gl->size; gl->size += 2; theword = CTool_EndianConvertWord16(theword); - *(ptr++) = ((unsigned char *) &theword)[0]; - *(ptr++) = ((unsigned char *) &theword)[1]; + *(ptr++) = ((char *) &theword)[0]; + *(ptr++) = ((char *) &theword)[1]; } void AppendGListLong(GList *gl, SInt32 theword) { @@ -219,10 +219,10 @@ void AppendGListLong(GList *gl, SInt32 theword) { ptr = *gl->data + gl->size; gl->size += 4; - *(ptr++) = ((unsigned char *) &theword)[0]; - *(ptr++) = ((unsigned char *) &theword)[1]; - *(ptr++) = ((unsigned char *) &theword)[2]; - *(ptr++) = ((unsigned char *) &theword)[3]; + *(ptr++) = ((char *) &theword)[0]; + *(ptr++) = ((char *) &theword)[1]; + *(ptr++) = ((char *) &theword)[2]; + *(ptr++) = ((char *) &theword)[3]; } void AppendGListTargetEndianLong(GList *gl, SInt32 theword) { @@ -236,10 +236,10 @@ void AppendGListTargetEndianLong(GList *gl, SInt32 theword) { ptr = *gl->data + gl->size; gl->size += 4; theword = CTool_EndianConvertWord32(theword); - *(ptr++) = ((unsigned char *) &theword)[0]; - *(ptr++) = ((unsigned char *) &theword)[1]; - *(ptr++) = ((unsigned char *) &theword)[2]; - *(ptr++) = ((unsigned char *) &theword)[3]; + *(ptr++) = ((char *) &theword)[0]; + *(ptr++) = ((char *) &theword)[1]; + *(ptr++) = ((char *) &theword)[2]; + *(ptr++) = ((char *) &theword)[3]; } void AppendGListID(GList *gl, const char *name) { @@ -365,7 +365,7 @@ SInt16 CHash(const char *string) { SInt16 hashval; UInt8 u; - if ((hashval = (UInt8) strlen(string))) { + if ((hashval = (strlen(string) & 0xFF))) { i = hashval; u = 0; while (i > 0) { |