[Bf-blender-cvs] [70ba6d35329] soc-2019-npr: Cleanup: Fix compiler warnings.

YimingWu noreply at git.blender.org
Wed Jul 31 11:14:10 CEST 2019


Commit: 70ba6d35329ea0dd8276616ed182376ef29485e1
Author: YimingWu
Date:   Wed Jul 31 17:13:48 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB70ba6d35329ea0dd8276616ed182376ef29485e1

Cleanup: Fix compiler warnings.

===================================================================

M	source/blender/draw/engines/lanpr/lanpr_access.h
M	source/blender/draw/engines/lanpr/lanpr_all.h
M	source/blender/draw/engines/lanpr/lanpr_dpix.c
M	source/blender/draw/engines/lanpr/lanpr_engine.c
M	source/blender/editors/include/ED_lanpr.h
M	source/blender/editors/include/ED_svg.h
M	source/blender/editors/io/io_svg.c
M	source/blender/editors/lanpr/lanpr_cpu.c
M	source/blender/modifiers/intern/MOD_edgesplit.c

===================================================================

diff --git a/source/blender/draw/engines/lanpr/lanpr_access.h b/source/blender/draw/engines/lanpr/lanpr_access.h
index ed87c3dc9a1..b590250fc56 100644
--- a/source/blender/draw/engines/lanpr/lanpr_access.h
+++ b/source/blender/draw/engines/lanpr/lanpr_access.h
@@ -21,7 +21,4 @@ void lanpr_generate_gpencil_from_chain(Depsgraph *depsgraph,
                                        struct Collection *col,
                                        int types);
 
-bool ED_lanpr_dpix_shader_error(void);
-bool ED_lanpr_disable_edge_splits(struct Scene *s);
-
 #endif
diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h b/source/blender/draw/engines/lanpr/lanpr_all.h
index 5701590c693..e7c8034dca2 100644
--- a/source/blender/draw/engines/lanpr/lanpr_all.h
+++ b/source/blender/draw/engines/lanpr/lanpr_all.h
@@ -253,4 +253,6 @@ void lanpr_snake_draw_scene(LANPR_TextureList *txl,
 
 void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb, int is_render);
 
+int lanpr_dpix_texture_size(SceneLANPR *lanpr);
+
 #endif
diff --git a/source/blender/draw/engines/lanpr/lanpr_dpix.c b/source/blender/draw/engines/lanpr/lanpr_dpix.c
index f1b85b389ad..b5f16f6a7a7 100644
--- a/source/blender/draw/engines/lanpr/lanpr_dpix.c
+++ b/source/blender/draw/engines/lanpr/lanpr_dpix.c
@@ -52,13 +52,8 @@ void lanpr_init_atlas_inputs(void *ved)
   LANPR_Data *vedata = (LANPR_Data *)ved;
   LANPR_TextureList *txl = vedata->txl;
   LANPR_FramebufferList *fbl = vedata->fbl;
-  LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl;
-  DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
 
   const DRWContextState *draw_ctx = DRW_context_state_get();
-  View3D *v3d = draw_ctx->v3d;
-  RegionView3D *rv3d = draw_ctx->rv3d;
-  Object *camera = (rv3d && rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL;
   SceneLANPR *lanpr = &draw_ctx->scene->lanpr;
 
   int texture_size = lanpr_dpix_texture_size(lanpr);
@@ -133,12 +128,12 @@ void lanpr_init_atlas_inputs(void *ved)
     }
   }
 }
-void lanpr_destroy_atlas(void *ved)
+void lanpr_destroy_atlas(void *UNUSED(ved))
 {
   /*  no need to free things, no custom data. */
 }
 
