Skip to content

Commit 042ebe8

Browse files
committed
Cleanup.
1 parent f6baa4b commit 042ebe8

31 files changed

+110
-110
lines changed

examples/01-cubes/cubes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static const uint64_t s_ptState[]
120120
BGFX_STATE_PT_LINESTRIP,
121121
BGFX_STATE_PT_POINTS,
122122
};
123-
BX_STATIC_ASSERT(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) );
123+
static_assert(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) );
124124

125125
class ExampleCubes : public entry::AppI
126126
{

examples/08-update/update.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static PosTexcoordVertex s_cubeVertices[] =
7777
{-1.0f, -1.0f, 1.0f, -2.0f, -2.0f, 2.0f },
7878
{ 1.0f, -1.0f, 1.0f, 2.0f, -2.0f, 2.0f },
7979
};
80-
BX_STATIC_ASSERT(BX_COUNTOF(s_cubeVertices) == 28);
80+
static_assert(BX_COUNTOF(s_cubeVertices) == 28);
8181

8282
static const uint16_t s_cubeIndices[] =
8383
{
@@ -99,7 +99,7 @@ static const uint16_t s_cubeIndices[] =
9999
20, 22, 21, // 10
100100
21, 22, 23,
101101
};
102-
BX_STATIC_ASSERT(BX_COUNTOF(s_cubeIndices) == 36);
102+
static_assert(BX_COUNTOF(s_cubeIndices) == 36);
103103

104104
bx::Vec3 s_faceColors[] =
105105
{
@@ -295,7 +295,7 @@ class ExampleUpdate : public entry::AppI
295295
m_textures[22] = loadTextureWithUpdate("textures/texture_compression_atci.dds");
296296
m_textures[23] = loadTextureWithUpdate("textures/texture_compression_atce.dds");
297297

298-
BX_STATIC_ASSERT(24 == BX_COUNTOF(m_textures));
298+
static_assert(24 == BX_COUNTOF(m_textures));
299299

300300
const bgfx::Caps* caps = bgfx::getCaps();
301301
m_texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D);
@@ -754,7 +754,7 @@ class ExampleUpdate : public entry::AppI
754754
"compute",
755755
"frameBuffer",
756756
};
757-
BX_STATIC_ASSERT(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube));
757+
static_assert(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube));
758758

759759
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textureCube); ++ii)
760760
{
@@ -847,7 +847,7 @@ class ExampleUpdate : public entry::AppI
847847
"update\natci",
848848
"update\natce",
849849
};
850-
BX_STATIC_ASSERT(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures));
850+
static_assert(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures));
851851

852852
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
853853
{
@@ -878,7 +878,7 @@ class ExampleUpdate : public entry::AppI
878878
"Tex3D R16F",
879879
"Tex3D R32F",
880880
};
881-
BX_STATIC_ASSERT(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d));
881+
static_assert(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d));
882882

883883
for (uint32_t ii = 0; ii < m_numTextures3d; ++ii)
884884
{

examples/32-particles/particles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static const char* s_easeFuncName[] =
8181
"InOutBounce",
8282
"OutInBounce",
8383
};
84-
BX_STATIC_ASSERT(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count);
84+
static_assert(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count);
8585

8686
struct Emitter
8787
{

examples/43-denoise/denoise.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ class ExampleDenoise : public entry::AppI
527527
m_temporaryColor.m_buffer,
528528
m_currentColor.m_buffer,
529529
};
530-
BX_STATIC_ASSERT(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES);
530+
static_assert(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES);
531531

532532
const uint32_t denoisePasses = bx::min(DENOISE_MAX_PASSES, m_denoisePasses);
533533

examples/common/debugdraw/debugdraw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ struct DebugDrawEncoderImpl
15051505
}
15061506
else
15071507
{
1508-
BX_STATIC_ASSERT(sizeof(DdVertex) == sizeof(bx::Vec3), "");
1508+
static_assert(sizeof(DdVertex) == sizeof(bx::Vec3), "");
15091509

15101510
uint64_t old = attrib.m_state;
15111511
attrib.m_state &= ~BGFX_STATE_CULL_MASK;
@@ -2241,7 +2241,7 @@ struct DebugDrawEncoderImpl
22412241
static const uint32_t kCacheSize = 1024;
22422242
static const uint32_t kStackSize = 16;
22432243
static const uint32_t kCacheQuadSize = 1024;
2244-
BX_STATIC_ASSERT(kCacheSize >= 3, "Cache must be at least 3 elements.");
2244+
static_assert(kCacheSize >= 3, "Cache must be at least 3 elements.");
22452245

22462246
DebugVertex m_cache[kCacheSize+1];
22472247
DebugUvVertex m_cacheQuad[kCacheQuadSize];
@@ -2281,7 +2281,7 @@ struct DebugDrawEncoderImpl
22812281
};
22822282

