Skip to content

Commit

Permalink
Merge pull request #79 from pettarin/master
Browse files Browse the repository at this point in the history
Fixed issue with symlinks in Windows
  • Loading branch information
readbeyond committed Apr 3, 2016
2 parents 2d7c18d + ce22d05 commit d8666b8
Show file tree
Hide file tree
Showing 11 changed files with 959 additions and 11 deletions.
1 change: 0 additions & 1 deletion aeneas/cdtw/cint.c

This file was deleted.

111 changes: 111 additions & 0 deletions aeneas/cdtw/cint.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
Portable fixed-size int definitions for the other Python C extensions.
__author__ = "Alberto Pettarin"
__copyright__ = """
Copyright 2012-2013, Alberto Pettarin (www.albertopettarin.it)
Copyright 2013-2015, ReadBeyond Srl (www.readbeyond.it)
Copyright 2015-2016, Alberto Pettarin (www.albertopettarin.it)
"""
__license__ = "GNU AGPL v3"
__version__ = "1.5.0"
__email__ = "[email protected]"
__status__ = "Production"
*/

#include "cint.h"

uint8_t le_u8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
uint8_t be_u8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
uint16_t le_u16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[0]) | (((uint16_t)buf[1]) << 8);
}
uint16_t be_u16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[1]) | (((uint16_t)buf[0]) << 8);
}
uint32_t le_u32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[0]) | (((uint32_t)buf[1]) << 8) | (((uint32_t)buf[2]) << 16) | (((uint32_t)buf[3]) << 24);
}
uint32_t be_u32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[3]) | (((uint32_t)buf[2]) << 8) | (((uint32_t)buf[1]) << 16) | (((uint32_t)buf[0]) << 24);
}

int8_t le_s8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
int8_t be_s8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
int16_t le_s16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[0]) | (((uint16_t)buf[1]) << 8);
}
int16_t be_s16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[1]) | (((uint16_t)buf[0]) << 8);
}
int32_t le_s32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[0]) | (((uint32_t)buf[1]) << 8) | (((uint32_t)buf[2]) << 16) | (((uint32_t)buf[3]) << 24);
}
int32_t be_s32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[3]) | (((uint32_t)buf[2]) << 8) | (((uint32_t)buf[1]) << 16) | (((uint32_t)buf[0]) << 24);
}

