Fix for size_t related warnings.

This commit is contained in:
Stefan Sommerfeld 2010-11-07 15:16:33 -02:00 committed by Marcelo Roberto Jimenez
parent 243cd41974
commit fcb5e7c438
6 changed files with 47 additions and 45 deletions

View File

@ -2412,7 +2412,7 @@ EXPORT_SPEC int UpnpReadHttpGet(
/*! [in,out] The buffer to store the read item. */
char *buf,
/*! [in,out] The size of the buffer to be read. */
unsigned int *size,
size_t *size,
/*! [in] The time out value sent with the request during which a response is
* expected from the server, failing which, an error is reported back to
* the user. */
@ -2431,9 +2431,9 @@ EXPORT_SPEC int UpnpHttpGetProgress(
/*! [in] The token created by the call to \b UpnpOpenHttpGet. */
void *handle,
/*! [out] The number of bytes received. */
unsigned int *length,
size_t *length,
/*! [out] The content length. */
unsigned int *total);
size_t *total);
/*!

View File

@ -1440,12 +1440,12 @@ static int GetDescDocumentAndURL(
if (fp == NULL) {
return UPNP_E_FILE_NOT_FOUND;
}
membuf = (char *)malloc(fileLen + 1);
membuf = (char *)malloc((size_t) fileLen + 1);
if (membuf == NULL) {
fclose(fp);
return UPNP_E_OUTOF_MEMORY;
}
num_read = fread(membuf, 1, fileLen, fp);
num_read = fread(membuf, 1, (size_t) fileLen, fp);
if (num_read != fileLen) {
fclose(fp);
free(membuf);
@ -2877,13 +2877,13 @@ int UpnpCloseHttpGet(void *Handle)
}
int UpnpReadHttpGet(void *Handle, char *buf, unsigned int *size, int timeout)
int UpnpReadHttpGet(void *Handle, char *buf, size_t *size, int timeout)
{
return http_ReadHttpGet(Handle, buf, size, timeout);
}
int UpnpHttpGetProgress(void *Handle, unsigned int *length, unsigned int *total)
int UpnpHttpGetProgress(void *Handle, size_t *length, size_t *total)
{
return http_HttpGetProgress(Handle, length, total);
}

View File

@ -102,7 +102,7 @@ static int GeneratePropertySet(
{
char *buffer;
int counter = 0;
int size = 0;
size_t size = 0;
int temp_counter = 0;
/*size += strlen(XML_VERSION);*/
@ -445,7 +445,7 @@ static char *AllocGenaHeaders(
static const char *HEADER_LINE_4 =
"NTS: upnp:propchange\r\n";
char *headers = NULL;
int headers_size = 0;
size_t headers_size = 0;
int line = 0;
headers_size =
@ -1133,7 +1133,7 @@ static int create_url_list(
URL_list *out)
{
int URLcount = 0;
int i;
size_t i;
int return_code = 0;
uri_type temp;
token urls;

View File

@ -928,7 +928,7 @@ int StopMiniServer()
SOCKET sock;
struct sockaddr_in ssdpAddr;
char buf[256] = "ShutDown";
int bufLen = strlen(buf);
size_t bufLen = strlen(buf);
if(gMServState == MSERV_RUNNING) {
gMServState = MSERV_STOPPING;
@ -947,8 +947,8 @@ int StopMiniServer()
ssdpAddr.sin_family = AF_INET;
ssdpAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
ssdpAddr.sin_port = htons(miniStopSockPort);
sendto(sock, buf, bufLen, 0, (struct sockaddr *)&ssdpAddr,
socklen);
sendto(sock, buf, (int)bufLen, 0,
(struct sockaddr *)&ssdpAddr, socklen);
usleep(1000);
if (gMServState == MSERV_IDLE) {
break;

View File

@ -1440,10 +1440,10 @@ ReadResponseLineAndHeaders( IN SOCKINFO * info,
* Function: http_ReadHttpGet
*
* Parameters:
* IN void *Handle; Handle to the HTTP get object
* IN OUT char *buf; Buffer to get the read and parsed data
* IN OUT unsigned int *size; Size of the buffer passed
* IN int timeout; time out value
* IN void *Handle; Handle to the HTTP get object
* IN OUT char *buf; Buffer to get the read and parsed data
* IN OUT size_t *size; Size of the buffer passed
* IN int timeout; time out value
*
* Description:
* Parses already existing data, then gets new data.
@ -1456,11 +1456,11 @@ ReadResponseLineAndHeaders( IN SOCKINFO * info,
* UPNP_E_BAD_HTTPMSG
* UPNP_E_CANCELED
************************************************************************/
int
http_ReadHttpGet( IN void *Handle,
IN OUT char *buf,
IN OUT unsigned int *size,
IN int timeout )
int http_ReadHttpGet(
IN void *Handle,
IN OUT char *buf,
IN OUT size_t *size,
IN int timeout)
{
http_get_handle_t *handle = Handle;
@ -1567,9 +1567,9 @@ http_ReadHttpGet( IN void *Handle,
* Function: http_HttpGetProgress
*
* Parameters:
* IN void *Handle; Handle to the HTTP get object
* OUT unsigned int *length; Buffer to get the read and parsed data
* OUT unsigned int *total; Size of tge buffer passed
* IN void *Handle; Handle to the HTTP get object
* OUT size_t *length; Buffer to get the read and parsed data
* OUT size_t *total; Size of tge buffer passed
*
* Description:
* Extracts information from the Handle to the HTTP get object.
@ -1578,18 +1578,20 @@ http_ReadHttpGet( IN void *Handle,
* UPNP_E_SUCCESS - On Sucess
* UPNP_E_INVALID_PARAM - Invalid Parameter
************************************************************************/
int http_HttpGetProgress( IN void *Handle,
OUT unsigned int *length,
OUT unsigned int *total )
int http_HttpGetProgress(
IN void *Handle,
OUT size_t *length,
OUT size_t *total)
{
http_get_handle_t *handle = Handle;
http_get_handle_t *handle = Handle;
if( ( !handle ) || ( !length ) || ( !total ) ) {
return UPNP_E_INVALID_PARAM;
}
*length = handle->response.msg.entity.length;
*total = handle->response.content_length;
return UPNP_E_SUCCESS;
if (!handle || !length || !total) {
return UPNP_E_INVALID_PARAM;
}
*length = handle->response.msg.entity.length;
*total = handle->response.content_length;
return UPNP_E_SUCCESS;
}
/************************************************************************

View File

@ -313,10 +313,10 @@ int http_OpenHttpPost(IN const char *url_str,
* Function: http_ReadHttpGet
*
* Parameters:
* IN void *Handle; Handle to the HTTP get object
* IN OUT char *buf; Buffer to get the read and parsed data
* IN OUT unsigned int *size; Size of the buffer passed
* IN int timeout; time out value
* IN void *Handle; Handle to the HTTP get object
* IN OUT char *buf; Buffer to get the read and parsed data
* IN OUT size_t *size; Size of the buffer passed
* IN int timeout; time out value
*
* Description:
* Parses already existing data, then gets new data.
@ -332,7 +332,7 @@ int http_OpenHttpPost(IN const char *url_str,
int http_ReadHttpGet(
IN void *Handle,
IN OUT char *buf,
IN OUT unsigned int *size,
IN OUT size_t *size,
IN int timeout);
@ -340,9 +340,9 @@ int http_ReadHttpGet(
* Function: http_HttpGetProgress
*
* Parameters:
* IN void *Handle; Handle to the HTTP get object
* OUT unsigned int *length; Buffer to get the read and parsed data
* OUT unsigned int *total; Size of tge buffer passed
* IN void *Handle; Handle to the HTTP get object
* OUT size_t *length; Buffer to get the read and parsed data
* OUT size_t *total; Size of tge buffer passed
*
* Description:
* Extracts information from the Handle to the HTTP get object.
@ -353,8 +353,8 @@ int http_ReadHttpGet(
************************************************************************/
int http_HttpGetProgress(
IN void *Handle,
OUT unsigned int *length,
OUT unsigned int *total );
OUT size_t *length,
OUT size_t *total);
/************************************************************************