From 36f0b95f2c8b98b184d623a27910700033a66267 Mon Sep 17 00:00:00 2001
From: Michael Jerris <mike@jerris.com>
Date: Sun, 18 Dec 2005 05:14:20 +0000
Subject: [PATCH] msvc ports for ilbc and lpc10 codec libs.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@169 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 libs/codec/ilbc/libilbc.vcproj   | 353 +++++++++++++++++++++++++++++++
 libs/codec/lpc10/bsynz.c         |   4 +-
 libs/codec/lpc10/decode.c        |   4 +-
 libs/codec/lpc10/encode.c        |   8 +-
 libs/codec/lpc10/energy.c        |   2 +-
 libs/codec/lpc10/f2clib.c        |   6 +-
 libs/codec/lpc10/irc2pc.c        |   2 +-
 libs/codec/lpc10/liblpc10.vcproj | 305 ++++++++++++++++++++++++++
 libs/codec/lpc10/lpc10.h         |  12 +-
 libs/codec/lpc10/onset.c         |   2 +-
 libs/codec/lpc10/pitsyn.c        |  14 +-
 libs/codec/lpc10/tbdm.c          |   6 +-
 libs/codec/lpc10/voicin.c        |   2 +-
 libs/codec/lpc10/vparms.c        |   2 +-
 14 files changed, 693 insertions(+), 29 deletions(-)
 create mode 100644 libs/codec/ilbc/libilbc.vcproj
 create mode 100644 libs/codec/lpc10/liblpc10.vcproj