22832283
static DebugDrawEncoderImpl s_dde;
2284-
BX_STATIC_ASSERT(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match");
2284+
static_assert(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match");
22852285

22862286
void ddInit(bx::AllocatorI* _allocator)
22872287
{

examples/common/entry/dialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ s_getFileNameA[] =
118118
{ GetOpenFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 | /* OFN_FILEMUSTEXIST */ 0x00001000 },
119119
{ GetSaveFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 },
120120
};
121-
BX_STATIC_ASSERT(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count);
121+
static_assert(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count);
122122
#endif
123123

124124
#if !BX_PLATFORM_OSX

examples/common/entry/entry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
185185
"GamepadStart",
186186
"GamepadGuide",
187187
};
188-
BX_STATIC_ASSERT(Key::Count == BX_COUNTOF(s_keyName) );
188+
static_assert(Key::Count == BX_COUNTOF(s_keyName) );
189189

190190
const char* getName(Key::Enum _key)
191191
{
@@ -455,7 +455,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
455455

456456
AppI::AppI(const char* _name, const char* _description, const char* _url)
457457
{
458-
BX_STATIC_ASSERT(sizeof(AppInternal) <= sizeof(m_internal) );
458+
static_assert(sizeof(AppInternal) <= sizeof(m_internal) );
459459
s_offset = BX_OFFSETOF(AppI, m_internal);
460460

461461
AppInternal* ai = (AppInternal*)m_internal;

examples/common/entry/entry_x11.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace entry
8181
{ Key::GamepadUp, Key::GamepadDown },
8282
{ Key::None, Key::None },
8383
};
84-
BX_STATIC_ASSERT(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
84+
static_assert(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
8585

8686
struct Joystick
8787
{

scripts/temp.bgfx.idl.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
#define BGFX_C99_ENUM_CHECK(_enum, _c99enumcount) \
16-
BX_STATIC_ASSERT(_enum::Count == _enum::Enum(_c99enumcount) )
16+
static_assert(_enum::Count == _enum::Enum(_c99enumcount) )
1717

1818
BGFX_C99_ENUM_CHECK(bgfx::Fatal, BGFX_FATAL_COUNT);
1919
BGFX_C99_ENUM_CHECK(bgfx::RendererType, BGFX_RENDERER_TYPE_COUNT);
@@ -30,7 +30,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT);
3030
#undef BGFX_C99_ENUM_CHECK
3131

3232
#define BGFX_C99_STRUCT_SIZE_CHECK(_cppstruct, _c99struct) \
33-
BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) )
33+
static_assert(sizeof(_cppstruct) == sizeof(_c99struct) )
3434

3535
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t);
3636
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t);

src/bgfx.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ namespace bgfx
330330
{ "VL", "VertexLayout" },
331331
{ "?", "?" },
332332
};
333-
BX_STATIC_ASSERT(BX_COUNTOF(s_typeName) == Handle::Count+1, "");
333+
static_assert(BX_COUNTOF(s_typeName) == Handle::Count+1, "");
334334

335335
const Handle::TypeName& Handle::getTypeName(Handle::Enum _enum)
336336
{
@@ -748,7 +748,7 @@ namespace bgfx
748748
0xff4fe9fc, // Yellow
749749
0xffeceeee, // White
750750
};
751-
BX_STATIC_ASSERT(BX_COUNTOF(s_paletteSrgb) == 16);
751+
static_assert(BX_COUNTOF(s_paletteSrgb) == 16);
752752

753753
static const uint32_t s_paletteLinear[] =
754754
{
@@ -769,7 +769,7 @@ namespace bgfx
769769
0xff13cff8, // Yellow
770770
0xffd5dada // White
771771
};
772-
BX_STATIC_ASSERT(BX_COUNTOF(s_paletteLinear) == 16);
772+
static_assert(BX_COUNTOF(s_paletteLinear) == 16);
773773

