Skip to content

Commit 34dcd8c

Browse files
committed
Fix -Werror issues with the Clang in r27.
1 parent 3930e39 commit 34dcd8c

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

camera/basic/src/main/cpp/camera_listeners.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ void NDKCamera::OnSessionState(ACameraCaptureSession* ses,
157157
return;
158158
}
159159

160-
ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d", state);
160+
ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d",
161+
static_cast<int>(state));
161162

162163
captureSessionState_ = state;
163164
}

camera/basic/src/main/cpp/camera_manager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ void NDKCamera::StartPreview(bool start) {
394394
ACameraCaptureSession_stopRepeating(captureSession_);
395395
} else {
396396
ASSERT(false, "Conflict states(%s, %d)", (start ? "true" : "false"),
397-
captureSessionState_);
397+
static_cast<int>(captureSessionState_));
398398
}
399399
}
400400

camera/texture-view/src/main/cpp/camera_listeners.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ void NDKCamera::OnSessionState(ACameraCaptureSession* ses,
157157
return;
158158
}
159159

160-
ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d", state);
160+
ASSERT(state < CaptureSessionState::MAX_STATE, "Wrong state %d",
161+
static_cast<int>(state));
161162

162163
captureSessionState_ = state;
163164
}

prefab/curl-ssl/app/src/main/cpp/java_interop.h

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <jni.h>
2020

2121
#include <cstdlib>
22+
#include <functional>
2223
#include <string>
2324
#include <vector>
2425

prefab/prefab-dependency/app/src/main/cpp/java_interop.h

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <jni.h>
2020

2121
#include <cstdlib>
22+
#include <functional>
2223
#include <string>
2324
#include <vector>
2425

teapots/more-teapots/src/main/cpp/MoreTeapotsRenderer.cpp

+12-8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#include <string.h>
2727

28+
#include <vector>
29+
2830
//--------------------------------------------------------------------------------
2931
// Teapot model data
3032
//--------------------------------------------------------------------------------
@@ -152,15 +154,17 @@ void MoreTeapotsRenderer::Init(const int32_t numX, const int32_t numY,
152154
int32_t num_indices;
153155
glGetActiveUniformBlockiv(shader_param_.program_, blockIndex,
154156
GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &num_indices);
155-
GLint i[num_indices];
156-
GLint stride[num_indices];
157+
std::vector<GLint> indices(num_indices);
158+
std::vector<GLint> strides(num_indices);
157159
glGetActiveUniformBlockiv(shader_param_.program_, blockIndex,
158-
GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, i);
159-
glGetActiveUniformsiv(shader_param_.program_, num_indices, (GLuint*)i,
160-
GL_UNIFORM_ARRAY_STRIDE, stride);
161-
162-
ubo_matrix_stride_ = stride[0] / sizeof(float);
163-
ubo_vector_stride_ = stride[2] / sizeof(float);
160+
GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
161+
indices.data());
162+
glGetActiveUniformsiv(shader_param_.program_, num_indices,
163+
(GLuint*)indices.data(), GL_UNIFORM_ARRAY_STRIDE,
164+
strides.data());
165+
166+
ubo_matrix_stride_ = strides.at(0) / sizeof(float);
167+
ubo_vector_stride_ = strides.at(2) / sizeof(float);
164168

165169
glGenBuffers(1, &ubo_);
166170
glBindBuffer(GL_UNIFORM_BUFFER, ubo_);

0 commit comments

Comments
 (0)