Lots of little fixes for doing MSVC compiling codecs in windows (#6022)
authorMatthew Fredrickson <creslin@digium.com>
Fri, 10 Feb 2006 23:37:27 +0000 (23:37 +0000)
committerMatthew Fredrickson <creslin@digium.com>
Fri, 10 Feb 2006 23:37:27 +0000 (23:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9450 65c4cc65-6c06-0410-ace0-fbb531ad65f3

24 files changed:
codecs/gsm/inc/private.h
codecs/gsm/libgsm.vcproj [new file with mode: 0644]
codecs/gsm/src/add.c
codecs/gsm/src/code.c
codecs/gsm/src/decode.c
codecs/gsm/src/long_term.c
codecs/gsm/src/lpc.c
codecs/gsm/src/preprocess.c
codecs/gsm/src/rpe.c
codecs/gsm/src/short_term.c
codecs/ilbc/libilbc.vcproj [new file with mode: 0644]
codecs/lpc10/bsynz.c
codecs/lpc10/decode.c
codecs/lpc10/encode.c
codecs/lpc10/energy.c
codecs/lpc10/f2clib.c
codecs/lpc10/irc2pc.c
codecs/lpc10/liblpc10.vcproj [new file with mode: 0644]
codecs/lpc10/lpc10.h
codecs/lpc10/onset.c
codecs/lpc10/pitsyn.c
codecs/lpc10/tbdm.c
codecs/lpc10/voicin.c
codecs/lpc10/vparms.c

index b7115ae..24f0b42 100644 (file)
@@ -136,6 +136,11 @@ static __inline__ short GSM_SUB(short a, short b)
 
 #else
 
+#ifdef WIN32
+#define inline __inline
+#define __inline__ __inline
+#endif 
+
 # define GSM_L_ADD(a, b)       \
        ( (a) <  0 ? ( (b) >= 0 ? (a) + (b)     \
                 : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \
@@ -144,25 +149,19 @@ static __inline__ short GSM_SUB(short a, short b)
                  : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \
                    ? MAX_LONGWORD : utmp))
 
-/*
- * # define GSM_ADD(a, b)      \
- *     ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \
- *     ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp)
- */
-/* Nonportable, but faster: */
-
-# define GSM_ADD(a, b) ({ \
-               register longword ltmp; \
-               ltmp = (longword) (a) + (longword) (b); \
-               ((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? \
-                       (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp); \
-       })
-
-#define GSM_SUB(a, b) ({ \
-               register longword ltmp; \
-               ltmp = (longword) (a) - (longword) (b); \
-               (ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp); \
-       })
+static inline word GSM_ADD(a, b)
+{
+       register longword ltmp;
+       ltmp = (longword) (a) + (longword) (b);
+       return (word)((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp);
+};
+
+static inline word GSM_SUB(a, b)
+{
+       register longword ltmp;
+       ltmp = (longword) (a) - (longword) (b);
+       return (word)(ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp);
+};
 
 #endif
 
diff --git a/codecs/gsm/libgsm.vcproj b/codecs/gsm/libgsm.vcproj
new file mode 100644 (file)
index 0000000..025c913
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="libgsm"\r
+       ProjectGUID="{8FD2E297-4096-47E5-9258-C48FF1841523}"\r
+       RootNamespace="libgsm"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="inc"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="inc"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\src\add.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\code.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\debug.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\decode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_create.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_decode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_destroy.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_encode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_explode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_implode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_option.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\gsm_print.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\long_term.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\lpc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\preprocess.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\rpe.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\short_term.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\table.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\inc\config.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\inc\gsm.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\inc\private.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\inc\proto.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\inc\unproto.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 21ccfab..f23d27f 100644 (file)
 word gsm_add P2((a,b), word a, word b)
 {
        longword sum = (longword)a + (longword)b;
-       return saturate(sum);
+       return (word)saturate(sum);
 }
 
 word gsm_sub P2((a,b), word a, word b)
 {
        longword diff = (longword)a - (longword)b;
-       return saturate(diff);
+       return (word)saturate(diff);
 }
 
 word gsm_mult P2((a,b), word a, word b)
 {
        if (a == MIN_WORD && b == MIN_WORD) return MAX_WORD;
-       else return SASR( (longword)a * (longword)b, 15 );
+       else return (word)SASR( (longword)a * (longword)b, 15 );
 }
 
 word gsm_mult_r P2((a,b), word a, word b)
@@ -44,7 +44,7 @@ word gsm_mult_r P2((a,b), word a, word b)
        else {
                longword prod = (longword)a * (longword)b + 16384;
                prod >>= 15;
-               return prod & 0xFFFF;
+               return (word)(prod & 0xFFFF);
        }
 }
 