void cpu_to_le_u8(unsigned char *buf, uint8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_be_u8(uint8_t *buf, uint8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_le_u16(unsigned char *buf, uint16_t val) {
buf[0] = (val & 0x00FF);
buf[1] = (val & 0xFF00) >> 8;
}
void cpu_to_be_u16(uint8_t *buf, uint16_t val) {
buf[0] = (val & 0xFF00) >> 8;
buf[1] = (val & 0x00FF);
}
void cpu_to_le_u32(unsigned char *buf, uint32_t val) {
buf[0] = (val & 0x000000FF);
buf[1] = (val & 0x0000FF00) >> 8;
buf[2] = (val & 0x00FF0000) >> 16;
buf[3] = (val & 0xFF000000) >> 24;
}
void cpu_to_be_u32(uint8_t *buf, uint32_t val) {
buf[0] = (val & 0xFF000000) >> 24;
buf[1] = (val & 0x00FF0000) >> 16;
buf[2] = (val & 0x0000FF00) >> 8;
buf[3] = (val & 0x000000FF);
}

void cpu_to_le_s8(unsigned char *buf, int8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_be_s8(uint8_t *buf, int8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_le_s16(unsigned char *buf, int16_t val) {
buf[0] = (val & 0x00FF);
buf[1] = (val & 0xFF00) >> 8;
}
void cpu_to_be_s16(uint8_t *buf, int16_t val) {
buf[0] = (val & 0xFF00) >> 8;
buf[1] = (val & 0x00FF);
}
void cpu_to_le_s32(unsigned char *buf, int32_t val) {
buf[0] = (val & 0x000000FF);
buf[1] = (val & 0x0000FF00) >> 8;
buf[2] = (val & 0x00FF0000) >> 16;
buf[3] = (val & 0xFF000000) >> 24;
}
void cpu_to_be_s32(uint8_t *buf, int32_t val) {
buf[0] = (val & 0xFF000000) >> 24;
buf[1] = (val & 0x00FF0000) >> 16;
buf[2] = (val & 0x0000FF00) >> 8;
buf[3] = (val & 0x000000FF);
}

1 change: 0 additions & 1 deletion aeneas/cdtw/cint.h

This file was deleted.

58 changes: 58 additions & 0 deletions aeneas/cdtw/cint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Portable fixed-size int definitions for the other Python C extensions.
__author__ = "Alberto Pettarin"
__copyright__ = """
Copyright 2012-2013, Alberto Pettarin (www.albertopettarin.it)
Copyright 2013-2015, ReadBeyond Srl (www.readbeyond.it)
Copyright 2015-2016, Alberto Pettarin (www.albertopettarin.it)
"""
__license__ = "GNU AGPL v3"
__version__ = "1.5.0"
__email__ = "[email protected]"
__status__ = "Production"
*/

#ifdef _MSC_VER
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif

uint8_t le_u8_to_cpu(const unsigned char *buf);
uint8_t be_u8_to_cpu(const unsigned char *buf);
uint16_t le_u16_to_cpu(const unsigned char *buf);
uint16_t be_u16_to_cpu(const unsigned char *buf);
uint32_t le_u32_to_cpu(const unsigned char *buf);
uint32_t be_u32_to_cpu(const unsigned char *buf);

int8_t le_s8_to_cpu(const unsigned char *buf);
int8_t be_s8_to_cpu(const unsigned char *buf);
int16_t le_s16_to_cpu(const unsigned char *buf);
int16_t be_s16_to_cpu(const unsigned char *buf);
int32_t le_s32_to_cpu(const unsigned char *buf);
int32_t be_s32_to_cpu(const unsigned char *buf);

void cpu_to_le_u8(unsigned char *buf, uint8_t val);
void cpu_to_be_u8(unsigned char *buf, uint8_t val);
void cpu_to_le_u16(unsigned char *buf, uint16_t val);
void cpu_to_be_u16(unsigned char *buf, uint16_t val);
void cpu_to_le_u32(unsigned char *buf, uint32_t val);
void cpu_to_be_u32(unsigned char *buf, uint32_t val);

void cpu_to_le_s8(unsigned char *buf, int8_t val);
void cpu_to_be_s8(unsigned char *buf, int8_t val);
void cpu_to_le_s16(unsigned char *buf, int16_t val);
void cpu_to_be_s16(unsigned char *buf, int16_t val);
void cpu_to_le_s32(unsigned char *buf, int32_t val);
void cpu_to_be_s32(unsigned char *buf, int32_t val);

1 change: 0 additions & 1 deletion aeneas/cmfcc/cint.c

This file was deleted.

111 changes: 111 additions & 0 deletions aeneas/cmfcc/cint.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
Portable fixed-size int definitions for the other Python C extensions.
__author__ = "Alberto Pettarin"
__copyright__ = """
Copyright 2012-2013, Alberto Pettarin (www.albertopettarin.it)
Copyright 2013-2015, ReadBeyond Srl (www.readbeyond.it)
Copyright 2015-2016, Alberto Pettarin (www.albertopettarin.it)
"""
__license__ = "GNU AGPL v3"
__version__ = "1.5.0"
__email__ = "[email protected]"
__status__ = "Production"
*/

#include "cint.h"

uint8_t le_u8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
uint8_t be_u8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
uint16_t le_u16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[0]) | (((uint16_t)buf[1]) << 8);
}
uint16_t be_u16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[1]) | (((uint16_t)buf[0]) << 8);
}
uint32_t le_u32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[0]) | (((uint32_t)buf[1]) << 8) | (((uint32_t)buf[2]) << 16) | (((uint32_t)buf[3]) << 24);
}
uint32_t be_u32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[3]) | (((uint32_t)buf[2]) << 8) | (((uint32_t)buf[1]) << 16) | (((uint32_t)buf[0]) << 24);
}

int8_t le_s8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
int8_t be_s8_to_cpu(const unsigned char *buf) {
return (uint8_t)buf[0];
}
int16_t le_s16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[0]) | (((uint16_t)buf[1]) << 8);
}
int16_t be_s16_to_cpu(const unsigned char *buf) {
return ((uint16_t)buf[1]) | (((uint16_t)buf[0]) << 8);
}
int32_t le_s32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[0]) | (((uint32_t)buf[1]) << 8) | (((uint32_t)buf[2]) << 16) | (((uint32_t)buf[3]) << 24);
}
int32_t be_s32_to_cpu(const unsigned char *buf) {
return ((uint32_t)buf[3]) | (((uint32_t)buf[2]) << 8) | (((uint32_t)buf[1]) << 16) | (((uint32_t)buf[0]) << 24);
}

