fix various inaccuracies exposed by the mach ppc plugin

This commit is contained in:
Ash Wolf
2023-01-20 00:39:43 +00:00
parent 4d670146b4
commit 7d986adf37
24 changed files with 429 additions and 422 deletions

View File

@@ -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) {