- document register_filter() and add test for it
- add example to SYNOPSIS of samples/inline_replace_color.pl
- minor POD fix in Imager::Color::Table
+- eliminate many -Wall warnings
=================================================================
void
flines(i_img *im) {
i_color vl;
- int i,bytes,x,y;
- int idx;
-
+ int x,y;
for(y = 0; y < im->ysize; y ++) {
for(x = 0; x < im->xsize; x ++ ) {
--len;
}
EXTEND(SP, 1);
- if (outsize = i_t1_glyph_name(handle, ch, name, sizeof(name))) {
+ if ((outsize = i_t1_glyph_name(handle, ch, name, sizeof(name))) != 0) {
PUSHs(sv_2mortal(newSVpv(name, 0)));
}
else {
Imager::Color cl
float points
SV * str_sv
- int len_ignored
int smooth
int utf8
int align
int channel
float points
SV * str_sv
- int len_ignored
int smooth
int utf8
int align
Imager::Font::TT handle
float point
SV* str_sv
- int len_ignored
int utf8
PREINIT:
int cords[BOUNDING_BOX_COUNT],rc;
--len;
}
EXTEND(SP, 1);
- if (outsize = i_tt_glyph_name(handle, ch, name, sizeof(name))) {
+ if ((outsize = i_tt_glyph_name(handle, ch, name, sizeof(name))) != 0) {
PUSHs(sv_2mortal(newSVpv(name, 0)));
}
else {
--len;
}
EXTEND(SP, 1);
- if (outsize = i_ft2_glyph_name(handle, ch, name, sizeof(name),
- reliable_only)) {
+ if ((outsize = i_ft2_glyph_name(handle, ch, name, sizeof(name),
+ reliable_only)) != 0) {
PUSHs(sv_2mortal(newSVpv(name, 0)));
}
else {
imager.h
imageri.h
imdatatypes.h
+imerror.h Error handling functions
imext.c Defines the function table
imext.h Included by external modules for API access
imextdef.h
mandel(double x, double y, int max_iter) {
double xn, yn;
double xo, yo;
- double dist;
int iter = 1;
/* Z(n+1) = Z(n) ^2 + c */
void
mandelbrot(i_img *im, double minx, double miny, double maxx, double maxy, int max_iter) {
- i_color vl;
- int i,bytes,x,y;
+ int i,x,y;
int idx;
double divx, divy;
typedef int frac;
static frac float_to_frac(float x) { return (frac)(0.5+x*16.0); }
-static int frac_sub (frac x) { return (x%16); }
-static int frac_int (frac x) { return (x/16); }
-static float frac_to_float(float x) { return (float)x/16.0; }
static
void
*y = float_to_frac(cy+radius*sin(angle));
}
-static
-void
-order_pair(frac *x, frac *y) {
- frac t = *x;
- if (t>*y) {
- *x = *y;
- *y = t;
- }
-}
-
-
-
-
static
void
make_minmax_list(i_mmarray *dot, float x, float y, float radius) {
*/
void
i_int_hlines_fill_fill(i_img *im, i_int_hlines *hlines, i_fill_t *fill) {
- int y, i, x;
+ int y, i;
if (im->bits == i_8_bits && fill->fill_with_color) {
i_color *line = mymalloc(sizeof(i_color) * im->xsize);
} symbol_table_t;
-/* error handling
- see error.c for documentation
- the error information is currently global
-*/
-typedef struct {
- char *msg;
- int code;
-} i_errmsg;
-
-typedef void (*i_error_cb)(int code, char const *msg);
-typedef void (*i_failed_cb)(i_errmsg *msgs);
-extern i_error_cb i_set_error_cb(i_error_cb);
-extern i_failed_cb i_set_failed_cb(i_failed_cb);
-extern void i_set_argv0(char const *);
-extern int i_set_errors_fatal(int new_fatal);
-extern i_errmsg *i_errors(void);
-
-extern void i_push_error(int code, char const *msg);
-extern void i_push_errorf(int code, char const *fmt, ...);
-extern void i_push_errorvf(int code, char const *fmt, va_list);
-extern void i_clear_error(void);
-extern int i_failed(int code, char const *msg);
+#include "imerror.h"
/* image tag processing */
extern void i_tags_new(i_img_tags *tags);
--- /dev/null
+#ifndef IMAGER_IMERROR_H
+#define IMAGER_IMERROR_H
+
+/* error handling
+ see error.c for documentation
+ the error information is currently global
+*/
+typedef struct {
+ char *msg;
+ int code;
+} i_errmsg;
+
+typedef void (*i_error_cb)(int code, char const *msg);
+typedef void (*i_failed_cb)(i_errmsg *msgs);
+extern i_error_cb i_set_error_cb(i_error_cb);
+extern i_failed_cb i_set_failed_cb(i_failed_cb);
+extern void i_set_argv0(char const *);
+extern int i_set_errors_fatal(int new_fatal);
+extern i_errmsg *i_errors(void);
+
+extern void i_push_error(int code, char const *msg);
+extern void i_push_errorf(int code, char const *fmt, ...);
+extern void i_push_errorvf(int code, char const *fmt, va_list);
+extern void i_clear_error(void);
+extern int i_failed(int code, char const *msg);
+
+#endif
static tag_map ifd0_string_tags[] =
{
- tag_make, "exif_make",
- tag_model, "exif_model",
- tag_copyright, "exif_copyright",
- tag_software, "exif_software",
- tag_artist, "exif_artist",
- tag_date_time, "exif_date_time",
- tag_image_description, "exif_image_description",
+ { tag_make, "exif_make" },
+ { tag_model, "exif_model" },
+ { tag_copyright, "exif_copyright" },
+ { tag_software, "exif_software" },
+ { tag_artist, "exif_artist" },
+ { tag_date_time, "exif_date_time" },
+ { tag_image_description, "exif_image_description" },
};
static const int ifd0_string_tag_count = ARRAY_COUNT(ifd0_string_tags);
static void
save_ifd0_tags(i_img *im, imtiff *tiff, unsigned long *exif_ifd_offset,
unsigned long *gps_ifd_offset) {
- int i, tag_index;
+ int tag_index;
int work;
ifd_entry *entry;
static void
save_exif_ifd_tags(i_img *im, imtiff *tiff) {
int i, tag_index;
- int work;
ifd_entry *entry;
char *user_comment;
unsigned long maker_note_offset = 0;
static void
save_gps_ifd_tags(i_img *im, imtiff *tiff) {
- int i, tag_index;
+ /* int i, tag_index;
int work;
- ifd_entry *entry;
+ ifd_entry *entry; */
/* for (tag_index = 0, entry = tiff->ifd;
tag_index < tiff->ifd_size; ++tag_index, ++entry) {
static void
tiff_clear_ifd(imtiff *tiff) {
- int i;
-
if (tiff->ifd_size && tiff->ifd) {
myfree(tiff->ifd);
tiff->ifd_size = 0;
#include "imio.h"
#include "iolayer.h"
+#include "imerror.h"
#include "log.h"
#include <stdlib.h>
#include <stdio.h>
ig->writecb = fd_write;
ig->seekcb = fd_seek;
ig->closecb = fd_close;
+ ig->sizecb = fd_size;
break;
}
}
=for comment
-From: Line 531 in draw.c
+From: Line 515 in draw.c
=item i_box_cfill(im, x1, y1, x2, y2, fill)
=for comment
-From: Line 574 in draw.c
+From: Line 558 in draw.c
=item i_box_filled(im, x1, y1, x2, y2, color)
=for comment
-From: Line 556 in draw.c
+From: Line 540 in draw.c
=item i_circle_aa(im, x, y, rad, color)
=for comment
-From: Line 477 in draw.c
+From: Line 461 in draw.c
=item i_flood_cfill(im, seedx, seedy, fill)
=for comment
-From: Line 1332 in draw.c
+From: Line 1316 in draw.c
=item i_flood_fill(im, seedx, seedy, color)
=for comment
-From: Line 1295 in draw.c
+From: Line 1279 in draw.c
=item i_glin(im, l, r, y, colors)
=for comment
-From: Line 645 in draw.c
+From: Line 629 in draw.c
=item i_line_aa(im, x1, x2, y1, y2, color, endp)
=for comment
-From: Line 849 in draw.c
+From: Line 833 in draw.c
=item i_plin(im, l, r, y, colors)
static
int
rgb_dest_write(rgb_dest *s, unsigned char *buf, size_t pixels) {
-
+ return -1;
}
errno = 0;
result = strtol(data, &myend, 10);
- if ((result == LONG_MIN || result == LONG_MAX) && errno == ERANGE
+ if (((result == LONG_MIN || result == LONG_MAX) && errno == ERANGE)
|| myend == data) {
errno = savederr;
return 0;