mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-24 16:04:40 +08:00
Reverted to different code in support of https://github.com/Unidata/netcdf-c/issues/344
This commit is contained in:
parent
59618c481b
commit
2f3b894bec
@ -10,6 +10,12 @@
|
||||
#include "ncio.h"
|
||||
#include "fbits.h"
|
||||
|
||||
#ifndef HAVE_STDINT_H
|
||||
#include "pstdint.h"
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif /* HAVE_STDINT_H */
|
||||
|
||||
/*
|
||||
* An external data representation interface.
|
||||
|
||||
|
@ -190,19 +190,13 @@ swapn2b(void *dst, const void *src, size_t nn)
|
||||
void
|
||||
swap4b(void *dst, const void *src)
|
||||
{
|
||||
unsigned int *op = dst;
|
||||
const char *ip = src;
|
||||
unsigned int tempIn;
|
||||
unsigned int tempOut;
|
||||
uint32_t* op32 = (uint32_t*)(dst);
|
||||
const uint32_t* ip32 = (const uint32_t*)(src);
|
||||
|
||||
tempIn = *(unsigned int *)(ip+0);
|
||||
tempOut =
|
||||
( tempIn << 24) |
|
||||
((tempIn & 0x0000ff00) << 8) |
|
||||
((tempIn & 0x00ff0000) >> 8) |
|
||||
( tempIn >> 24);
|
||||
|
||||
*op = *(&tempOut);
|
||||
*op32 = (((*ip32) ) << 24) |
|
||||
(((*ip32) & 0x0000ff00u) << 8) |
|
||||
(((*ip32) & 0x00ff0000u) >> 8) |
|
||||
(((*ip32) ) >> 24);
|
||||
}
|
||||
# endif /* !vax */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user