Skip to content

Commit

Permalink
- hush lot of implict typecasting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Oct 14, 2009
1 parent 0f51999 commit 2281ab4
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 98 deletions.
11 changes: 5 additions & 6 deletions Global/Global.c
Expand Up @@ -100,7 +100,7 @@ hline( PImage image, int x1, int x2, int y, double color)
case imFloat:
{
float * d = ( float *) data;
float c = color;
float c = (float) color;
for ( i = x1; i <= x2; i++) *(d++) = c;
}
break;
Expand All @@ -119,29 +119,29 @@ hline( PImage image, int x1, int x2, int y, double color)
case 24:
/* fall back to Image::pixel */
{
SV * sv = newSViv( color);
SV * sv = newSViv(( int ) color);
for ( i = x1; i <= x2; i++)
image-> self-> pixel(( Handle) image, 1, i, y, sv);
sv_free( sv);
}
break;
case 8:
{
Byte c = ( color > 255) ? 255 : (( color < 0) ? 0 : color + .5);
Byte c = ( color > 255) ? 255 : (( color < 0) ? 0 : (Byte)(color + .5));
for ( i = x1; i <= x2; i++) *(data++) = c;
}
break;
case 16:
{
Short * d = ( Short *) data;
Short c = ( color > 32768) ? 32768 : (( color < -32767) ? -32767 : color + .5);
Short c = ( color > 32768) ? 32768 : (( color < -32767) ? -32767 : (Short)(color + .5));
for ( i = x1; i <= x2; i++) *(d++) = c;
}
break;
case 32:
{
Long * d = ( Long *) data;
Long c = ( color > 0x7fffffff) ? 0x7fffffff : (( color < -0x7fffffff) ? -0x7fffffff : color + .5);
Long c = ( color > 0x7fffffff) ? 0x7fffffff : (( color < -0x7fffffff) ? -0x7fffffff : (Long)(color + .5));
for ( i = x1; i <= x2; i++) *(d++) = c;
}
break;
Expand Down Expand Up @@ -193,7 +193,6 @@ IPA__Global_line( PImage input, int from_x, int from_y, int to_x, int to_y, doub
int dir = 0, d, d_inc1, d_inc2;
int inc_maj, inc_min;
int x, y, acc_x = 0, acc_y = -1, ox;
Color v;

if (abs(delta_y) > abs(delta_x)) dir = 1;

Expand Down
4 changes: 2 additions & 2 deletions Global/Global.pm
Expand Up @@ -256,8 +256,6 @@ Supported types: all
The parameters are same as those passed to L<band_filter>.
=back
=item hough IMAGE [ type = "line", direct = 1, resolution = 500 ]
Realizes Hough transform. If type is "line", linear transform is performed.
Expand Down Expand Up @@ -288,6 +286,8 @@ then plotting lines back (after $h was filtered) would be
Supported types: 8-bit (expects result from C<hough> function).
=back
=head2 Optimized plotting
The following functions can draw lines on images, and are optimized for speed,
Expand Down

0 comments on commit 2281ab4

Please sign in to comment.