Changeset 2934


Ignore:
Timestamp:
Sep 15, 2013, 6:19:32 PM (6 years ago)
Author:
sam
Message:

core: fix some minor compiler warnings.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/shader.cpp

    r2931 r2934  
    365365
    366366        String name(name_buffer);
    367         int index = 0;
     367        int index = -1;
    368368        VertexUsage usage = VertexUsage::Max;
    369369        for (int j = 0; j < VertexUsage::Max; ++j)
     
    378378        }
    379379
    380         if (usage == VertexUsage::Max || index == LONG_MIN || index == LONG_MAX)
    381         {
    382             Log::Error("unable to parse attribute sementic from name: %s", name_buffer);
     380        if (usage == VertexUsage::Max || index == -1)
     381        {
     382            Log::Error("unable to parse attribute semantic from name: %s",
     383                       name_buffer);
    383384        }
    384385        else
     
    391392            if (data->attrib_locations.HasKey(flags))
    392393            {
    393                 Log::Error("an error occured while parsing attribute sementics");
     394                Log::Error("an error occured while parsing attribute semantics");
    394395            }
    395396#endif
  • trunk/src/input/controller.h

    r2925 r2934  
    2020{
    2121public:
    22     KeyBinding() : m_device(nullptr), m_current(false), m_previous(false), m_keyindex(-1) {}
     22    KeyBinding()
     23      : m_device(nullptr),
     24        m_keyindex(-1),
     25        m_current(false),
     26        m_previous(false)
     27    {}
    2328
    2429    /** Indicate wheither the key is currently down */
     
    5358{
    5459public:
    55     AxisBinding() : m_device(nullptr), m_current(0.0f), m_previous(0.0f), m_axisindex(-1), m_minkeyindex(-1), m_maxkeyindex(-1) {}
     60    AxisBinding()
     61      : m_device(nullptr),
     62        m_axisindex(-1),
     63        m_minkeyindex(-1),
     64        m_maxkeyindex(-1),
     65        m_current(0.0f),
     66        m_previous(0.0f)
     67    {}
    5668
    5769    /** Gets the current absolute value of this axis */
     
    7082
    7183    /** Indicate wheither a physical device and axis has been bound */
    72     bool IsBound() { return m_device && m_axisindex != -1 || m_maxkeyindex != -1; }
     84    bool IsBound() { return m_device &&
     85                            (m_axisindex != -1 || m_maxkeyindex != -1); }
    7386
    7487protected:
  • trunk/src/lol/math/functions.h

    r2917 r2934  
    172172    static inline T min(T x, T y) { return std::min(x, y); } \
    173173    static inline T max(T x, T y) { return std::max(x, y); } \
    174     static inline T clamp(T x, T y, T z) { return min(max(x, y), z); } \
     174    static inline T clamp(T x, T y, T z) { return min(max(x, y), z); }
     175
     176#define LOL_GENERIC_FUNC_SIGNED(T) \
     177    LOL_GENERIC_FUNC(T) \
    175178    static inline T sign(T x) { return (T)(((T)0 < x) - (x < (T)0)); }
    176179
    177 LOL_GENERIC_FUNC(uint8_t)
    178 LOL_GENERIC_FUNC(int8_t)
    179 LOL_GENERIC_FUNC(uint16_t)
    180 LOL_GENERIC_FUNC(int16_t)
    181 LOL_GENERIC_FUNC(uint32_t)
    182 LOL_GENERIC_FUNC(int32_t)
    183 LOL_GENERIC_FUNC(uint64_t)
    184 LOL_GENERIC_FUNC(int64_t)
    185 LOL_GENERIC_FUNC(float)
    186 LOL_GENERIC_FUNC(double)
    187 LOL_GENERIC_FUNC(ldouble)
     180#define LOL_GENERIC_FUNC_UNSIGNED(T) \
     181    LOL_GENERIC_FUNC(T) \
     182    static inline T sign(T x) { return (T)((T)0 < x); }
     183
     184LOL_GENERIC_FUNC_UNSIGNED(uint8_t)
     185LOL_GENERIC_FUNC_SIGNED(int8_t)
     186LOL_GENERIC_FUNC_UNSIGNED(uint16_t)
     187LOL_GENERIC_FUNC_SIGNED(int16_t)
     188LOL_GENERIC_FUNC_UNSIGNED(uint32_t)
     189LOL_GENERIC_FUNC_SIGNED(int32_t)
     190LOL_GENERIC_FUNC_UNSIGNED(uint64_t)
     191LOL_GENERIC_FUNC_SIGNED(int64_t)
     192LOL_GENERIC_FUNC_SIGNED(float)
     193LOL_GENERIC_FUNC_SIGNED(double)
     194LOL_GENERIC_FUNC_SIGNED(ldouble)
    188195#undef LOL_GENERIC_FUNC
    189196
Note: See TracChangeset for help on using the changeset viewer.