dnsapi: Cast-qual warnings fix.

This commit is contained in:
Andrew Talbot 2006-09-09 17:10:21 +01:00 committed by Alexandre Julliard
parent 78cdd5460c
commit ba645eaab1
1 changed files with 23 additions and 23 deletions

View File

@ -249,7 +249,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, ns_rr *rr, DNS_RECORDA *r, WORD *d
{
case ns_t_a:
{
r->Data.A.IpAddress = *(DWORD *)pos;
r->Data.A.IpAddress = *(const DWORD *)pos;
*dlen = sizeof(DNS_A_DATA);
break;
}
@ -257,7 +257,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, ns_rr *rr, DNS_RECORDA *r, WORD *d
{
for (i = 0; i < sizeof(IP6_ADDRESS)/sizeof(DWORD); i++)
{
r->Data.AAAA.Ip6Address.IP6Dword[i] = *(DWORD *)pos;
r->Data.AAAA.Ip6Address.IP6Dword[i] = *(const DWORD *)pos;
pos += sizeof(DWORD);
}
@ -267,14 +267,14 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, ns_rr *rr, DNS_RECORDA *r, WORD *d
case ns_t_key:
{
/* FIXME: byte order? */
r->Data.KEY.wFlags = *(WORD *)pos; pos += sizeof(WORD);
r->Data.KEY.chProtocol = *(BYTE *)pos++;
r->Data.KEY.chAlgorithm = *(BYTE *)pos++;
r->Data.KEY.wFlags = *(const WORD *)pos; pos += sizeof(WORD);
r->Data.KEY.chProtocol = *(const BYTE *)pos++;
r->Data.KEY.chAlgorithm = *(const BYTE *)pos++;
size = rr->rdata + rr->rdlength - pos;
for (i = 0; i < size; i++)
r->Data.KEY.Key[i] = *(BYTE *)pos++;
r->Data.KEY.Key[i] = *(const BYTE *)pos++;
*dlen = sizeof(DNS_KEY_DATA) + (size - 1) * sizeof(BYTE);
break;
@ -302,7 +302,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, ns_rr *rr, DNS_RECORDA *r, WORD *d
case ns_t_rt:
case ns_t_mx:
{
r->Data.MX.wPreference = ntohs( *(WORD *)pos );
r->Data.MX.wPreference = ntohs( *(const WORD *)pos );
r->Data.MX.pNameExchange = dns_dname_from_msg( msg, pos + sizeof(WORD) );
if (!r->Data.MX.pNameExchange) return ERROR_NOT_ENOUGH_MEMORY;
@ -341,18 +341,18 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, ns_rr *rr, DNS_RECORDA *r, WORD *d
return DNS_ERROR_BAD_PACKET;
/* FIXME: byte order? */
r->Data.SIG.wTypeCovered = *(WORD *)pos; pos += sizeof(WORD);
r->Data.SIG.chAlgorithm = *(BYTE *)pos++;
r->Data.SIG.chLabelCount = *(BYTE *)pos++;
r->Data.SIG.dwOriginalTtl = *(DWORD *)pos; pos += sizeof(DWORD);
r->Data.SIG.dwExpiration = *(DWORD *)pos; pos += sizeof(DWORD);
r->Data.SIG.dwTimeSigned = *(DWORD *)pos; pos += sizeof(DWORD);
r->Data.SIG.wKeyTag = *(WORD *)pos;
r->Data.SIG.wTypeCovered = *(const WORD *)pos; pos += sizeof(WORD);
r->Data.SIG.chAlgorithm = *(const BYTE *)pos++;
r->Data.SIG.chLabelCount = *(const BYTE *)pos++;
r->Data.SIG.dwOriginalTtl = *(const DWORD *)pos; pos += sizeof(DWORD);
r->Data.SIG.dwExpiration = *(const DWORD *)pos; pos += sizeof(DWORD);
r->Data.SIG.dwTimeSigned = *(const DWORD *)pos; pos += sizeof(DWORD);
r->Data.SIG.wKeyTag = *(const WORD *)pos;
size = rr->rdata + rr->rdlength - pos;
for (i = 0; i < size; i++)
r->Data.SIG.Signature[i] = *(BYTE *)pos++;
r->Data.SIG.Signature[i] = *(const BYTE *)pos++;
*dlen = sizeof(DNS_SIG_DATAA) + (size - 1) * sizeof(BYTE);
break;
@ -375,20 +375,20 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, ns_rr *rr, DNS_RECORDA *r, WORD *d
if (dns_ns_name_skip( &pos, ns_msg_end( msg ) ) < 0)
return DNS_ERROR_BAD_PACKET;
r->Data.SOA.dwSerialNo = ntohl( *(DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwRefresh = ntohl( *(DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwRetry = ntohl( *(DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwExpire = ntohl( *(DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwDefaultTtl = ntohl( *(DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwSerialNo = ntohl( *(const DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwRefresh = ntohl( *(const DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwRetry = ntohl( *(const DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwExpire = ntohl( *(const DWORD *)pos ); pos += sizeof(DWORD);
r->Data.SOA.dwDefaultTtl = ntohl( *(const DWORD *)pos ); pos += sizeof(DWORD);
*dlen = sizeof(DNS_SOA_DATAA);
break;
}
case ns_t_srv:
{
r->Data.SRV.wPriority = ntohs( *(WORD *)pos ); pos += sizeof(WORD);
r->Data.SRV.wWeight = ntohs( *(WORD *)pos ); pos += sizeof(WORD);
r->Data.SRV.wPort = ntohs( *(WORD *)pos ); pos += sizeof(WORD);
r->Data.SRV.wPriority = ntohs( *(const WORD *)pos ); pos += sizeof(WORD);
r->Data.SRV.wWeight = ntohs( *(const WORD *)pos ); pos += sizeof(WORD);
r->Data.SRV.wPort = ntohs( *(const WORD *)pos ); pos += sizeof(WORD);
r->Data.SRV.pNameTarget = dns_dname_from_msg( msg, pos );
if (!r->Data.SRV.pNameTarget) return ERROR_NOT_ENOUGH_MEMORY;