Re #1680: Add initial support for Win64

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4537 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Riza Sulistyo 2013-06-19 06:47:43 +00:00
parent fd3e9ebae2
commit 25b575b336
215 changed files with 63952 additions and 33654 deletions

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="pjproject-vs8-win64-common-defaults"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN64;PJ_WIN64=1;PJ_M_X86_64=1;"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<UserMacro
Name="TargetCPU"
Value="x86_64"
/>
</VisualStudioPropertySheet>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="pjproject-vs8-win64-release-defaults"
InheritedPropertySheets=".\pjproject-vs8-win64-common-defaults.vsprops"
>
</VisualStudioPropertySheet>

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,9 @@
<Platform
Name="Smartphone 2003 (ARMV4)"
/>
<Platform
Name="x64"
/>
<Platform
Name="Windows Mobile 6 Standard SDK (ARMV4I)"
/>
@ -232,6 +235,76 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|x64"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include"
PreprocessorDefinitions="_CONSOLE;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib"
OutputFile="..\bin\pjlib-util-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
@ -432,6 +505,77 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|x64"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include"
PreprocessorDefinitions="_CONSOLE;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib"
OutputFile="..\bin\pjlib-util-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug-Static|Win32"
ConfigurationType="1"
@ -632,6 +776,77 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug-Static|x64"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include"
PreprocessorDefinitions="_CONSOLE;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib"
OutputFile="..\bin\pjlib-util-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release-Dynamic|Win32"
ConfigurationType="1"
@ -832,6 +1047,76 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release-Dynamic|x64"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include"
PreprocessorDefinitions="_CONSOLE;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib"
OutputFile="..\bin\pjlib-util-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug-Dynamic|Win32"
ConfigurationType="1"
@ -1032,6 +1317,77 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug-Dynamic|x64"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include"
PreprocessorDefinitions="_CONSOLE;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib"
OutputFile="..\bin\pjlib-util-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release-Static|Win32"
ConfigurationType="1"
@ -1232,6 +1588,76 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release-Static|x64"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include"
PreprocessorDefinitions="_CONSOLE;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib"
OutputFile="..\bin\pjlib-util-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
@ -2860,6 +3286,15 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
@ -2885,6 +3320,15 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -2910,6 +3354,15 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -2935,6 +3388,15 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -2960,6 +3422,15 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -2985,6 +3456,15 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
ExcludedFromBuild="true"
@ -3189,6 +3669,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
@ -3197,6 +3685,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
ExcludedFromBuild="true"
@ -3205,6 +3701,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
ExcludedFromBuild="true"
@ -3213,6 +3717,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
ExcludedFromBuild="true"
@ -3221,6 +3733,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
ExcludedFromBuild="true"
@ -3229,6 +3749,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjlib-util-test\resolver_test.c"
@ -3250,6 +3778,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
@ -3259,6 +3796,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -3268,6 +3814,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -3277,6 +3832,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -3286,6 +3850,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -3295,6 +3868,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjlib-util-test\xml.c"
@ -3308,6 +3890,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
@ -3317,6 +3908,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -3326,6 +3926,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -3335,6 +3944,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -3344,6 +3962,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -3353,6 +3980,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
<Filter

View File

