diff --git a/libs/spandsp/src/adsi.c b/libs/spandsp/src/adsi.c
index c17ed6cca0..cf314bc7af 100644
--- a/libs/spandsp/src/adsi.c
+++ b/libs/spandsp/src/adsi.c
@@ -23,7 +23,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: adsi.c,v 1.67 2009/01/28 03:41:26 steveu Exp $
+ * $Id: adsi.c,v 1.68 2009/01/29 01:41:05 steveu Exp $
*/
/*! \file */
@@ -1045,7 +1045,7 @@ int adsi_add_field(adsi_tx_state_t *s, uint8_t *msg, int len, uint8_t field_type
if (field_type != CLIP_DTMF_HASH_UNSPECIFIED)
msg[len++] = field_type;
memcpy(msg + len, field_body, field_len);
- msg[len + field_len] = x;
+ msg[len + field_len] = (uint8_t) x;
len += (field_len + 1);
}
break;
diff --git a/libs/spandsp/src/bell_r2_mf.c b/libs/spandsp/src/bell_r2_mf.c
index aa42b929d4..e5f613b4b8 100644
--- a/libs/spandsp/src/bell_r2_mf.c
+++ b/libs/spandsp/src/bell_r2_mf.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: bell_r2_mf.c,v 1.33 2009/01/28 03:41:26 steveu Exp $
+ * $Id: bell_r2_mf.c,v 1.34 2009/01/29 01:41:05 steveu Exp $
*/
/*! \file */
@@ -628,7 +628,7 @@ bell_mf_rx_state_t *bell_mf_rx_init(bell_mf_rx_state_t *s,
if (!initialised)
{
for (i = 0; i < 6; i++)
- make_goertzel_descriptor(&bell_mf_detect_desc[i], bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK);
+ make_goertzel_descriptor(&bell_mf_detect_desc[i], (float) bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK);
initialised = TRUE;
}
s->digits_callback = callback;
@@ -805,8 +805,8 @@ r2_mf_rx_state_t *r2_mf_rx_init(r2_mf_rx_state_t *s,
{
for (i = 0; i < 6; i++)
{
- make_goertzel_descriptor(&mf_fwd_detect_desc[i], r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
- make_goertzel_descriptor(&mf_back_detect_desc[i], r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
+ make_goertzel_descriptor(&mf_fwd_detect_desc[i], (float) r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
+ make_goertzel_descriptor(&mf_back_detect_desc[i], (float) r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
}
initialised = TRUE;
}
diff --git a/libs/spandsp/src/dds_int.c b/libs/spandsp/src/dds_int.c
index 10c4f7fd7a..70de2d1021 100644
--- a/libs/spandsp/src/dds_int.c
+++ b/libs/spandsp/src/dds_int.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: dds_int.c,v 1.13 2009/01/28 03:41:26 steveu Exp $
+ * $Id: dds_int.c,v 1.14 2009/01/29 01:41:05 steveu Exp $
*/
/*! \file */
@@ -202,15 +202,15 @@ float dds_frequency(int32_t phase_rate)
}
/*- End of function --------------------------------------------------------*/
-int dds_scaling_dbm0(float level)
+int16_t dds_scaling_dbm0(float level)
{
- return (int) (powf(10.0f, (level - DBM0_MAX_SINE_POWER)/20.0f)*32767.0f);
+ return (int16_t) (powf(10.0f, (level - DBM0_MAX_SINE_POWER)/20.0f)*32767.0f);
}
/*- End of function --------------------------------------------------------*/
-int dds_scaling_dbov(float level)
+int16_t dds_scaling_dbov(float level)
{
- return (int) (powf(10.0f, (level - DBOV_MAX_SINE_POWER)/20.0f)*32767.0f);
+ return (int16_t) (powf(10.0f, (level - DBOV_MAX_SINE_POWER)/20.0f)*32767.0f);
}
/*- End of function --------------------------------------------------------*/
diff --git a/libs/spandsp/src/floating_fudge.h b/libs/spandsp/src/floating_fudge.h
index 27c9491ba2..16c5b0b8cf 100644
--- a/libs/spandsp/src/floating_fudge.h
+++ b/libs/spandsp/src/floating_fudge.h
@@ -25,7 +25,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: floating_fudge.h,v 1.5 2008/08/03 03:44:00 steveu Exp $
+ * $Id: floating_fudge.h,v 1.6 2009/01/29 01:41:05 steveu Exp $
*/
#if !defined(_FLOATING_FUDGE_H_)
@@ -354,6 +354,23 @@ static __inline__ float log10f(float x)
return i;
}
+ __inline float rintf(float flt)
+ {
+ _asm
+ { fld flt
+ frndint
+ }
+ }
+
+ __inline double rint(double dbl)
+ {
+ __asm
+ {
+ fld dbl
+ frndint
+ }
+ }
+
__inline long int lfastrint(double x)
{
long int i;
diff --git a/libs/spandsp/src/libspandsp.vcproj b/libs/spandsp/src/libspandsp.vcproj
index 86392db5d6..7b90c7fb88 100644
--- a/libs/spandsp/src/libspandsp.vcproj
+++ b/libs/spandsp/src/libspandsp.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="src; src\spandsp; src\msvc;..\libtiff\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_MATH_H;HAVE_TGMATH_H"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -51,6 +51,7 @@
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CompileAs="1"
+ DisableSpecificWarnings="4127"
/>
len;
/*endif*/
- if (real_len < len + sizeof(uint16_t))
+ if (real_len < len + (int) sizeof(uint16_t))
return -1;
/*endif*/
- real_len = len + sizeof(uint16_t);
+ real_len = len + (int) sizeof(uint16_t);
to_end = s->len - iptr;
lenx = (uint16_t) len;
diff --git a/libs/spandsp/src/spandsp/dds.h b/libs/spandsp/src/spandsp/dds.h
index af09c510d3..a1c5e062d7 100644
--- a/libs/spandsp/src/spandsp/dds.h
+++ b/libs/spandsp/src/spandsp/dds.h
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: dds.h,v 1.21 2008/09/11 15:13:42 steveu Exp $
+ * $Id: dds.h,v 1.22 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -51,13 +51,13 @@ float dds_frequency(int32_t phase_rate);
\param level The desired signal level, in dBm0.
\return The scaling factor.
*/
-int dds_scaling_dbm0(float level);
+int16_t dds_scaling_dbm0(float level);
/*! \brief Find the scaling factor needed to achieve a specified level in dBmov.
\param level The desired signal level, in dBmov.
\return The scaling factor.
*/
-int dds_scaling_dbov(float level);
+int16_t dds_scaling_dbov(float level);
/*! \brief Find the amplitude for a particular phase.
\param phase The desired phase 32 bit phase.
diff --git a/libs/spandsp/src/spandsp/t38_core.h b/libs/spandsp/src/spandsp/t38_core.h
index caf67f9cb7..7d4218c2c7 100644
--- a/libs/spandsp/src/spandsp/t38_core.h
+++ b/libs/spandsp/src/spandsp/t38_core.h
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_core.h,v 1.33 2009/01/23 16:07:14 steveu Exp $
+ * $Id: t38_core.h,v 1.34 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -333,7 +333,7 @@ t38_core_state_t *t38_core_init(t38_core_state_t *s,
t38_rx_data_handler_t *rx_data_handler,
t38_rx_missing_handler_t *rx_missing_handler,
void *rx_user_data,
- t38_tx_packet_handler_t tx_packet_handler,
+ t38_tx_packet_handler_t *tx_packet_handler,
void *tx_packet_user_data);
#if defined(__cplusplus)
diff --git a/libs/spandsp/src/spandsp/version.h b/libs/spandsp/src/spandsp/version.h
index 8782556dd4..c47489d83e 100644
--- a/libs/spandsp/src/spandsp/version.h
+++ b/libs/spandsp/src/spandsp/version.h
@@ -30,8 +30,8 @@
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20090128
-#define SPANDSP_RELEASE_TIME 034417
+#define SPANDSP_RELEASE_DATE 20090129
+#define SPANDSP_RELEASE_TIME 014346
#endif
/*- End of file ------------------------------------------------------------*/
diff --git a/libs/spandsp/src/t30.c b/libs/spandsp/src/t30.c
index 3fba56a369..054dff204f 100644
--- a/libs/spandsp/src/t30.c
+++ b/libs/spandsp/src/t30.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t30.c,v 1.278 2009/01/28 03:41:27 steveu Exp $
+ * $Id: t30.c,v 1.279 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -628,7 +628,7 @@ static int get_partial_ecm_page(t30_state_t *s)
s->ecm_at_page_end = TRUE;
return i;
}
- s->ecm_len[i] = (int16_t) 4 + len;
+ s->ecm_len[i] = (int16_t) (4 + len);
}
/* We filled the entire buffer */
s->ecm_frames = 256;
diff --git a/libs/spandsp/src/t31.c b/libs/spandsp/src/t31.c
index 22572d7363..e5e91ddb04 100644
--- a/libs/spandsp/src/t31.c
+++ b/libs/spandsp/src/t31.c
@@ -25,7 +25,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t31.c,v 1.136 2009/01/28 03:41:27 steveu Exp $
+ * $Id: t31.c,v 1.137 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -373,7 +373,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
t31_state_t *s;
t31_t38_front_end_state_t *fe;
#if defined(_MSC_VER)
- uint8_t *buf2 = (uint8_t *) alloca(len);
+ uint8_t *buf2 = (uint8_t *) _alloca(len);
#else
uint8_t buf2[len];
#endif
@@ -1444,7 +1444,7 @@ static void t31_v21_rx(t31_state_t *s)
s->hdlc_tx.len = 0;
s->dled = FALSE;
fsk_rx_init(&(s->audio.modems.v21_rx), &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &(s->audio.modems.hdlc_rx));
- fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -39.09);
+ fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -39.09f);
s->at_state.transmit = TRUE;
}
/*- End of function --------------------------------------------------------*/
@@ -2233,7 +2233,7 @@ static void t31_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_d
hdlc_rx_init(&s->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, user_data);
hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data);
fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
- fsk_rx_signal_cutoff(&s->v21_rx, -39.09);
+ fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
v17_rx_init(&s->v17_rx, 14400, non_ecm_put_bit, user_data);
v17_tx_init(&s->v17_tx, 14400, s->use_tep, non_ecm_get_bit, user_data);
diff --git a/libs/spandsp/src/t38_terminal.c b/libs/spandsp/src/t38_terminal.c
index f5ea29ad48..d11ddc02d4 100644
--- a/libs/spandsp/src/t38_terminal.c
+++ b/libs/spandsp/src/t38_terminal.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_terminal.c,v 1.119 2009/01/28 03:41:27 steveu Exp $
+ * $Id: t38_terminal.c,v 1.120 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -278,7 +278,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
t38_terminal_state_t *s;
t38_terminal_front_end_state_t *fe;
#if defined(_MSC_VER)
- uint8_t *buf2 = (uint8_t *) alloca(len);
+ uint8_t *buf2 = (uint8_t *) _alloca(len);
#else
uint8_t buf2[len];
#endif
diff --git a/libs/spandsp/src/time_scale.c b/libs/spandsp/src/time_scale.c
index fce11a969f..ab2ab91015 100644
--- a/libs/spandsp/src/time_scale.c
+++ b/libs/spandsp/src/time_scale.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: time_scale.c,v 1.27 2009/01/28 03:41:27 steveu Exp $
+ * $Id: time_scale.c,v 1.28 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -274,7 +274,7 @@ int time_scale(time_scale_state_t *s, int16_t out[], int16_t in[], int len)
int time_scale_max_output_len(time_scale_state_t *s, int input_len)
{
- return input_len*s->playout_rate + s->min_pitch + 1;
+ return (int) (input_len*s->playout_rate + s->min_pitch + 1);
}
/*- End of function --------------------------------------------------------*/
/*- End of file ------------------------------------------------------------*/
diff --git a/libs/spandsp/src/v17rx.c b/libs/spandsp/src/v17rx.c
index 0d7fd17f35..8a2d19349b 100644
--- a/libs/spandsp/src/v17rx.c
+++ b/libs/spandsp/src/v17rx.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: v17rx.c,v 1.129 2009/01/28 03:41:27 steveu Exp $
+ * $Id: v17rx.c,v 1.130 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -984,7 +984,7 @@ int v17_rx(v17_rx_state_t *s, const int16_t amp[], int len)
We need to measure the power with the DC blocked, but not using
a slow to respond DC blocker. Use the most elementary HPF. */
x = amp[i] >> 1;
- diff = x - s->last_sample;
+ diff = (int32_t) x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */
diff --git a/libs/spandsp/src/v27ter_rx.c b/libs/spandsp/src/v27ter_rx.c
index 3ca323ab32..24595bbf17 100644
--- a/libs/spandsp/src/v27ter_rx.c
+++ b/libs/spandsp/src/v27ter_rx.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: v27ter_rx.c,v 1.113 2009/01/28 03:41:27 steveu Exp $
+ * $Id: v27ter_rx.c,v 1.114 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -772,7 +772,7 @@ int v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len)
We need to measure the power with the DC blocked, but not using
a slow to respond DC blocker. Use the most elementary HPF. */
x = amp[i] >> 1;
- diff = x - s->last_sample;
+ diff = (int32_t) x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */
diff --git a/libs/spandsp/src/v29rx.c b/libs/spandsp/src/v29rx.c
index 871f112344..49a5ab5ab1 100644
--- a/libs/spandsp/src/v29rx.c
+++ b/libs/spandsp/src/v29rx.c
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: v29rx.c,v 1.150 2009/01/28 03:41:27 steveu Exp $
+ * $Id: v29rx.c,v 1.151 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@@ -858,7 +858,7 @@ int v29_rx(v29_rx_state_t *s, const int16_t amp[], int len)
We need to measure the power with the DC blocked, but not using
a slow to respond DC blocker. Use the most elementary HPF. */
x = amp[i] >> 1;
- diff = x - s->last_sample;
+ diff = (int32_t) x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */