Remove more implicit casts in upnp part
Remove more "implicit integer or enum conversions" errors as well as dead code.
This commit is contained in:
@@ -77,7 +77,7 @@ struct SUpnpString
|
||||
UpnpString *UpnpString_new()
|
||||
{
|
||||
/* All bytes are zero, and so is the length of the string. */
|
||||
struct SUpnpString *p = calloc(1, sizeof (struct SUpnpString));
|
||||
struct SUpnpString *p = calloc((size_t)1, sizeof (struct SUpnpString));
|
||||
if (p == NULL) {
|
||||
goto error_handler1;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ UpnpString *UpnpString_new()
|
||||
#endif
|
||||
|
||||
/* This byte is zero, calloc does initialize it. */
|
||||
p->m_string = calloc(1, 1);
|
||||
p->m_string = calloc((size_t)1, (size_t)1);
|
||||
if (p->m_string == NULL) {
|
||||
goto error_handler2;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void UpnpString_delete(UpnpString *p)
|
||||
|
||||
if (!q) return;
|
||||
|
||||
q->m_length = 0;
|
||||
q->m_length = (size_t)0;
|
||||
|
||||
free(q->m_string);
|
||||
q->m_string = NULL;
|
||||
@@ -116,7 +116,7 @@ void UpnpString_delete(UpnpString *p)
|
||||
|
||||
UpnpString *UpnpString_dup(const UpnpString *p)
|
||||
{
|
||||
struct SUpnpString *q = calloc(1, sizeof (struct SUpnpString));
|
||||
struct SUpnpString *q = calloc((size_t)1, sizeof (struct SUpnpString));
|
||||
if (q == NULL) {
|
||||
goto error_handler1;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ error_handler1:
|
||||
|
||||
void UpnpString_clear(UpnpString *p)
|
||||
{
|
||||
((struct SUpnpString *)p)->m_length = 0;
|
||||
((struct SUpnpString *)p)->m_length = (size_t)0;
|
||||
/* No need to realloc now, will do later when needed. */
|
||||
((struct SUpnpString *)p)->m_string[0] = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user