Skip to content

Commit

Permalink
src/ALAC/ : Replace Apple endswap routines with ones from libsndfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Feb 11, 2013
1 parent 88b1e0f commit b9e801d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 212 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-02-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* src/ALAC/
Replace Apple endswap routines with ones from libsndfile.

2013-02-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* src/common.h
Expand Down
185 changes: 0 additions & 185 deletions src/ALAC/EndianPortable.c

This file was deleted.

32 changes: 6 additions & 26 deletions src/ALAC/EndianPortable.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2011 Apple Inc. All rights reserved.
** Copyright (C) 2013 Erik de Castro Lopo <erikd@mega-nerd.com>
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
Expand Down Expand Up @@ -27,33 +28,12 @@
#ifndef _EndianPortable_h
#define _EndianPortable_h

#include <stdint.h>
#include <sfendian.h>

#ifdef __cplusplus
extern "C" {
#endif

uint16_t Swap16NtoB(uint16_t inUInt16);
uint16_t Swap16BtoN(uint16_t inUInt16);

uint32_t Swap32NtoB(uint32_t inUInt32);
uint32_t Swap32BtoN(uint32_t inUInt32);

uint64_t Swap64BtoN(uint64_t inUInt64);
uint64_t Swap64NtoB(uint64_t inUInt64);
#define Swap16NtoB(x) H2BE_16(x)
#define Swap16BtoN(x) BE2H_16(x)

float SwapFloat32BtoN(float in);
float SwapFloat32NtoB(float in);

double SwapFloat64BtoN(double in);
double SwapFloat64NtoB(double in);

void Swap16(uint16_t * inUInt16);
void Swap24(uint8_t * inUInt24);
void Swap32(uint32_t * inUInt32);

#ifdef __cplusplus
}
#endif
#define Swap32NtoB(x) H2BE_32(x)
#define Swap32BtoN(x) BE2H_32(x)

#endif
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ G72x_libg72x_la_SOURCES = G72x/g72x.h G72x/g72x_priv.h \
ALAC_libalac_la_SOURCES = ALAC/ALACAudioTypes.h ALAC/ALACBitUtilities.h \
ALAC/EndianPortable.h ALAC/aglib.h ALAC/dplib.h ALAC/matrixlib.h \
ALAC/alac_codec.h \
ALAC/ALACBitUtilities.c ALAC/EndianPortable.c ALAC/ag_dec.c \
ALAC/ALACBitUtilities.c ALAC/ag_dec.c \
ALAC/ag_enc.c ALAC/dp_dec.c ALAC/dp_enc.c ALAC/matrix_dec.c \
ALAC/matrix_enc.c ALAC/alac_decoder.c ALAC/alac_encoder.c

Expand Down

0 comments on commit b9e801d

Please sign in to comment.