774774
void blit(RendererContextI* _renderCtx, TextVideoMemBlitter& _blitter, const TextVideoMem& _mem)
775775
{
@@ -948,7 +948,7 @@ namespace bgfx
948948
"mat3",
949949
"mat4",
950950
};
951-
BX_STATIC_ASSERT(UniformType::Count == BX_COUNTOF(s_uniformTypeName) );
951+
static_assert(UniformType::Count == BX_COUNTOF(s_uniformTypeName) );
952952

953953
const char* getUniformTypeName(UniformType::Enum _enum)
954954
{
@@ -1824,7 +1824,7 @@ namespace bgfx
18241824
"LineStrip",
18251825
"Points",
18261826
};
1827-
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_topologyName) );
1827+
static_assert(Topology::Count == BX_COUNTOF(s_topologyName) );
18281828

18291829
const char* getName(Topology::Enum _topology)
18301830
{
@@ -2656,7 +2656,7 @@ namespace bgfx
26562656
{ gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL
26572657
{ vk::rendererCreate, vk::rendererDestroy, BGFX_RENDERER_VULKAN_NAME, !!BGFX_CONFIG_RENDERER_VULKAN }, // Vulkan
26582658
};
2659-
BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
2659+
static_assert(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
26602660

26612661
bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build)
26622662
{
@@ -5612,7 +5612,7 @@ extern "C"
56125612
#endif // BGFX_CONFIG_PREFER_DISCRETE_GPU
56135613

56145614
#define BGFX_TEXTURE_FORMAT_BIMG(_fmt) \
5615-
BX_STATIC_ASSERT(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) )
5615+
static_assert(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) )
56165616

56175617
BGFX_TEXTURE_FORMAT_BIMG(BC1);
56185618
BGFX_TEXTURE_FORMAT_BIMG(BC2);
@@ -5718,29 +5718,29 @@ BGFX_TEXTURE_FORMAT_BIMG(Count);
57185718

57195719
#define FLAGS_MASK_TEST(_flags, _mask) ( (_flags) == ( (_flags) & (_mask) ) )
57205720

5721-
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
5721+
static_assert(FLAGS_MASK_TEST(0
57225722
| BGFX_SAMPLER_INTERNAL_DEFAULT
57235723
| BGFX_SAMPLER_INTERNAL_SHARED
57245724
, BGFX_SAMPLER_RESERVED_MASK
57255725
) );
57265726

5727-
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
5727+
static_assert(FLAGS_MASK_TEST(0
57285728
| BGFX_RESET_INTERNAL_FORCE
57295729
, BGFX_RESET_RESERVED_MASK
57305730
) );
57315731

5732-
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
5732+
static_assert(FLAGS_MASK_TEST(0
57335733
| BGFX_STATE_INTERNAL_SCISSOR
57345734
| BGFX_STATE_INTERNAL_OCCLUSION_QUERY
57355735
, BGFX_STATE_RESERVED_MASK
57365736
) );
57375737

5738-
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
5738+
static_assert(FLAGS_MASK_TEST(0
57395739
| BGFX_SUBMIT_INTERNAL_OCCLUSION_VISIBLE
57405740
, BGFX_SUBMIT_INTERNAL_RESERVED_MASK
57415741
) );
57425742

5743-
BX_STATIC_ASSERT( (0
5743+
static_assert( (0
57445744
| BGFX_STATE_ALPHA_REF_MASK
57455745
| BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
57465746
| BGFX_STATE_BLEND_EQUATION_MASK
@@ -5774,9 +5774,9 @@ BX_STATIC_ASSERT( (0
57745774
^ BGFX_STATE_WRITE_MASK
57755775
) );
57765776

5777-
BX_STATIC_ASSERT(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) );
5777+
static_assert(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) );
57785778

5779-
BX_STATIC_ASSERT( (0
5779+
static_assert( (0
57805780
| BGFX_CAPS_ALPHA_TO_COVERAGE
57815781
| BGFX_CAPS_BLEND_INDEPENDENT
57825782
| BGFX_CAPS_COMPUTE

0 commit comments

Comments
 (0)