From 291ee2252b421448d56acec99ecb80aab88e1f29 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 6 Apr 2010 12:04:46 -0400 Subject: [PATCH] freetdm type fixes --- libs/freetdm/src/ftdm_io.c | 4 ++-- libs/freetdm/src/ftdm_threadmutex.c | 6 +++--- libs/freetdm/src/include/freetdm.h | 4 ++-- libs/freetdm/src/include/ftdm_types.h | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 82301c0a5c..ef58eba7db 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -660,10 +660,10 @@ FT_DECLARE(ftdm_status_t) ftdm_span_load_tones(ftdm_span_t *span, const char *ma #define FTDM_SLINEAR_MAX_VALUE 32767 #define FTDM_SLINEAR_MIN_VALUE -32767 -static void reset_gain_table(unsigned char *gain_table, float new_gain, ftdm_codec_t codec_gain) +static void reset_gain_table(uint8_t *gain_table, float new_gain, ftdm_codec_t codec_gain) { /* sample value */ - unsigned char sv = 0; + uint8_t sv = 0; /* linear gain factor */ float lingain = 0; /* linear value for each table sample */ diff --git a/libs/freetdm/src/ftdm_threadmutex.c b/libs/freetdm/src/ftdm_threadmutex.c index 34c802b1de..8e9c62ff4c 100644 --- a/libs/freetdm/src/ftdm_threadmutex.c +++ b/libs/freetdm/src/ftdm_threadmutex.c @@ -258,8 +258,8 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_create(ftdm_interrupt_t **ininterrupt, interrupt->device = device; #ifdef WIN32 - interrupt->interrupt = CreateEvent(NULL, FALSE, FALSE, NULL); - if (!interrupt->interrupt) { + interrupt->event = CreateEvent(NULL, FALSE, FALSE, NULL); + if (!interrupt->event) { ftdm_log(FTDM_LOG_ERROR, "Failed to allocate interrupt event\n"); goto failed; } @@ -386,7 +386,7 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_destroy(ftdm_interrupt_t **ininterrupt) ftdm_assert_return(ininterrupt != NULL, FTDM_FAIL, "Interrupt null when destroying!\n"); interrupt = *ininterrupt; #ifdef WIN32 - CloseHandle(interrupt->interrupt); + CloseHandle(interrupt->event); #else close(interrupt->readfd); close(interrupt->writefd); diff --git a/libs/freetdm/src/include/freetdm.h b/libs/freetdm/src/include/freetdm.h index 0b8b43dbf8..dcf171b3d7 100644 --- a/libs/freetdm/src/include/freetdm.h +++ b/libs/freetdm/src/include/freetdm.h @@ -605,8 +605,8 @@ struct ftdm_channel { ftdm_hash_t *variable_hash; unsigned char rx_cas_bits; uint32_t pre_buffer_size; - unsigned char rxgain_table[FTDM_GAINS_TABLE_SIZE]; - unsigned char txgain_table[FTDM_GAINS_TABLE_SIZE]; + uint8_t rxgain_table[FTDM_GAINS_TABLE_SIZE]; + uint8_t txgain_table[FTDM_GAINS_TABLE_SIZE]; float rxgain; float txgain; }; diff --git a/libs/freetdm/src/include/ftdm_types.h b/libs/freetdm/src/include/ftdm_types.h index cf12bc9a2c..a13179e856 100644 --- a/libs/freetdm/src/include/ftdm_types.h +++ b/libs/freetdm/src/include/ftdm_types.h @@ -40,8 +40,8 @@ #define FTDM_TYPES_H #include "fsk.h" -#define FTDM_INVALID_SOCKET -1 #ifdef WIN32 +#define FTDM_INVALID_SOCKET INVALID_HANDLE_VALUE #include typedef HANDLE ftdm_socket_t; typedef unsigned __int64 uint64_t; @@ -55,6 +55,7 @@ typedef __int8 int8_t; typedef intptr_t ftdm_ssize_t; typedef int ftdm_filehandle_t; #else +#define FTDM_INVALID_SOCKET -1 #include #include #include