diff --git a/libs/codec/ilbc/libilbc.vcproj b/libs/codec/ilbc/libilbc.vcproj
new file mode 100644
index 0000000000..b6cfff0a4a
--- /dev/null
+++ b/libs/codec/ilbc/libilbc.vcproj
@@ -0,0 +1,353 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="libilbc"
+	ProjectGUID="{989BB874-7AF1-44CB-8E5C-CC8113D267E8}"
+	RootNamespace="libilbc"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\anaFilter.c"
+				>
+			</File>
+			<File
+				RelativePath=".\constants.c"
+				>
+			</File>
+			<File
+				RelativePath=".\createCB.c"
+				>
+			</File>
+			<File
+				RelativePath=".\doCPLC.c"
+				>
+			</File>
+			<File
+				RelativePath=".\enhancer.c"
+				>
+			</File>
+			<File
+				RelativePath=".\filter.c"
+				>
+			</File>
+			<File
+				RelativePath=".\FrameClassify.c"
+				>
+			</File>
+			<File
+				RelativePath=".\gainquant.c"
+				>
+			</File>
+			<File
+				RelativePath=".\getCBvec.c"
+				>
+			</File>
+			<File
+				RelativePath=".\helpfun.c"
+				>
+			</File>
+			<File
+				RelativePath=".\hpInput.c"
+				>
+			</File>
+			<File
+				RelativePath=".\hpOutput.c"
+				>
+			</File>
+			<File
+				RelativePath=".\iCBConstruct.c"
+				>
+			</File>
+			<File
+				RelativePath=".\iCBSearch.c"
+				>
+			</File>
+			<File
+				RelativePath=".\iLBC_decode.c"
+				>
+			</File>
+			<File
+				RelativePath=".\iLBC_encode.c"
+				>
+			</File>
+			<File
+				RelativePath=".\LPCdecode.c"
+				>
+			</File>
+			<File
+				RelativePath=".\LPCencode.c"
+				>
+			</File>
+			<File
+				RelativePath=".\lsf.c"
+				>
+			</File>
+			<File
+				RelativePath=".\packing.c"
+				>
+			</File>
+			<File
+				RelativePath=".\StateConstructW.c"
+				>
+			</File>
+			<File
+				RelativePath=".\StateSearchW.c"
+				>
+			</File>
+			<File
+				RelativePath=".\syntFilter.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\anaFilter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\constants.h"
+				>
+			</File>
+			<File
+				RelativePath=".\createCB.h"
+				>
+			</File>
+			<File
+				RelativePath=".\doCPLC.h"
+				>
+			</File>
+			<File
+				RelativePath=".\enhancer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\filter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\FrameClassify.h"
+				>
+			</File>
+			<File
+				RelativePath=".\gainquant.h"
+				>
+			</File>
+			<File
+				RelativePath=".\getCBvec.h"
+				>
+			</File>
+			<File
+				RelativePath=".\helpfun.h"
+				>
+			</File>
+			<File
+				RelativePath=".\hpInput.h"
+				>
+			</File>
+			<File
+				RelativePath=".\hpOutput.h"
+				>
+			</File>
+			<File
+				RelativePath=".\iCBConstruct.h"
+				>
+			</File>
+			<File
+				RelativePath=".\iCBSearch.h"
+				>
+			</File>
+			<File
+				RelativePath=".\iLBC_decode.h"
+				>
+			</File>
+			<File
+				RelativePath=".\iLBC_define.h"
+				>
+			</File>
+			<File
+				RelativePath=".\iLBC_encode.h"
+				>
+			</File>
+			<File
+				RelativePath=".\LPCdecode.h"
+				>
+			</File>
+			<File
+				RelativePath=".\LPCencode.h"
+				>
+			</File>
+			<File
+				RelativePath=".\lsf.h"
+				>
+			</File>
+			<File
+				RelativePath=".\packing.h"
+				>
+			</File>
+			<File
+				RelativePath=".\StateConstructW.h"
+				>
+			</File>
+			<File
+				RelativePath=".\StateSearchW.h"
+				>
+			</File>
+			<File
+				RelativePath=".\syntFilter.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/libs/codec/lpc10/bsynz.c b/libs/codec/lpc10/bsynz.c
index e4810de222..7c75abc9ca 100644
--- a/libs/codec/lpc10/bsynz.c
+++ b/libs/codec/lpc10/bsynz.c
@@ -372,7 +372,7 @@ e */
 	exc[px] -= pulse;
 /*  Load voiced excitation */
     } else {
-	sscale = sqrt((real) (*ip)) / 6.928f;
+	sscale = (real)sqrt((real) (*ip)) / 6.928f;
 	i__1 = *ip;
 	for (i__ = 1; i__ <= i__1; ++i__) {
 	    exc[contrl_1.order + i__ - 1] = 0.f;
@@ -438,7 +438,7 @@ e */
 /*  Apply gain to match RMS */
     r__1 = *rms * *rms;
     ssq = r__1 * *ip;
-    gain = sqrt(ssq / xssq);
+    gain = (real)sqrt(ssq / xssq);
     i__1 = *ip;
     for (i__ = 1; i__ <= i__1; ++i__) {
 	sout[i__] = gain * exc2[contrl_1.order + i__ - 1];
diff --git a/libs/codec/lpc10/decode.c b/libs/codec/lpc10/decode.c
index 3ab77e6831..ee1ecb388b 100644
--- a/libs/codec/lpc10/decode.c
+++ b/libs/codec/lpc10/decode.c
@@ -518,7 +518,7 @@ static integer c__2 = 2;
 	    drc[(5 - i__) * 3 - 2] = iout;
 	}
 /*  Determine error rate */
-	*erate = *erate * .96875f + errcnt * 102;
+	*erate = (integer)(*erate * .96875f + errcnt * 102);
     }
 /*  Get unsmoothed RMS, RC's, and PITCH */
     *irms = drms[1];
@@ -611,7 +611,7 @@ L900:
 	ishift = 15 - nbit[i__ - 1];
 	i2 *= pow_ii(&c__2, &ishift);
 	i2 += qb[i__ - 3];
-	irc[i__] = i2 * descl[i__ - 3] + deadd[i__ - 3];
+	irc[i__] = (integer)(i2 * descl[i__ - 3] + deadd[i__ - 3]);
     }
 /* 	IF (LISTL.GE.3) WRITE(FDEBUG,811) IRMS, (IRC(I),I=1,ORDER) */
 /* 811	FORMAT(1X,'<<DECODE OUT>>',T45,I4,1X,10I8) */
diff --git a/libs/codec/lpc10/encode.c b/libs/codec/lpc10/encode.c
index cfe1ef7991..21a784647a 100644
--- a/libs/codec/lpc10/encode.c
+++ b/libs/codec/lpc10/encode.c
@@ -279,10 +279,10 @@ static integer c__2 = 2;
 
     /* Function Body */
 /*  Scale RMS and RC's to integers */
-    *irms = *rms;
+    *irms = (integer)*rms;
     i__1 = contrl_1.order;
     for (i__ = 1; i__ <= i__1; ++i__) {
-	irc[i__] = rc[i__] * 32768.f;
+	irc[i__] = (integer)(rc[i__] * 32768.f);
     }
 /* 	IF(LISTL.GE.3)WRITE(FDEBUG,800)VOICE,PITCH,IRMS,(IRC(I),I=1,ORDER) */
 /* 800	FORMAT(1X,/,' <<ENCODE IN>>',T32,2I3,I6,I5,T50,10I8) */
