Last change
on this file was
2759,
checked in by aslmd, 3 years ago
|
adding unmodified code from WRFV3.0.1.1, expurged from useless data +1M size
|
File size:
389 bytes
|
Rev | Line | |
---|
[2759] | 1 | #include <stdio.h> |
---|
| 2 | #include <stdlib.h> |
---|
| 3 | void *swap_byte4(long *theInt) |
---|
| 4 | { |
---|
| 5 | char tmp[4]; |
---|
| 6 | int i; |
---|
| 7 | |
---|
| 8 | for (i=0; i<sizeof(long); i++) |
---|
| 9 | tmp[i] = *((char*)theInt+(sizeof(long)-1-i)); |
---|
| 10 | |
---|
| 11 | *theInt=*((long *)tmp); |
---|
| 12 | |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | void *swap_byte2(short *theInt) |
---|
| 16 | { |
---|
| 17 | char tmp[4]; |
---|
| 18 | int i; |
---|
| 19 | |
---|
| 20 | for (i=0; i<sizeof(short); i++) |
---|
| 21 | tmp[i] = *((char*)theInt+(sizeof(short)-1-i)); |
---|
| 22 | |
---|
| 23 | *theInt=*((short *)tmp); |
---|
| 24 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.