removed endian conversion code, now we just write in big-endian on output with shifts, not swaps etc

This commit is contained in:
Thomas von Dein
2016-10-20 23:14:14 +02:00
parent f664cc24c4
commit b8008d1207
14 changed files with 231 additions and 329 deletions

View File

@@ -23,25 +23,13 @@
#include "keysig.h"
pcp_keysig_t * keysig2be(pcp_keysig_t *s) {
#ifdef __CPU_IS_BIG_ENDIAN
_32towire(s->size, (byte *)&s->size);
return s;
#else
uint32_t size = s->size;
byte* p = (byte*)&size;
if(p[0] != 0) {
s->size = htobe32(s->size);
}
return s;
#endif
}
pcp_keysig_t *keysig2native(pcp_keysig_t *s) {
#ifdef __CPU_IS_BIG_ENDIAN
s->size = _wireto32((byte *)&s->size);
return s;
#else
s->size = be32toh(s->size);
return s;
#endif
}
Buffer *pcp_keysig2blob(pcp_keysig_t *s) {