@@ -336,8 +336,8 @@ static integer c__2 = 2;
     i__1 = contrl_1.order;
     for (i__ = 3; i__ <= i__1; ++i__) {
 	i2 = irc[i__] / 2;
-	i2 = (i2 + enadd[contrl_1.order + 1 - i__ - 1]) * enscl[
-		contrl_1.order + 1 - i__ - 1];
+	i2 = (integer)((i2 + enadd[contrl_1.order + 1 - i__ - 1]) * enscl[
+		contrl_1.order + 1 - i__ - 1]);
 /* Computing MIN */
 	i__2 = max(i2,-127);
 	i2 = min(i__2,127);
diff --git a/libs/codec/lpc10/energy.c b/libs/codec/lpc10/energy.c
index c5594b8bbf..601bc588dd 100644
--- a/libs/codec/lpc10/energy.c
+++ b/libs/codec/lpc10/energy.c
@@ -97,7 +97,7 @@ extern int energy_(integer *len, real *speech, real *rms);
     for (i__ = 1; i__ <= i__1; ++i__) {
 	*rms += speech[i__] * speech[i__];
     }
-    *rms = sqrt(*rms / *len);
+    *rms = (real)sqrt(*rms / *len);
     return 0;
 } /* energy_ */
 
diff --git a/libs/codec/lpc10/f2clib.c b/libs/codec/lpc10/f2clib.c
index aaee644101..a340a96b27 100644
--- a/libs/codec/lpc10/f2clib.c
+++ b/libs/codec/lpc10/f2clib.c
@@ -40,7 +40,7 @@ integer pow_ii(integer *ap, integer *bp)
 		if (n == 0 || x == 1)
 			return 1;
 		if (x != -1)
-			return x == 0 ? 1/x : 0;
+			return x == 0 ? 0 : 1/x;
 		n = -n;
 		}
 	u = n;
@@ -80,6 +80,6 @@ integer i_nint(x) real *x;
 integer i_nint(real *x)
 #endif
 {
-return( (*x)>=0 ?
-	floor(*x + .5) : -floor(.5 - *x) );
+return( (integer)((*x)>=0 ?
+	floor(*x + .5) : -floor(.5 - *x)) );
 }
diff --git a/libs/codec/lpc10/irc2pc.c b/libs/codec/lpc10/irc2pc.c
index 2a62881868..983432f987 100644
--- a/libs/codec/lpc10/irc2pc.c
+++ b/libs/codec/lpc10/irc2pc.c
@@ -132,7 +132,7 @@ extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pas
     for (i__ = 1; i__ <= i__1; ++i__) {
 	*g2pass *= 1.f - rc[i__] * rc[i__];
     }
