Sfoglia il codice sorgente

fixed 25 files out of 4243:

- removed 16 CR characters
 - removed 1 trailing whitespaces
 - replaced 53 tabs with spaces
 - fixed 22 svn:eol-style properties
undefined
Lolbot Sam Hocevar <sam@hocevar.net> 10 anni fa
parent
commit
e08e7434ec
3 ha cambiato i file con 29 aggiunte e 29 eliminazioni
  1. +1
    -1
      src/lol/base/avl_tree.h
  2. +11
    -11
      src/lol/base/enum.h
  3. +17
    -17
      src/lol/math/geometry.h

+ 1
- 1
src/lol/base/avl_tree.h Vedi File

@@ -588,4 +588,4 @@ protected:
}; };


} }

+ 11
- 11
src/lol/base/enum.h Vedi File

@@ -55,20 +55,20 @@ public:
inline explicit SafeEnum(int i) : m_value(T(i)) {} inline explicit SafeEnum(int i) : m_value(T(i)) {}
inline Type ToScalar() const { return m_value; } inline Type ToScalar() const { return m_value; }


/* Convert to string stuff */ /* Convert to string stuff */
inline class String ToString() inline class String ToString()
{ {
/* FIXME: we all know this isn’t thread safe. But is it really /* FIXME: we all know this isn’t thread safe. But is it really
* a big deal? */ * a big deal? */
static map<int64_t, String> enum_map; static map<int64_t, String> enum_map;
static bool ready = false; static bool ready = false;


if (ready || this->BuildEnumMap(enum_map)) if (ready || this->BuildEnumMap(enum_map))
{ {
ready = true; ready = true;
if (enum_map.has_key((int64_t)m_value)) if (enum_map.has_key((int64_t)m_value))
return enum_map[(int64_t)m_value]; return enum_map[(int64_t)m_value];
} }
return "<invalid enum>"; return "<invalid enum>";
} }




+ 17
- 17
src/lol/math/geometry.h Vedi File

@@ -34,16 +34,16 @@ namespace lol
X = 0, Y, Z, MAX, XY = 2, XYZ = 3, X = 0, Y, Z, MAX, XY = 2, XYZ = 3,
}; };
protected: protected:
virtual bool BuildEnumMap(map<int64_t, String>& enum_map) virtual bool BuildEnumMap(map<int64_t, String>& enum_map)
{ {
enum_map[X] = "X"; enum_map[X] = "X";
enum_map[Y] = "Y"; enum_map[Y] = "Y";
enum_map[Z] = "Z"; enum_map[Z] = "Z";
enum_map[MAX] = "MAX"; enum_map[MAX] = "MAX";
enum_map[XY] = "XY"; enum_map[XY] = "XY";
enum_map[XYZ] = "XYZ"; enum_map[XYZ] = "XYZ";
return true; return true;
} }
}; };
typedef SafeEnum<AxisBase> Axis; typedef SafeEnum<AxisBase> Axis;


@@ -55,15 +55,15 @@ struct DirectionBase : public StructSafeEnum
Up = 0, Down, Left, Right, MAX, Up = 0, Down, Left, Right, MAX,
}; };
protected: protected:
virtual bool BuildEnumMap(map<int64_t, String>& enum_map) virtual bool BuildEnumMap(map<int64_t, String>& enum_map)
{ {
enum_map[Up] = "Up"; enum_map[Up] = "Up";
enum_map[Down] = "Down"; enum_map[Down] = "Down";
enum_map[Left] = "Left"; enum_map[Left] = "Left";
enum_map[Right] = "Right"; enum_map[Right] = "Right";
enum_map[MAX] = "MAX"; enum_map[MAX] = "MAX";
return true; return true;
} }
}; };
typedef SafeEnum<DirectionBase> Direction; typedef SafeEnum<DirectionBase> Direction;




||||||
x
 
000:0
Caricamento…
Annulla
Salva