Commit 3275b05a authored by Barak Itkin's avatar Barak Itkin
Browse files

Fix the code to remove compiler warnings

parent f84a747f
......@@ -99,7 +99,7 @@ in_range(gint val,gint min,gint max)
}
static inline gfloat
sc_sample_alpha (GeglBuffer *buf, gint x, gint y, Babl *format)
sc_sample_alpha (GeglBuffer *buf, gint x, gint y, const Babl *format)
{
gfloat col[4] = {0, 0, 0, 0};
gegl_buffer_sample (buf, x, y, NULL, col, format, GEGL_SAMPLER_NEAREST);
......@@ -107,10 +107,10 @@ sc_sample_alpha (GeglBuffer *buf, gint x, gint y, Babl *format)
}
static inline gboolean
is_opaque (GeglRectangle *rect,
GeglBuffer *pixels,
Babl *format,
ScPoint *pt)
is_opaque (const GeglRectangle *rect,
GeglBuffer *pixels,
const Babl *format,
const ScPoint *pt)
{
g_assert (pt != NULL);
g_assert (rect != NULL);
......@@ -135,12 +135,12 @@ is_opaque (GeglRectangle *rect,
* 5. Return the result - moving by Dprev
*/
static inline OUTLINE_DIRECTION
outline_walk_cw (GeglRectangle *rect,
GeglBuffer *pixels,
Babl *format,
OUTLINE_DIRECTION prevdirection,
ScPoint *pt,
ScPoint *dest)
outline_walk_cw (const GeglRectangle *rect,
GeglBuffer *pixels,
const Babl *format,
OUTLINE_DIRECTION prevdirection,
ScPoint *pt,
ScPoint *dest)
{
OUTLINE_DIRECTION Dprev = oppositedirection(prevdirection);
OUTLINE_DIRECTION Dnow = cwdirection (Dprev);
......@@ -168,10 +168,10 @@ outline_walk_cw (GeglRectangle *rect,
GPtrArray*
sc_outline_find_ccw (const GeglRectangle *rect,
const GeglBuffer *pixels)
GeglBuffer *pixels)
{
Babl *format = babl_format("RGBA float");
GPtrArray *points = g_ptr_array_new ();
const Babl *format = babl_format("RGBA float");
GPtrArray *points = g_ptr_array_new ();
gint x = rect->x, y;
......
......@@ -33,7 +33,7 @@ typedef struct {
*/
typedef GPtrArray ScOutline;
ScOutline* sc_outline_find_ccw (const GeglRectangle *rect, const GeglBuffer *pixels);
ScOutline* sc_outline_find_ccw (const GeglRectangle *rect, GeglBuffer *pixels);
void sc_outline_free (ScOutline *self);
......
......@@ -19,6 +19,7 @@
#include "seamless-clone-common.h"
#include "make-mesh.h"
#include <gegl-utils.h>
static GeglBuffer*
sc_compute_UVT_cache (P2tRTriangulation *mesh,
......@@ -58,13 +59,16 @@ sc_point_to_color_func (P2tRPoint *point,
gfloat *dest,
gpointer cci_p)
{
ScColorComputeInfo *cci = (ScColorComputeInfo*) cci_p;
ScSampleList *sl = g_hash_table_lookup (cci->sampling, point);
gfloat aux_c[4], input_c[4], dest_c[3] = {0, 0, 0};
gint i;
gdouble weightT = 0;
guint N = sl->points->len;
ScColorComputeInfo *cci = (ScColorComputeInfo*) cci_p;
ScSampleList *sl = g_hash_table_lookup (cci->sampling, point);
gint i;
gdouble weightT = 0;
guint N = sl->points->len;
const Babl *format = babl_format ("R'G'B'A float");
gfloat *col_cpy;
gfloat aux_c[4], input_c[4], dest_c[3] = {0, 0, 0};
if ((col_cpy = g_hash_table_lookup (cci->pt2col, point)) != NULL)
{
......@@ -78,8 +82,6 @@ sc_point_to_color_func (P2tRPoint *point,
col_cpy = g_new (gfloat, 4);
g_hash_table_insert (cci->pt2col, point, col_cpy);
Babl *format = babl_format ("R'G'B'A float");
for (i = 0; i < N; i++)
{
ScPoint *pt = g_ptr_array_index (sl->points, i);
......@@ -132,7 +134,7 @@ sc_render_seamless (GeglBuffer *bg,
GeglBufferIterator *iter;
int out_index, uvt_index, fg_index;
Babl *format = babl_format("R'G'B'A float");
const Babl *format = babl_format("R'G'B'A float");
if (cache == NULL)
{
......
......@@ -47,8 +47,8 @@ gegl_chant_int (max_refine_steps, _("Refinement Steps"), 0, 100000.0, 2000,
static void
prepare (GeglOperation *operation)
{
Babl *format = babl_format ("R'G'B'A float");
gpointer *dest = GEGL_CHANT_PROPERTIES (operation) -> result;
const Babl *format = babl_format ("R'G'B'A float");
gpointer *dest = GEGL_CHANT_PROPERTIES (operation) -> result;
gegl_operation_set_format (operation, "input", format);
......@@ -64,7 +64,7 @@ process (GeglOperation *operation,
GeglBuffer *input,
const GeglRectangle *roi)
{
gpointer *dest = GEGL_CHANT_PROPERTIES (operation) -> result;
gpointer *dest = GEGL_CHANT_PROPERTIES (operation) -> result;
if (dest == NULL)
{
......
......@@ -68,7 +68,7 @@ get_required_for_output (GeglOperation *operation,
static void
prepare (GeglOperation *operation)
{
Babl *format = babl_format ("R'G'B'A float");
const Babl *format = babl_format ("R'G'B'A float");
gegl_operation_set_format (operation, "input", format);
gegl_operation_set_format (operation, "aux", format);
......
......@@ -63,7 +63,7 @@ get_required_for_output (GeglOperation *operation,
static void
prepare (GeglOperation *operation)
{
Babl *format = babl_format ("R'G'B'A float");
const Babl *format = babl_format ("R'G'B'A float");
gegl_operation_set_format (operation, "input", format);
gegl_operation_set_format (operation, "aux", format);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment