Browse Source

- added GNU extension bswap_xx() instead own implementation

development
Andreas Romeyke 9 months ago
parent
commit
d529f439a7
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      src/helper/check_helper.c

+ 3
- 8
src/helper/check_helper.c View File

@ -16,6 +16,7 @@
#include <assert.h>
#include <fcntl.h>
#include <string.h>
#include <byteswap.h>
/*
#define DEBUG
*/
@ -62,17 +63,11 @@ char* frac2str(int d, int n) {
}
void TIFFSwabShort(uint16 *a) {
uint16 b = ((*a & 0xff) << 8) | ((*a >> 8) & 0xff);
*a=b;
*a = bswap_16( *a );
}
void TIFFSwabLong(uint32 *a) {
uint8 b0 = (*a) & 0xff;
uint8 b1 = (*a >> 8) & 0xff;
uint8 b2 = (*a >> 16) & 0xff;
uint8 b3 = (*a >> 24) & 0xff;
uint32 b = (b0 << 24) | (b1 << 16) | (b2 << 8) | b3;
*a=b;
*a = bswap_32( *a );
}
long long fsize(int fd) {


Loading…
Cancel
Save