mirror of
https://git.wuffs.org/MWCC
synced 2025-12-12 06:45:17 +00:00
fix various inaccuracies exposed by the mach ppc plugin
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user