Cleanup: fix compiler warnings

This commit is contained in:
Brecht Van Lommel 2020-01-26 16:35:58 +01:00
parent 34c8ba6d3e
commit 3788901107
12 changed files with 36 additions and 16 deletions

View File

@ -97,6 +97,9 @@ cmake_policy(SET CMP0010 NEW)
# Input directories must have CMakeLists.txt
cmake_policy(SET CMP0014 NEW)
# Silence draco warning on macOS, new policy works fine.
cmake_policy(SET CMP0068 NEW)
#-----------------------------------------------------------------------------
# Load some macros.
include(build_files/cmake/macros.cmake)

View File

@ -249,8 +249,8 @@ namespace lemon {
current = state + length;
register Word *curr = state + length - 1;
register long num;
Word *curr = state + length - 1;
long num;
num = length - shift;
while (num--) {

View File

@ -116,3 +116,18 @@ index c333256..8cc41da 100644
for (uint32_t i = 0; i != mV[l + 1].cols(); ++i) {
Vector2i upper = toUpper.col(i);
diff --git a/extern/quadriflow/3rd/lemon-1.3.1/lemon/random.h b/extern/quadriflow/3rd/lemon-1.3.1/lemon/random.h
index 8de74ede8a9..f9861f39169 100644
--- a/extern/quadriflow/3rd/lemon-1.3.1/lemon/random.h
+++ b/extern/quadriflow/3rd/lemon-1.3.1/lemon/random.h
@@ -249,8 +249,8 @@ namespace lemon {
current = state + length;
- register Word *curr = state + length - 1;
- register long num;
+ Word *curr = state + length - 1;
+ long num;
num = length - shift;
while (num--) {

View File

@ -106,6 +106,7 @@ if(WITH_OPENSUBDIV)
data_to_c_simple(shader/gpu_shader_opensubdiv_fragment.glsl SRC)
add_definitions(-DGLEW_STATIC)
add_definitions(-DOSD_USES_GLEW)
if(WIN32)
add_definitions(-DNOMINMAX)

View File

@ -27,5 +27,10 @@ ScopeTimer::ScopeTimer(const std::string &message) : m_message(message), m_timer
ScopeTimer::~ScopeTimer()
{
std::printf("%s: %fms\n", m_message.c_str(), m_timer.delta());
#if OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER >= 7
double delta = m_timer.milliseconds();
#else
double delta = m_timer.delta(); /* Deprecated in OpenVDB 7. */
#endif
std::printf("%s: %fms\n", m_message.c_str(), delta);
}

View File

@ -416,9 +416,7 @@ static PrefetchJob *seq_prefetch_start(const SeqRenderData *context, float cfra)
pfjob->stop = false;
pfjob->running = true;
if (&pfjob->threads) {
BLI_threadpool_remove(&pfjob->threads, pfjob);
}
BLI_threadpool_remove(&pfjob->threads, pfjob);
BLI_threadpool_insert(&pfjob->threads, pfjob);
return pfjob;

View File

@ -1511,7 +1511,7 @@ void BKE_shrinkwrap_mesh_nearest_surface_deform(struct bContext *C,
{
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
struct Scene *sce = CTX_data_scene(C);
ShrinkwrapModifierData ssmd = {0};
ShrinkwrapModifierData ssmd = {{0}};
ModifierEvalContext ctx = {depsgraph, ob_source, 0};
int totvert;
@ -1532,7 +1532,7 @@ void BKE_shrinkwrap_mesh_nearest_surface_deform(struct bContext *C,
void BKE_shrinkwrap_remesh_target_project(Mesh *src_me, Mesh *target_me, Object *ob_target)
{
ShrinkwrapModifierData ssmd = {0};
ShrinkwrapModifierData ssmd = {{0}};
int totvert;
ssmd.target = ob_target;

View File

@ -1386,7 +1386,7 @@ static void gpencil_primitive_edit_event_handling(
case LEFTMOUSE: {
if ((event->val == KM_RELEASE) && (tgpi->flag == IN_PROGRESS)) {
/* set control points and enter edit mode */
if ((ELEM(tgpi->type, GP_STROKE_POLYLINE))) {
if (ELEM(tgpi->type, GP_STROKE_POLYLINE)) {
gpencil_primitive_add_segment(tgpi);
copy_v2_v2(tgpi->start, tgpi->end);
copy_v2_v2(tgpi->origin, tgpi->start);

View File

@ -309,7 +309,7 @@ static void quadriflow_update_job(void *customdata, float progress, int *cancel)
static Mesh *remesh_symmetry_bisect(Main *bmain, Mesh *mesh, eSymmetryAxes symmetry_axes)
{
MirrorModifierData mmd = {0};
MirrorModifierData mmd = {{0}};
mmd.tolerance = QUADRIFLOW_MIRROR_BISECT_TOLERANCE;
Mesh *mesh_bisect, *mesh_bisect_temp;
@ -343,7 +343,7 @@ static Mesh *remesh_symmetry_bisect(Main *bmain, Mesh *mesh, eSymmetryAxes symme
static Mesh *remesh_symmetry_mirror(Object *ob, Mesh *mesh, eSymmetryAxes symmetry_axes)
{
MirrorModifierData mmd = {0};
MirrorModifierData mmd = {{0}};
mmd.tolerance = QUADRIFLOW_MIRROR_BISECT_TOLERANCE;
Mesh *mesh_mirror, *mesh_mirror_temp;

View File

@ -8379,7 +8379,7 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op))
ED_sculpt_undo_geometry_begin(ob, "mesh symmetrize");
Mesh *mesh = ob->data;
Mesh *mesh_mirror;
MirrorModifierData mmd = {0};
MirrorModifierData mmd = {{0}};
int axis = 0;
mmd.flag = 0;
mmd.tolerance = 0.005f;

View File

@ -449,8 +449,6 @@ void AbstractHierarchyIterator::make_writers(const HierarchyContext *parent_cont
unit_m4(parent_matrix_inv_world);
}
const std::string &parent_export_path = parent_context ? parent_context->export_path : "";
for (HierarchyContext *context : graph_children(parent_context)) {
copy_m4_m4(context->parent_matrix_inv_world, parent_matrix_inv_world);

View File

@ -339,14 +339,14 @@ void WM_msg_subscribe_ID(struct wmMsgBus *mbus,
const wmMsgSubscribeValue *msg_val_params,
const char *id_repr)
{
wmMsgParams_RNA msg_key_params = {NULL};
wmMsgParams_RNA msg_key_params = {{NULL}};
RNA_id_pointer_create(id, &msg_key_params.ptr);
WM_msg_subscribe_rna_params(mbus, &msg_key_params, msg_val_params, id_repr);
}
void WM_msg_publish_ID(struct wmMsgBus *mbus, ID *id)
{
wmMsgParams_RNA msg_key_params = {NULL};
wmMsgParams_RNA msg_key_params = {{NULL}};
RNA_id_pointer_create(id, &msg_key_params.ptr);
WM_msg_publish_rna_params(mbus, &msg_key_params);
}