Remove 'register' keyword in all c++ code.

It's never really done much in c++, was deprecated in c++11 and is reserved since c++17.
Thanks @Maksym Hamarnyk for remdinding me about this.
Note: there are few more register commands in third library .c code. It's still a valid keyword there.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6130 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2020-06-21 11:38:31 +00:00
parent 2c593614cb
commit 54f5ac4982
6 changed files with 46 additions and 46 deletions

@ -243,7 +243,7 @@ namespace core
//! returns if a equals b, taking possible rounding errors into account
template <class T>
inline bool equals(const T a, const T b, const T tolerance = roundingError<T>())
inline bool equals(const T a, const T b, const T tolerance = roundingError<T>())
{
return (a + tolerance >= b) && (a - tolerance <= b);
}
@ -633,7 +633,7 @@ namespace core
return rec;
*/
/*
register u32 x = 0x7F000000 - IR ( p );
u32 x = 0x7F000000 - IR ( p );
const f32 r = FR ( x );
return r * (2.0f - p * r);
*/

@ -878,7 +878,7 @@ static void executeBlit_TextureBlendColor_16_to_16( const SBlitJob * job )
f18 src_x = f18_zero;
for (u32 dx = 0; dx < job->width; ++dx, src_x += wscale)
{
register u16 c0 = src[f18_floor(src_x)];
u16 c0 = src[f18_floor(src_x)];
if (0 == (c0 & 0x8000))
continue;

@ -470,7 +470,7 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
case EVDF_RENDER_TO_TARGET:
case EVDF_MULTITEXTURE:
case EVDF_HARDWARE_TL:
case EVDF_TEXTURE_NSQUARE:
case EVDF_TEXTURE_NSQUARE:
case EVDF_TEXTURE_MATRIX:
on = 1;
break;
@ -894,7 +894,7 @@ const sVec4 CBurningVideoDriver::NDCPlane[6+2] =
REALINLINE size_t CBurningVideoDriver::clipToFrustumTest ( const s4DVertex* v ) const
{
register size_t flag;
size_t flag;
f32 test[8];
const f32 w = - v->Pos.w;
@ -908,7 +908,7 @@ REALINLINE size_t CBurningVideoDriver::clipToFrustumTest ( const s4DVertex* v )
test[3] = -v->Pos.x + w;
test[4] = v->Pos.y + w;
test[5] = -v->Pos.y + w;
const u32* a = F32_AS_U32_POINTER(test);
flag = (a[0] ) >> 31;
flag |= (a[1] & 0x80000000) >> 30;
@ -948,7 +948,7 @@ REALINLINE size_t clipToFrustumTest ( const s4DVertex* v )
flag |= v->Pos.x <= v->Pos.w ? VERTEX4D_CLIP_LEFT : 0;
flag |= -v->Pos.x <= v->Pos.w ? VERTEX4D_CLIP_RIGHT : 0;
flag |= v->Pos.y <= v->Pos.w ? VERTEX4D_CLIP_BOTTOM : 0;
flag |= -v->Pos.y <= v->Pos.w ? VERTEX4D_CLIP_TOP : 0;
@ -1093,7 +1093,7 @@ size_t CBurningVideoDriver::clipToFrustum(const size_t vIn /*, const size_t clip
/*!
Part I:
apply Clip Scale matrix
From Normalized Device Coordiante ( NDC ) Space to Device Coordinate ( DC ) Space
From Normalized Device Coordiante ( NDC ) Space to Device Coordinate ( DC ) Space
Part II:
Project homogeneous vector
@ -1272,7 +1272,7 @@ REALINLINE s32 CBurningVideoDriver::lodFactor_inside(const s4DVertexPair* burnin
ieee754 v[2];
v[0].f = t[0] * t[2];
v[1].f = t[1] * t[3];
//signedArea.f = t[4] > t[5] ? t[4] : t[5];
signedArea.u = v[0].fields.frac > v[1].fields.frac ? v[0].u : v[1].u;
if (signedArea.fields.exp == 0)
@ -1454,7 +1454,7 @@ void CBurningVideoDriver::VertexCache_map_source_format()
Clipper.resize(VERTEXCACHE_ELEMENT * 2);
Clipper_temp.resize(VERTEXCACHE_ELEMENT * 2);
TransformationStack = 0;
memset(TransformationFlag, 0, sizeof(TransformationFlag));
memset(Transformation_ETS_CLIPSCALE, 0, sizeof(Transformation_ETS_CLIPSCALE));
@ -2238,8 +2238,8 @@ void CBurningVideoDriver::drawVertexPrimitiveList(const void* vertices, u32 vert
//collect pointer to face vertices
VertexCache_get(face);
register size_t clipMask_i;
register size_t clipMask_o;
size_t clipMask_i;
size_t clipMask_o;
clipMask_i = face[0]->flag;
clipMask_o = face[0]->flag;
@ -2506,7 +2506,7 @@ void CBurningVideoDriver::setMaterial(const SMaterial& material)
//Material.Fallback_MaterialType = material.MaterialType;
//-----------------
//Material.org = material;
Material.CullFlag = CULL_INVISIBLE | (in.BackfaceCulling ? CULL_BACK : 0) | (in.FrontfaceCulling ? CULL_FRONT : 0);
@ -2536,7 +2536,7 @@ void CBurningVideoDriver::setMaterial(const SMaterial& material)
#endif
//--------------- setCurrentShader
ITexture* texture0 = in.getTexture(0);
ITexture* texture1 = in.getTexture(1);
//ITexture* texture2 = in.getTexture(2);
@ -3179,7 +3179,7 @@ void CBurningVideoDriver::setRenderStates2DMode(const video::SColor& color, vide
{
CurrentShader->setPrimitiveColor(color.color);
}
}
void CBurningVideoDriver::setRenderStates3DMode()
@ -3363,7 +3363,7 @@ void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core
quad_triangle_indexList, 2,
EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);
if (clipRect)
EyeSpace.TL_Flag &= ~TL_SCISSOR;
@ -3491,7 +3491,7 @@ void CBurningVideoDriver::draw3DLine(const core::vector3df& start,
const core::vector3df& end, SColor color_start)
{
SColor color_end = color_start;
VertexCache.primitiveHasVertex = 2;
VertexCache.vType = E4VT_LINE;
@ -3875,7 +3875,7 @@ void CBurningVideoDriver::setBasicRenderStates(const SMaterial& material,
const SMaterial& lastMaterial,
bool resetAllRenderstates)
{
}
//! Return an index constant for the vertex shader based on a name.

@ -85,7 +85,7 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const io::path& name, u32 fl
MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, image->getDimension());
#if defined(IRRLICHT_sRGB)
MipMap[0]->set_sRGB( (Flags & TEXTURE_IS_LINEAR ) ? 0 : image->get_sRGB() );
#endif
#endif
if (!isCompressed)
image->copyTo(MipMap[0]);
}
@ -241,14 +241,14 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* data)
for (i=1; i < 0 && i < SOFTWARE_DRIVER_2_MIPMAPPING_MAX; ++i)
{
/*
static u32 color[] = {
static u32 color[] = {
0x30bf7f00,0x3040bf00,0x30bf00bf,0x3000bf00,
0x300080bf,0x30bf4000,0x300040bf,0x307f00bf,
0x30bf0000,0x3000bfbf,0x304000bf,0x307fbf00,
0x8000bf7f,0x80bf0040,0x80bfbf00,0x800000bf
};
*/
static u32 color[] = {
static u32 color[] = {
0xFFFFFFFF,0xFFFF0000,0xFF00FF00,0xFF0000FF,
0xFFFFFF00,0xFF00FFFF,0xFFFF00FF,0xFF0000FF,
0xFF0000FF,0xFF0000FF,0xFF0000FF,0xFF0000FF,
@ -473,9 +473,9 @@ u32 linear_to_srgb_8bit(const float v)
{
ieee754 c;
c.f = v;
const register size_t x = c.u;
const size_t x = c.u;
const u32 *table = (u32*)srgb_8bit_to_linear_float;
register u32 y = 0;
u32 y = 0;
y += table[y + 128] <= x ? 128 : 0;
y += table[y + 64] <= x ? 64 : 0;
y += table[y + 32] <= x ? 32 : 0;

@ -158,7 +158,7 @@ void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b, int re
if ( dy > dx )
{
//swap
register s32 t;
s32 t;
t = dx;dx=dy;dy=t;
t = xInc0;xInc0=yInc0;yInc0=t;
#ifdef USE_ZBUFFER

@ -182,7 +182,7 @@ static inline s32 s32_log2_s32(u32 in)
}
return ret;
//return s32_log2_f32( (f32) x);
//ieee754 _log2;_log2.f = (f32) in; return _log2.fields.exp - 127;
//ieee754 _log2;_log2.f = (f32) in; return _log2.fields.exp - 127;
}
#if 0
@ -599,11 +599,11 @@ REALINLINE tFixPoint imulFix_tex2(const tFixPoint x, const tFixPoint y)
REALINLINE tFixPoint imulFix_tex4(const tFixPoint x, const tFixPoint y)
{
#ifdef SOFTWARE_DRIVER_2_32BIT
register tFixPoint a = (((tFixPointu)x >> 2)*(((tFixPointu)y + FIX_POINT_ONE) >> 2)) >> (tFixPointu)(FIX_POINT_PRE + 2);
tFixPoint a = (((tFixPointu)x >> 2)*(((tFixPointu)y + FIX_POINT_ONE) >> 2)) >> (tFixPointu)(FIX_POINT_PRE + 2);
#else
register tFixPoint a = (x * (y + FIX_POINT_ONE)) >> (FIX_POINT_PRE + 3);
tFixPoint a = (x * (y + FIX_POINT_ONE)) >> (FIX_POINT_PRE + 3);
#endif
register tFixPoint mask = (a - FIXPOINT_COLOR_MAX) >> 31;
tFixPoint mask = (a - FIXPOINT_COLOR_MAX) >> 31;
return (a & mask) | (FIXPOINT_COLOR_MAX & ~mask);
}
@ -624,7 +624,7 @@ REALINLINE tFixPoint imulFix_tex4(const tFixPoint x, const tFixPoint y)
*/
REALINLINE tFixPoint clampfix_maxcolor ( const tFixPoint a)
{
register tFixPoint c = (a - FIXPOINT_COLOR_MAX) >> 31;
tFixPoint c = (a - FIXPOINT_COLOR_MAX) >> 31;
return (a & c) | ( FIXPOINT_COLOR_MAX & ~c);
}
@ -828,7 +828,7 @@ struct sInternalTexture
// get video sample plain
static inline tVideoSample getTexel_plain ( const sInternalTexture* t, const tFixPointu tx, const tFixPointu ty )
{
register size_t ofs;
size_t ofs;
ofs = ( ( ty & t->textureYMask ) >> FIX_POINT_PRE ) << t->pitchlog2;
ofs |= ( tx & t->textureXMask ) >> ( FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY );
@ -842,13 +842,13 @@ inline void getTexel_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b,
const sInternalTexture* t, const tFixPointu tx, const tFixPointu ty
)
{
register size_t ofs;
size_t ofs;
ofs = ( ((ty + FIX_POINT_ZERO_DOT_FIVE) & t->textureYMask ) >> FIX_POINT_PRE ) << t->pitchlog2;
ofs |= ((tx + FIX_POINT_ZERO_DOT_FIVE) & t->textureXMask ) >> ( FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY );
// texel
register tVideoSample t00;
tVideoSample t00;
t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE);
@ -862,13 +862,13 @@ inline void getTexel_fix(tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint &b,
const sInternalTexture* t, const tFixPointu tx, const tFixPointu ty
)
{
register size_t ofs;
size_t ofs;
ofs = (((ty+ FIX_POINT_ZERO_DOT_FIVE) & t->textureYMask) >> FIX_POINT_PRE) << t->pitchlog2;
ofs |= ((tx+ FIX_POINT_ZERO_DOT_FIVE) & t->textureXMask) >> (FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY);
// texel
register tVideoSample t00;
tVideoSample t00;
t00 = *((tVideoSample*)((u8*)t->data + ofs));
a = (t00 & MASK_A) >> (SHIFT_A - FIX_POINT_PRE);
@ -910,7 +910,7 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
#if 0
if (t->lodFactor > 0)
{
register size_t ofs;
size_t ofs;
ofs = (((ty + FIX_POINT_ZERO_DOT_FIVE) & t->textureYMask) >> FIX_POINT_PRE) << t->pitchlog2;
ofs += ((tx + FIX_POINT_ZERO_DOT_FIVE) & t->textureXMask) >> (FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY);
@ -932,7 +932,7 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
tFixPointu r11, g11, b11;
size_t o0, o1, o2, o3;
register tVideoSample t00;
tVideoSample t00;
//wraps positive (ignoring negative)
o0 = (((ty)& t->textureYMask) >> FIX_POINT_PRE) << t->pitchlog2;
@ -961,8 +961,8 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
b11 = (t00 & MASK_B);
register tFixPointu fracx = tx & FIX_POINT_FRACT_MASK;
register tFixPointu fracy = ty & FIX_POINT_FRACT_MASK;
tFixPointu fracx = tx & FIX_POINT_FRACT_MASK;
tFixPointu fracy = ty & FIX_POINT_FRACT_MASK;
//w00 w01 w10 w11
tFixPointu w[4];
@ -999,11 +999,11 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
if (tex->lodFactor > 1)
{
//nearest neighbor
register size_t ofs;
size_t ofs;
ofs = (((ty + FIX_POINT_ZERO_DOT_FIVE) & tex->textureYMask) >> FIX_POINT_PRE) << tex->pitchlog2;
ofs += ((tx + FIX_POINT_ZERO_DOT_FIVE) & tex->textureXMask) >> (FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY);
register tVideoSample t00;
tVideoSample t00;
t00 = *((tVideoSample*)((u8*)tex->data + ofs));
r = (t00 & MASK_R) >> (SHIFT_R - FIX_POINT_PRE);
@ -1015,8 +1015,8 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
//w00 w01 w10 w11
tFixPointu w[4];
{
register tFixPointu fracx = tx & FIX_POINT_FRACT_MASK;
register tFixPointu fracy = ty & FIX_POINT_FRACT_MASK;
tFixPointu fracx = tx & FIX_POINT_FRACT_MASK;
tFixPointu fracy = ty & FIX_POINT_FRACT_MASK;
w[0] = imulFixu(FIX_POINT_ONE - fracx, FIX_POINT_ONE - fracy);
w[1] = imulFixu(fracx, FIX_POINT_ONE - fracy);
w[2] = imulFixu(FIX_POINT_ONE - fracx, fracy);
@ -1026,7 +1026,7 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
//wraps positive (ignoring negative)
tVideoSample t[4];
{
register size_t o0, o1, o2, o3;
size_t o0, o1, o2, o3;
o0 = (((ty) & tex->textureYMask) >> FIX_POINT_PRE) << tex->pitchlog2;
o1 = (((ty + FIX_POINT_ONE) & tex->textureYMask) >> FIX_POINT_PRE) << tex->pitchlog2;
o2 = ((tx)& tex->textureXMask) >> (unsigned)(FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY);
@ -1068,7 +1068,7 @@ static REALINLINE void getSample_texture(tFixPoint &a, tFixPoint &r, tFixPoint &
tFixPointu a11, r11, g11, b11;
size_t o0, o1, o2, o3;
register tVideoSample t00;
tVideoSample t00;
o0 = (((ty)& tex->textureYMask) >> FIX_POINT_PRE) << tex->pitchlog2;
o1 = (((ty + FIX_POINT_ONE) & tex->textureYMask) >> FIX_POINT_PRE) << tex->pitchlog2;
@ -1142,7 +1142,7 @@ static REALINLINE void getSample_texture(tFixPoint &r, tFixPoint &g, tFixPoint &
const sInternalTexture* burning_restrict t, const tFixPointu tx, const tFixPointu ty
)
{
register size_t ofs;
size_t ofs;
ofs = (((ty + FIX_POINT_ZERO_DOT_FIVE) & t->textureYMask) >> FIX_POINT_PRE) << t->pitchlog2;
ofs += ((tx + FIX_POINT_ZERO_DOT_FIVE) & t->textureXMask) >> (FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY);
@ -1158,7 +1158,7 @@ static REALINLINE void getSample_texture(tFixPoint &a, tFixPoint &r, tFixPoint &
const sInternalTexture* burning_restrict t, const tFixPointu tx, const tFixPointu ty
)
{
register size_t ofs;
size_t ofs;
ofs = (((ty + FIX_POINT_ZERO_DOT_FIVE) & t->textureYMask) >> FIX_POINT_PRE) << t->pitchlog2;
ofs += ((tx + FIX_POINT_ZERO_DOT_FIVE) & t->textureXMask) >> (FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY);