mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-06 10:28:41 +01:00
refactor(sonar): use nullptr literal (cpp:S4962)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,14 +91,14 @@ void gl::framebuffer::blit(framebuffer *src, framebuffer *dst, int sx, int sy, i
|
|||||||
|
|
||||||
{
|
{
|
||||||
GLenum outputs[8] = { GL_NONE };
|
GLenum outputs[8] = { GL_NONE };
|
||||||
outputs[attachment_n] = src != 0 ? attachment : GL_BACK_LEFT;
|
outputs[attachment_n] = src != nullptr ? attachment : GL_BACK_LEFT;
|
||||||
|
|
||||||
glReadBuffer(attachment);
|
glReadBuffer(attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GLenum outputs[8] = { GL_NONE };
|
GLenum outputs[8] = { GL_NONE };
|
||||||
outputs[attachment_n] = dst != 0 ? attachment : GL_BACK_LEFT;
|
outputs[attachment_n] = dst != nullptr ? attachment : GL_BACK_LEFT;
|
||||||
|
|
||||||
glDrawBuffers(attachment_n + 1, outputs);
|
glDrawBuffers(attachment_n + 1, outputs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ void gl::pbo::request_read(int x, int y, int lx, int ly, int pixsize, GLenum for
|
|||||||
sync.reset();
|
sync.reset();
|
||||||
|
|
||||||
bind(PIXEL_PACK_BUFFER);
|
bind(PIXEL_PACK_BUFFER);
|
||||||
glReadPixels(x, y, lx, ly, format, type, 0);
|
glReadPixels(x, y, lx, ly, format, type, nullptr);
|
||||||
unbind(PIXEL_PACK_BUFFER);
|
unbind(PIXEL_PACK_BUFFER);
|
||||||
|
|
||||||
sync.emplace();
|
sync.emplace();
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ gl::shader::shader(const std::string &filename)
|
|||||||
const GLchar *cstr = source.second.c_str();
|
const GLchar *cstr = source.second.c_str();
|
||||||
|
|
||||||
**this = glCreateShader(source.first);
|
**this = glCreateShader(source.first);
|
||||||
glShaderSource(*this, 1, &cstr, 0);
|
glShaderSource(*this, 1, &cstr, nullptr);
|
||||||
glCompileShader(*this);
|
glCompileShader(*this);
|
||||||
|
|
||||||
GLint status;
|
GLint status;
|
||||||
@@ -321,7 +321,7 @@ gl::shader::shader(const std::string &filename)
|
|||||||
if (!status)
|
if (!status)
|
||||||
{
|
{
|
||||||
GLchar info[512];
|
GLchar info[512];
|
||||||
glGetShaderInfoLog(*this, 512, 0, info);
|
glGetShaderInfoLog(*this, 512, nullptr, info);
|
||||||
log_error(std::string(info));
|
log_error(std::string(info));
|
||||||
|
|
||||||
throw shader_exception("failed to compile " + filename + ": " + std::string(info));
|
throw shader_exception("failed to compile " + filename + ": " + std::string(info));
|
||||||
@@ -395,7 +395,7 @@ void gl::program::link()
|
|||||||
if (!status)
|
if (!status)
|
||||||
{
|
{
|
||||||
GLchar info[512];
|
GLchar info[512];
|
||||||
glGetProgramInfoLog(*this, 512, 0, info);
|
glGetProgramInfoLog(*this, 512, nullptr, info);
|
||||||
throw shader_exception("failed to link program: " + std::string(info));
|
throw shader_exception("failed to link program: " + std::string(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ OnCommandGet(multiplayer::DaneRozkaz *pRozkaz)
|
|||||||
if( event != nullptr ) {
|
if( event != nullptr ) {
|
||||||
if( typeid(*event) == typeid(multi_event)
|
if( typeid(*event) == typeid(multi_event)
|
||||||
|| typeid(*event) == typeid(lights_event)
|
|| typeid(*event) == typeid(lights_event)
|
||||||
|| event->m_sibling != 0 ) {
|
|| event->m_sibling != nullptr ) {
|
||||||
// tylko jawne albo niejawne Multiple
|
// tylko jawne albo niejawne Multiple
|
||||||
command_relay relay;
|
command_relay relay;
|
||||||
relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &event->name());
|
relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &event->name());
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ void python_taskqueue::exit()
|
|||||||
auto python_taskqueue::insert(task_request const &Task) -> bool
|
auto python_taskqueue::insert(task_request const &Task) -> bool
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!m_initialized || false == Global.python_enabled || Task.renderer.empty() || Task.input == nullptr || Task.target == 0)
|
if (!m_initialized || false == Global.python_enabled || Task.renderer.empty() || Task.input == nullptr || Task.target == nullptr)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user