void cpu_to_le_u8(unsigned char *buf, uint8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_be_u8(uint8_t *buf, uint8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_le_u16(unsigned char *buf, uint16_t val) {
buf[0] = (val & 0x00FF);
buf[1] = (val & 0xFF00) >> 8;
}
void cpu_to_be_u16(uint8_t *buf, uint16_t val) {
buf[0] = (val & 0xFF00) >> 8;
buf[1] = (val & 0x00FF);
}
void cpu_to_le_u32(unsigned char *buf, uint32_t val) {
buf[0] = (val & 0x000000FF);
buf[1] = (val & 0x0000FF00) >> 8;
buf[2] = (val & 0x00FF0000) >> 16;
buf[3] = (val & 0xFF000000) >> 24;
}
void cpu_to_be_u32(uint8_t *buf, uint32_t val) {
buf[0] = (val & 0xFF000000) >> 24;
buf[1] = (val & 0x00FF0000) >> 16;
buf[2] = (val & 0x0000FF00) >> 8;
buf[3] = (val & 0x000000FF);
}

void cpu_to_le_s8(unsigned char *buf, int8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_be_s8(uint8_t *buf, int8_t val) {
buf[0] = (val & 0xFF);
}
void cpu_to_le_s16(unsigned char *buf, int16_t val) {
buf[0] = (val & 0x00FF);
buf[1] = (val & 0xFF00) >> 8;
}
void cpu_to_be_s16(uint8_t *buf, int16_t val) {
buf[0] = (val & 0xFF00) >> 8;
buf[1] = (val & 0x00FF);
}
void cpu_to_le_s32(unsigned char *buf, int32_t val) {
buf[0] = (val & 0x000000FF);
buf[1] = (val & 0x0000FF00) >> 8;
buf[2] = (val & 0x00FF0000) >> 16;
buf[3] = (val & 0xFF000000) >> 24;
}
void cpu_to_be_s32(uint8_t *buf, int32_t val) {
buf[0] = (val & 0xFF000000) >> 24;
buf[1] = (val & 0x00FF0000) >> 16;
buf[2] = (val & 0x0000FF00) >> 8;
buf[3] = (val & 0x000000FF);
}

1 change: 0 additions & 1 deletion aeneas/cmfcc/cint.h

This file was deleted.

58 changes: 58 additions & 0 deletions aeneas/cmfcc/cint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Portable fixed-size int definitions for the other Python C extensions.
__author__ = "Alberto Pettarin"
__copyright__ = """
Copyright 2012-2013, Alberto Pettarin (www.albertopettarin.it)
Copyright 2013-2015, ReadBeyond Srl (www.readbeyond.it)
Copyright 2015-2016, Alberto Pettarin (www.albertopettarin.it)
"""
__license__ = "GNU AGPL v3"
__version__ = "1.5.0"
__email__ = "[email protected]"
__status__ = "Production"
*/

#ifdef _MSC_VER
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif

uint8_t le_u8_to_cpu(const unsigned char *buf);
uint8_t be_u8_to_cpu(const unsigned char *buf);
uint16_t le_u16_to_cpu(const unsigned char *buf);
uint16_t be_u16_to_cpu(const unsigned char *buf);
uint32_t le_u32_to_cpu(const unsigned char *buf);
uint32_t be_u32_to_cpu(const unsigned char *buf);

int8_t le_s8_to_cpu(const unsigned char *buf);
int8_t be_s8_to_cpu(const unsigned char *buf);
int16_t le_s16_to_cpu(const unsigned char *buf);
int16_t be_s16_to_cpu(const unsigned char *buf);
int32_t le_s32_to_cpu(const unsigned char *buf);
int32_t be_s32_to_cpu(const unsigned char *buf);

void cpu_to_le_u8(unsigned char *buf, uint8_t val);
void cpu_to_be_u8(unsigned char *buf, uint8_t val);
void cpu_to_le_u16(unsigned char *buf, uint16_t val);
void cpu_to_be_u16(unsigned char *buf, uint16_t val);
void cpu_to_le_u32(unsigned char *buf, uint32_t val);
void cpu_to_be_u32(unsigned char *buf, uint32_t val);

void cpu_to_le_s8(unsigned char *buf, int8_t val);
void cpu_to_be_s8(unsigned char *buf, int8_t val);
void cpu_to_le_s16(unsigned char *buf, int16_t val);
void cpu_to_be_s16(unsigned char *buf, int16_t val);
void cpu_to_le_s32(unsigned char *buf, int32_t val);
void cpu_to_be_s32(unsigned char *buf, int32_t val);

1 change: 0 additions & 1 deletion aeneas/cmfcc/cwave_func.c

This file was deleted.

Loading

0 comments on commit d8666b8

Please sign in to comment.