ref: c2b0f9aa695406f0319fa1cb98b7bb7b5dbd7e02
parent: 1ff642d9c61d62d6903db649e51675e13337418d
author: glenda <glenda@bones>
date: Mon Mar 6 09:11:13 EST 2023
endian fix for spim
--- a/spim/include/u.h
+++ b/spim/include/u.h
@@ -49,12 +49,14 @@
union FPdbleword
{
double x;
- struct { /* big endian */
- ulong hi;
+ struct { /* little endian */
ulong lo;
+ ulong hi;
};
};
+
+
/* stdarg */
typedef char* va_list;
#define va_start(list, start) list =\
@@ -65,7 +67,7 @@
USED(list)
#define va_arg(list, mode)\
((sizeof(mode) == 1)?\
- ((list += 4), (mode*)list)[-1]:\
+ ((list += 4), (mode*)list)[-4]:\
(sizeof(mode) == 2)?\
- ((list += 4), (mode*)list)[-1]:\
+ ((list += 4), (mode*)list)[-2]:\
((list += sizeof(mode)), (mode*)list)[-1])