Browse Source

Initialize raw pointers as nullptr

master
Riyyi 3 years ago
parent
commit
7401936016
  1. 2
      inferno/src/inferno/component/luascriptcomponent.h
  2. 2
      inferno/src/inferno/component/nativescriptcomponent.h
  3. 2
      inferno/src/inferno/io/log.h
  4. 2
      inferno/src/inferno/render/context.h
  5. 12
      inferno/src/inferno/render/renderer.h
  6. 2
      inferno/src/inferno/script/cameracontroller.h
  7. 6
      inferno/src/inferno/script/luascript.h
  8. 6
      inferno/src/inferno/script/nativescript.h
  9. 2
      inferno/src/inferno/system/scriptsystem.h

2
inferno/src/inferno/component/luascriptcomponent.h

@ -9,7 +9,7 @@ namespace Inferno {
class LuaScript;
struct LuaScriptComponent {
LuaScript* instance = nullptr;
LuaScript* instance { nullptr };
std::string path;
// Dont allow manually setting instance during construction

2
inferno/src/inferno/component/nativescriptcomponent.h

@ -7,7 +7,7 @@
namespace Inferno {
struct NativeScriptComponent {
NativeScript* instance = nullptr;
NativeScript* instance { nullptr };
NativeScript* (*initialize)();

2
inferno/src/inferno/io/log.h

@ -111,7 +111,7 @@ namespace Inferno {
virtual ~StringLogStream() override;
private:
std::string* m_fill;
std::string* m_fill { nullptr };
};
// -----------------------------------------

2
inferno/src/inferno/render/context.h

@ -16,7 +16,7 @@ namespace Inferno {
void setCurrent();
private:
GLFWwindow* m_window;
GLFWwindow* m_window { nullptr };
};
}

12
inferno/src/inferno/render/renderer.h

@ -88,8 +88,8 @@ namespace Inferno {
std::array<std::shared_ptr<Texture>, textureUnitPerBatch> m_textureUnits;
// GPU objects
std::shared_ptr<Shader> m_shader = nullptr;
std::shared_ptr<VertexArray> m_vertexArray = nullptr;
std::shared_ptr<Shader> m_shader;
std::shared_ptr<VertexArray> m_vertexArray;
};
// -----------------------------------------
@ -122,8 +122,8 @@ namespace Inferno {
void nextBatch() override;
// CPU quad vertices
std::unique_ptr<QuadVertex[]> m_vertexBufferBase = nullptr;
QuadVertex* m_vertexBufferPtr = nullptr;
std::unique_ptr<QuadVertex[]> m_vertexBufferBase;
QuadVertex* m_vertexBufferPtr { nullptr };
// Default quad vertex positions
glm::vec4 m_vertexPositions[vertexPerQuad];
@ -156,8 +156,8 @@ namespace Inferno {
void nextBatch() override;
// CPU quad vertices
std::unique_ptr<CharacterVertex[]> m_vertexBufferBase = nullptr;
CharacterVertex* m_vertexBufferPtr = nullptr;
std::unique_ptr<CharacterVertex[]> m_vertexBufferBase;
CharacterVertex* m_vertexBufferPtr { nullptr };
};
}

2
inferno/src/inferno/script/cameracontroller.h

@ -31,7 +31,7 @@ namespace Inferno {
void updatePerspective(float deltaTime);
private:
CameraComponent* m_camera;
CameraComponent* m_camera { nullptr };
};
}

6
inferno/src/inferno/script/luascript.h

@ -45,9 +45,9 @@ namespace Inferno {
sol::state m_state;
std::string m_path = "";
Scene* m_scene = nullptr;
uint32_t m_entity = 0;
TransformComponent* transform = nullptr;
Scene* m_scene { nullptr };
uint32_t m_entity { 0 };
TransformComponent* transform { nullptr };
friend class ScriptSystem;
};

6
inferno/src/inferno/script/nativescript.h

@ -22,11 +22,11 @@ namespace Inferno {
return m_scene->getComponent<T>(m_entity);
}
TransformComponent* transform = nullptr;
TransformComponent* transform { nullptr };
private:
Scene* m_scene = nullptr;
uint32_t m_entity = 0;
Scene* m_scene { nullptr };
uint32_t m_entity { 0 };
friend class ScriptSystem;
};

2
inferno/src/inferno/system/scriptsystem.h

@ -26,7 +26,7 @@ namespace Inferno {
void setScene(Scene* scene) { m_scene = scene; }
private:
Scene* m_scene;
Scene* m_scene { nullptr };
};
}

Loading…
Cancel
Save