Cleanup: fix warnings, removed unused code.

This commit is contained in:
2018-05-02 10:32:01 +02:00
parent bb92edd1c8
commit e684e0ec95
13 changed files with 25 additions and 16 deletions

View File

@@ -232,6 +232,9 @@ bool ccgSubSurf_prepareGLMesh(CCGSubSurf *ss,
CHECK_COMPUTE_TYPE(CUDA)
CHECK_COMPUTE_TYPE(GLSL_TRANSFORM_FEEDBACK)
CHECK_COMPUTE_TYPE(GLSL_COMPUTE)
default:
compute_type = OPENSUBDIV_EVALUATOR_CPU;
break;
#undef CHECK_COMPUTE_TYPE
}
@@ -739,7 +742,7 @@ static void opensubdiv_evaluateNGonFaceGrids(CCGSubSurf *ss,
/* Evaluate edges. */
for (S = 0; S < face->numVerts; S++) {
CCGEdge *edge = FACE_getEdges(face)[S];
int x, S0, S1;
int x, S0 = 0, S1 = 0;
bool flip;
for (x = 0; x < face->numVerts; ++x) {

View File

@@ -1022,7 +1022,7 @@ makebreak:
/* top and top-baseline are the same when text-boxes are used */
if (cu->align_y != CU_ALIGN_Y_TOP && i_textbox < slen) {
/* all previous textboxes are 'full', only align the last used text-box */
float yoff;
float yoff = 0.0f;
int lines;
struct CharTrans *ct_last, *ct_textbox;
@@ -1051,7 +1051,7 @@ makebreak:
else {
/* non text-box case handled separately */
ct = chartransdata;
float yoff;
float yoff = 0.0f;
if (cu->align_y == CU_ALIGN_Y_TOP) {
yoff = -linedist;

View File

@@ -157,6 +157,11 @@ void RenderLayersNode::missingSocketLink(NodeConverter &converter,
operation = value_operation;
break;
}
default:
{
BLI_assert("!Unexpected data type");
return;
}
}
converter.mapOutputSocket(output, operation->getOutputSocket());

View File

@@ -198,7 +198,7 @@ void DEG_graph_build_from_view_layer(Depsgraph *graph,
Scene *scene,
ViewLayer *view_layer)
{
double start_time;
double start_time = 0.0;
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) {
start_time = PIL_check_seconds_timer();
}

View File

@@ -25,7 +25,7 @@
#include "draw_manager.h"
#ifdef DEBUG
#ifndef NDEBUG
/* Maybe gpu_texture.c is a better place for this. */
static bool drw_texture_format_supports_framebuffer(GPUTextureFormat format)
{

View File

@@ -829,7 +829,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
{
Object *obedit;
bArmature *arm;
EditBone *newbone, *ebone, *flipbone, *first = NULL;
EditBone *newbone = NULL, *ebone, *flipbone, *first = NULL;
int a, totbone = 0, do_extrude;
bool forked = RNA_boolean_get(op->ptr, "forked");

View File

@@ -711,7 +711,7 @@ static void curve_draw_exec_precalc(wmOperator *op)
const struct StrokeElem *selem, *selem_first, *selem_last;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
selem_first = BLI_mempool_iterstep(&iter);
selem_first = selem_last = BLI_mempool_iterstep(&iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter)) {
selem_last = selem;
}

View File

@@ -1599,6 +1599,7 @@ static void curve_select_shortest_path_surf(Nurb *nu, int vert_src, int vert_dst
/* init heap */
heap = BLI_heap_new();
vert_curr = data[vert_src].vert;
BLI_heap_insert(heap, 0.0f, &data[vert_src].vert);
data[vert_src].cost = 0.0f;
data[vert_src].vert_prev = vert_src; /* nop */

View File

@@ -212,6 +212,7 @@ eAutoPropButsReturn uiDefAutoButsRNA(
break;
}
case UI_BUT_LABEL_ALIGN_NONE:
default:
col = layout;
name = NULL; /* no smart label alignment, show default name with button */
break;

View File

@@ -553,7 +553,7 @@ UvVertMap *BM_uv_vert_map_create(
BM_ITER_MESH_INDEX (efa, &iter, bm, BM_FACES_OF_MESH, a) {
if ((use_select == false) || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
float (*tf_uv)[2];
float (*tf_uv)[2] = NULL;
if (use_winding) {
tf_uv = (float (*)[2])BLI_buffer_reinit_data(&tf_uv_buf, vec2f, efa->len);
@@ -657,7 +657,7 @@ UvElementMap *BM_uv_element_map_create(
/* vars from original func */
UvElementMap *element_map;
UvElement *buf;
bool *winding;
bool *winding = NULL;
BLI_buffer_declare_static(vec2f, tf_uv_buf, BLI_BUFFER_NOP, BM_DEFAULT_NGON_STACK_SIZE);
MLoopUV *luv;
@@ -698,7 +698,7 @@ UvElementMap *BM_uv_element_map_create(
}
if (!selected || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
float (*tf_uv)[2];
float (*tf_uv)[2] = NULL;
if (use_winding) {
tf_uv = (float (*)[2])BLI_buffer_reinit_data(&tf_uv_buf, vec2f, efa->len);
@@ -1002,7 +1002,7 @@ void EDBM_verts_mirror_cache_begin_ex(
BMesh *bm = em->bm;
BMIter iter;
BMVert *v;
int cd_vmirr_offset;
int cd_vmirr_offset = 0;
int i;
const float maxdist_sq = SQUARE(maxdist);

View File

@@ -676,7 +676,7 @@ MovieTrackingTrack *tracking_marker_check_slide(bContext *C,
* the mouse.
*/
if (sc->flag & SC_SHOW_MARKER_PATTERN) {
int current_corner;
int current_corner = -1;
distance_squared =
mouse_to_closest_pattern_corner_distance_squared(
marker,

View File

@@ -5905,6 +5905,7 @@ static bool bm_loop_calc_opposite_co(BMLoop *l_tmp,
BMLoop *l_last = l_tmp->prev;
BMLoop *l_iter;
float dist = FLT_MAX;
bool found = false;
l_iter = l_first;
do {
@@ -5923,12 +5924,13 @@ static bool bm_loop_calc_opposite_co(BMLoop *l_tmp,
if (tdist < dist) {
copy_v3_v3(r_co, tvec);
dist = tdist;
found = true;
}
}
}
} while ((l_iter = l_iter->next) != l_last);
return (dist != FLT_MAX);
return found;
}
/**

View File

@@ -42,9 +42,6 @@ struct Object;
typedef struct GroupObject {
struct GroupObject *next, *prev;
struct Object *ob;
void *lampren; /* used while render */
short recalc; /* copy of ob->recalc, used to set animated groups OK */
char pad[6];
} GroupObject;