[tidy] Check modernize-use-nullptr
Ref: http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
@@ -19,7 +19,7 @@ gl::glProc HeadlessView::initializeExtension(const char* name) {
|
||||
}
|
||||
|
||||
void HeadlessView::createContext() {
|
||||
CGLError error = CGLCreateContext(display->pixelFormat, NULL, &glContext);
|
||||
CGLError error = CGLCreateContext(display->pixelFormat, nullptr, &glContext);
|
||||
if (error != kCGLNoError) {
|
||||
throw std::runtime_error(std::string("Error creating GL context object:") + CGLErrorString(error) + "\n");
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
|
||||
: fullscreen(fullscreen_), benchmark(benchmark_) {
|
||||
glfwSetErrorCallback(glfwError);
|
||||
|
||||
std::srand(std::time(0));
|
||||
std::srand(std::time(nullptr));
|
||||
|
||||
if (!glfwInit()) {
|
||||
mbgl::Log::Error(mbgl::Event::OpenGL, "failed to initialize glfw");
|
||||
@@ -55,7 +55,7 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
|
||||
glfwWindowHint(GLFW_STENCIL_BITS, 8);
|
||||
glfwWindowHint(GLFW_DEPTH_BITS, 16);
|
||||
|
||||
window = glfwCreateWindow(width, height, "Mapbox GL", monitor, NULL);
|
||||
window = glfwCreateWindow(width, height, "Mapbox GL", monitor, nullptr);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
mbgl::Log::Error(mbgl::Event::OpenGL, "failed to initialize window");
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
const char *bound_shader_name = "";
|
||||
GLuint bound_vertex_buffer = 0;
|
||||
GLuint bound_elements_buffer = 0;
|
||||
GLbyte *bound_offset = 0;
|
||||
GLbyte *bound_offset = nullptr;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
MBGL_CHECK_ERROR(glUseProgram(program));
|
||||
MBGL_CHECK_ERROR(glBindBuffer(GL_ARRAY_BUFFER, buffer));
|
||||
MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_pos));
|
||||
MBGL_CHECK_ERROR(glVertexAttribPointer(a_pos, 2, GL_FLOAT, GL_FALSE, 0, NULL));
|
||||
MBGL_CHECK_ERROR(glVertexAttribPointer(a_pos, 2, GL_FLOAT, GL_FALSE, 0, nullptr));
|
||||
MBGL_CHECK_ERROR(glDisable(GL_STENCIL_TEST));
|
||||
MBGL_CHECK_ERROR(glDisable(GL_DEPTH_TEST));
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
|
||||
|
||||
Reference in New Issue
Block a user