-    *g2pass = *gprime * sqrt(*g2pass);
+    *g2pass = *gprime * (real)sqrt(*g2pass);
     pc[1] = rc[1];
     i__1 = *order;
     for (i__ = 2; i__ <= i__1; ++i__) {
diff --git a/libs/codec/lpc10/liblpc10.vcproj b/libs/codec/lpc10/liblpc10.vcproj
new file mode 100644
index 0000000000..56bb2ea188
--- /dev/null
+++ b/libs/codec/lpc10/liblpc10.vcproj
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="liblpc10"
+	ProjectGUID="{FF1D238A-9D59-4850-838E-78182E05736B}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="4"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;P_R_O_T_O_T_Y_P_E_S"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="4"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;P_R_O_T_O_T_Y_P_E_S"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\f2c.h"
+				>
+			</File>
+			<File
+				RelativePath=".\lpc10.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\analys.c"
+				>
+			</File>
+			<File
+				RelativePath=".\bsynz.c"
+				>
+			</File>
+			<File
+				RelativePath=".\chanwr.c"
+				>
+			</File>
+			<File
+				RelativePath=".\dcbias.c"
+				>
+			</File>
+			<File
+				RelativePath=".\decode.c"
+				>
+			</File>
+			<File
+				RelativePath=".\deemp.c"
+				>
+			</File>
+			<File
+				RelativePath=".\difmag.c"
+				>
+			</File>
+			<File
+				RelativePath=".\dyptrk.c"
+				>
+			</File>
+			<File
+				RelativePath=".\encode.c"
+				>
+			</File>
+			<File
+				RelativePath=".\energy.c"
+				>
+			</File>
+			<File
+				RelativePath=".\f2clib.c"
+				>
+			</File>
+			<File
+				RelativePath=".\ham84.c"
+				>
+			</File>
+			<File
+				RelativePath=".\hp100.c"
+				>
+			</File>
+			<File
+				RelativePath=".\invert.c"
+				>
+			</File>
+			<File
+				RelativePath=".\irc2pc.c"
+				>
+			</File>
+			<File
+				RelativePath=".\ivfilt.c"
+				>
+			</File>
+			<File
+				RelativePath=".\lpcdec.c"
+				>
+			</File>
+			<File
+				RelativePath=".\lpcenc.c"
+				>
+			</File>
+			<File
+				RelativePath=".\lpcini.c"
+				>
+			</File>
+			<File
+				RelativePath=".\lpfilt.c"
+				>
+			</File>
+			<File
+				RelativePath=".\median.c"
+				>
+			</File>
+			<File
+				RelativePath=".\mload.c"
+				>
+			</File>
+			<File
+				RelativePath=".\onset.c"
+				>
+			</File>
+			<File
+				RelativePath=".\pitsyn.c"
+				>
+			</File>
+			<File
+				RelativePath=".\placea.c"
+				>
+			</File>
+			<File
+				RelativePath=".\placev.c"
+				>
+			</File>
+			<File
+				RelativePath=".\preemp.c"
+				>
+			</File>
+			<File
+				RelativePath=".\prepro.c"
+				>
+			</File>
+			<File
+				RelativePath=".\random.c"
+				>
+			</File>
+			<File
+				RelativePath=".\rcchk.c"
+				>
+			</File>
+			<File
+				RelativePath=".\synths.c"
+				>
+			</File>
+			<File
+				RelativePath=".\tbdm.c"
+				>
+			</File>
+			<File
+				RelativePath=".\voicin.c"
+				>
+			</File>
+			<File
+				RelativePath=".\vparms.c"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/libs/codec/lpc10/lpc10.h b/libs/codec/lpc10/lpc10.h
index 17d04910b7..871a5c40c6 100644
--- a/libs/codec/lpc10/lpc10.h
+++ b/libs/codec/lpc10/lpc10.h
@@ -46,18 +46,24 @@ Add broken lpc10 code...  It's not too far from working I don't think...
 
 #if defined(unix) || defined(__unix__) || defined(__NetBSD__)
 typedef short		INT16;
-typedef int		INT32;
+typedef int			INT32;
 #endif
 
 
 #if defined(__MSDOS__) || defined(MSDOS)
-typedef int		INT16;
+typedef int			INT16;
 typedef long		INT32;
 #endif
 
 #if defined(__APPLE__)
 typedef short		INT16;
-typedef int		INT32;
+typedef int			INT32;
+#endif
+
+#if defined(WIN32) || defined(_MSC_VER)
+typedef __int16		INT16;
+typedef __int32		INT32;
+#pragma warning(disable: 4005)
 #endif
 
 
diff --git a/libs/codec/lpc10/onset.c b/libs/codec/lpc10/onset.c
index 1d682c1c16..2281cd14bb 100644
--- a/libs/codec/lpc10/onset.c
+++ b/libs/codec/lpc10/onset.c
@@ -272,7 +272,7 @@ static real c_b2 = 1.f;
 	*d__ = (r__1 * r__1 + (*d__) * 63.f) / 64.f;
 	if ((*d__) != 0.f) {
 	    if (abs(*n) > (*d__)) {
-		*fpc = r_sign(&c_b2, n);
+		*fpc = (real)r_sign(&c_b2, n);
 	    } else {
 		*fpc = (*n) / (*d__);
 	    }
diff --git a/libs/codec/lpc10/pitsyn.c b/libs/codec/lpc10/pitsyn.c
index 30d6063776..7378c0bd93 100644
--- a/libs/codec/lpc10/pitsyn.c
+++ b/libs/codec/lpc10/pitsyn.c
@@ -465,9 +465,9 @@ after */
 	    i__1 = lsamp;
 	    for (i__ = istart; i__ <= i__1; ++i__) {
 		r__1 = *ipito + slope * i__;
-		ip = r__1 + .5f;
+		ip = (integer)(r__1 + .5f);
 		if (uvpit != 0.f) {
-		    ip = uvpit;
+		    ip = (integer)uvpit;
 		}
 		if (ip <= i__ - jused) {
 		    ++(*nout);
@@ -487,14 +487,14 @@ over 16. */
 		    prop = (jused - ip / 2) / (real) lsamp;
 		    i__2 = *order;
 		    for (j = 1; j <= i__2; ++j) {
-			alro = log((rco[j - 1] + 1) / (1 - rco[j - 1]));
-			alrn = log((rc[j] + 1) / (1 - rc[j]));
+			alro = (real)log((rco[j - 1] + 1) / (1 - rco[j - 1]));
+			alrn = (real)log((rc[j] + 1) / (1 - rc[j]));
 			xxy = alro + prop * (alrn - alro);
-			xxy = exp(xxy);
+			xxy = (real)exp(xxy);
 			rci[j + *nout * rci_dim1] = (xxy - 1) / (xxy + 1);
 		    }
-		    rmsi[*nout] = log(*rmso) + prop * (log(*rms) - log(*rmso));
-		    rmsi[*nout] = exp(rmsi[*nout]);
+		    rmsi[*nout] = (real)(log(*rmso) + prop * (log(*rms) - log(*rmso)));
+		    rmsi[*nout] = (real)exp(rmsi[*nout]);
 		}
 	    }
 	    if (vflag != 1) {
diff --git a/libs/codec/lpc10/tbdm.c b/libs/codec/lpc10/tbdm.c
index aaca148156..5071dfb0c8 100644
--- a/libs/codec/lpc10/tbdm.c
+++ b/libs/codec/lpc10/tbdm.c
@@ -121,7 +121,7 @@ extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real
     difmag_(&speech[1], lpita, &tau[1], ltau, &tau[*ltau], &amdf[1], minptr, 
 	    maxptr);
     *mintau = tau[*minptr];
-    minamd = amdf[*minptr];
+    minamd = (integer)amdf[*minptr];
 /*   Build table containing all lags within +/- 3 of the AMDF minimum */
 /*    excluding all that have already been computed */
     ltau2 = 0;
@@ -147,7 +147,7 @@ extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real
 		maxp2);
 	if (amdf2[minp2 - 1] < (real) minamd) {
 	    *mintau = tau2[minp2 - 1];
-	    minamd = amdf2[minp2 - 1];
+	    minamd = (integer)amdf2[minp2 - 1];
 	}
     }
 /*   Check one octave up, if there are any lags not yet computed */
@@ -165,7 +165,7 @@ extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real
 		maxp2);
 	if (amdf2[minp2 - 1] < (real) minamd) {
 	    *mintau = tau2[minp2 - 1];
-	    minamd = amdf2[minp2 - 1];
+	    minamd = (integer)amdf2[minp2 - 1];
 	    *minptr += -20;
 	}
     }
