Skip to content

Commit

Permalink
Merge pull request #34 from blackwarthog/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
genete committed Aug 30, 2013
2 parents c739730 + 733bd3b commit eb44c82
Show file tree
Hide file tree
Showing 31 changed files with 93 additions and 149 deletions.
34 changes: 17 additions & 17 deletions ETL/ETL/_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class surface
deletable_=true;
}

virtual void
void
set_wh(typename size_type::value_type w, typename size_type::value_type h, unsigned char* newdata, const typename size_type::value_type &pitch)
{
if(data_ && deletable_)
Expand Down Expand Up @@ -557,18 +557,18 @@ class surface
//figure polynomials for each point
const float txf[] =
{
0.5*xf*(xf*(xf*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(xf*(xf*(3*xf - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*xf*(xf*(-3*xf + 4) + 1), //t + 4t^2 - 3t^3
0.5*xf*xf*(xf-1) //-t^2 + t^3
0.5f*xf*(xf*(xf*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(xf*(xf*(3.f*xf - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*xf*(xf*(-3.f*xf + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*xf*xf*(xf-1.f) //-t^2 + t^3
};

const float tyf[] =
{
0.5*yf*(yf*(yf*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(yf*(yf*(3*yf - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*yf*(yf*(-3*yf + 4) + 1), //t + 4t^2 - 3t^3
0.5*yf*yf*(yf-1) //-t^2 + t^3
0.5f*yf*(yf*(yf*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(yf*(yf*(3.f*yf - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*yf*(yf*(-3.f*yf + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*yf*yf*(yf-1.f) //-t^2 + t^3
};

//evaluate polynomial for each row
Expand Down Expand Up @@ -604,18 +604,18 @@ class surface
//figure polynomials for each point
const float txf[] =
{
0.5*xf*(xf*(xf*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(xf*(xf*(3*xf - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*xf*(xf*(-3*xf + 4) + 1), //t + 4t^2 - 3t^3
0.5*xf*xf*(xf-1) //-t^2 + t^3
0.5f*xf*(xf*(xf*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5f*(xf*(xf*(3*xf - 5)) + 2), //2 - 5t^2 + 3t^3
0.5f*xf*(xf*(-3*xf + 4) + 1), //t + 4t^2 - 3t^3
0.5f*xf*xf*(xf-1) //-t^2 + t^3
};

const float tyf[] =
{
0.5*yf*(yf*(yf*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(yf*(yf*(3*yf - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*yf*(yf*(-3*yf + 4) + 1), //t + 4t^2 - 3t^3
0.5*yf*yf*(yf-1) //-t^2 + t^3
0.5f*yf*(yf*(yf*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(yf*(yf*(3.f*yf - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*yf*(yf*(-3.f*yf + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*yf*yf*(yf-1.f) //-t^2 + t^3
};

//evaluate polynomial for each row
Expand Down
9 changes: 6 additions & 3 deletions synfig-core/src/modules/mod_geometry/advanced_outline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ Advanced_Outline::sync()
// initialize the blinepoints positions iterators
hbpiter=hbline_pos.begin();
bpiter=bline_pos.begin();
Real biter_pos(*bpiter), hbiter_pos(*hbpiter);
// todo: why 'hbiter_pos' never used?
Real biter_pos(*bpiter) /* , hbiter_pos(*hbpiter) */ ;
bpiter++;
hbpiter++;
Real bnext_pos(*bpiter), hbnext_pos(*hbpiter);
Expand Down Expand Up @@ -857,7 +858,8 @@ Advanced_Outline::sync()
bnext++;
// Update blinepoints positions
biter_pos = bnext_pos;
hbiter_pos = hbnext_pos;
// todo: why 'hbiter_pos' never used?
//hbiter_pos = hbnext_pos;
bpiter++;
hbpiter++;
bnext_pos=*bpiter;
Expand Down Expand Up @@ -974,7 +976,8 @@ Advanced_Outline::sync()
bnext++;
// Update blinepoints positions
biter_pos = bnext_pos;
hbiter_pos = hbnext_pos;
// todo: why 'hbiter_pos' never used?
//hbiter_pos = hbnext_pos;
bpiter++;
hbpiter++;
bnext_pos=*bpiter;
Expand Down
7 changes: 0 additions & 7 deletions synfig-core/src/modules/mod_geometry/checkerboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ CheckerBoard::get_param_vocab()const
synfig::Layer::Handle
CheckerBoard::hit_check(synfig::Context context, const synfig::Point &getpos)const
{
Point origin=param_origin.get(Point());
Point size=param_size.get(Point());

if(get_amount()!=0.0 && point_test(getpos))
{
synfig::Layer::Handle tmp;
Expand All @@ -182,8 +179,6 @@ Color
CheckerBoard::get_color(Context context, const Point &getpos)const
{
Color color=param_color.get(Color());
Point origin=param_origin.get(Point());
Point size=param_size.get(Point());

if(get_amount()!=0.0 && point_test(getpos))
{
Expand All @@ -200,8 +195,6 @@ bool
CheckerBoard::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
{
Color color=param_color.get(Color());
Point origin=param_origin.get(Point());
Point size=param_size.get(Point());

SuperCallback supercb(cb,0,9500,10000);

Expand Down
4 changes: 1 addition & 3 deletions synfig-core/src/modules/mod_gradient/conicalgradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ ConicalGradient::accelerated_cairorender(Context context,cairo_t *cr,int quality
{
Gradient gradient=param_gradient.get(Gradient());
Point center=param_center.get(Point());
Angle angle=param_angle.get(Angle());

cairo_save(cr);
const Point tl(renddesc.get_tl());
Expand All @@ -328,7 +327,7 @@ ConicalGradient::accelerated_cairorender(Context context,cairo_t *cr,int quality
if(
!
(is_solid_color() ||
cpoints_all_opaque && get_blend_method()==Color::BLEND_COMPOSITE && get_amount()==1.0)
(cpoints_all_opaque && get_blend_method()==Color::BLEND_COMPOSITE && get_amount()==1.f))
)
{
// Initially render what's behind us
Expand All @@ -352,7 +351,6 @@ ConicalGradient::accelerated_cairorender(Context context,cairo_t *cr,int quality
bool
ConicalGradient::compile_mesh(cairo_pattern_t* pattern, Gradient mygradient, Real radius)const
{
Point center=param_center.get(Point());
Angle angle=param_angle.get(Angle());
bool symmetric=param_symmetric.get(bool());

Expand Down
6 changes: 3 additions & 3 deletions synfig-core/src/modules/mod_gradient/curvegradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ find_closest(bool fast, const std::vector<synfig::BLinePoint>& bline,const Point
next=bline.begin();

float best_bline_dist(0);
float best_bline_len(0);
//float best_bline_len(0);
float total_bline_dist(0);
float best_pos(0);
etl::hermite<Vector> best_curve;
Expand Down Expand Up @@ -157,7 +157,7 @@ find_closest(bool fast, const std::vector<synfig::BLinePoint>& bline,const Point

if (fast)
{
#define POINT_CHECK(x) bp=curve(x); thisdist=(bp-p).mag_squared(); if(thisdist<dist) { ret=iter; dist=thisdist; best_bline_dist=total_bline_dist; best_bline_len=len; best_curve=curve; }
#define POINT_CHECK(x) bp=curve(x); thisdist=(bp-p).mag_squared(); if(thisdist<dist) { ret=iter; dist=thisdist; best_bline_dist=total_bline_dist; /* best_bline_len=len; */ best_curve=curve; }
POINT_CHECK(0.0001);
POINT_CHECK((1.0/6.0));
POINT_CHECK((2.0/6.0));
Expand All @@ -175,7 +175,7 @@ find_closest(bool fast, const std::vector<synfig::BLinePoint>& bline,const Point
ret=iter;
dist=thisdist;
best_bline_dist=total_bline_dist;
best_bline_len=len;
//best_bline_len=len;
best_curve=curve;
best_pos = pos;
}
Expand Down
5 changes: 2 additions & 3 deletions synfig-core/src/modules/mod_gradient/lineargradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ inline Color
LinearGradient::color_func(const Point &point, float supersample)const
{
Point p1=param_p1.get(Point());
Point p2=param_p2.get(Point());
Gradient gradient=param_gradient.get(Gradient());
bool loop=param_loop.get(bool());
bool zigzag=param_zigzag.get(bool());
Expand Down Expand Up @@ -285,7 +284,7 @@ LinearGradient::accelerated_cairorender(Context context, cairo_t *cr, int qualit
if(
!
(is_solid_color() ||
cpoints_all_opaque && get_blend_method()==Color::BLEND_COMPOSITE && get_amount()==1.0)
(cpoints_all_opaque && get_blend_method()==Color::BLEND_COMPOSITE && get_amount()==1.f))
)
{
// Initially render what's behind us
Expand Down Expand Up @@ -363,4 +362,4 @@ LinearGradient::compile_gradient(cairo_pattern_t* pattern, Gradient mygradient)c
cairo_pattern_add_color_stop_rgba(pattern, 1.0, r, g, b, a);
}
return cpoints_all_opaque;
}
}
2 changes: 1 addition & 1 deletion synfig-core/src/modules/mod_gradient/radialgradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ RadialGradient::accelerated_cairorender(Context context,cairo_t *cr, int quality
if(
!
(is_solid_color() ||
cpoints_all_opaque && get_blend_method()==Color::BLEND_COMPOSITE && get_amount()==1.0)
(cpoints_all_opaque && get_blend_method()==Color::BLEND_COMPOSITE && get_amount()==1.f))
)
{
// Initially render what's behind us
Expand Down
2 changes: 1 addition & 1 deletion synfig-core/src/modules/mod_noise/distort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ NoiseDistort::hit_check(synfig::Context context, const synfig::Point &point)cons
return context.hit_check(point);
if(color_func(point,0,context).get_a()>0.5)
return const_cast<NoiseDistort*>(this);
return false;
return synfig::Layer::Handle();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion synfig-core/src/modules/mod_noise/noise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Noise::hit_check(synfig::Context context, const synfig::Point &point)const
return context.hit_check(point);
if(color_func(point,0,context).get_a()>0.5)
return const_cast<Noise*>(this);
return false;
return synfig::Layer::Handle();
}

bool
Expand Down
24 changes: 12 additions & 12 deletions synfig-core/src/modules/mod_noise/random_noise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,26 @@ RandomNoise::operator()(SmoothType smooth,int subseed,float xf,float yf,float tf
//figure polynomials for each point
const float txf[] =
{
0.5*dx*(dx*(dx*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(dx*(dx*(3*dx - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*dx*(dx*(-3*dx + 4) + 1), //t + 4t^2 - 3t^3
0.5*dx*dx*(dx-1) //-t^2 + t^3
0.5f*dx*(dx*(dx*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(dx*(dx*(3.f*dx - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*dx*(dx*(-3.f*dx + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*dx*dx*(dx-1.f) //-t^2 + t^3
};

const float tyf[] =
{
0.5*dy*(dy*(dy*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(dy*(dy*(3*dy - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*dy*(dy*(-3*dy + 4) + 1), //t + 4t^2 - 3t^3
0.5*dy*dy*(dy-1) //-t^2 + t^3
0.5f*dy*(dy*(dy*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(dy*(dy*(3.f*dy - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*dy*(dy*(-3.f*dy + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*dy*dy*(dy-1.f) //-t^2 + t^3
};

const float ttf[] =
{
0.5*dt*(dt*(dt*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(dt*(dt*(3*dt - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*dt*(dt*(-3*dt + 4) + 1), //t + 4t^2 - 3t^3
0.5*dt*dt*(dt-1) //-t^2 + t^3
0.5f*dt*(dt*(dt*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(dt*(dt*(3.f*dt - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*dt*(dt*(-3.f*dt + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*dt*dt*(dt-1.f) //-t^2 + t^3
};

//evaluate polynomial for each row
Expand Down
24 changes: 12 additions & 12 deletions synfig-core/src/modules/mod_particle/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,26 @@ Random::operator()(SmoothType smooth,int subseed,float xf,float yf,float tf)cons
//figure polynomials for each point
const float txf[] =
{
0.5*dx*(dx*(dx*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(dx*(dx*(3*dx - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*dx*(dx*(-3*dx + 4) + 1), //t + 4t^2 - 3t^3
0.5*dx*dx*(dx-1) //-t^2 + t^3
0.5f*dx*(dx*(dx*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(dx*(dx*(3.f*dx - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*dx*(dx*(-3.f*dx + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*dx*dx*(dx-1.f) //-t^2 + t^3
};

const float tyf[] =
{
0.5*dy*(dy*(dy*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(dy*(dy*(3*dy - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*dy*(dy*(-3*dy + 4) + 1), //t + 4t^2 - 3t^3
0.5*dy*dy*(dy-1) //-t^2 + t^3
0.5f*dy*(dy*(dy*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(dy*(dy*(3.f*dy - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*dy*(dy*(-3.f*dy + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*dy*dy*(dy-1.f) //-t^2 + t^3
};

const float ttf[] =
{
0.5*dt*(dt*(dt*(-1) + 2) - 1), //-t + 2t^2 -t^3
0.5*(dt*(dt*(3*dt - 5)) + 2), //2 - 5t^2 + 3t^3
0.5*dt*(dt*(-3*dt + 4) + 1), //t + 4t^2 - 3t^3
0.5*dt*dt*(dt-1) //-t^2 + t^3
0.5f*dt*(dt*(dt*(-1.f) + 2.f) - 1.f), //-t + 2t^2 -t^3
0.5f*(dt*(dt*(3.f*dt - 5.f)) + 2.f), //2 - 5t^2 + 3t^3
0.5f*dt*(dt*(-3.f*dt + 4.f) + 1.f), //t + 4t^2 - 3t^3
0.5f*dt*dt*(dt-1.f) //-t^2 + t^3
};

//evaluate polynomial for each row
Expand Down
6 changes: 4 additions & 2 deletions synfig-core/src/modules/mod_svg/svg_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,16 @@ Svg_parser::parser_path_d(String path_d,SVGMatrix* mtx){
//this curve have 6 parameters
//radius
float radius_x,radius_y;
float angle;
// todo: why 'angle' never used?
//float angle;
bool sweep,large;
//radius
radius_x=atof(tokens.at(i).data());
i++; if(tokens.at(i).compare(",")==0) i++;
radius_y=atof(tokens.at(i).data());
//angle
i++; angle=atof(tokens.at(i).data());
// todo: why 'angle' never used?
i++; // angle=atof(tokens.at(i).data());
//flags
i++; large=atoi(tokens.at(i).data());
i++; sweep=atoi(tokens.at(i).data());
Expand Down
13 changes: 3 additions & 10 deletions synfig-core/src/synfig/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,17 +880,14 @@ blendfunc_ALPHA_BRIGHTEN(CairoColor &a, CairoColor &b, float amount)
// return a.set_a(a.get_a()*amount);
//return b;
unsigned char ra, ga, ba, aa;
unsigned char rb, gb, bb, ab;
unsigned char ab;
unsigned char rc, gc, bc, ac;

ra=a.get_r();
ga=a.get_g();
ba=a.get_b();
aa=a.get_a();

rb=b.get_r();
gb=b.get_g();
bb=b.get_b();
ab=b.get_a();

ac=aa*amount;
Expand Down Expand Up @@ -923,17 +920,14 @@ CairoColor
blendfunc_ALPHA_DARKEN(CairoColor &a, CairoColor &b, float amount)
{
unsigned char ra, ga, ba, aa;
unsigned char rb, gb, bb, ab;
unsigned char ab;
unsigned char rc, gc, bc, ac;

ra=a.get_r();
ga=a.get_g();
ba=a.get_b();
aa=a.get_a();

rb=b.get_r();
gb=b.get_g();
bb=b.get_b();
ab=b.get_a();

ac=aa*amount;
Expand Down Expand Up @@ -1067,7 +1061,7 @@ blendfunc_HARD_LIGHT(CairoColor &a, CairoColor &b, float amount)
if(amount<0) a=~a, amount=-amount;

int ra, ga, ba, aa;
int rb, gb, bb, ab;
int rb, gb, bb;
int rc, gc, bc;

ra=a.get_r();
Expand All @@ -1078,7 +1072,6 @@ blendfunc_HARD_LIGHT(CairoColor &a, CairoColor &b, float amount)
rb=b.get_r();
gb=b.get_g();
bb=b.get_b();
ab=b.get_a();

if(ra>127) rc =255 - (255-(ra*2-255)) * (255-rb)/255.0;
else rc= rb*(ra*2)/255.0;
Expand Down
Loading

0 comments on commit eb44c82

Please sign in to comment.