index 6358330..4d195df 100644 (file)
@@ -62,10 +62,6 @@ void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc),
 
        word    so[160];
 
-#if !(defined(__GNUC__) && defined(__i386__))
-       longword ltmp;
-#endif
-
        Gsm_Preprocess                  (S, s, so);
        Gsm_LPC_Analysis                (S, so, LARc);
        Gsm_Short_Term_Analysis_Filter  (S, LARc, so);
index 7d56bf9..093ac64 100644 (file)
@@ -25,7 +25,7 @@ static void Postprocessing P2((S,s),
        register word           tmp;
 
        for (k = 160; k--; s++) {
-               tmp = GSM_MULT_R( msr, 28180 );
+               tmp = (word)GSM_MULT_R( msr, 28180 );
                msr = GSM_ADD(*s, tmp);            /* Deemphasis             */
                *s  = GSM_ADD(msr, msr) & 0xFFF8;  /* Truncation & Upscaling */
        }
index 98f64aa..50594ff 100644 (file)
@@ -278,8 +278,8 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
 
        temp = gsm_norm( L_power );
 
-       R = SASR( L_max   << temp, 16 );
-       S = SASR( L_power << temp, 16 );
+       R = (word)SASR( L_max   << temp, 16 );
+       S = (word)SASR( L_power << temp, 16 );
 
        /*  Coding of the LTP gain
         */
@@ -856,7 +856,7 @@ static void Long_term_analysis_filtering P6((bc,Nc,dp,d,dpp,e),
 #      undef STEP
 #      define STEP(BP)                                 \
        for (k = 0; k <= 39; k++) {                     \
-               dpp[k]  = GSM_MULT_R( BP, dp[k - Nc]);  \
+               dpp[k]  = (word)GSM_MULT_R( BP, dp[k - Nc]);    \
                e[k]    = GSM_SUB( d[k], dpp[k] );      \
        }
 
@@ -939,7 +939,7 @@ void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp),
        assert(brp != MIN_WORD);
 
        for (k = 0; k <= 39; k++) {
-               drpp   = GSM_MULT_R( brp, drp[ k - Nr ] );
+               drpp   = (word)GSM_MULT_R( brp, drp[ k - Nr ] );
                drp[k] = GSM_ADD( erp[k], drpp );
        }
 
index a8e9192..49145f8 100644 (file)
@@ -84,7 +84,7 @@ static void Autocorrelation P2((s, L_ACF),
 # else 
 #   define SCALE(n)    \
        case n: for (k = 0; k <= 159; k++) \
-                       s[k] = GSM_MULT_R( s[k], 16384 >> (n-1) );\
+                       s[k] = (word)GSM_MULT_R( s[k], 16384 >> (n-1) );\
                break;
 # endif /* USE_FLOAT_MUL */
 
@@ -229,7 +229,7 @@ static void Reflection_coefficients P2( (L_ACF, r),
        assert(temp >= 0 && temp < 32);
 
        /* ? overflow ? */
-       for (i = 0; i <= 8; i++) ACF[i] = SASR( L_ACF[i] << temp, 16 );
+       for (i = 0; i <= 8; i++) ACF[i] = (word)SASR( L_ACF[i] << temp, 16 );
 
        /*   Initialize array P[..] and K[..] for the recursion.
         */
@@ -257,14 +257,14 @@ static void Reflection_coefficients P2( (L_ACF, r),
 
                /*  Schur recursion
                 */
-               temp = GSM_MULT_R( P[1], *r );
+               temp = (word)GSM_MULT_R( P[1], *r );
                P[0] = GSM_ADD( P[0], temp );
 
                for (m = 1; m <= 8 - n; m++) {
-                       temp     = GSM_MULT_R( K[ m   ],    *r );
+                       temp     = (word)GSM_MULT_R( K[ m   ],    *r );
                        P[m]     = GSM_ADD(    P[ m+1 ],  temp );
 
-                       temp     = GSM_MULT_R( P[ m+1 ],    *r );
+                       temp     = (word)GSM_MULT_R( P[ m+1 ],    *r );
                        K[m]     = GSM_ADD(    K[ m   ],  temp );
                }
        }
@@ -331,10 +331,10 @@ static void Quantization_and_coding P1((LAR),
 
 #      undef STEP
 #      define  STEP( A, B, MAC, MIC )          \
-               temp = GSM_MULT( A,   *LAR );   \
+               temp = (word)GSM_MULT( A,   *LAR );     \
                temp = GSM_ADD(  temp,   B );   \
                temp = GSM_ADD(  temp, 256 );   \
-               temp = SASR(     temp,   9 );   \
+               temp = (word)SASR(     temp,   9 );     \
                *LAR  =  temp>MAC ? MAC - MIC : (temp<MIC ? 0 : temp - MIC); \
                LAR++;
 
index 03746f9..bbfe314 100644 (file)
@@ -95,8 +95,8 @@ void Gsm_Preprocess P3((S, s, so),
                L_s2 = s1;
                L_s2 <<= 15;
 #ifndef __GNUC__ 
-               msp = SASR( L_z2, 15 );
-               lsp = L_z2 & 0x7fff; /* gsm_L_sub(L_z2,(msp<<15)); */
+               msp = (word)SASR( L_z2, 15 );
+               lsp = (word)(L_z2 & 0x7fff); /* gsm_L_sub(L_z2,(msp<<15)); */
 
                L_s2  += GSM_MULT_R( lsp, 32735 );
                L_temp = (longword)msp * 32735; /* GSM_L_MULT(msp,32735) >> 1;*/
@@ -119,8 +119,8 @@ void Gsm_Preprocess P3((S, s, so),
        /*   4.2.3  Preemphasis
         */
 
-               msp   = GSM_MULT_R( mp, -28180 );
-               mp    = SASR( L_temp, 15 );
+               msp   = (word)GSM_MULT_R( mp, -28180 );
+               mp    = (word)SASR( L_temp, 15 );
                *so++ = GSM_ADD( mp, msp );
                }
        }
index 8be0c07..1c35479 100644 (file)
@@ -108,7 +108,7 @@ static void Weighting_filter P2((e, x),
                 */
 
                L_result = SASR( L_result, 13 );
-               x[k] =  (  L_result < MIN_WORD ? MIN_WORD
+               x[k] =  (word)(  L_result < MIN_WORD ? MIN_WORD
                        : (L_result > MAX_WORD ? MAX_WORD : L_result ));
        }
 }
@@ -334,7 +334,7 @@ static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out),
                assert(temp1 >= 0 && temp1 < 16);
 
                temp = xM[i] << temp1;
-               temp = GSM_MULT( temp, temp2 );
+               temp = (word)GSM_MULT( temp, temp2 );
                temp = SASR(temp, 12);
                xMc[i] = temp + 4;              /* see note below */
        }
@@ -378,7 +378,7 @@ static void APCM_inverse_quantization P4((xMc,mant,exp,xMp),
                assert( temp <= 7 && temp >= -7 );      /* 4 bit signed   */
 
                temp <<= 12;                            /* 16 bit signed  */
-               temp = GSM_MULT_R( temp1, temp );
+               temp = (word)GSM_MULT_R( temp1, temp );
                temp = GSM_ADD( temp, temp3 );
                *xMp++ = gsm_asr( temp, temp2 );
        }
index c8c0c1b..43c592c 100644 (file)
@@ -58,7 +58,7 @@ static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp),
 #define        STEP( B, MIC, INVA )    \
                temp1    = GSM_ADD( *LARc++, MIC ) << 10;       \
                temp1    = GSM_SUB( temp1, B << 1 );            \
-               temp1    = GSM_MULT_R( INVA, temp1 );           \
+               temp1    = (word)GSM_MULT_R( INVA, temp1 );             \
                *LARpp++ = GSM_ADD( temp1, temp1 );
 
        STEP(      0,  -32,  13107 );
@@ -214,7 +214,7 @@ static void Short_term_analysis_filtering P4((u0,rp0,k_n,s),
                for (rp=rp0, u=u0; u<u_top;) {
                        register longword       ui, rpi;
                        ui    = *u;
-                       *u++  = u_out;
+                       *u++  = (word)u_out;
                        rpi   = *rp++;
                        u_out = ui + (((rpi*di)+0x4000)>>15);
                        di    = di + (((rpi*ui)+0x4000)>>15);
@@ -226,7 +226,7 @@ static void Short_term_analysis_filtering P4((u0,rp0,k_n,s),
                        if (di>MAX_WORD) di=MAX_WORD;
                        else if (di<MIN_WORD) di=MIN_WORD;
                }
-               *s++ = di;
+               *s++ = (word)di;
        }
 }
 #endif
@@ -315,9 +315,9 @@ static void Short_term_synthesis_filtering P5((S,rrp,k,wt,sr),
                        if (tmp1 != (word)tmp1) {
                                tmp1 = (tmp1<0)? MIN_WORD:MAX_WORD;
                        }
-                       v[i+1] = tmp1;
+                       v[i+1] = (word)tmp1;
                }
-               *sr++ = v[0] = sri;
+               *sr++ = v[0] = (word)sri;
        }
 }
 