-int lanpr_feed_atlas_data_obj(void *vedata,
+int lanpr_feed_atlas_data_obj(void *UNUSED(vedata),
                               float *AtlasPointsL,
                               float *AtlasPointsR,
                               float *AtlasFaceNormalL,
@@ -147,8 +142,6 @@ int lanpr_feed_atlas_data_obj(void *vedata,
                               Object *ob,
                               int begin_index)
 {
-  LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl;
-
   if (!DRW_object_is_renderable(ob)) {
     return begin_index;
   }
@@ -168,7 +161,7 @@ int lanpr_feed_atlas_data_obj(void *vedata,
   struct BMLoop *l1, *l2;
   FreestyleEdge *fe;
   int CanFindFreestyle = 0;
-  int vert_count = me->totvert, edge_count = me->totedge, face_count = me->totface;
+  int edge_count = me->totedge;
   int i, idx;
 
   int cache_total = lanpr_share.texture_size * lanpr_share.texture_size;
@@ -272,10 +265,6 @@ int lanpr_feed_atlas_data_intersection_cache(void *vedata,
                                              float *AtlasEdgeMask,
                                              int begin_index)
 {
-  LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl;
-  LANPR_PrivateData *pd = stl->g_data;
-  const DRWContextState *draw_ctx = DRW_context_state_get();
-  SceneLANPR *lanpr = &draw_ctx->scene->lanpr;
   LANPR_RenderBuffer *rb = lanpr_share.render_buffer_shared;
   LinkData *lip;
   LANPR_RenderLine *rl;
@@ -326,14 +315,14 @@ int lanpr_feed_atlas_data_intersection_cache(void *vedata,
   return begin_index + i;
 }
 
-void lanpr_dpix_index_to_coord(int index, float *x, float *y)
+static void lanpr_dpix_index_to_coord(int index, float *x, float *y)
 {
   int texture_size = lanpr_share.texture_size;
   (*x) = tnsLinearItp(-1, 1, (float)(index % texture_size + 0.5) / (float)texture_size);
   (*y) = tnsLinearItp(-1, 1, (float)(index / texture_size + 0.5) / (float)texture_size);
 }
 
-void lanpr_dpix_index_to_coord_absolute(int index, float *x, float *y)
+static void lanpr_dpix_index_to_coord_absolute(int index, float *x, float *y)
 {
   int texture_size = lanpr_share.texture_size;
   (*x) = (float)(index % texture_size) + 0.5;
@@ -342,8 +331,6 @@ void lanpr_dpix_index_to_coord_absolute(int index, float *x, float *y)
 
 int lanpr_feed_atlas_trigger_preview_obj(void *vedata, Object *ob, int begin_index)
 {
-  LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl;
-  LANPR_PrivateData *pd = stl->g_data;
   Mesh *me = ob->data;
   if (ob->type != OB_MESH) {
     return begin_index;
@@ -403,10 +390,6 @@ int lanpr_feed_atlas_trigger_preview_obj(void *vedata, Object *ob, int begin_ind
 
 void lanpr_create_atlas_intersection_preview(void *vedata, int begin_index)
 {
-  LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl;
-  LANPR_PrivateData *pd = stl->g_data;
-  const DRWContextState *draw_ctx = DRW_context_state_get();
-  SceneLANPR *lanpr = &draw_ctx->scene->lanpr;
   LANPR_RenderBuffer *rb = lanpr_share.render_buffer_shared;
   float co[2];
   int i;
@@ -484,8 +467,6 @@ void lanpr_dpix_draw_scene(LANPR_TextureList *txl,
   }
   int texw = GPU_texture_width(txl->edge_intermediate),
       texh = GPU_texture_height(txl->edge_intermediate);
-  ;
-  int tsize = texw * texh;
 
   const DRWContextState *draw_ctx = DRW_context_state_get();
   Scene *scene = DEG_get_evaluated_scene(draw_ctx->depsgraph);
diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c
index 429250c3a23..9a105bd7023 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -47,7 +47,7 @@ extern char datatoc_gpu_shader_2D_smooth_color_frag_glsl[];
 LANPR_SharedResource lanpr_share;
 
 void lanpr_calculate_normal_object_vector(LANPR_LineLayer *ll, float *normal_object_direction);
-int lanpr_dpix_texture_size(SceneLANPR *lanpr);
+
 void lanpr_rebuild_all_command(SceneLANPR *lanpr);
 
 static void lanpr_engine_init(void *ved)
@@ -636,7 +636,6 @@ static void lanpr_render_matrices_init(RenderEngine *engine, Depsgraph *depsgrap
 }
 
 int ED_lanpr_compute_feature_lines_internal(Depsgraph *depsgraph, int instersections_only);
-LANPR_RenderBuffer *ED_lanpr_create_render_buffer();
 
 extern DrawEngineType draw_engine_lanpr_type;
 
diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index c536415a9fc..7f78d6088af 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -815,6 +815,8 @@ int ED_lanpr_compute_feature_lines_internal(struct Depsgraph *depsgraph, int ins
 
 void ED_lanpr_destroy_render_data(struct LANPR_RenderBuffer *rb);
 
+LANPR_RenderBuffer *ED_lanpr_create_render_buffer(void);
+
 bool ED_lanpr_dpix_shader_error(void);
 bool ED_lanpr_disable_edge_splits(struct Scene *s);
 
diff --git a/source/blender/editors/include/ED_svg.h b/source/blender/editors/include/ED_svg.h
index 2b0bb3d6c90..eba9c88bf6a 100644
--- a/source/blender/editors/include/ED_svg.h
+++ b/source/blender/editors/include/ED_svg.h
@@ -24,7 +24,13 @@
 #ifndef __ED_SVG_H__
 #define __ED_SVG_H__
 
-bool ED_svg_data_from_lanpr_chain(Text *ta,
+struct Text;
+struct LANPR_RenderBuffer;
+struct LANPR_LineLayer;
+struct bGPdata;
+struct bGPDlayer;
+
+bool ED_svg_data_from_lanpr_chain(struct Text *ta,
                                   struct LANPR_RenderBuffer *rb,
                                   struct LANPR_LineLayer *ll);
 bool ED_svg_data_from_gpencil(struct bGPdata *gpd,
diff --git a/source/blender/editors/io/io_svg.c b/source/blender/editors/io/io_svg.c
index 1cf5d3d8736..83479cce49f 100644
--- a/source/blender/editors/io/io_svg.c
+++ b/source/blender/editors/io/io_svg.c
@@ -40,6 +40,8 @@
 #include "DNA_lanpr_types.h"
 #include "ED_lanpr.h"
 
+#include "ED_svg.h"
+
 #include "DEG_depsgraph.h"
 
 #include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c
index a18f0e394eb..eff394d47f5 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -1926,7 +1926,7 @@ static int lanpr_triangle_line_imagespace_intersection_v2(SpinLock *UNUSED(spl),
   int order[3];
   int LCross = -1, RCross = -1;
   int a, b, c;
-  int StL = 0, StR = 0, In;
+  int StL = 0, StR = 0;
 
   tnsVector3d Lv;
   tnsVector3d Rv;
@@ -2046,9 +2046,10 @@ static int lanpr_triangle_line_imagespace_intersection_v2(SpinLock *UNUSED(spl),
     Cut = tMatGetLinearRatio(rl->l->fbcoord[1], rl->r->fbcoord[1], Trans[1]);
   }
 
+  /*
   In = ED_lanpr_point_inside_triangled(
       Trans, rt->v[0]->fbcoord, rt->v[1]->fbcoord, rt->v[2]->fbcoord);
-
+  */
   if (StL == 2) {
     if (StR == 2) {
       INTERSECT_JUST_SMALLER(is, order, DBL_TRIANGLE_LIM, LCross);
@@ -2415,7 +2416,7 @@ static LANPR_RenderLine *lanpr_triangle_generate_intersection_line_only(
   l->intersecting_with = rt;
   r->intersecting_with = testing;
 
-  /* /*((1 / rl->l->fbcoord[3])*rb->FrameBuffer->H / 2) */
+  /* ((1 / rl->l->fbcoord[3])*rb->FrameBuffer->H / 2) */
 
   Result = mem_static_aquire(&rb->render_data_pool, sizeof(LANPR_RenderLine));
   Result->l = l;
@@ -2692,7 +2693,7 @@ void ED_lanpr_destroy_render_data(LANPR_RenderBuffer *rb)
 
   mem_static_destroy(&rb->render_data_pool);
 }
-LANPR_RenderBuffer *ED_lanpr_create_render_buffer()
+LANPR_RenderBuffer *ED_lanpr_create_render_buffer(void)
 {
   if (lanpr_share.render_buffer_shared) {
     ED_lanpr_destroy_render_data(lanpr_share.render_buffer_shared);
@@ -2868,7 +2869,6 @@ long lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer
 long lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb)
 {
   LANPR_RenderLine *rl;
-  LANPR_RenderLineSegment *rls;
   long Count = 0;
   for (rl = rb->intersection_lines.first; rl; rl = rl->next) {
     Count++;
@@ -2886,9 +2886,6 @@ void *lanpr_make_leveled_edge_vertex_array(LANPR_RenderBuffer *rb,
   LinkData *lip;
   LANPR_RenderLine *rl;
   LANPR_RenderLineSegment *rls, *irls;
-  Object *o;
-  real W = rb->w / 2, H = rb->h / 2;
-  long i = 0;
   float *v = vertexArray;
   floa

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list