Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 29, 2015, 5:36:14 PM (9 years ago)
Author:
landauf
Message:

using some constexpr

Location:
code/branches/cpp11_v2/src/libraries/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/network/NetworkFunction.h

    r10845 r10994  
    4545
    4646#if defined(ORXONOX_COMPILER_GCC) && defined(ORXONOX_ARCH_32)
    47 static const unsigned int MAX_FUNCTION_POINTER_SIZE = 8;
     47static constexpr unsigned int MAX_FUNCTION_POINTER_SIZE = 8;
    4848#else
    49 static const unsigned int MAX_FUNCTION_POINTER_SIZE = 16;
     49static constexpr unsigned int MAX_FUNCTION_POINTER_SIZE = 16;
    5050#endif //ORXONOX_COMPILER_GCC
    51 static const unsigned int MAX_FUNCTION_POINTER_INTS = (MAX_FUNCTION_POINTER_SIZE-1)/4+1;
     51static constexpr unsigned int MAX_FUNCTION_POINTER_INTS = (MAX_FUNCTION_POINTER_SIZE-1)/4+1;
    5252
    5353struct _NetworkExport NetworkFunctionPointer {
  • code/branches/cpp11_v2/src/libraries/network/NetworkPrereqs.h

    r10624 r10994  
    6767namespace orxonox
    6868{
    69   static const unsigned int GAMESTATEID_INITIAL       = static_cast<unsigned int>(-1);
     69  static constexpr unsigned int GAMESTATEID_INITIAL       = static_cast<unsigned int>(-1);
    7070  extern const char* LAN_DISCOVERY_MESSAGE;
    7171  extern const char* LAN_DISCOVERY_ACK;
    72   static const unsigned int LAN_DISCOVERY_PORT          = 55558;
    73   static const unsigned int NETWORK_PEER_ID_SERVER      = 0;
    74   static const unsigned int NETWORK_PEER_ID_BROADCAST   = static_cast<unsigned int>(-1);
    75   static const unsigned int NETWORK_PEER_ID_UNKNOWN     = static_cast<unsigned int>(-2);
    76   static const unsigned int NETWORK_CHANNEL_DEFAULT     = 0;
    77   static const unsigned int NETWORK_CHANNEL_UNRELIABLE  = 1;
    78   static const unsigned int NETWORK_CHANNEL_COUNT       = 2;
     72  static constexpr unsigned int LAN_DISCOVERY_PORT          = 55558;
     73  static constexpr unsigned int NETWORK_PEER_ID_SERVER      = 0;
     74  static constexpr unsigned int NETWORK_PEER_ID_BROADCAST   = static_cast<unsigned int>(-1);
     75  static constexpr unsigned int NETWORK_PEER_ID_UNKNOWN     = static_cast<unsigned int>(-2);
     76  static constexpr unsigned int NETWORK_CHANNEL_DEFAULT     = 0;
     77  static constexpr unsigned int NETWORK_CHANNEL_UNRELIABLE  = 1;
     78  static constexpr unsigned int NETWORK_CHANNEL_COUNT       = 2;
    7979}
    8080
  • code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc

    r10775 r10994  
    3838namespace orxonox {
    3939
    40   static const unsigned int SCHED_PRIORITY_OFFSET = static_cast<unsigned int>(-1);
     40  static constexpr unsigned int SCHED_PRIORITY_OFFSET = static_cast<unsigned int>(-1);
    4141  namespace arg = std::placeholders;
    4242
  • code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.h

    r10817 r10994  
    4848{
    4949   
    50 static const uint8_t GAMESTATE_MODE_SERVER = 0x1;
    51 static const uint8_t GAMESTATE_MODE_CLIENT = 0x2;
     50static constexpr uint8_t GAMESTATE_MODE_SERVER = 0x1;
     51static constexpr uint8_t GAMESTATE_MODE_CLIENT = 0x2;
    5252
    5353class _NetworkExport GamestateHeader
Note: See TracChangeset for help on using the changeset viewer.