From 7d986adf37220e1981a707745b784b078de4e3bc Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Fri, 20 Jan 2023 00:39:43 +0000 Subject: fix various inaccuracies exposed by the mach ppc plugin --- .../FrontEnd/Common/CompilerTools.c | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'compiler_and_linker/FrontEnd/Common') 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) { -- cgit v1.2.3