VirtualBox

Ignore:
Timestamp:
Aug 12, 2016 6:34:15 PM (8 years ago)
Author:
vboxsync
Message:

NetworkServices: warnings (gcc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NetLib/cpp/utils.h

    • Property svn:keywords set to Author Date Id Revision
    r62481 r63380  
    1616 */
    1717
    18 #ifndef _NETLIB_CPP_UTILS_H_
    19 # define _NETLIB_CPP_UTILS_H_
     18#ifndef ___NETLIB_CPP_UTILS_H___
     19#define ___NETLIB_CPP_UTILS_H___
    2020
    21 /* less operator for IPv4 addresess */
    22 static bool operator <(const RTNETADDRIPV4& a, const RTNETADDRIPV4& b)
     21#include <iprt/types.h>
     22
     23/** less operator for IPv4 addresess */
     24DECLINLINE(bool) operator <(const RTNETADDRIPV4 &lhs, const RTNETADDRIPV4 &rhs)
    2325{
    24     return (RT_N2H_U32(a.u) < RT_N2H_U32(b.u));
     26    return RT_N2H_U32(lhs.u) < RT_N2H_U32(rhs.u);
    2527}
    2628
    27 /*  Compares MAC addresses */
    28 static bool operator== (const RTMAC& lhs, const RTMAC& rhs)
     29/** greater operator for IPv4 addresess */
     30DECLINLINE(bool) operator >(const RTNETADDRIPV4 &lhs, const RTNETADDRIPV4 &rhs)
    2931{
    30     return (   lhs.au16[0] == rhs.au16[0]
    31             && lhs.au16[1] == rhs.au16[1]
    32             && lhs.au16[2] == rhs.au16[2]);
     32    return RT_N2H_U32(lhs.u) > RT_N2H_U32(rhs.u);
    3333}
     34
     35/**  Compares MAC addresses */
     36DECLINLINE(bool) operator== (const RTMAC &lhs, const RTMAC &rhs)
     37{
     38    return lhs.au16[0] == rhs.au16[0]
     39        && lhs.au16[1] == rhs.au16[1]
     40        && lhs.au16[2] == rhs.au16[2];
     41}
     42
    3443#endif
     44
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette