Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 02d9fec in mainline


Ignore:
Timestamp:
2010-03-15T20:52:26Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
6e81d04
Parents:
6092b56e
Message:

Fix more dangerous type casts.

Location:
uspace/srv/net
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip.c

    r6092b56e r02d9fec  
    895895        ip_pseudo_header_ref header;
    896896        size_t headerlen;
     897        device_id_t device_id;
    897898
    898899        *answer_count = 0;
     
    921922                case NET_IP_GET_ROUTE:
    922923                        ERROR_PROPAGATE(data_receive((void **) &addr, &addrlen));
    923                         ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen, IPC_SET_DEVICE(answer), &header, &headerlen));
     924                        ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen,
     925                            &device_id, &header, &headerlen));
     926                        *IPC_SET_DEVICE(answer) = device_id;
    924927                        *IP_SET_HEADERLEN(answer) = headerlen;
    925928                        *answer_count = 2;
  • uspace/srv/net/il/ip/ip_messages.h

    r6092b56e r02d9fec  
    8282 *  @param[out] answer The message answer structure.
    8383 */
    84 #define IP_SET_HEADERLEN(answer)        ((size_t *) &IPC_GET_ARG2(*answer))
     84#define IP_SET_HEADERLEN(answer)        (&IPC_GET_ARG2(*answer))
    8585
    8686/** Returns the network mask message parameter.
  • uspace/srv/net/messages.h

    r6092b56e r02d9fec  
    391391 *  @param[out] answer The message answer structure.
    392392 */
    393 #define IPC_SET_DEVICE(answer)  ((device_id_t *) &IPC_GET_ARG1(*answer))
     393#define IPC_SET_DEVICE(answer)  (&IPC_GET_ARG1(*answer))
    394394
    395395/** Sets the minimum address length in the message answer.
    396396 *  @param[out] answer The message answer structure.
    397397 */
    398 #define IPC_SET_ADDR(answer)            ((size_t *) &IPC_GET_ARG1(*answer))
     398#define IPC_SET_ADDR(answer)            (&IPC_GET_ARG1(*answer))
    399399
    400400/*@}*/
     
    407407 *  @param[out] answer The message answer structure.
    408408 */
    409 #define IPC_SET_PREFIX(answer)  ((size_t *) &IPC_GET_ARG2(*answer))
     409#define IPC_SET_PREFIX(answer)  (&IPC_GET_ARG2(*answer))
    410410
    411411/*@}*/
     
    418418 *  @param[out] answer The message answer structure.
    419419 */
    420 #define IPC_SET_CONTENT(answer) ((size_t *) &IPC_GET_ARG3(*answer))
     420#define IPC_SET_CONTENT(answer) (&IPC_GET_ARG3(*answer))
    421421
    422422/*@}*/
     
    429429 *  @param[out] answer The message answer structure.
    430430 */
    431 #define IPC_SET_SUFFIX(answer)  ((size_t *) &IPC_GET_ARG4(*answer))
     431#define IPC_SET_SUFFIX(answer)  (&IPC_GET_ARG4(*answer))
    432432
    433433/*@}*/
Note: See TracChangeset for help on using the changeset viewer.