diff --git a/libs/codec/lpc10/voicin.c b/libs/codec/lpc10/voicin.c
index dc277e5ca0..f72bee9c0e 100644
--- a/libs/codec/lpc10/voicin.c
+++ b/libs/codec/lpc10/voicin.c
@@ -778,7 +778,7 @@ d*/
 /*   NOTE: The divisor is a function of REF, the expected energies. */
 /* Computing MIN */
 /* Computing MAX */
-    r__2 = sqrt((real) (*lbue * *lbve)) * 64 / 3000;
+    r__2 = (real)(sqrt((real) (*lbue * *lbve)) * 64 / 3000);
     r__1 = max(r__2,1.f);
     *dither = min(r__1,20.f);
 /*   Voicing decisions are returned in VOIBUF. */
diff --git a/libs/codec/lpc10/vparms.c b/libs/codec/lpc10/vparms.c
index e40cbfd642..0bb1f117de 100644
--- a/libs/codec/lpc10/vparms.c
+++ b/libs/codec/lpc10/vparms.c
@@ -194,7 +194,7 @@ static real c_b2 = 1.f;
 /* is undefined. */
 
     r__1 = inbuf[start - 1] - *dither;
-    oldsgn = r_sign(&c_b2, &r__1);
+    oldsgn = (real)r_sign(&c_b2, &r__1);
     i__1 = stop;
     for (i__ = start; i__ <= i__1; ++i__) {
 	lp_rms__ += (r__1 = lpbuf[i__], abs(r__1));