@ -437,7 +437,7 @@ PJ_DECL(void) pj_cli_exec_info_default(pj_cli_exec_info *param);
*/
PJ_DECL(void) pj_cli_sess_write_msg(pj_cli_sess *sess,
const char *buffer,
int len);
pj_size_t len);
/**
* Parse an input cmdline string. The first word of the command line is the

View File

@ -87,7 +87,7 @@ typedef struct pj_cli_front_end_op
* @param len Length of this message.
*/
void (*on_write_log)(pj_cli_front_end *fe, int level,
const char *data, int len);
const char *data, pj_size_t len);
/**
* Callback to be called when the application is quitting, to signal the

View File

@ -231,7 +231,8 @@ typedef struct pj_scan_state
* @param callback Callback to be called when the scanner encounters syntax
* error condition.
*/
PJ_DECL(void) pj_scan_init( pj_scanner *scanner, char *bufstart, int buflen,
PJ_DECL(void) pj_scan_init( pj_scanner *scanner, char *bufstart,
pj_size_t buflen,
unsigned options,
pj_syn_err_func_ptr callback );

View File

@ -468,7 +468,7 @@ static int crc32_test(void)
for (i=0; i<PJ_ARRAY_SIZE(crc32_test_data); ++i) {
pj_crc32_context ctx;
pj_uint32_t crc0, crc1;
unsigned len;
pj_size_t len;
len = pj_ansi_strlen(crc32_test_data[i].input);
crc0 = pj_crc32_calc((pj_uint8_t*)crc32_test_data[i].input, len);
@ -591,7 +591,7 @@ static int base64_test(void)
if (base64_test_vec[i].flag & ENCODE) {
out_len = sizeof(output);
rc = pj_base64_encode((pj_uint8_t*)base64_test_vec[i].base256,
strlen(base64_test_vec[i].base256),
(int)strlen(base64_test_vec[i].base256),
output, &out_len);
if (rc != PJ_SUCCESS)
return -90;
@ -712,7 +712,7 @@ int encryption_benchmark()
double total_len;
input_len = 2048;
total_len = input_len * LOOP;
total_len = (unsigned)input_len * LOOP;
pool = pj_pool_create(mem, "enc", input_len+256, 0, NULL);
if (!pool)
return PJ_ENOMEM;
@ -726,7 +726,7 @@ int encryption_benchmark()
/* Dry run */
for (i=0; i<PJ_ARRAY_SIZE(algorithms); ++i) {
algorithms[i].init_context(&context);
algorithms[i].update(&context, input, input_len);
algorithms[i].update(&context, input, (unsigned)input_len);
algorithms[i].final(&context, digest);
}
@ -738,7 +738,7 @@ int encryption_benchmark()
pj_get_timestamp(&t1);
algorithms[i].init_context(&context);
for (j=0; j<LOOP; ++j) {
algorithms[i].update(&context, input, input_len);
algorithms[i].update(&context, input, (unsigned)input_len);
}
algorithms[i].final(&context, digest);
pj_get_timestamp(&t2);

View File

@ -76,7 +76,7 @@ static int server_thread(void *p)
while (!thread_quit) {
PJ_FD_ZERO(&rset);
PJ_FD_SET(srv->sock, &rset);
rc = pj_sock_select(srv->sock+1, &rset, NULL, NULL, &timeout);
rc = pj_sock_select((int)srv->sock+1, &rset, NULL, NULL, &timeout);
if (rc != 1) {
continue;
}
@ -93,7 +93,7 @@ static int server_thread(void *p)
while (!thread_quit) {
PJ_FD_ZERO(&rset);
PJ_FD_SET(newsock, &rset);
rc = pj_sock_select(newsock+1, &rset, NULL, NULL, &timeout);
rc = pj_sock_select((int)newsock+1, &rset, NULL, NULL, &timeout);
if (rc != 1) {
PJ_LOG(3,("http test", "client timeout"));
continue;
@ -115,7 +115,8 @@ static int server_thread(void *p)
if (srv->action == ACTION_IGNORE) {
continue;
} else if (srv->action == ACTION_REPLY) {
unsigned send_size = 0, ctr = 0;
pj_size_t send_size = 0;
unsigned ctr = 0;
pj_ansi_sprintf(pkt, "HTTP/1.0 200 OK\r\n");
if (srv->send_content_length) {
pj_ansi_sprintf(pkt + pj_ansi_strlen(pkt),

View File

@ -111,7 +111,7 @@ static int print_name(pj_uint8_t *pkt, int size,
return 2;
} else {
if (tab->count < MAX_LABEL) {
tab->a[tab->count].pos = (p-pkt);
tab->a[tab->count].pos = (unsigned)(p-pkt);
tab->a[tab->count].label.ptr = (char*)(p+1);
tab->a[tab->count].label.slen = name->slen;
++tab->count;
@ -136,7 +136,7 @@ static int print_name(pj_uint8_t *pkt, int size,
*p = (pj_uint8_t)label.slen;
pj_memcpy(p+1, label.ptr, label.slen);
size -= (label.slen+1);
size -= (int)(label.slen+1);
p += (label.slen+1);
if (endlabel != endname && *endlabel == '.')
@ -149,7 +149,7 @@ static int print_name(pj_uint8_t *pkt, int size,
*p++ = '\0';
return p-pos;
return (int)(p-pos);
}
static int print_rr(pj_uint8_t *pkt, int size, pj_uint8_t *pos,
@ -232,7 +232,7 @@ static int print_rr(pj_uint8_t *pkt, int size, pj_uint8_t *pos,
return -1;
}
return p-pos;
return (int)(p-pos);
}
static int print_packet(const pj_dns_parsed_packet *rec, pj_uint8_t *pkt,
@ -319,7 +319,7 @@ static int print_packet(const pj_dns_parsed_packet *rec, pj_uint8_t *pkt,
size -= len;
}
return p - pkt;
return (int)(p - pkt);
}
@ -339,7 +339,7 @@ static int server_thread(void *p)
PJ_FD_ZERO(&rset);
PJ_FD_SET(srv->sock, &rset);
rc = pj_sock_select(srv->sock+1, &rset, NULL, NULL, &timeout);
rc = pj_sock_select((int)(srv->sock+1), &rset, NULL, NULL, &timeout);
if (rc != 1)
continue;
@ -355,7 +355,7 @@ static int server_thread(void *p)
PJ_LOG(5,(THIS_FILE, "Server %d processing packet", srv - &g_server[0]));
srv->pkt_count++;
rc = pj_dns_parse_packet(pool, pkt, pkt_len, &req);
rc = pj_dns_parse_packet(pool, pkt, (unsigned)pkt_len, &req);
if (rc != PJ_SUCCESS) {
app_perror("server error parsing packet", rc);
continue;

View File

@ -116,7 +116,7 @@ PJ_DEF(pj_status_t) pj_base64_encode(const pj_uint8_t *input, int in_len,
po += 4;
}
*out_len = po - output;
*out_len = (int)(po - output);
return PJ_SUCCESS;
}
@ -125,7 +125,7 @@ PJ_DEF(pj_status_t) pj_base64_decode(const pj_str_t *input,
pj_uint8_t *out, int *out_len)
{
const char *buf = input->ptr;
int len = input->slen;
int len = (int)input->slen;
int i, j, k;
int c[4];

View File

@ -319,9 +319,9 @@ PJ_DEF(void) pj_cli_write_log(pj_cli_t *cli,
}
}
PJ_DECL(void) pj_cli_sess_write_msg(pj_cli_sess *sess,
const char *buffer,
int len)
PJ_DEF(void) pj_cli_sess_write_msg(pj_cli_sess *sess,
const char *buffer,
pj_size_t len)
{
struct pj_cli_front_end *fe;
@ -507,7 +507,7 @@ static pj_cli_cmd_spec *get_cmd_name(const pj_cli_t *cli,
}
pj_strcat(&cmd_val, cmd);
return (pj_cli_cmd_spec *)pj_hash_get(cli->cmd_name_hash, cmd_val.ptr,
cmd_val.slen, NULL);
(unsigned)cmd_val.slen, NULL);
}
/* Add command to the command hash */
@ -530,7 +530,7 @@ static void add_cmd_name(pj_cli_t *cli, pj_cli_cmd_spec *group,
pj_strdup(cli->pool, &add_cmd, &cmd_val);
pj_hash_set(cli->pool, cli->cmd_name_hash, cmd_val.ptr,
cmd_val.slen, 0, cmd);
(unsigned)cmd_val.slen, 0, cmd);
}
/**
@ -845,7 +845,7 @@ PJ_DEF(pj_status_t) pj_cli_sess_parse(pj_cli_sess *sess,
{
pj_scanner scanner;
pj_str_t str;
int len;
pj_size_t len;
pj_cli_cmd_spec *cmd;
pj_cli_cmd_spec *next_cmd;
pj_status_t status = PJ_SUCCESS;
@ -887,7 +887,7 @@ PJ_DEF(pj_status_t) pj_cli_sess_parse(pj_cli_sess *sess,
PJ_TRY {
val->argc = 0;
while (!pj_scan_is_eof(&scanner)) {
info->err_pos = scanner.curptr - scanner.begin;
info->err_pos = (int)(scanner.curptr - scanner.begin);
if (*scanner.curptr == '\'' || *scanner.curptr == '"' ||
*scanner.curptr == '{')
{
@ -944,7 +944,7 @@ PJ_DEF(pj_status_t) pj_cli_sess_parse(pj_cli_sess *sess,
data.ptr[data.slen] = ' ';
data.ptr[data.slen+1] = 0;
info->err_pos = pj_ansi_strlen(cmdline);
info->err_pos = (int)pj_ansi_strlen(cmdline);
}
}

View File

@ -57,12 +57,12 @@ struct cli_console_fe
};
static void console_write_log(pj_cli_front_end *fe, int level,
const char *data, int len)
const char *data, pj_size_t len)
{
struct cli_console_fe * cfe = (struct cli_console_fe *)fe;
if (cfe->sess->log_level > level)
printf("%.*s", len, data);
printf("%.*s", (int)len, data);
}
static void console_quit(pj_cli_front_end *fe, pj_cli_sess *req)
@ -197,7 +197,7 @@ static void send_err_arg(pj_cli_sess *sess,
{
pj_str_t send_data;
char data_str[256];
unsigned len;
pj_size_t len;
unsigned i;
struct cli_console_fe *fe = (struct cli_console_fe *)sess->fe;
@ -261,7 +261,7 @@ static void send_ambi_arg(pj_cli_sess *sess,
pj_bool_t with_return)
{
unsigned i;
unsigned len;
pj_size_t len;
pj_str_t send_data;
char data[1028];
struct cli_console_fe *fe = (struct cli_console_fe *)sess->fe;
@ -466,7 +466,7 @@ static int readline_thread(void * p)
printf("%s", fe->cfg.prompt_str.ptr);
while (!fe->thread_quit) {
unsigned input_len = 0;
pj_size_t input_len = 0;
pj_str_t input_str;
char *recv_buf = fe->input.buf;
pj_bool_t is_valid = PJ_TRUE;
@ -478,8 +478,9 @@ static int readline_thread(void * p)
* If exit is desired end script with q for quit
*/
/* Reopen stdin/stdout/stderr to /dev/console */
#if defined(PJ_WIN32) && PJ_WIN32!=0 && \
(!defined(PJ_WIN32_WINCE) || PJ_WIN32_WINCE==0)
#if ((defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0)) && \
(!defined(PJ_WIN32_WINCE) || PJ_WIN32_WINCE==0)
if (freopen ("CONIN$", "r", stdin) == NULL) {
#else
if (1) {

View File

@ -33,6 +33,7 @@
#include <pj/compat/socket.h>
#if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0) || \
(defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0)
#define EADDRINUSE WSAEADDRINUSE
@ -687,7 +688,7 @@ static void send_err_arg(cli_telnet_sess *sess,
{
pj_str_t send_data;
char data_str[256];
unsigned len;
pj_size_t len;
unsigned i;
cli_telnet_fe *fe = (cli_telnet_fe *)sess->base.fe;
@ -760,7 +761,7 @@ static void send_ambi_arg(cli_telnet_sess *sess,
pj_bool_t with_last_cmd)
{
unsigned i;
unsigned len;
pj_size_t len;
pj_str_t send_data;
char data[1028];
cli_telnet_fe *fe = (cli_telnet_fe *)sess->base.fe;
@ -992,7 +993,7 @@ static pj_bool_t handle_tab(cli_telnet_sess *sess)
status = pj_cli_sess_parse(&sess->base, (char *)&sess->rcmd->rbuf, cmd_val,
pool, &info);
len = pj_ansi_strlen((char *)sess->rcmd->rbuf);
len = (unsigned)pj_ansi_strlen((char *)sess->rcmd->rbuf);
switch (status) {
case PJ_CLI_EINVARG:
@ -1033,7 +1034,7 @@ static pj_bool_t handle_tab(cli_telnet_sess *sess)
pj_memcpy(&sess->rcmd->rbuf[len], info.hint[0].name.ptr,
info.hint[0].name.slen);
len += info.hint[0].name.slen;
len += (unsigned)info.hint[0].name.slen;
sess->rcmd->rbuf[len] = 0;
}
} else {
@ -1166,7 +1167,7 @@ static pj_bool_t handle_up_down(cli_telnet_sess *sess, pj_bool_t is_up)
telnet_sess_send(sess, &send_data);
pj_ansi_strncpy((char*)&sess->rcmd->rbuf, history->ptr, history->slen);
sess->rcmd->rbuf[history->slen] = 0;
sess->rcmd->len = history->slen;
sess->rcmd->len = (unsigned)history->slen;
sess->rcmd->cur_pos = sess->rcmd->len;
return PJ_TRUE;
}
@ -1256,9 +1257,9 @@ static pj_status_t telnet_sess_send(cli_telnet_sess *sess,
if (clen < sz) {
pj_ansi_snprintf((char *)sess->buf + CLI_TELNET_BUF_SIZE,
MAX_CUT_MSG_LEN, CUT_MSG);
sess->buf_len = CLI_TELNET_BUF_SIZE +
sess->buf_len = (unsigned)(CLI_TELNET_BUF_SIZE +
pj_ansi_strlen((char *)sess->buf+
CLI_TELNET_BUF_SIZE);
CLI_TELNET_BUF_SIZE));
} else
sess->buf_len += clen;
} else if (status == PJ_SUCCESS && sz < str->slen) {
@ -1294,13 +1295,13 @@ static pj_status_t telnet_sess_send_with_format(cli_telnet_sess *sess,
PJ_TRY {
while (!pj_scan_is_eof(&scanner)) {
pj_scan_get_until_ch(&scanner, '\n', &out_str);
str_len = scanner.curptr - str_begin;
str_len = (int)(scanner.curptr - str_begin);
if (*scanner.curptr == '\n') {
if ((str_len > 1) && (out_str.ptr[str_len-2] == '\r'))
{
continue;
} else {
int str_pos = str_begin - scanner.begin;
int str_pos = (int)(str_begin - scanner.begin);
if (str_len > 0) {
pj_str_t s;
@ -1316,7 +1317,7 @@ static pj_status_t telnet_sess_send_with_format(cli_telnet_sess *sess,
}
} else {
pj_str_t s;
int str_pos = str_begin - scanner.begin;
int str_pos = (int)(str_begin - scanner.begin);
pj_strset(&s, &str->ptr[str_pos], str_len);
telnet_sess_send(sess, &s);
@ -1358,7 +1359,7 @@ static void telnet_sess_destroy(pj_cli_sess *sess)
}
static void telnet_fe_write_log(pj_cli_front_end *fe, int level,
const char *data, int len)
const char *data, pj_size_t len)
{
cli_telnet_fe *tfe = (cli_telnet_fe *)fe;
pj_cli_sess *sess;

View File

@ -159,7 +159,7 @@ PJ_DEF(pj_uint32_t) pj_crc32_update(pj_crc32_context *ctx,
{
pj_uint32_t crc = ctx->crc_state ^ CRC32_NEGL;
for( ; (((unsigned long)data) & 0x03) && nbytes > 0; --nbytes) {
for( ; (((unsigned long)(pj_ssize_t)data) & 0x03) && nbytes > 0; --nbytes) {
crc = crc_tab[CRC32_INDEX(crc) ^ *data++] ^ CRC32_SHIFTED(crc);
}

View File

@ -61,7 +61,7 @@ PJ_DEF(pj_status_t) pj_dns_make_query( void *packet,
{
pj_uint8_t *query, *p = (pj_uint8_t*)packet;
const char *startlabel, *endlabel, *endname;
unsigned d;
pj_size_t d;
/* Sanity check */
PJ_ASSERT_RETURN(packet && size && qtype && name, PJ_EINVAL);
@ -106,7 +106,7 @@ PJ_DEF(pj_status_t) pj_dns_make_query( void *packet,
p += 2;
/* Done, calculate length */
*size = p - (pj_uint8_t*)packet;
*size = (unsigned)(p - (pj_uint8_t*)packet);
return 0;
}

View File

@ -231,7 +231,7 @@ static int print_name(pj_uint8_t *pkt, int size,
return 2;
} else {
if (tab->count < MAX_LABEL) {
tab->a[tab->count].pos = (p-pkt);
tab->a[tab->count].pos = (unsigned)(p-pkt);
tab->a[tab->count].label.ptr = (char*)(p+1);
tab->a[tab->count].label.slen = name->slen;
++tab->count;
@ -256,7 +256,7 @@ static int print_name(pj_uint8_t *pkt, int size,
*p = (pj_uint8_t)label.slen;
pj_memcpy(p+1, label.ptr, label.slen);
size -= (label.slen+1);
size -= (int)(label.slen+1);
p += (label.slen+1);
if (endlabel != endname && *endlabel == '.')
@ -269,7 +269,7 @@ static int print_name(pj_uint8_t *pkt, int size,
*p++ = '\0';
return p-pos;
return (int)(p-pos);
}
static int print_rr(pj_uint8_t *pkt, int size, pj_uint8_t *pos,
@ -352,7 +352,7 @@ static int print_rr(pj_uint8_t *pkt, int size, pj_uint8_t *pos,
return -1;
}
return p-pos;
return (int)(p-pos);
}
static int print_packet(const pj_dns_parsed_packet *rec, pj_uint8_t *pkt,
@ -432,7 +432,7 @@ static int print_packet(const pj_dns_parsed_packet *rec, pj_uint8_t *pkt,
size -= len;
}
return p - pkt;
return (int)(p - pkt);
}
@ -457,7 +457,7 @@ static pj_bool_t on_data_recvfrom(pj_activesock_t *asock,
srv = (pj_dns_server*) pj_activesock_get_user_data(asock);
pool = pj_pool_create(srv->pf, "dnssrvrx", 512, 256, NULL);
status = pj_dns_parse_packet(pool, data, size, &req);
status = pj_dns_parse_packet(pool, data, (unsigned)size, &req);
if (status != PJ_SUCCESS) {
char addrinfo[PJ_INET6_ADDRSTRLEN+10];
pj_sockaddr_print(src_addr, addrinfo, sizeof(addrinfo), 3);

View File

@ -229,7 +229,7 @@ static pj_bool_t http_on_data_sent(pj_activesock_t *asock,
return PJ_FALSE;
if (sent <= 0) {
hreq->error = (sent < 0 ? -sent : PJLIB_UTIL_EHTTPLOST);
hreq->error = (sent < 0 ? (pj_status_t)-sent : PJLIB_UTIL_EHTTPLOST);
pj_http_req_cancel(hreq, PJ_TRUE);
return PJ_FALSE;
}
@ -773,7 +773,7 @@ PJ_DEF(void) pj_http_req_param_default(pj_http_req_param *param)
* user:passwd part of an URI. If user:passwd part is not
* present, NULL will be returned.
*/
static char *get_url_at_pos(const char *str, long len)
static char *get_url_at_pos(const char *str, pj_size_t len)
{
const char *end = str + len;
const char *p = str;
@ -801,7 +801,7 @@ PJ_DEF(pj_status_t) pj_http_req_parse_url(const pj_str_t *url,
pj_http_url *hurl)
{
pj_scanner scanner;
int len = url->slen;
pj_size_t len = url->slen;
PJ_USE_EXCEPTION;
if (!len) return -1;
@ -973,7 +973,7 @@ PJ_DEF(pj_status_t) pj_http_req_create(pj_pool_t *pool,
/* Remove "username:password@" from the URL */
pj_assert(user_pos != 0 && user_pos < at_pos);
user_pos += 2;
removed_len = at_pos + 1 - user_pos;
removed_len = (int)(at_pos + 1 - user_pos);
pj_memmove(user_pos, at_pos+1, hreq->url.ptr+hreq->url.slen-at_pos-1);
hreq->url.slen -= removed_len;
@ -1159,12 +1159,12 @@ static pj_status_t auth_respond_basic(pj_http_req *hreq)
else
phdr->name = pj_str("Proxy-Authorization");
len = PJ_BASE256_TO_BASE64_LEN(user_pass.slen) + 10;
len = (int)(PJ_BASE256_TO_BASE64_LEN(user_pass.slen) + 10);
phdr->value.ptr = (char*)pj_pool_alloc(hreq->pool, len);
phdr->value.slen = 0;
pj_strcpy2(&phdr->value, "Basic ");
len -= phdr->value.slen;
len -= (int)phdr->value.slen;
pj_base64_encode((pj_uint8_t*)user_pass.ptr, (int)user_pass.slen,
phdr->value.ptr + phdr->value.slen, &len);
phdr->value.slen += len;
@ -1175,7 +1175,8 @@ static pj_status_t auth_respond_basic(pj_http_req *hreq)
/** Length of digest string. */
#define MD5_STRLEN 32
/* A macro just to get rid of type mismatch between char and unsigned char */
#define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, len)
#define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, \
(unsigned)len)
/* Transform digest to string.
* output must be at least PJSIP_MD5STRLEN+1 bytes.
@ -1337,7 +1338,7 @@ static pj_status_t auth_respond_digest(pj_http_req *hreq)
phdr->name = pj_str("Proxy-Authorization");
/* Allocate space for the header */
len = 8 + /* Digest */
len = (int)(8 + /* Digest */
16 + hreq->param.auth_cred.username.slen + /* username= */
12 + chal->realm.slen + /* realm= */
12 + chal->nonce.slen + /* nonce= */
@ -1348,7 +1349,7 @@ static pj_status_t auth_respond_digest(pj_http_req *hreq)
8 + /* nc=.. */
30 + /* cnonce= */
12 + chal->opaque.slen + /* opaque=".." */
0;
0);
phdr->value.ptr = (char*)pj_pool_alloc(hreq->pool, len);
/* Configure buffer to temporarily store the digest */
@ -1537,8 +1538,8 @@ static pj_status_t http_req_start_sending(pj_http_req *hreq)
/* Header field "Content-Length" */
pj_utoa(hreq->param.reqdata.total_size ?
hreq->param.reqdata.total_size:
hreq->param.reqdata.size, buf);
(unsigned long)hreq->param.reqdata.total_size:
(unsigned long)hreq->param.reqdata.size, buf);
str_snprintf(&pkt, BUF_SIZE, PJ_TRUE, "%s: %s\r\n",
CONTENT_LENGTH, buf);
}

View File

@ -228,14 +228,14 @@ PJ_DEF(pj_status_t) pj_pcap_read_udp(pj_pcap_file *file,
} tmp;
unsigned rec_incl;
pj_ssize_t sz;
unsigned sz_read = 0;
pj_size_t sz_read = 0;
pj_status_t status;
TRACE_((file->obj_name, "Reading packet.."));
/* Read PCAP packet header */
sz = sizeof(tmp.rec);
status = read_file(file, &tmp.rec, &sz);
status = read_file(file, &tmp.rec, &sz);
if (status != PJ_SUCCESS) {
TRACE_((file->obj_name, "read_file() error: %d", status));
return status;

View File

@ -672,7 +672,8 @@ static pj_status_t transmit_query(pj_dns_resolver *resolver,
*/
static void init_res_key(struct res_key *key, int type, const pj_str_t *name)
{
unsigned i, len;
unsigned i;
pj_size_t len;
char *dst = key->name;
const char *src = name->ptr;
@ -883,8 +884,8 @@ PJ_DEF(pj_status_t) pj_dns_parse_a_response(const pj_dns_parsed_packet *pkt,
{
enum { MAX_SEARCH = 20 };
pj_str_t hostname, alias = {NULL, 0}, *resname;
unsigned bufstart = 0;
unsigned bufleft = sizeof(rec->buf_);
pj_size_t bufstart = 0;
pj_size_t bufleft = sizeof(rec->buf_);
unsigned i, ansidx, search_cnt=0;
PJ_ASSERT_RETURN(pkt && rec, PJ_EINVAL);
@ -1346,7 +1347,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
if (bytes_read < 0) {
char errmsg[PJ_ERR_MSG_SIZE];
status = -bytes_read;
status = (pj_status_t)-bytes_read;
pj_strerror(status, errmsg, sizeof(errmsg));
PJ_LOG(4,(resolver->name.ptr,
"DNS resolver read error from %s:%d: %s",

View File

@ -111,8 +111,9 @@ PJ_DEF(void) pj_cis_invert( pj_cis_t *cis )
}
}
PJ_DEF(void) pj_scan_init( pj_scanner *scanner, char *bufstart, int buflen,
unsigned options, pj_syn_err_func_ptr callback )
PJ_DEF(void) pj_scan_init( pj_scanner *scanner, char *bufstart,
pj_size_t buflen, unsigned options,
pj_syn_err_func_ptr callback )
{
PJ_CHECK_STACK();
@ -549,7 +550,7 @@ PJ_DEF(void) pj_scan_get_until_chr( pj_scanner *scanner,
const char *until_spec, pj_str_t *out)
{
register char *s = scanner->curptr;
int speclen;
pj_size_t speclen;
if (s >= scanner->end) {
pj_scan_syntax_err(scanner);

View File

@ -209,8 +209,9 @@ PJ_DEF(void) pj_sha1_update(pj_sha1_context* context,
pj_size_t i, j;
j = (context->count[0] >> 3) & 63;
if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
context->count[1] += (len >> 29);
if ((context->count[0] += (pj_uint32_t)len << 3) < (len << 3))
context->count[1]++;
context->count[1] += ((pj_uint32_t)len >> 29);
if ((j + len) > 63) {
pj_memcpy(&context->buffer[j], data, (i = 64-j));
SHA1_Transform(context->state, context->buffer);

View File

@ -102,7 +102,7 @@ PJ_DEF(pj_status_t) pj_dns_srv_resolve( const pj_str_t *domain_name,
pj_dns_srv_resolver_cb *cb,
pj_dns_srv_async_query **p_query)
{
int len;
pj_size_t len;
pj_str_t target_name;
pj_dns_srv_async_query *query_job;
pj_status_t status;

View File

@ -235,7 +235,7 @@ static int xml_print_node( const pj_xml_node *node, int indent,
*p++ = ' ';
*p++ = '/';
*p++ = '>';
return p-buf;
return (int)(p-buf);
}
/* Enclosing '>' */
@ -287,7 +287,7 @@ static int xml_print_node( const pj_xml_node *node, int indent,
#undef SIZE_LEFT
return p - buf;
return (int)(p-buf);
}
PJ_DEF(int) pj_xml_print(const pj_xml_node *node, char *buf, pj_size_t len,
@ -304,7 +304,7 @@ PJ_DEF(int) pj_xml_print(const pj_xml_node *node, char *buf, pj_size_t len,
if ((int)len < prolog.slen)
return -1;
pj_memcpy(buf, prolog.ptr, prolog.slen);
prolog_len = prolog.slen;
prolog_len = (int)prolog.slen;
}
printed = xml_print_node(node, 0, buf+prolog_len, len-prolog_len) + prolog_len;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,8 @@
#define __PJ_COMPAT_ERRNO_H__
#if defined(PJ_WIN32) && PJ_WIN32 != 0 || \
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0 || \
defined(PJ_WIN64) && PJ_WIN64 != 0
typedef unsigned long pj_os_err_type;
# define pj_get_native_os_error() GetLastError()

View File

@ -152,7 +152,8 @@
* Define common errors.
*/
#if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0)
(defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0)
# define OSERR_EWOULDBLOCK WSAEWOULDBLOCK
# define OSERR_EINPROGRESS WSAEINPROGRESS
# define OSERR_ECONNRESET WSAECONNRESET

View File

@ -77,10 +77,15 @@
# define PJ_WIN32 1
#elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
/*
* Win32
*/
defined(WIN32) || defined(PJ_WIN64) || defined(_WIN64) || \
defined(WIN64) || defined(__TOS_WIN__)
# if defined(PJ_WIN64) || defined(_WIN64) || defined(WIN64)
/*
* Win64
*/
# undef PJ_WIN64
# define PJ_WIN64 1
# endif
# undef PJ_WIN32
# define PJ_WIN32 1
# include <pj/compat/os_win32.h>

View File

@ -475,7 +475,7 @@
# define PJ_HASH_USE_OWN_TOLOWER 1
# define PJSIP_UNESCAPE_IN_PLACE 1
# ifdef PJ_WIN32
# if defined(PJ_WIN32) || defined(PJ_WIN64)
# define PJSIP_MAX_NET_EVENTS 10
# endif

View File

@ -339,9 +339,9 @@ public:
* stack.
*/
struct pj_exception_state_t
{
struct pj_exception_state_t *prev; /**< Previous state in the list. */
{
pj_jmp_buf state; /**< jmp_buf. */
struct pj_exception_state_t *prev; /**< Previous state in the list. */
};
/**

View File

@ -856,7 +856,7 @@ struct pj_caching_pool
/**
* Internal pool.
*/
char pool_buf[256 * (sizeof(long) / 4)];
char pool_buf[256 * (sizeof(size_t) / 4)];
/**
* Mutex.

View File

@ -145,7 +145,7 @@ PJ_IDEF(int) pj_strcmp( const pj_str_t *str1, const pj_str_t *str2)
} else if (str2->slen == 0) {
return 1;
} else {
int min = (str1->slen < str2->slen)? str1->slen : str2->slen;
pj_size_t min = (str1->slen < str2->slen)? str1->slen : str2->slen;
int res = pj_memcmp(str1->ptr, str2->ptr, min);
if (res == 0) {
return (str1->slen < str2->slen) ? -1 :
@ -213,7 +213,7 @@ PJ_IDEF(int) pj_stricmp( const pj_str_t *str1, const pj_str_t *str2)
} else if (str2->slen == 0) {
return 1;
} else {
int min = (str1->slen < str2->slen)? str1->slen : str2->slen;
pj_size_t min = (str1->slen < str2->slen)? str1->slen : str2->slen;
int res = pj_ansi_strnicmp(str1->ptr, str2->ptr, min);
if (res == 0) {
return (str1->slen < str2->slen) ? -1 :
@ -355,7 +355,7 @@ PJ_IDEF(void) pj_strcat(pj_str_t *dst, const pj_str_t *src)
PJ_IDEF(void) pj_strcat2(pj_str_t *dst, const char *str)
{
unsigned len = str? pj_ansi_strlen(str) : 0;
pj_size_t len = str? pj_ansi_strlen(str) : 0;
if (len) {
pj_memcpy(dst->ptr + dst->slen, str, len);
dst->slen += len;

View File

@ -58,7 +58,11 @@ typedef unsigned char pj_uint8_t;
typedef size_t pj_size_t;
/** Large signed integer. */
typedef long pj_ssize_t;
#if defined(PJ_WIN64) && PJ_WIN64!=0
typedef pj_int64_t pj_ssize_t;
#else
typedef long pj_ssize_t;
#endif
/** Status code. */
typedef int pj_status_t;
@ -250,7 +254,11 @@ typedef struct pj_pipe_t pj_pipe_t;
typedef void *pj_oshandle_t;
/** Socket handle. */
typedef long pj_sock_t;
#if defined(PJ_WIN64) && PJ_WIN64!=0
typedef pj_int64_t pj_sock_t;
#else
typedef long pj_sock_t;
#endif
/** Generic socket address. */
typedef void pj_sockaddr_t;

View File

@ -47,8 +47,8 @@ PJ_BEGIN_DECL
*
* @return The Unicode string, NULL terminated.
*/
PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *str, pj_size_t len,
wchar_t *wbuf, pj_size_t wbuf_count);
PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *str, int len,
wchar_t *wbuf, int wbuf_count);
/**
@ -61,8 +61,8 @@ PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *str, pj_size_t len,
*
* @return The ANSI string, NULL terminated.
*/
PJ_DECL(char*) pj_unicode_to_ansi(const wchar_t *wstr, pj_size_t len,
char *buf, pj_size_t buf_size);
PJ_DECL(char*) pj_unicode_to_ansi(const wchar_t *wstr, pj_ssize_t len,
char *buf, int buf_size);
#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0

View File

@ -370,7 +370,7 @@ PJ_DEF(pj_status_t) pj_activesock_start_read2( pj_activesock_t *asock,
pj_ssize_t size_to_read;
r->pkt = (pj_uint8_t*)readbuf[i];
r->max_size = size_to_read = buff_size;
size_to_read = r->max_size = buff_size;
status = pj_ioqueue_recv(asock->key, &r->op_key, r->pkt, &size_to_read,
PJ_IOQUEUE_ALWAYS_ASYNC | flags);
@ -429,7 +429,7 @@ PJ_DEF(pj_status_t) pj_activesock_start_recvfrom2( pj_activesock_t *asock,
pj_ssize_t size_to_read;
r->pkt = (pj_uint8_t*) readbuf[i];
r->max_size = size_to_read = buff_size;
size_to_read = r->max_size = buff_size;
r->src_addr_len = sizeof(r->src_addr);
status = pj_ioqueue_recvfrom(asock->key, &r->op_key, r->pkt,
@ -532,7 +532,7 @@ static void ioqueue_on_read_complete(pj_ioqueue_key_t *key,
* oriented, it means connection has been closed. For datagram
* sockets, it means we've got some error (e.g. EWOULDBLOCK).
*/
status = -bytes_read;
status = (pj_status_t)-bytes_read;
}
/* Set default remainder to zero */

View File

@ -100,7 +100,7 @@ static int pjlib_error(pj_status_t code, char *buf, pj_size_t size)
if (len >= size) len = size-1;
pj_memcpy(buf, err_str[i].msg, len);
buf[len] = '\0';
return len;
return (int)len;
}
}
#endif

View File

@ -47,10 +47,10 @@ PJ_DEF(unsigned) pj_fifobuf_max_size (pj_fifobuf_t *fifobuf)
PJ_CHECK_STACK();
if (fifobuf->uend >= fifobuf->ubegin) {
s1 = fifobuf->last - fifobuf->uend;
s2 = fifobuf->ubegin - fifobuf->first;
s1 = (unsigned)(fifobuf->last - fifobuf->uend);
s2 = (unsigned)(fifobuf->ubegin - fifobuf->first);
} else {
s1 = s2 = fifobuf->ubegin - fifobuf->uend;
s1 = s2 = (unsigned)(fifobuf->ubegin - fifobuf->uend);
}
return s1<s2 ? s2 : s1;
@ -72,7 +72,7 @@ PJ_DEF(void*) pj_fifobuf_alloc (pj_fifobuf_t *fifobuf, unsigned size)
/* try to allocate from the end part of the fifo */
if (fifobuf->uend >= fifobuf->ubegin) {
available = fifobuf->last - fifobuf->uend;
available = (unsigned)(fifobuf->last - fifobuf->uend);
if (available >= size+SZ) {
char *ptr = fifobuf->uend;
fifobuf->uend += (size+SZ);
@ -92,7 +92,7 @@ PJ_DEF(void*) pj_fifobuf_alloc (pj_fifobuf_t *fifobuf, unsigned size)
/* try to allocate from the start part of the fifo */
start = (fifobuf->uend <= fifobuf->ubegin) ? fifobuf->uend : fifobuf->first;
available = fifobuf->ubegin - start;
available = (unsigned)(fifobuf->ubegin - start);
if (available >= size+SZ) {
char *ptr = start;
fifobuf->uend = start + size + SZ;

View File

@ -124,7 +124,7 @@ PJ_DEF(pj_status_t) pj_file_write( pj_oshandle_t fd,
BOOL rc;
DWORD bytesWritten;
rc = WriteFile(fd, data, *size, &bytesWritten, NULL);
rc = WriteFile(fd, data, (DWORD)*size, &bytesWritten, NULL);
if (!rc) {
*size = -1;
return PJ_RETURN_OS_ERROR(GetLastError());
@ -141,7 +141,7 @@ PJ_DEF(pj_status_t) pj_file_read( pj_oshandle_t fd,
BOOL rc;
DWORD bytesRead;
rc = ReadFile(fd, data, *size, &bytesRead, NULL);
rc = ReadFile(fd, data, (DWORD)*size, &bytesRead, NULL);
if (!rc) {
*size = -1;
return PJ_RETURN_OS_ERROR(GetLastError());

View File

@ -141,7 +141,7 @@ static pj_hash_entry **find_entry( pj_pool_t *pool, pj_hash_table_t *ht,
if (hval && *hval != 0) {
hash = *hval;
if (keylen==PJ_HASH_KEY_STRING) {
keylen = pj_ansi_strlen((const char*)key);
keylen = (unsigned)pj_ansi_strlen((const char*)key);
}
} else {
/* This slightly differs with pj_hash_calc() because we need
@ -156,7 +156,7 @@ static pj_hash_entry **find_entry( pj_pool_t *pool, pj_hash_table_t *ht,
else
hash = hash * PJ_HASH_MULTIPLIER + *p;
}
keylen = p - (const unsigned char*)key;
keylen = (unsigned)(p - (const unsigned char*)key);
} else {
const pj_uint8_t *p = (const pj_uint8_t*)key,
*end = p + keylen;

View File

@ -240,7 +240,7 @@ void ioqueue_dispatch_write_event(pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h)
status = PJ_STATUS_FROM_OS(value);
}
}
#elif defined(PJ_WIN32) && PJ_WIN32!=0
#elif (defined(PJ_WIN32) && PJ_WIN32!=0) || (defined(PJ_WIN64) && PJ_WIN64!=0)
status = PJ_SUCCESS; /* success */
#else
/* Excellent information in D.J. Bernstein page:
@ -523,6 +523,7 @@ void ioqueue_dispatch_read_event( pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h )
* that error is easier to catch.
*/
# if defined(PJ_WIN32) && PJ_WIN32 != 0 || \
defined(PJ_WIN64) && PJ_WIN64 != 0 || \
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0
rc = pj_sock_recv(h->fd, read_op->buf, &bytes_read,
read_op->flags);
@ -540,7 +541,8 @@ void ioqueue_dispatch_read_event( pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h )
}
if (rc != PJ_SUCCESS) {
# if defined(PJ_WIN32) && PJ_WIN32 != 0
# if (defined(PJ_WIN32) && PJ_WIN32 != 0) || \
(defined(PJ_WIN64) && PJ_WIN64 != 0)
/* On Win32, for UDP, WSAECONNRESET on the receive side
* indicates that previous sending has triggered ICMP Port
* Unreachable message.
@ -1281,7 +1283,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key,
(*key->cb.on_accept_complete)(key, op_key,
PJ_INVALID_SOCKET,
bytes_status);
(pj_status_t)bytes_status);
return PJ_SUCCESS;
}
op_rec = op_rec->next;

View File

@ -202,7 +202,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_create( pj_pool_t *pool,
ioqueue = PJ_POOL_ALLOC_T(pool, pj_ioqueue_t);
ioqueue_init(ioqueue);
ioqueue->max = max_fd;
ioqueue->max = (unsigned)max_fd;
ioqueue->count = 0;
PJ_FD_ZERO(&ioqueue->rfdset);
PJ_FD_ZERO(&ioqueue->wfdset);
@ -323,6 +323,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_register_sock2(pj_pool_t *pool,
{
pj_ioqueue_key_t *key = NULL;
#if defined(PJ_WIN32) && PJ_WIN32!=0 || \
defined(PJ_WIN64) && PJ_WIN64 != 0 || \
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
u_long value;
#else
@ -369,6 +370,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_register_sock2(pj_pool_t *pool,
/* Set socket to nonblocking. */
value = 1;
#if defined(PJ_WIN32) && PJ_WIN32!=0 || \
defined(PJ_WIN64) && PJ_WIN64 != 0 || \
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
if (ioctlsocket(sock, FIONBIO, &value)) {
#else
@ -762,6 +764,7 @@ static pj_status_t replace_udp_sock(pj_ioqueue_key_t *h)
/* Set socket to nonblocking. */
val = 1;
#if defined(PJ_WIN32) && PJ_WIN32!=0 || \
defined(PJ_WIN64) && PJ_WIN64 != 0 || \
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
if (ioctlsocket(new_sock, FIONBIO, &val)) {
#else

View File

@ -49,7 +49,8 @@ static unsigned log_decor = PJ_LOG_HAS_TIME | PJ_LOG_HAS_MICRO_SEC |
PJ_LOG_HAS_SENDER | PJ_LOG_HAS_NEWLINE |
PJ_LOG_HAS_SPACE | PJ_LOG_HAS_THREAD_SWC |
PJ_LOG_HAS_INDENT
#if defined(PJ_WIN32) && PJ_WIN32!=0
#if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0)
| PJ_LOG_HAS_COLOR
#endif
;
@ -103,12 +104,12 @@ static void logging_shutdown(void)
static void log_set_indent(int indent)
{
if (indent < 0) indent = 0;
pj_thread_local_set(thread_indent_tls_id, (void*)(long)indent);
pj_thread_local_set(thread_indent_tls_id, (void*)(pj_ssize_t)indent);
}
static int log_get_raw_indent()
{
return (long)pj_thread_local_get(thread_indent_tls_id);
return (long)(pj_ssize_t)pj_thread_local_get(thread_indent_tls_id);
}
#else
@ -267,7 +268,8 @@ static void suspend_logging(int *saved_level)
#if PJ_HAS_THREADS
if (thread_suspended_tls_id != -1)
{
pj_thread_local_set(thread_suspended_tls_id, (void*)PJ_TRUE);
pj_thread_local_set(thread_suspended_tls_id,
(void*)(pj_ssize_t)PJ_TRUE);
}
else
#endif
@ -378,7 +380,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,
}
if (log_decor & PJ_LOG_HAS_SENDER) {
enum { SENDER_WIDTH = 14 };
int sender_len = strlen(sender);
pj_size_t sender_len = strlen(sender);
if (pre!=log_buffer) *pre++ = ' ';
if (sender_len <= SENDER_WIDTH) {
while (sender_len < SENDER_WIDTH)
@ -394,7 +396,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,
if (log_decor & PJ_LOG_HAS_THREAD_ID) {
enum { THREAD_WIDTH = 12 };
const char *thread_name = pj_thread_get_name(pj_thread_this());
int thread_len = strlen(thread_name);
pj_size_t thread_len = strlen(thread_name);
*pre++ = ' ';
if (thread_len <= THREAD_WIDTH) {
while (thread_len < THREAD_WIDTH)
@ -433,7 +435,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,
}
#endif
len = pre - log_buffer;
len = (int)(pre - log_buffer);
/* Print the whole message to the string log_buffer. */
print_len = pj_ansi_vsnprintf(pre, sizeof(log_buffer)-len, format,

View File

@ -408,7 +408,7 @@ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name,
cstr_thread_name, thread->idthread);
else
pj_ansi_snprintf(thread->obj_name, sizeof(thread->obj_name),
"thr%p", (void*)thread->idthread);
"thr%p", (void*)(pj_ssize_t)thread->idthread);
rc = pj_thread_local_set(thread_tls_id, thread);
if (rc != PJ_SUCCESS)
@ -499,7 +499,7 @@ PJ_DEF(pj_status_t) pj_thread_create( pj_pool_t *pool,
PJ_LOG(6, (rec->obj_name, "Thread created"));
#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
rec->stk_size = stack_size ? stack_size : 0xFFFFFFFFUL;
rec->stk_size = stack_size ? (pj_uint32_t)stack_size : 0xFFFFFFFFUL;
rec->stk_max_usage = 0;
#endif
@ -634,8 +634,9 @@ PJ_DEF(void) pj_thread_check_stack(const char *file, int line)
pj_assert(thread);
/* Calculate current usage. */
usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start :
thread->stk_start - &stk_ptr;
usage = (&stk_ptr > thread->stk_start) ?
(pj_uint32_t)(&stk_ptr - thread->stk_start) :
(pj_uint32_t)(thread->stk_start - &stk_ptr);
/* Assert if stack usage is dangerously high. */
pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128));

View File

@ -142,7 +142,7 @@ PJ_DEF(void) pj_set_netos_error(pj_status_t code)
int platform_strerror( pj_os_err_type os_errcode,
char *buf, pj_size_t bufsize)
{
int len = 0;
pj_size_t len = 0;
PJ_DECL_UNICODE_TEMP_BUF(wbuf,128);
pj_assert(buf != NULL);
@ -193,7 +193,7 @@ int platform_strerror( pj_os_err_type os_errcode,
os_errcode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf,
bufsize,
(int)bufsize,
NULL);
buf[bufsize-1] = '\0';
#endif
@ -215,6 +215,6 @@ int platform_strerror( pj_os_err_type os_errcode,
buf[len] = '\0';
}
return len;
return (int)len;
}

View File

@ -71,7 +71,7 @@
static char *ver_info(pj_uint32_t ver, char *buf)
{
int len;
pj_size_t len;
if (ver == 0) {
*buf = '\0';
@ -125,7 +125,7 @@ PJ_DEF(const pj_sys_info*) pj_get_sys_info(void)
static char si_buffer[PJ_SYS_INFO_BUFFER_SIZE];
static pj_sys_info si;
static pj_bool_t si_initialized;
unsigned left = PJ_SYS_INFO_BUFFER_SIZE, len;
pj_size_t left = PJ_SYS_INFO_BUFFER_SIZE, len;
if (si_initialized)
return &si;

View File

@ -31,8 +31,8 @@
# include <pj/pool_i.h>
#endif
#define LOG(expr) PJ_LOG(6,expr)
#define ALIGN_PTR(PTR,ALIGNMENT) (PTR + (-(long)(PTR) & (ALIGNMENT-1)))
#define LOG(expr) PJ_LOG(6,expr)
#define ALIGN_PTR(PTR,ALIGNMENT) (PTR + (-(pj_ssize_t)(PTR) & (ALIGNMENT-1)))
PJ_DEF_DATA(int) PJ_NO_MEMORY_EXCEPTION;
@ -92,7 +92,7 @@ PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, pj_size_t size)
{
pj_pool_block *block = pool->block_list.next;
void *p;
unsigned block_size;
pj_size_t block_size;
PJ_CHECK_STACK();

View File

@ -83,7 +83,7 @@ PJ_DEF(pj_pool_t*) pj_pool_create_on_buf(const char *name,
{
#if PJ_HAS_POOL_ALT_API == 0
struct creation_param param;
long align_diff;
pj_size_t align_diff;
PJ_ASSERT_RETURN(buf && size, NULL);
@ -94,7 +94,7 @@ PJ_DEF(pj_pool_t*) pj_pool_create_on_buf(const char *name,
}
/* Check and align buffer */
align_diff = (long)buf;
align_diff = (pj_size_t)buf;
if (align_diff & (PJ_POOL_ALIGNMENT-1)) {
align_diff &= (PJ_POOL_ALIGNMENT-1);
buf = (void*) (((char*)buf) + align_diff);

View File

@ -191,7 +191,7 @@ static pj_pool_t* cpool_create_pool(pj_pool_factory *pf,
pj_list_insert_before( &cp->used_list, pool );
/* Mark factory data */
pool->factory_data = (void*) (long) idx;
pool->factory_data = (void*) (pj_ssize_t) idx;
/* Increment used count. */
++cp->used_count;
@ -251,7 +251,7 @@ static void cpool_release_pool( pj_pool_factory *pf, pj_pool_t *pool)
/*
* Otherwise put the pool in our recycle list.
*/
i = (unsigned) (unsigned long) pool->factory_data;
i = (unsigned) (unsigned long) (pj_ssize_t) pool->factory_data;
pj_assert(i<PJ_CACHING_POOL_ARRAY_SIZE);
if (i >= PJ_CACHING_POOL_ARRAY_SIZE ) {
@ -279,10 +279,10 @@ static void cpool_dump_status(pj_pool_factory *factory, pj_bool_t detail )
cp->capacity, cp->max_capacity, cp->used_count));
if (detail) {
pj_pool_t *pool = (pj_pool_t*) cp->used_list.next;
pj_uint32_t total_used = 0, total_capacity = 0;
pj_size_t total_used = 0, total_capacity = 0;
PJ_LOG(3,("cachpool", " Dumping all active pools:"));
while (pool != (void*)&cp->used_list) {
unsigned pool_capacity = pj_pool_get_capacity(pool);
pj_size_t pool_capacity = pj_pool_get_capacity(pool);
PJ_LOG(3,("cachpool", " %16s: %8d of %8d (%d%%) used",
pj_pool_getobjname(pool),
pj_pool_get_used_size(pool),

View File

@ -32,8 +32,9 @@
#endif
#if defined(PJ_WIN32) && PJ_WIN32!=0 && defined(PJ_DEBUG) && PJ_DEBUG!=0 \
&& !PJ_NATIVE_STRING_IS_UNICODE
#if ((defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64 != 0)) && \
defined(PJ_DEBUG) && PJ_DEBUG!=0 && !PJ_NATIVE_STRING_IS_UNICODE
# include <windows.h>
# define TRACE_(msg) OutputDebugString(msg)
#endif

View File

@ -60,7 +60,7 @@ const pj_uint16_t PJ_SOCK_RDM = SOCK_RDM;
const pj_uint16_t PJ_SOL_SOCKET = SOL_SOCKET;
#ifdef SOL_IP
const pj_uint16_t PJ_SOL_IP = SOL_IP;
#elif defined(PJ_WIN32) && PJ_WIN32
#elif (defined(PJ_WIN32) && PJ_WIN32) || (defined(PJ_WIN64) && PJ_WIN64)
const pj_uint16_t PJ_SOL_IP = IPPROTO_IP;
#else
const pj_uint16_t PJ_SOL_IP = 0;
@ -70,7 +70,7 @@ const pj_uint16_t PJ_SOL_IP = 0;
const pj_uint16_t PJ_SOL_TCP = SOL_TCP;
#elif defined(IPPROTO_TCP)
const pj_uint16_t PJ_SOL_TCP = IPPROTO_TCP;
#elif defined(PJ_WIN32) && PJ_WIN32
#elif (defined(PJ_WIN32) && PJ_WIN32) || (defined(PJ_WIN64) && PJ_WIN64)
const pj_uint16_t PJ_SOL_TCP = IPPROTO_TCP;
#else
const pj_uint16_t PJ_SOL_TCP = 6;
@ -80,7 +80,7 @@ const pj_uint16_t PJ_SOL_TCP = 6;
const pj_uint16_t PJ_SOL_UDP = SOL_UDP;
#elif defined(IPPROTO_UDP)
const pj_uint16_t PJ_SOL_UDP = IPPROTO_UDP;
#elif defined(PJ_WIN32) && PJ_WIN32
#elif (defined(PJ_WIN32) && PJ_WIN32) || (defined(PJ_WIN64) && PJ_WIN64)
const pj_uint16_t PJ_SOL_UDP = IPPROTO_UDP;
#else
const pj_uint16_t PJ_SOL_UDP = 17;
@ -88,7 +88,7 @@ const pj_uint16_t PJ_SOL_UDP = 17;
#ifdef SOL_IPV6
const pj_uint16_t PJ_SOL_IPV6 = SOL_IPV6;
#elif defined(PJ_WIN32) && PJ_WIN32
#elif (defined(PJ_WIN32) && PJ_WIN32) || (defined(PJ_WIN64) && PJ_WIN64)
# if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0501)
const pj_uint16_t PJ_SOL_IPV6 = IPPROTO_IPV6;
# else
@ -304,7 +304,7 @@ PJ_DEF(pj_status_t) pj_inet_pton(int af, const pj_str_t *src, void *dst)
return PJ_SUCCESS;
#elif defined(PJ_WIN32) || defined(PJ_WIN32_WINCE)
#elif defined(PJ_WIN32) || defined(PJ_WIN64) || defined(PJ_WIN32_WINCE)
/*
* Implementation on Windows, using WSAStringToAddress().
* Should also work on Unicode systems.
@ -378,7 +378,7 @@ PJ_DEF(pj_status_t) pj_inet_ntop(int af, const void *src,
return PJ_SUCCESS;
#elif defined(PJ_WIN32) || defined(PJ_WIN32_WINCE)
#elif defined(PJ_WIN32) || defined(PJ_WIN64) || defined(PJ_WIN32_WINCE)
/*
* Implementation on Windows, using WSAAddressToString().
* Should also work on Unicode systems.
@ -461,7 +461,7 @@ PJ_DEF(const pj_str_t*) pj_gethostname(void)
return &hostname;
}
#if defined(PJ_WIN32)
#if defined(PJ_WIN32) || defined(PJ_WIN64)
/*
* Create new socket/endpoint for communication and returns a descriptor.
*/
@ -474,7 +474,7 @@ PJ_DEF(pj_status_t) pj_sock_socket(int af,
/* Sanity checks. */
PJ_ASSERT_RETURN(sock!=NULL, PJ_EINVAL);
PJ_ASSERT_RETURN((unsigned)PJ_INVALID_SOCKET==INVALID_SOCKET,
PJ_ASSERT_RETURN((SOCKET)PJ_INVALID_SOCKET==INVALID_SOCKET,
(*sock=PJ_INVALID_SOCKET, PJ_EINVAL));
*sock = WSASocket(af, type, proto, NULL, 0, WSA_FLAG_OVERLAPPED);
@ -599,6 +599,7 @@ PJ_DEF(pj_status_t) pj_sock_close(pj_sock_t sock)
PJ_CHECK_STACK();
#if defined(PJ_WIN32) && PJ_WIN32!=0 || \
defined(PJ_WIN64) && PJ_WIN64 != 0 || \
defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
rc = closesocket(sock);
#else
@ -659,7 +660,7 @@ PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock,
flags |= MSG_NOSIGNAL;
#endif
*len = send(sock, (const char*)buf, *len, flags);
*len = send(sock, (const char*)buf, (int)(*len), flags);
if (*len < 0)
return PJ_RETURN_OS_ERROR(pj_get_native_netos_error());
@ -683,7 +684,7 @@ PJ_DEF(pj_status_t) pj_sock_sendto(pj_sock_t sock,
CHECK_ADDR_LEN(to, tolen);
*len = sendto(sock, (const char*)buf, *len, flags,
*len = sendto(sock, (const char*)buf, (int)(*len), flags,
(const struct sockaddr*)to, tolen);
if (*len < 0)
@ -703,7 +704,7 @@ PJ_DEF(pj_status_t) pj_sock_recv(pj_sock_t sock,
PJ_CHECK_STACK();
PJ_ASSERT_RETURN(buf && len, PJ_EINVAL);
*len = recv(sock, (char*)buf, *len, flags);
*len = recv(sock, (char*)buf, (int)(*len), flags);
if (*len < 0)
return PJ_RETURN_OS_ERROR(pj_get_native_netos_error());
@ -724,7 +725,7 @@ PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock,
PJ_CHECK_STACK();
PJ_ASSERT_RETURN(buf && len, PJ_EINVAL);
*len = recvfrom(sock, (char*)buf, *len, flags,
*len = recvfrom(sock, (char*)buf, (int)(*len), flags,
(struct sockaddr*)from, (socklen_t*)fromlen);
if (*len < 0)

View File

@ -380,7 +380,7 @@ static int password_cb(char *buf, int num, int rwflag, void *user_data)
return 0;
pj_memcpy(buf, cert->privkey_pass.ptr, cert->privkey_pass.slen);
return cert->privkey_pass.slen;
return (int)cert->privkey_pass.slen;
}
@ -987,7 +987,7 @@ static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock,
errmsg));
/* Workaround for ticket #985 */
#if defined(PJ_WIN32) && PJ_WIN32!=0
#if (defined(PJ_WIN32) && PJ_WIN32!=0) || (defined(PJ_WIN64) && PJ_WIN64!=0)
if (ssock->param.timer_heap) {
pj_time_val interval = {0, DELAYED_CLOSE_TIMEOUT};
@ -1130,7 +1130,7 @@ static void free_send_data(pj_ssl_sock_t *ssock, write_data_t *wdata)
buf->len -= ((char*)wdata->next - buf->start);
} else {
/* Overlapped */
unsigned right_len, left_len;
pj_size_t right_len, left_len;
right_len = buf->buf + buf->max_len - (char*)wdata;
left_len = (char*)wdata->next - buf->buf;
buf->len -= (right_len + left_len);
@ -1138,13 +1138,13 @@ static void free_send_data(pj_ssl_sock_t *ssock, write_data_t *wdata)
} else if (spl->prev == wdata) {
/* This is the last data, just adjust the buffer length */
if (wdata->prev < wdata) {
unsigned jump_len;
pj_size_t jump_len;
jump_len = (char*)wdata -
((char*)wdata->prev + wdata->prev->record_len);
buf->len -= (wdata->record_len + jump_len);
} else {
/* Overlapped */
unsigned right_len, left_len;
pj_size_t right_len, left_len;
right_len = buf->buf + buf->max_len -
((char*)wdata->prev + wdata->prev->record_len);
left_len = (char*)wdata + wdata->record_len - buf->buf;
@ -1387,7 +1387,7 @@ static pj_bool_t asock_on_data_read (pj_activesock_t *asock,
/* Socket error or closed */
if (data && size > 0) {
/* Consume the whole data */
nwritten = BIO_write(ssock->ossl_rbio, data, size);
nwritten = BIO_write(ssock->ossl_rbio, data, (int)size);
if (nwritten < size) {
status = GET_SSL_STATUS(ssock);
goto on_error;
@ -1413,7 +1413,7 @@ static pj_bool_t asock_on_data_read (pj_activesock_t *asock,
do {
read_data_t *buf = *(OFFSET_OF_READ_DATA_PTR(ssock, data));
void *data_ = (pj_int8_t*)buf->data + buf->len;
int size_ = ssock->read_size - buf->len;
int size_ = (int)(ssock->read_size - buf->len);
/* SSL_read() may write some data to BIO write when re-negotiation
* is on progress, so let's protect it with write mutex.
@ -1455,7 +1455,7 @@ static pj_bool_t asock_on_data_read (pj_activesock_t *asock,
} else {
int err = SSL_get_error(ssock->ossl_ssl, size);
int err = SSL_get_error(ssock->ossl_ssl, (int)size);
/* SSL might just return SSL_ERROR_WANT_READ in
* re-negotiation.
@ -1663,7 +1663,7 @@ static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock,
/* Start read */
status = pj_activesock_start_read2(ssock->asock, ssock->pool,
ssock->param.read_buffer_size,
(unsigned)ssock->param.read_buffer_size,
ssock->asock_rbuf,
PJ_IOQUEUE_ALWAYS_ASYNC);
if (status != PJ_SUCCESS)
@ -1742,7 +1742,7 @@ static pj_bool_t asock_on_connect_complete (pj_activesock_t *asock,
/* Start read */
status = pj_activesock_start_read2(ssock->asock, ssock->pool,
ssock->param.read_buffer_size,
(unsigned)ssock->param.read_buffer_size,
ssock->asock_rbuf,
PJ_IOQUEUE_ALWAYS_ASYNC);
if (status != PJ_SUCCESS)
@ -2180,7 +2180,7 @@ static pj_status_t ssl_write(pj_ssl_sock_t *ssock,
* until re-negotiation is completed.
*/
pj_lock_acquire(ssock->write_mutex);
nwritten = SSL_write(ssock->ossl_ssl, data, size);
nwritten = SSL_write(ssock->ossl_ssl, data, (int)size);
pj_lock_release(ssock->write_mutex);
if (nwritten == size) {

View File

@ -194,7 +194,7 @@ PJ_DEF(int) pj_utoa_pad( unsigned long val, char *buf, int min_dig, int pad)
*p++ = (char) (digval + '0');
} while (val > 0);
len = p-buf;
len = (int)(p-buf);
while (len < min_dig) {
*p++ = (char)pad;
++len;

View File

@ -124,7 +124,8 @@ PJ_INLINE(void) unlock_timer_heap( pj_timer_heap_t *ht )
}
static void copy_node( pj_timer_heap_t *ht, int slot, pj_timer_entry *moved_node )
static void copy_node( pj_timer_heap_t *ht, pj_size_t slot,
pj_timer_entry *moved_node )
{
PJ_CHECK_STACK();
@ -132,7 +133,7 @@ static void copy_node( pj_timer_heap_t *ht, int slot, pj_timer_entry *moved_node
ht->heap[slot] = moved_node;
// Update the corresponding slot in the parallel <timer_ids_> array.
ht->timer_ids[moved_node->_timer_id] = slot;
ht->timer_ids[moved_node->_timer_id] = (int)slot;
}
static pj_timer_id_t pop_freelist( pj_timer_heap_t *ht )
@ -235,7 +236,7 @@ static pj_timer_entry * remove_node( pj_timer_heap_t *ht, size_t slot)
if (slot < ht->cur_size)
{
int parent;
pj_size_t parent;
pj_timer_entry *moved_node = ht->heap[ht->cur_size];
// Move the end node to the location being removed and update

View File

@ -23,8 +23,8 @@
#include <windows.h>
PJ_DEF(wchar_t*) pj_ansi_to_unicode(const char *s, pj_size_t len,
wchar_t *buf, pj_size_t buf_count)
PJ_DEF(wchar_t*) pj_ansi_to_unicode(const char *s, int len,
wchar_t *buf, int buf_count)
{
PJ_ASSERT_RETURN(s && buf, NULL);
@ -41,12 +41,13 @@ PJ_DEF(wchar_t*) pj_ansi_to_unicode(const char *s, pj_size_t len,
}
PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len,
char *buf, pj_size_t buf_size)
PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_ssize_t len,
char *buf, int buf_size)
{
PJ_ASSERT_RETURN(wstr && buf, NULL);
len = WideCharToMultiByte(CP_ACP, 0, wstr, len, buf, buf_size, NULL, NULL);
len = WideCharToMultiByte(CP_ACP, 0, wstr, (int)len, buf, buf_size,
NULL, NULL);
if (buf_size) {
if (len < buf_size)
buf[len] = '\0';

View File

@ -28,7 +28,8 @@
#define THIS_FILE "errno"
#if defined(PJ_WIN32) && PJ_WIN32 != 0
#if (defined(PJ_WIN32) && PJ_WIN32 != 0) || \
(defined(PJ_WIN64) && PJ_WIN64 != 0)
# include <windows.h>
#endif
@ -59,7 +60,7 @@ int my_strncasecmp(const char *s1, const char *s2, int max_len)
const char *my_stristr(const char *whole, const char *part)
{
int part_len = strlen(part);
int part_len = (int)strlen(part);
while (*whole) {
if (my_strncasecmp(whole, part, part_len) == 0)
return whole;

View File

@ -84,7 +84,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
return;
if (bytes_read < 0) {
pj_status_t rc = -bytes_read;
pj_status_t rc = (pj_status_t)-bytes_read;
char errmsg[PJ_ERR_MSG_SIZE];
if (rc != last_error) {
@ -424,7 +424,7 @@ static int perform_test(pj_bool_t allow_concur,
/* Calculate total bytes received. */
total_received = 0;
for (i=0; i<sockpair_cnt; ++i) {
total_received = items[i].bytes_recv;
total_received = (pj_uint32_t)items[i].bytes_recv;
}
/* bandwidth = total_received*1000/total_elapsed_usec */

View File

@ -253,8 +253,8 @@ static int compliance_test_0(pj_bool_t allow_concur)
pj_ioqueue_key_t *skey=NULL, *ckey0=NULL, *ckey1=NULL;
pj_ioqueue_op_key_t accept_op;
int bufsize = BUF_MIN_SIZE;
pj_ssize_t status = -1;
int pending_op = 0;
int status = -1;
pj_ssize_t pending_op = 0;
pj_timestamp t_elapsed;
pj_str_t s;
pj_status_t rc;
@ -467,7 +467,7 @@ on_error:
if (ioque != NULL)
pj_ioqueue_destroy(ioque);
pj_pool_release(pool);
return status;
return (int)status;
}
@ -482,7 +482,7 @@ static int compliance_test_1(pj_bool_t allow_concur)
pj_pool_t *pool = NULL;
pj_ioqueue_t *ioque = NULL;
pj_ioqueue_key_t *ckey1 = NULL;
pj_ssize_t status = -1;
int status = -1;
int pending_op = 0;
pj_str_t s;
pj_status_t rc;
@ -640,7 +640,7 @@ static int compliance_test_2(pj_bool_t allow_concur)
char *send_buf, *recv_buf;
pj_ioqueue_t *ioque = NULL;
int i, bufsize = BUF_MIN_SIZE;
pj_ssize_t status;
int status;
int test_loop, pending_op = 0;
pj_timestamp t_elapsed;
pj_str_t s;

View File

@ -115,7 +115,7 @@ static pj_ioqueue_callback test_cb =
&on_ioqueue_connect,
};
#ifdef PJ_WIN32
#if defined(PJ_WIN32) || defined(PJ_WIN64)
# define S_ADDR S_un.S_addr
#else
# define S_ADDR s_addr
@ -137,7 +137,8 @@ static int compliance_test(pj_bool_t allow_concur)
pj_ioqueue_key_t *skey = NULL, *ckey = NULL;
pj_ioqueue_op_key_t read_op, write_op;
int bufsize = BUF_MIN_SIZE;
pj_ssize_t bytes, status = -1;
pj_ssize_t bytes;
int status = -1;
pj_str_t temp;
pj_bool_t send_pending, recv_pending;
pj_status_t rc;
@ -768,7 +769,7 @@ static int bench_test(pj_bool_t allow_concur, int bufsize,
}
if (rc == PJ_SUCCESS) {
if (bytes < 0) {
app_perror("...error: pj_ioqueue_sendto()", -bytes);
app_perror("...error: pj_ioqueue_sendto()",(pj_status_t)-bytes);
break;
}
}

View File

@ -58,7 +58,7 @@ struct sock_data
char *buffer;
pj_size_t bufsize;
pj_bool_t unregistered;
unsigned received;
pj_ssize_t received;
} sock_data;
static void on_read_complete(pj_ioqueue_key_t *key,
@ -81,7 +81,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
if (bytes_read < 0) {
if (-bytes_read != PJ_STATUS_FROM_OS(PJ_BLOCKING_ERROR_VAL))
app_perror("ioqueue reported recv error", -bytes_read);
app_perror("ioqueue reported recv error", (pj_status_t)-bytes_read);
} else {
sock_data.received += bytes_read;
}

View File

@ -57,7 +57,7 @@ typedef struct list_node
static int compare_node(void *value, const pj_list_type *nd)
{
list_node *node = (list_node*)nd;
return ((long)value == node->value) ? 0 : -1;
return ((long)(pj_ssize_t)value == node->value) ? 0 : -1;
}
#define PJ_SIGNED_ARRAY_SIZE(a) ((int)PJ_ARRAY_SIZE(a))
@ -207,7 +207,8 @@ int list_test()
if (p != &nodes[i]) {
return -1;
}
p = (list_node*) pj_list_search(&list, (void*)(long)i, &compare_node);
p = (list_node*) pj_list_search(&list, (void*)(pj_ssize_t)i,
&compare_node);
pj_assert( p == &nodes[i] );
if (p != &nodes[i]) {
return -1;

View File

@ -93,7 +93,8 @@ static int pool_alignment_test(void)
if (!pool)
return -300;
#define IS_ALIGNED(p) ((((unsigned long)p) & (PJ_POOL_ALIGNMENT-1)) == 0)
#define IS_ALIGNED(p) ((((unsigned long)(pj_ssize_t)p) & \
(PJ_POOL_ALIGNMENT-1)) == 0)
for (i=0; i<LOOP; ++i) {
/* Test first allocation */
@ -195,7 +196,7 @@ static int drain_test(pj_size_t size, pj_size_t increment)
size = ((pj_rand() & 0x000000FF) + PJ_POOL_ALIGNMENT) &
~(PJ_POOL_ALIGNMENT - 1);
else
size = freesize;
size = (int)freesize;
p = pj_pool_alloc(pool, size);
if (!p) {

View File

@ -44,7 +44,7 @@
* buf_size size packets as fast as possible.
*/
static int sock_producer_consumer(int sock_type,
unsigned buf_size,
pj_size_t buf_size,
unsigned loop,
unsigned *p_bandwidth)
{
@ -54,7 +54,7 @@ static int sock_producer_consumer(int sock_type,
pj_timestamp start, stop;
unsigned i;
pj_highprec_t elapsed, bandwidth;
pj_size_t total_received;
pj_highprec_t total_received;
pj_status_t rc;
/* Create pool. */

View File

@ -73,12 +73,12 @@ struct test_state
pj_bool_t is_verbose; /* verbose flag, e.g: cert info */
pj_bool_t echo; /* echo received data */
pj_status_t err; /* error flag */
unsigned sent; /* bytes sent */
unsigned recv; /* bytes received */
pj_size_t sent; /* bytes sent */
pj_size_t recv; /* bytes received */
pj_uint8_t read_buf[256]; /* read buffer */
pj_bool_t done; /* test done flag */
char *send_str; /* data to send once connected */
unsigned send_str_len; /* send data length */
pj_size_t send_str_len; /* send data length */
pj_bool_t check_echo; /* flag to compare sent & echoed data */
const char *check_echo_ptr; /* pointer/cursor for comparing data */
struct send_key send_key; /* send op key */
@ -363,7 +363,7 @@ static pj_bool_t ssl_on_data_sent(pj_ssl_sock_t *ssock,
PJ_UNUSED_ARG(op_key);
if (sent < 0) {
st->err = -sent;
st->err = (pj_status_t)-sent;
} else {
st->sent += sent;
@ -1113,7 +1113,8 @@ static int perf_test(unsigned clients, unsigned ms_handshake_timeout)
pj_sockaddr addr, listen_addr;
pj_ssl_cert_t *cert = NULL;
pj_status_t status;
unsigned i, cli_err = 0, tot_sent = 0, tot_recv = 0;
unsigned i, cli_err = 0;
pj_size_t tot_sent = 0, tot_recv = 0;
pj_time_val start;
pool = pj_pool_create(mem, "ssl_perf", 256, 256, NULL);

View File

@ -59,7 +59,8 @@ static int test_timer_heap(void)
pj_timer_heap_t *timer;
pj_time_val delay;
pj_status_t rc; int err=0;
unsigned size, count;
pj_size_t size;
unsigned count;
size = pj_timer_heap_mem_size(MAX_COUNT)+MAX_COUNT*sizeof(pj_timer_entry);
pool = pj_pool_create( mem, NULL, size, 4000, NULL);

View File

@ -49,13 +49,13 @@ static void on_read_complete(pj_ioqueue_key_t *key,
if (bytes_received < 0) {
if (-bytes_received != recv_rec->last_err) {
recv_rec->last_err = -bytes_received;
app_perror("...error receiving data", -bytes_received);
recv_rec->last_err = (pj_status_t)-bytes_received;
app_perror("...error receiving data", recv_rec->last_err);
}
} else if (bytes_received == 0) {
/* note: previous error, or write callback */
} else {
pj_atomic_add(total_bytes, bytes_received);
pj_atomic_add(total_bytes, (pj_atomic_value_t)bytes_received);
if (!send_rec->is_pending) {
pj_ssize_t sent = bytes_received;
@ -106,7 +106,7 @@ static void on_write_complete(pj_ioqueue_key_t *key,
struct op_key *send_rec = (struct op_key*)op_key;
if (bytes_sent <= 0) {
pj_status_t rc = -bytes_sent;
pj_status_t rc = (pj_status_t)-bytes_sent;
if (rc != send_rec->last_err) {
send_rec->last_err = rc;
app_perror("...send error(2)", rc);

View File

@ -46,7 +46,7 @@ static int worker_thread(void *arg)
continue;
}
pj_atomic_add(total_bytes, len);
pj_atomic_add(total_bytes, (pj_atomic_value_t)len);
rc = pj_sock_sendto(sock, buf, &len, 0, &addr, addrlen);
if (rc != PJ_SUCCESS) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,9 @@
<Platform
Name="Smartphone 2003 (ARMV4)"
/>
<Platform
Name="x64"
/>
<Platform
Name="Windows Mobile 6 Standard SDK (ARMV4I)"
/>
@ -222,6 +225,66 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="4"
@ -412,6 +475,65 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug-Static|Win32"
ConfigurationType="4"
@ -602,6 +724,66 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug-Static|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release-Dynamic|Win32"
ConfigurationType="4"
@ -792,6 +974,65 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release-Dynamic|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug-Dynamic|Win32"
ConfigurationType="4"
@ -982,6 +1223,66 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug-Dynamic|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release-Static|Win32"
ConfigurationType="4"
@ -1172,6 +1473,65 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release-Static|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
ConfigurationType="4"
@ -2800,6 +3160,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -2809,6 +3178,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -2818,6 +3196,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -2827,6 +3214,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -2836,6 +3232,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -2845,6 +3250,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjmedia-codec\h263_packetizer.c"
@ -2866,6 +3280,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -2875,6 +3298,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -2884,6 +3316,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -2893,6 +3334,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -2902,6 +3352,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -2911,6 +3370,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjmedia-codec\ipp_codecs.c"
@ -2928,6 +3396,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -2937,6 +3414,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -2946,6 +3432,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -2955,6 +3450,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -2964,6 +3468,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -2973,6 +3486,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjmedia-codec\opencore_amr.c"
@ -2998,6 +3520,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -3007,6 +3538,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
@ -3016,6 +3556,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
@ -3025,6 +3574,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
@ -3034,6 +3592,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
@ -3043,6 +3610,15 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<Filter
Name="g722 Files"

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,9 @@
<Platform
Name="Smartphone 2003 (ARMV4)"
/>
<Platform
Name="x64"
/>
<Platform
Name="Windows Mobile 6 Standard SDK (ARMV4I)"
/>
@ -224,6 +227,66 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/crypto/include,../../third_party/srtp/include,../..,../../third_party/BaseClasses"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-videodev-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="4"
@ -416,6 +479,65 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/crypto/include,../../third_party/srtp/include,../..,../../third_party/BaseClasses"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-videodev-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug-Static|Win32"
ConfigurationType="4"
@ -608,6 +730,66 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug-Static|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/crypto/include,../../third_party/srtp/include,../..,../../third_party/BaseClasses"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-videodev-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release-Dynamic|Win32"
ConfigurationType="4"
@ -800,6 +982,65 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release-Dynamic|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/crypto/include,../../third_party/srtp/include,../..,../../third_party/BaseClasses"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-videodev-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug-Dynamic|Win32"
ConfigurationType="4"
@ -992,6 +1233,66 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug-Dynamic|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/crypto/include,../../third_party/srtp/include,../..,../../third_party/BaseClasses"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-videodev-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release-Static|Win32"
ConfigurationType="4"
@ -1184,6 +1485,65 @@
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release-Static|x64"
ConfigurationType="4"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/crypto/include,../../third_party/srtp/include,../..,../../third_party/BaseClasses"
PreprocessorDefinitions="_LIB;"
PrecompiledHeaderFile=""
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\pjmedia-videodev-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
ConfigurationType="4"

View File

@ -50,6 +50,7 @@ PJ_BEGIN_DECL
*/
#ifndef PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO
# if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0) || \
(defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0)
# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
# else

View File

@ -216,7 +216,8 @@ PJ_INLINE(void) pjmedia_circ_buf_get_read_regions(pjmedia_circ_buf *circbuf,
*reg1 = circbuf->start;
*reg1_len = circbuf->len;
if (*reg1 + *reg1_len > circbuf->buf + circbuf->capacity) {
*reg1_len = circbuf->buf + circbuf->capacity - circbuf->start;
*reg1_len = (unsigned)(circbuf->buf + circbuf->capacity -
circbuf->start);
*reg2 = circbuf->buf;
*reg2_len = circbuf->len - *reg1_len;
} else {
@ -252,9 +253,9 @@ PJ_INLINE(void) pjmedia_circ_buf_get_write_regions(pjmedia_circ_buf *circbuf,
*reg1 -= circbuf->capacity;
*reg1_len = circbuf->capacity - circbuf->len;
if (*reg1 + *reg1_len > circbuf->buf + circbuf->capacity) {
*reg1_len = circbuf->buf + circbuf->capacity - *reg1;
*reg1_len = (unsigned)(circbuf->buf + circbuf->capacity - *reg1);
*reg2 = circbuf->buf;
*reg2_len = circbuf->start - circbuf->buf;
*reg2_len = (unsigned)(circbuf->start - circbuf->buf);
} else {
*reg2 = NULL;
*reg2_len = 0;

View File

@ -231,7 +231,7 @@ pjmedia_frame_ext_pop_subframes(pjmedia_frame_ext *frm, unsigned n)
{
pjmedia_frame_ext_subframe *sf;
pj_uint8_t *move_src;
unsigned move_len;
pj_size_t move_len;
if (frm->subframe_cnt <= n) {
frm->subframe_cnt = 0;
@ -241,8 +241,8 @@ pjmedia_frame_ext_pop_subframes(pjmedia_frame_ext *frm, unsigned n)
move_src = (pj_uint8_t*)pjmedia_frame_ext_get_subframe(frm, n);
sf = pjmedia_frame_ext_get_subframe(frm, frm->subframe_cnt-1);
move_len = (pj_uint8_t*)sf - move_src + sizeof(sf->bitlen) +
((sf->bitlen+7) >> 3);
move_len = ((pj_uint8_t*)sf - move_src + sizeof(sf->bitlen) +
((sf->bitlen+7) >> 3));
pj_memmove((pj_uint8_t*)frm+sizeof(pjmedia_frame_ext),
move_src, move_len);

View File

@ -139,7 +139,7 @@ PJ_DEF(pj_str_t) pjmedia_audiodev_strerror(pj_status_t statcode,
pj_unicode_to_ansi(wbuf, len, buf, bufsize);
}
#else
mr = (*waveGetErrText)(native_err, buf, bufsize);
mr = (*waveGetErrText)(native_err, buf, (UINT)bufsize);
#endif
if (mr==MMSYSERR_NOERROR) {

View File

@ -742,7 +742,7 @@ static pj_status_t init_player_stream( struct wmme_factory *wf,
*/
mr = waveOutOpen(&wmme_strm->hWave.Out,
wf->dev_info[prm->play_id].deviceId,
&wfx, (DWORD)wmme_strm->hEvent, 0, flag);
&wfx, (DWORD)(pj_ssize_t)wmme_strm->hEvent, 0, flag);
if (mr != MMSYSERR_NOERROR) {
return PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(mr);
}
@ -833,7 +833,7 @@ static pj_status_t init_capture_stream( struct wmme_factory *wf,
*/
mr = waveInOpen(&wmme_strm->hWave.In,
wf->dev_info[prm->rec_id].deviceId,
&wfx, (DWORD)wmme_strm->hEvent, 0, flag);
&wfx, (DWORD)(pj_ssize_t)wmme_strm->hEvent, 0, flag);
if (mr != MMSYSERR_NOERROR) {
return PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_IN(mr);
}

View File

@ -454,7 +454,7 @@ static pj_status_t h264_preopen(ffmpeg_private *ff)
* extradata of ffmpeg codec context.
*/
if (data->fmtp.sprop_param_sets_len) {
ctx->extradata_size = data->fmtp.sprop_param_sets_len;
ctx->extradata_size = (int)data->fmtp.sprop_param_sets_len;
ctx->extradata = data->fmtp.sprop_param_sets;
}
}
@ -1288,10 +1288,10 @@ static pj_status_t ffmpeg_codec_open( pjmedia_vid_codec *codec,
/* Alloc buffers if needed */
ff->whole = (ff->param.packing == PJMEDIA_VID_PACKING_WHOLE);
if (!ff->whole) {
ff->enc_buf_size = ff->enc_vafp.framebytes;
ff->enc_buf_size = (unsigned)ff->enc_vafp.framebytes;
ff->enc_buf = pj_pool_alloc(ff->pool, ff->enc_buf_size);
ff->dec_buf_size = ff->dec_vafp.framebytes;
ff->dec_buf_size = (unsigned)ff->dec_vafp.framebytes;
ff->dec_buf = pj_pool_alloc(ff->pool, ff->dec_buf_size);
}
@ -1420,7 +1420,7 @@ static pj_status_t ffmpeg_codec_encode_whole(pjmedia_vid_codec *codec,
*/
PJ_ALIGN_DATA(pj_uint32_t i[4], 16);
if ((long)i & 0xF) {
if ((long)(pj_ssize_t)i & 0xF) {
PJ_LOG(2,(THIS_FILE, "Stack alignment fails"));
}
@ -1502,7 +1502,8 @@ static pj_status_t ffmpeg_codec_encode_begin(pjmedia_vid_codec *codec,
whole_frm.buf = ff->enc_buf;
whole_frm.size = ff->enc_buf_size;
status = ffmpeg_codec_encode_whole(codec, opt, input,
whole_frm.size, &whole_frm);
(unsigned)whole_frm.size,
&whole_frm);
if (status != PJ_SUCCESS)
return status;
@ -1618,7 +1619,7 @@ static pj_status_t check_decode_result(pjmedia_vid_codec *codec,
PJ_LOG(5,(THIS_FILE, "Reallocating decoding buffer %u --> %u",
(unsigned)ff->dec_buf_size,
(unsigned)ff->dec_vafp.framebytes));
ff->dec_buf_size = ff->dec_vafp.framebytes;
ff->dec_buf_size = (unsigned)ff->dec_vafp.framebytes;
ff->dec_buf = pj_pool_alloc(ff->pool, ff->dec_buf_size);
}
@ -1681,7 +1682,7 @@ static pj_status_t ffmpeg_codec_decode_whole(pjmedia_vid_codec *codec,
/* Init packet, the container of the encoded data */
av_init_packet(&avpacket);
avpacket.data = (pj_uint8_t*)input->buf;
avpacket.size = input->size;
avpacket.size = (int)input->size;
/* ffmpeg warns:
* - input buffer padding, at least FF_INPUT_BUFFER_PADDING_SIZE

View File

@ -530,7 +530,7 @@ static pj_status_t gsm_codec_encode( pjmedia_codec *codec,
{
struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data;
pj_int16_t *pcm_in;
unsigned in_size;
pj_size_t in_size;
pj_assert(gsm_data && input && output);

View File

@ -155,7 +155,7 @@ PJ_DEF(pj_status_t) pjmedia_h263_packetize(pjmedia_h263_packetizer *pktz,
*payload = p;
*payload_len = end-p;
*pos = end - bits;
*pos = (unsigned)(end - bits);
return PJ_SUCCESS;
}
@ -273,7 +273,7 @@ PJ_DEF(pj_status_t) pjmedia_h263_unpacketize (pjmedia_h263_packetizer *pktz,
/* Write two zero octets when payload flagged with sync point */
if (P) {
pktz->unpack_last_sync_pos = q - bits;
pktz->unpack_last_sync_pos = (unsigned)(q - bits);
*q++ = 0;
*q++ = 0;
}
@ -283,7 +283,7 @@ PJ_DEF(pj_status_t) pjmedia_h263_unpacketize (pjmedia_h263_packetizer *pktz,
q += payload_len;
/* Update the bitstream writing offset */
*pos = q - bits;
*pos = (unsigned)(q - bits);
pktz->unpack_prev_lost = PJ_FALSE;

View File

@ -214,7 +214,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz,
*payload_len = pktz->cfg.mtu;
else
*payload_len = nal_end - nal_start + HEADER_SIZE_FU_A;
*pos = *payload + *payload_len - buf;
*pos = (unsigned)(*payload + *payload_len - buf);
#if DBG_PACKETIZE
PJ_LOG(3, ("h264pack", "Packetized fragmented H264 NAL unit "
@ -242,7 +242,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz,
/* Init the first NAL unit in the packet */
nal[0] = nal_start;
nal_size[0] = nal_end - nal_start;
total_size = nal_size[0] + HEADER_SIZE_STAP_A;
total_size = (int)nal_size[0] + HEADER_SIZE_STAP_A;
NRI = (*nal_octet & 0x60) >> 5;
/* Populate next NAL units */
@ -266,7 +266,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz,
}
/* Update total payload size (2 octet NAL size + NAL) */
total_size += (2 + nal_size[nal_cnt]);
total_size += (2 + (int)nal_size[nal_cnt]);
if (total_size <= pktz->cfg.mtu) {
pj_uint8_t tmp_nri;
@ -306,7 +306,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz,
*payload = nal[0] - HEADER_SIZE_STAP_A;
pj_assert(*payload >= buf+*pos);
*payload_len = p - *payload;
*pos = nal[nal_cnt-1] + nal_size[nal_cnt-1] - buf;
*pos = (unsigned)(nal[nal_cnt-1] + nal_size[nal_cnt-1] - buf);
#if DBG_PACKETIZE
PJ_LOG(3, ("h264pack", "Packetized aggregation of "
@ -321,7 +321,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz,
/* Single NAL unit packet */
*payload = nal_start;
*payload_len = nal_end - nal_start;
*pos = nal_end - buf;
*pos = (unsigned)(nal_end - buf);
#if DBG_PACKETIZE
PJ_LOG(3, ("h264pack", "Packetized single H264 NAL unit "
@ -399,7 +399,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz,
p += payload_len;
/* Update the bitstream writing offset */
*bits_pos = p - bits;
*bits_pos = (unsigned)(p - bits);
pktz->unpack_last_sync_pos = *bits_pos;
#if DBG_UNPACKETIZE
@ -450,7 +450,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz,
++cnt;
/* Update the bitstream writing offset */
*bits_pos = p - bits;
*bits_pos = (unsigned)(p - bits);
pktz->unpack_last_sync_pos = *bits_pos;
}
@ -509,7 +509,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz,
p += (payload_len - 2);
/* Update the bitstream writing offset */
*bits_pos = p - bits;
*bits_pos = (unsigned)(p - bits);
if (E) {
/* Update the sync pos only if the end bit flag is set */
pktz->unpack_last_sync_pos = *bits_pos;

View File

@ -668,7 +668,7 @@ static pj_status_t ilbc_codec_encode(pjmedia_codec *codec,
{
struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec;
pj_int16_t *pcm_in;
unsigned nsamples;
pj_size_t nsamples;
#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO
UInt32 npackets;
OSStatus err;

View File

@ -840,7 +840,7 @@ static pj_status_t spx_codec_parse( pjmedia_codec *codec,
samples_per_frame=spx_factory.speex_param[spx->param_id].samples_per_frame;
/* Copy the data into the speex bit-stream */
speex_bits_read_from(&spx->dec_bits, (char*)pkt, pkt_size);
speex_bits_read_from(&spx->dec_bits, (char*)pkt, (int)pkt_size);
while (speex_get_next_frame(&spx->dec_bits) == 0 &&
spx->dec_bits.charPtr != char_ptr)
@ -877,7 +877,7 @@ static pj_status_t spx_codec_encode( pjmedia_codec *codec,
unsigned samples_per_frame;
int tx = 0;
spx_int16_t *pcm_in = (spx_int16_t*)input->buf;
unsigned nsamples;
pj_size_t nsamples;
spx = (struct spx_private*) codec->codec_data;
@ -952,7 +952,7 @@ static pj_status_t spx_codec_decode( pjmedia_codec *codec,
}
/* Copy the data into the bit-stream struct */
speex_bits_read_from(&spx->dec_bits, (char*)input->buf, input->size);
speex_bits_read_from(&spx->dec_bits, (char*)input->buf, (int)input->size);
/* Set Speex dec_bits pointer to the start bit of the frame */
speex_bits_advance(&spx->dec_bits, input->bit_info);

View File

@ -628,7 +628,7 @@ static pj_status_t avi_dev_strm_get_frame(pjmedia_vid_dev_stream *strm,
return status;
return pjmedia_vid_codec_decode(stream->adi->codec, 1, &enc_frame,
frame->size, frame);
(unsigned)frame->size, frame);
} else {
return pjmedia_port_get_frame(stream->adi->vid, frame);
}

View File

@ -633,7 +633,7 @@ static pj_status_t dshow_stream_put_frame(pjmedia_vid_dev_stream *strm,
}
hr = SourceFilter_Deliver(stream->dgraph.csource_filter,
frame->buf, frame->size);
frame->buf, (long)frame->size);
if (FAILED(hr))
return hr;

View File

@ -278,7 +278,8 @@ static pj_status_t ffmpeg_factory_refresh(pjmedia_vid_dev_factory *f)
info->host_api = p;
#if defined(PJ_WIN32) && PJ_WIN32!=0
#if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0)
info->def_devname = "0";
#elif defined(PJ_LINUX) && PJ_LINUX!=0
info->def_devname = "/dev/video0";

View File

@ -158,7 +158,7 @@ static struct avi_reader_port *create_avi_port(pj_pool_t *pool)
pjmedia_port_info_init(&port->base.info, &name, SIGNATURE,
8000, 1, 16, 80);
port->fd = (pj_oshandle_t)-1;
port->fd = (pj_oshandle_t)(pj_ssize_t)-1;
port->base.get_frame = &avi_get_frame;
port->base.on_destroy = &avi_on_destroy;
@ -785,7 +785,7 @@ static pj_status_t avi_on_destroy(pjmedia_port *this_port)
pj_assert(this_port->info.signature == SIGNATURE);
if (fport->fd != (pj_oshandle_t) -1)
if (fport->fd != (pj_oshandle_t) (pj_ssize_t)-1)
pj_file_close(fport->fd);
return PJ_SUCCESS;
}

View File

@ -709,7 +709,7 @@ PJ_DEF(pjmedia_port*) pjmedia_conf_get_master_port(pjmedia_conf *conf)
PJ_DEF(pj_status_t) pjmedia_conf_set_port0_name(pjmedia_conf *conf,
const pj_str_t *name)
{
unsigned len;
pj_size_t len;
/* Sanity check. */
PJ_ASSERT_RETURN(conf != NULL && name != NULL, PJ_EINVAL);
@ -1524,8 +1524,8 @@ static pj_status_t read_port( pjmedia_conf *conf,
} else {
pjmedia_copy_samples(frame, cport->rx_buf, count);
cport->rx_buf_count -= count;
pjmedia_copy_samples(frame, cport->rx_buf, (unsigned)count);
cport->rx_buf_count -= (unsigned)count;
if (cport->rx_buf_count) {
pjmedia_move_samples(cport->rx_buf, cport->rx_buf+count,
cport->rx_buf_count);

View File

@ -496,7 +496,7 @@ PJ_DEF(pj_status_t) pjmedia_endpt_create_audio_sdp(pjmedia_endpt *endpt,
codec_info->pt);
for (i = 0; i < dec_fmtp->cnt; ++i) {
unsigned test_len = 2;
pj_size_t test_len = 2;
/* Check if buf still available */
test_len = dec_fmtp->param[i].val.slen +
@ -682,7 +682,7 @@ PJ_DEF(pj_status_t) pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt,
codec_info[i].pt);
for (j = 0; j < dec_fmtp->cnt; ++j) {
unsigned test_len = 2;
pj_size_t test_len = 2;
/* Check if buf still available */
test_len = dec_fmtp->param[j].val.slen +

View File

@ -103,7 +103,7 @@ static void ffmpeg_log_cb(void* ptr, int level, const char* fmt, va_list vl)
const char *LOG_SENDER = "ffmpeg";
enum { LOG_LEVEL = 5 };
char buf[100];
int bufsize = sizeof(buf), len;
pj_size_t bufsize = sizeof(buf), len;
pj_str_t fmt_st;
/* Custom callback needs to filter log level by itself */

View File

@ -140,7 +140,7 @@ PJ_DEF(void) pjmedia_format_init_video( pjmedia_format *fmt,
vafp.size = fmt->det.vid.size;
vfi->apply_fmt(vfi, &vafp);
bps = vafp.framebytes * fps_num * (pj_size_t)8 / fps_denum;
bps = (pj_uint32_t)vafp.framebytes * fps_num * (pj_size_t)8 / fps_denum;
fmt->det.vid.avg_bps = fmt->det.vid.max_bps = bps;
}
}
@ -172,7 +172,7 @@ static pj_status_t apply_packed_fmt(const pjmedia_video_format_info *fi,
/* Packed formats only use 1 plane */
aparam->planes[0] = aparam->buffer;
aparam->strides[0] = stride;
aparam->strides[0] = (int)stride;
aparam->plane_bytes[0] = aparam->framebytes;
/* Zero unused planes */

View File

@ -523,7 +523,7 @@ static pj_status_t g711_encode(pjmedia_codec *codec,
unsigned i, n;
pj_uint8_t *dst = (pj_uint8_t*) output->buf;
n = (input->size >> 1);
n = ((unsigned)input->size >> 1);
for (i=0; i!=n; ++i, ++dst) {
*dst = pjmedia_linear2alaw(samples[i]);
}
@ -531,7 +531,7 @@ static pj_status_t g711_encode(pjmedia_codec *codec,
unsigned i, n;
pj_uint8_t *dst = (pj_uint8_t*) output->buf;
n = (input->size >> 1);
n = ((unsigned)input->size >> 1);
for (i=0; i!=n; ++i, ++dst) {
*dst = pjmedia_linear2ulaw(samples[i]);
}

View File

@ -975,7 +975,7 @@ PJ_DEF(void) pjmedia_jbuf_put_frame3(pjmedia_jbuf *jb,
/* Attempt to store the frame */
min_frame_size = PJ_MIN(frame_size, jb->jb_frame_size);
status = jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame,
min_frame_size, bit_info, ts,
(unsigned)min_frame_size, bit_info, ts,
PJMEDIA_JB_NORMAL_FRAME);
/* Jitter buffer is full, remove some older frames */
@ -989,12 +989,12 @@ PJ_DEF(void) pjmedia_jbuf_put_frame3(pjmedia_jbuf *jb,
* So we're confident about 'distance' value here.
*/
distance = (frame_seq - jb_framelist_origin(&jb->jb_framelist)) -
jb->jb_max_count + 1;
(int)jb->jb_max_count + 1;
pj_assert(distance > 0);
removed = jb_framelist_remove_head(&jb->jb_framelist, distance);
status = jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame,
min_frame_size, bit_info, ts,
(unsigned)min_frame_size, bit_info, ts,
PJMEDIA_JB_NORMAL_FRAME);
jb->jb_discard += removed;
@ -1125,7 +1125,7 @@ PJ_DEF(pj_status_t) pjmedia_jbuf_get_state( const pjmedia_jbuf *jb,
{
PJ_ASSERT_RETURN(jb && state, PJ_EINVAL);
state->frame_size = jb->jb_frame_size;
state->frame_size = (unsigned)jb->jb_frame_size;
state->min_prefetch = jb->jb_min_prefetch;
state->max_prefetch = jb->jb_max_prefetch;

View File

@ -192,7 +192,7 @@ static pj_status_t resample_get_frame(pjmedia_port *this_port,
if (tmp_frame.size) {
pjmedia_copy_samples((pj_int16_t*)frame->buf,
(const pj_int16_t*)tmp_frame.buf,
frame->size >> 1);
(unsigned)frame->size >> 1);
}
return PJ_SUCCESS;
}

View File

@ -84,6 +84,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_get_ntp_time(const pjmedia_rtcp_session *sess,
#if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
(defined(PJ_WIN64) && PJ_WIN64!=0) || \
(defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0)
/* On Win32, since we use QueryPerformanceCounter() as the backend
@ -963,7 +964,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_build_rtcp_sdes(
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len;
pj_size_t len;
PJ_ASSERT_RETURN(session && buf && length && sdes, PJ_EINVAL);
@ -1036,7 +1037,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_build_rtcp_bye(pjmedia_rtcp_session *session,
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len;
pj_size_t len;
PJ_ASSERT_RETURN(session && buf && length, PJ_EINVAL);

View File

@ -640,7 +640,7 @@ static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len)
/* print connection info, if present. */
if (m->conn) {
printed = print_connection_info(m->conn, p, end-p);
printed = print_connection_info(m->conn, p, (int)(end-p));
if (printed < 0) {
return -1;
}
@ -649,7 +649,7 @@ static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len)
/* print optional bandwidth info. */
for (i=0; i<m->bandw_count; ++i) {
printed = print_bandw(m->bandw[i], p, end-p);
printed = (int)print_bandw(m->bandw[i], p, end-p);
if (printed < 0) {
return -1;
}
@ -658,14 +658,14 @@ static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len)
/* print attributes. */
for (i=0; i<m->attr_count; ++i) {
printed = print_attr(m->attr[i], p, end-p);
printed = (int)print_attr(m->attr[i], p, end-p);
if (printed < 0) {
return -1;
}
p += printed;
}
return p-buf;
return (int)(p-buf);
}
PJ_DEF(pjmedia_sdp_media*) pjmedia_sdp_media_clone(
@ -805,7 +805,7 @@ static int print_session(const pjmedia_sdp_session *ses,
/* Connection line (c=) if exist. */
if (ses->conn) {
printed = print_connection_info(ses->conn, p, end-p);
printed = print_connection_info(ses->conn, p, (int)(end-p));
if (printed < 1) {
return -1;
}
@ -814,7 +814,7 @@ static int print_session(const pjmedia_sdp_session *ses,
/* print optional bandwidth info. */
for (i=0; i<ses->bandw_count; ++i) {
printed = print_bandw(ses->bandw[i], p, end-p);
printed = (int)print_bandw(ses->bandw[i], p, end-p);
if (printed < 1) {
return -1;
}
@ -837,7 +837,7 @@ static int print_session(const pjmedia_sdp_session *ses,
/* Print all attribute (a=) lines. */
for (i=0; i<ses->attr_count; ++i) {
printed = print_attr(ses->attr[i], p, end-p);
printed = (int)print_attr(ses->attr[i], p, end-p);
if (printed < 0) {
return -1;
}
@ -846,14 +846,14 @@ static int print_session(const pjmedia_sdp_session *ses,
/* Print media (m=) lines. */
for (i=0; i<ses->media_count; ++i) {
printed = print_media_desc(ses->media[i], p, end-p);
printed = print_media_desc(ses->media[i], p, (int)(end-p));
if (printed < 0) {
return -1;
}
p += printed;
}
return p-buf;
return (int)(p-buf);
}
/******************************************************************************

View File

@ -910,7 +910,7 @@ static pj_status_t process_answer(pj_pool_t *pool,
PJ_INLINE(void) rewrite_pt(pj_pool_t *pool, pj_str_t *attr_val,
const pj_str_t *old_pt, const pj_str_t *new_pt)
{
int len_diff = new_pt->slen - old_pt->slen;
int len_diff = (int)(new_pt->slen - old_pt->slen);
/* Note that attribute value should be null-terminated. */
if (len_diff > 0) {

View File

@ -94,7 +94,7 @@ static pj_status_t snd_play_cb(void *user_data,
return strm->user_play_cb(strm->user_user_data,
frame->timestamp.u32.lo,
frame->buf,
frame->size);
(unsigned)frame->size);
}
static pj_status_t snd_rec_cb(void *user_data,
@ -104,7 +104,7 @@ static pj_status_t snd_rec_cb(void *user_data,
return strm->user_rec_cb(strm->user_user_data,
frame->timestamp.u32.lo,
frame->buf,
frame->size);
(unsigned)frame->size);
}
static pj_status_t open_stream( pjmedia_dir dir,

View File

@ -71,7 +71,7 @@ static pj_status_t play_cb(void *user_data, pjmedia_frame *frame)
{
pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
pjmedia_port *port;
const unsigned required_size = frame->size;
const unsigned required_size = (unsigned)frame->size;
pj_status_t status;
pjmedia_clock_src_update(&snd_port->play_clocksrc, &frame->timestamp);

View File

@ -565,7 +565,7 @@ static pj_status_t put_frame(pjmedia_port *this_port,
/* Extract the mono frame to temporary buffer */
extract_mono_frame((const pj_int16_t*)frame->buf, sc->put_buf, ch,
PJMEDIA_PIA_CCNT(&this_port->info),
frame->size * 8 /
(unsigned)frame->size * 8 /
PJMEDIA_PIA_BITS(&this_port->info) /
PJMEDIA_PIA_CCNT(&this_port->info));

Some files were not shown because too many files have changed in this diff Show More