@@ -373,7 +373,7 @@ void Gsm_Short_Term_Analysis_Filter P3((S,LARc,s),
        word            * LARpp_j_1     = S->LARpp[ S->j ^= 1 ];
 
        word            LARp[8];
-int i;
+
 #undef FILTER
 #if    defined(FAST) && defined(USE_FLOAT_MUL)
 #      define  FILTER  (* (S->fast                     \
diff --git a/codecs/ilbc/libilbc.vcproj b/codecs/ilbc/libilbc.vcproj
new file mode 100644 (file)
index 0000000..b6cfff0
--- /dev/null
@@ -0,0 +1,353 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="libilbc"\r
+       ProjectGUID="{989BB874-7AF1-44CB-8E5C-CC8113D267E8}"\r
+       RootNamespace="libilbc"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\anaFilter.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\constants.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\createCB.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\doCPLC.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\enhancer.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\filter.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\FrameClassify.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\gainquant.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\getCBvec.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\helpfun.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hpInput.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hpOutput.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iCBConstruct.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iCBSearch.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iLBC_decode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iLBC_encode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\LPCdecode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\LPCencode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lsf.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\packing.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\StateConstructW.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\StateSearchW.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\syntFilter.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\anaFilter.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\constants.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\createCB.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\doCPLC.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\enhancer.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\filter.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\FrameClassify.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\gainquant.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\getCBvec.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\helpfun.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hpInput.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hpOutput.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iCBConstruct.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iCBSearch.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iLBC_decode.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iLBC_define.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\iLBC_encode.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\LPCdecode.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\LPCencode.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lsf.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\packing.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\StateConstructW.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\StateSearchW.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\syntFilter.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 5971a1a..89e978d 100644 (file)
@@ -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];
index 8a16616..460c61d 100644 (file)
@@ -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) */
index 109a422..ed48cbf 100644 (file)
@@ -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);
index baa6f57..fcc93fd 100644 (file)
@@ -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_ */
 
