Skip to content

Commit 3259d29

Browse files
committed
Fix clang-tidy warnings
1 parent e916a59 commit 3259d29

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
assets/models/
2-
build/
3-
screenshots/
4-
.vs/
5-
.vscode/
6-
CMakeSettings.json
7-
*.cap
1+
/assets/models/
2+
/build/
3+
/out/
4+
/screenshots/
5+
/.vs/
6+
*/.vscode/
7+
/CMakeSettings.json
8+
/*.cap

src/Cluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void Cluster::initialize(int _argc, char* _argv[])
121121
{ { 5.0f, 0.3f, 0.0f }, { 100.0f, 100.0f, 100.0f } }
122122
};
123123
scene->pointLights.update();
124-
config->lights = scene->pointLights.lights.size();
124+
config->lights = (int)scene->pointLights.lights.size();
125125

126126
frameNumber = 0;
127127
}

src/Renderer/Renderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
bgfx::VertexDecl Renderer::PosVertex::decl;
1616

1717
Renderer::Renderer(const Scene* scene) :
18+
buffers(nullptr),
19+
frameBuffer(BGFX_INVALID_HANDLE),
1820
tonemappingMode(TonemappingMode::NONE),
1921
scene(scene),
2022
width(0),
@@ -23,7 +25,6 @@ Renderer::Renderer(const Scene* scene) :
2325
time(0.0f),
2426
viewMat(1.0f),
2527
projMat(1.0f),
26-
frameBuffer(BGFX_INVALID_HANDLE),
2728
blitTriangleBuffer(BGFX_INVALID_HANDLE),
2829
blitProgram(BGFX_INVALID_HANDLE),
2930
blitSampler(BGFX_INVALID_HANDLE),

src/Renderer/Renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Renderer
5555
const char* name;
5656
};
5757

58-
TextureBuffer* buffers = nullptr;
58+
TextureBuffer* buffers;
5959

6060
// final output
6161
// used for tonemapping, screenshots

src/Scene/Scene.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ Mesh Scene::loadMesh(const aiMesh* mesh)
243243
const bgfx::Memory* iMem = bgfx::alloc(mesh->mNumFaces * 3 * sizeof(uint16_t));
244244
uint16_t* indices = (uint16_t*)iMem->data;
245245

246-
const aiFace* faces = mesh->mFaces;
247246
for(unsigned int i = 0; i < mesh->mNumFaces; i++)
248247
{
249248
assert(mesh->mFaces[i].mNumIndices == 3);

src/UI.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void ClusterUI::initialize()
6565
iconsConfig.PixelSnapH = true;
6666
iconsConfig.OversampleH = 1;
6767
iconsConfig.OversampleV = 1;
68-
ImFont* iconFont = io.Fonts->AddFontFromFileTTF(iconFontFile, 13.0f, &iconsConfig);
68+
io.Fonts->AddFontFromFileTTF(iconFontFile, 13.0f, &iconsConfig);
6969

7070
// Generate font texture
7171
unsigned char* tex_data = nullptr;
@@ -79,7 +79,7 @@ void ClusterUI::initialize()
7979
bgfx::TextureFormat::RGBA8,
8080
0,
8181
bgfx::copy(tex_data, tex_w * tex_h * bytes));
82-
io.Fonts->SetTexID((ImTextureID)fontTexture.idx);
82+
io.Fonts->SetTexID((ImTextureID)(uintptr_t)fontTexture.idx);
8383
}
8484

8585
void ClusterUI::update(float dt)
@@ -395,7 +395,7 @@ void ClusterUI::update(float dt)
395395

396396
for(size_t i = 0; buffers[i].name != nullptr; i++)
397397
{
398-
ImGui::Text(buffers[i].name);
398+
ImGui::Text("%s", buffers[i].name);
399399
ImTextureID texId = ImTextureID(uintptr_t(buffers[i].handle.idx));
400400
ImVec2 texSize = io.DisplaySize;
401401
texSize = { 128.0f, 128.0f };

0 commit comments

Comments
 (0)