Skip to content

Commit 7c99022

Browse files
committed
Code conformance improvement
1 parent c099b90 commit 7c99022

File tree

226 files changed

+2471
-2506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+2471
-2506
lines changed

Externals/ode/include/ode/misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dReal dRandReal();
5555

5656
/* print out a matrix */
5757
#ifdef __cplusplus
58-
void dPrintMatrix (const dReal *A, int n, int m, char *fmt = "%10.4f ",
58+
void dPrintMatrix (const dReal *A, int n, int m, const char *fmt = "%10.4f ",
5959
FILE *f=stdout);
6060
#else
6161
void dPrintMatrix (const dReal *A, int n, int m, char *fmt, FILE *f);

Externals/ode/ode/src/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ dReal dRandReal()
7676
//****************************************************************************
7777
// matrix utility stuff
7878

79-
void dPrintMatrix (const dReal *A, int n, int m, char *fmt, FILE *f)
79+
void dPrintMatrix (const dReal *A, int n, int m, const char *fmt, FILE *f)
8080
{
8181
int i,j;
8282
int skip = dPAD(m);

src/Common/object_comparer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ struct CComparer
4343
if (v1.size() != v2.size())
4444
return p();
4545

46-
svector<T, size>::const_iterator I = v1.begin(), J = v2.begin();
47-
svector<T, size>::const_iterator E = v1.end();
46+
auto I = v1.cbegin(), J = v2.cbegin();
47+
auto E = v1.end();
4848
for (; I != E; ++I, ++J)
4949
if (!compare(*I, *J, p))
5050
return false;

src/Common/object_loader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct CLoader
4242
template <>
4343
static void load_data<true>(T& data, M& stream, const P& p)
4444
{
45-
CLoader<M, P>::load_data(*(data = new object_type_traits::remove_pointer<T>::type()), stream, p);
45+
CLoader<M, P>::load_data(*(data = new typename object_type_traits::remove_pointer<T>::type()), stream, p);
4646
}
4747
};
4848

@@ -101,7 +101,7 @@ struct CLoader
101101
const u32 count = stream.r_u32();
102102
for (u32 i = 0; i < count; ++i)
103103
{
104-
T::value_type temp;
104+
typename T::value_type temp;
105105
CLoader<M, P>::load_data(temp, stream, p);
106106
if (p(data, temp))
107107
add(data, temp);
@@ -144,11 +144,11 @@ struct CLoader
144144
template <typename T1, typename T2>
145145
static void load_data(std::pair<T1, T2>& data, M& stream, const P& p)
146146
{
147-
if (p(data, const_cast<object_type_traits::remove_const<T1>::type&>(data.first), true))
147+
if (p(data, const_cast<typename object_type_traits::remove_const<T1>::type&>(data.first), true))
148148
{
149149
const bool value = object_type_traits::is_same<T1, LPCSTR>::value;
150150
VERIFY(!value);
151-
load_data(const_cast<object_type_traits::remove_const<T1>::type&>(data.first), stream, p);
151+
load_data(const_cast<typename object_type_traits::remove_const<T1>::type&>(data.first), stream, p);
152152
}
153153
if (p(data, data.second, false))
154154
load_data(data.second, stream, p);
@@ -183,7 +183,7 @@ struct CLoader
183183
const u32 count = stream.r_u32();
184184
for (u32 i = 0; i < count; ++i)
185185
{
186-
svector<T, size>::value_type temp;
186+
typename svector<T, size>::value_type temp;
187187
CLoader<M, P>::load_data(temp, stream, p);
188188
if (p(data, temp))
189189
data.push_back(temp);
@@ -202,7 +202,7 @@ struct CLoader
202202
const u32 count = stream.r_u32();
203203
for (u32 i = 0; i < count; ++i)
204204
{
205-
std::queue<T1, T2>::value_type t;
205+
typename std::queue<T1, T2>::value_type t;
206206
CLoader<M, P>::load_data(t, stream, p);
207207
if (p(temp, t))
208208
temp.push(t);
@@ -223,7 +223,7 @@ struct CLoader
223223
const u32 count = stream.r_u32();
224224
for (u32 i = 0; i < count; ++i)
225225
{
226-
T1<T2, T3>::value_type t;
226+
typename T1<T2, T3>::value_type t;
227227
CLoader<M, P>::load_data(t, stream, p);
228228
if (p(temp, t))
229229
temp.push(t);
@@ -244,7 +244,7 @@ struct CLoader
244244
u32 count = stream.r_u32();
245245
for (u32 i = 0; i < count; ++i)
246246
{
247-
T1<T2, T3, T4>::value_type t;
247+
typename T1<T2, T3, T4>::value_type t;
248248
CLoader<M, P>::load_data(t, stream, p);
249249
if (p(temp, t))
250250
temp.push(t);

src/Common/object_saver.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ struct CSaver
9292
IC static void save_data(const xr_vector<bool>& data, M& stream, const P& /*p*/)
9393
{
9494
stream.w_u32((u32)data.size());
95-
xr_vector<bool>::const_iterator I = data.begin();
96-
xr_vector<bool>::const_iterator E = data.end();
95+
auto I = data.cbegin();
96+
auto E = data.cend();
9797
u32 mask = 0;
9898
if (I != E)
9999
{
@@ -116,8 +116,8 @@ struct CSaver
116116
IC static void save_data(const svector<T, size>& data, M& stream, const P& p)
117117
{
118118
stream.w_u32((u32)data.size());
119-
svector<T, size>::const_iterator I = data.begin();
120-
svector<T, size>::const_iterator E = data.end();
119+
auto I = data.cbegin();
120+
auto E = data.cend();
121121
for (; I != E; ++I)
122122
if (p(data, *I))
123123
CSaver<M, P>::save_data(*I, stream, p);

src/Layers/xrRender/ColorMapManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ColorMapManager
1616
private:
1717
void UpdateTexture(const shared_str& strTexName, int iTex);
1818

19-
struct str_pred : public std::binary_function<const shared_str&, const shared_str&, bool>
19+
struct str_pred
2020
{
2121
bool operator()(const shared_str& x, const shared_str& y) const { return x < y; }
2222
};

src/Layers/xrRender/ModelPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ECORE_API CModelPool
1616
{
1717
friend class CRender;
1818

19-
struct str_pred : public std::binary_function<const shared_str&, const shared_str&, bool>
19+
struct str_pred
2020
{
2121
bool operator()(const shared_str& x, const shared_str& y) const { return xr_strcmp(x, y) < 0; }
2222
};

src/Layers/xrRender/ParticleGroup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void OnGroupParticleDead(void* owner, u32 param, PAPI::Particle& m, u32 idx)
346346
PG->items[param].StartFreeChild(PE, *eff->m_OnDeadChildName, m);
347347
}
348348
//------------------------------------------------------------------------------
349-
struct zero_vis_pred : public std::unary_function<dxRender_Visual*, bool>
349+
struct zero_vis_pred
350350
{
351351
bool operator()(const dxRender_Visual* x) { return x == nullptr; }
352352
};

src/Layers/xrRender/ResourceManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ void fix_texture_name(LPSTR fn)
3434
template <class T>
3535
bool reclaim(xr_vector<T*>& vec, const T* ptr)
3636
{
37-
xr_vector<T*>::iterator it = vec.begin();
38-
xr_vector<T*>::iterator end = vec.end();
39-
for (; it != end; it++)
37+
auto it = vec.begin();
38+
auto end = vec.end();
39+
for (; it != end; ++it)
4040
if (*it == ptr)
4141
{
4242
vec.erase(it);

src/Layers/xrRender/ResourceManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class dx10ConstantBuffer;
1919
class ECORE_API CResourceManager
2020
{
2121
private:
22-
struct str_pred : public std::binary_function<char*, char*, bool>
22+
struct str_pred
2323
{
2424
bool operator()(LPCSTR x, LPCSTR y) const { return xr_strcmp(x, y) < 0; }
2525
};

0 commit comments

Comments
 (0)