index e72c307..0371728 100644 (file)
@@ -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)) );
 }
index 412feb7..8150c93 100644 (file)
@@ -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/codecs/lpc10/liblpc10.vcproj b/codecs/lpc10/liblpc10.vcproj
new file mode 100644 (file)
index 0000000..56bb2ea
--- /dev/null
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="liblpc10"\r
+       ProjectGUID="{FF1D238A-9D59-4850-838E-78182E05736B}"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="Debug"\r
+                       IntermediateDirectory="Debug"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;P_R_O_T_O_T_Y_P_E_S"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="Release"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;P_R_O_T_O_T_Y_P_E_S"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\f2c.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lpc10.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\analys.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\bsynz.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\chanwr.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\dcbias.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\decode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\deemp.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\difmag.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\dyptrk.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\encode.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\energy.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\f2clib.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ham84.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hp100.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\invert.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\irc2pc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ivfilt.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lpcdec.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lpcenc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lpcini.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lpfilt.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\median.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\mload.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\onset.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\pitsyn.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\placea.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\placev.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\preemp.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\prepro.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\random.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\rcchk.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\synths.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\tbdm.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\voicin.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\vparms.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 99c64c6..db7c25a 100644 (file)
@@ -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
 
 
index b8037a8..8cb82f8 100644 (file)
@@ -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__);
            }
index 3152ce4..2d9c161 100644 (file)
@@ -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) {
index 2ed6e34..3e206de 100644 (file)
@@ -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;
        }
     }
index 45bb5d0..02e4d40 100644 (file)
@@ -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. */
index b9e6029..fe80f87 100644 (file)
@@ -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));