void mmssdd( char *b, char *p )
{
int m, s, d;
-#if defined(__BIGENDIAN__)
+#if defined(__arm__)
+ int block = (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];
+#elif defined(__BIGENDIAN__)
int block = (b[0] & 0xff) | ((b[1] & 0xff) << 8) | ((b[2] & 0xff) << 16) | (b[3] << 24);
#else
int block = *((int*)b);
#else
#define GETLE16(X) LE2HOST16(*(uint16_t *)X)
-#define GETLE32(X) LE2HOST32(*(uint32_t *)X)
#define GETLE16D(X) ({uint32_t val = GETLE32(X); (val<<16 | val >> 16);})
#define PUTLE16(X, Y) do{*((uint16_t *)X)=HOST2LE16((uint16_t)Y);}while(0)
+#ifdef __arm__
+#define GETLE32(X) (*(uint16_t *)X|(((uint16_t *)X)[1]<<16))
+#define PUTLE32(X, Y) do{*((uint16_t *)X)=(uint32_t)Y;((uint16_t *)X)[1]=(uint32_t)(Y)>>16;}while(0)
+#else
+#define GETLE32(X) LE2HOST32(*(uint32_t *)X)
#define PUTLE32(X, Y) do{*((uint32_t *)X)=HOST2LE16((uint32_t)Y);}while(0)
#endif
+#endif