Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix -Werror issues with the Clang in r27. #1064

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading