Remove implicit casts

Cast parameters of htonl in uint32_t in IN6_IS_ADDR_GLOBAL and
IN6_IS_ADDR_ULA definitions.
Remove comparison with 0 in while statement of vfmatch,
http_SendMessage and http_MakeMessage.
This commit is contained in:
Fabrice Fontaine 2012-03-24 22:18:20 +01:00
parent 679ebeec48
commit 804088d859
4 changed files with 16 additions and 7 deletions

View File

@ -2,6 +2,15 @@
Version 1.6.17 Version 1.6.17
******************************************************************************* *******************************************************************************
2012-03-24 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Remove implicit casts
Cast parameters of htonl in uint32_t in IN6_IS_ADDR_GLOBAL and
IN6_IS_ADDR_ULA definitions.
Remove comparison with 0 in while statement of vfmatch,
http_SendMessage and http_MakeMessage.
2012-03-24 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com> 2012-03-24 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
SF Bug Tracker id 3510693 - build fail with --disable-device SF Bug Tracker id 3510693 - build fail with --disable-device

View File

@ -80,14 +80,14 @@
#ifndef IN6_IS_ADDR_GLOBAL #ifndef IN6_IS_ADDR_GLOBAL
#define IN6_IS_ADDR_GLOBAL(a) \ #define IN6_IS_ADDR_GLOBAL(a) \
((((__const uint32_t *) (a))[0] & htonl(0x70000000)) \ ((((__const uint32_t *) (a))[0] & htonl((uint32_t)0x70000000)) \
== htonl (0x20000000)) == htonl ((uint32_t)0x20000000))
#endif /* IS ADDR GLOBAL */ #endif /* IS ADDR GLOBAL */
#ifndef IN6_IS_ADDR_ULA #ifndef IN6_IS_ADDR_ULA
#define IN6_IS_ADDR_ULA(a) \ #define IN6_IS_ADDR_ULA(a) \
((((__const uint32_t *) (a))[0] & htonl(0xfe000000)) \ ((((__const uint32_t *) (a))[0] & htonl((uint32_t)0xfe000000)) \
== htonl (0xfc000000)) == htonl ((uint32_t)0xfc000000))
#endif /* IS ADDR ULA */ #endif /* IS ADDR ULA */
/*! This structure is for virtual directory callbacks */ /*! This structure is for virtual directory callbacks */

View File

@ -977,7 +977,7 @@ static parse_status_t vfmatch(
save_pos = scanner->cursor; save_pos = scanner->cursor;
status = PARSE_OK; status = PARSE_OK;
while( ( ( c = *fmt_ptr++ ) != 0 ) && while( ( c = *fmt_ptr++ ) &&
( status == ( parse_status_t ) PARSE_OK ) ) { ( status == ( parse_status_t ) PARSE_OK ) ) {
if( c == '%' ) { if( c == '%' ) {
c = *fmt_ptr++; c = *fmt_ptr++;

View File

@ -383,7 +383,7 @@ int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
memset(Chunk_Header, 0, sizeof(Chunk_Header)); memset(Chunk_Header, 0, sizeof(Chunk_Header));
va_start(argp, fmt); va_start(argp, fmt);
while ((c = *fmt++) != 0) { while ((c = *fmt++)) {
if (c == 'I') { if (c == 'I') {
Instr = va_arg(argp, struct SendInstruction *); Instr = va_arg(argp, struct SendInstruction *);
if (Instr->ReadSendSize >= 0) if (Instr->ReadSendSize >= 0)
@ -1636,7 +1636,7 @@ int http_MakeMessage(membuffer *buf, int http_major_version,
memset(tempbuf, 0, sizeof(tempbuf)); memset(tempbuf, 0, sizeof(tempbuf));
va_start(argp, fmt); va_start(argp, fmt);
while ((c = *fmt++) != 0) { while ((c = *fmt++)) {
if (c == 's') { if (c == 's') {
/* C string */ /* C string */
s = (char *)va_arg(argp, char *); s = (char *)va_arg(argp, char *);