Skip to content

Commit

Permalink
Fix -Werror issues with the Clang in r27.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanAlbert committed Jun 4, 2024
1 parent 3930e39 commit 34dcd8c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion camera/basic/src/main/cpp/camera_listeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ void NDKCamera::OnSessionState(ACameraCaptureSession* ses,
return;
}

ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d", state);
ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d",
static_cast<int>(state));

captureSessionState_ = state;
}
Expand Down
2 changes: 1 addition & 1 deletion camera/basic/src/main/cpp/camera_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void NDKCamera::StartPreview(bool start) {
ACameraCaptureSession_stopRepeating(captureSession_);
} else {
ASSERT(false, "Conflict states(%s, %d)", (start ? "true" : "false"),
captureSessionState_);
static_cast<int>(captureSessionState_));
}
}

Expand Down
3 changes: 2 additions & 1 deletion camera/texture-view/src/main/cpp/camera_listeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ void NDKCamera::OnSessionState(ACameraCaptureSession* ses,
return;
}

ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d", state);
ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d",
static_cast<int>(state));

captureSessionState_ = state;
}
Expand Down
1 change: 1 addition & 0 deletions prefab/curl-ssl/app/src/main/cpp/java_interop.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <jni.h>

#include <cstdlib>
#include <functional>
#include <string>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions prefab/prefab-dependency/app/src/main/cpp/java_interop.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <jni.h>

#include <cstdlib>
#include <functional>
#include <string>
#include <vector>

Expand Down
20 changes: 12 additions & 8 deletions teapots/more-teapots/src/main/cpp/MoreTeapotsRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <string.h>

#include <vector>

//--------------------------------------------------------------------------------
// Teapot model data
//--------------------------------------------------------------------------------
Expand Down Expand Up @@ -152,15 +154,17 @@ void MoreTeapotsRenderer::Init(const int32_t numX, const int32_t numY,
int32_t num_indices;
glGetActiveUniformBlockiv(shader_param_.program_, blockIndex,
GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &num_indices);
GLint i[num_indices];
GLint stride[num_indices];
std::vector<GLint> indices(num_indices);
std::vector<GLint> strides(num_indices);
glGetActiveUniformBlockiv(shader_param_.program_, blockIndex,
GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, i);
glGetActiveUniformsiv(shader_param_.program_, num_indices, (GLuint*)i,
GL_UNIFORM_ARRAY_STRIDE, stride);

ubo_matrix_stride_ = stride[0] / sizeof(float);
ubo_vector_stride_ = stride[2] / sizeof(float);
GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
indices.data());
glGetActiveUniformsiv(shader_param_.program_, num_indices,
(GLuint*)indices.data(), GL_UNIFORM_ARRAY_STRIDE,
strides.data());

ubo_matrix_stride_ = strides.at(0) / sizeof(float);
ubo_vector_stride_ = strides.at(2) / sizeof(float);

glGenBuffers(1, &ubo_);
glBindBuffer(GL_UNIFORM_BUFFER, ubo_);
Expand Down

0 comments on commit 34dcd8c

Please sign in to comment.