break;
default:
- m_fatal(1, "Unknown read_packed format code 0x%02x", *format);
+ i_fatal(1, "Unknown read_packed format code 0x%02x", *format);
}
++format;
}
break;
default:
- m_fatal(1, "Unknown write_packed format code 0x%02x", *format);
+ i_fatal(1, "Unknown write_packed format code 0x%02x", *format);
}
++format;
}
}
/* fprintf(stderr,"0x%08X\n",l->t); */
if (llist_llink_push(l,l->t,data)) {
- m_fatal(3, "out of memory\n");
+ i_fatal(3, "out of memory\n");
}
}
++sp;
}
/* we want to log the error too, build an error message to hand to
- m_fatal() */
+ i_fatal() */
total = 1; /* remember the NUL */
for (sp = error_sp; error_stack[sp].msg; ++sp) {
total += strlen(error_stack[sp].msg) + 2;
}
/* lose the extra ": " */
full[strlen(full)-2] = '\0';
- m_fatal(EXIT_FAILURE, "%s", full);
+ i_fatal(EXIT_FAILURE, "%s", full);
}
return 0;
fdist[p] = i_max(xd*xd, yd*yd); /* manhattan distance */
break;
default:
- m_fatal(3,"i_gradgen: Unknown distance measure\n");
+ i_fatal(3,"i_gradgen: Unknown distance measure\n");
}
cs += fdist[p];
}
mindist = i_max(xd*xd, yd*yd); /* manhattan distance */
break;
default:
- m_fatal(3,"i_nearest_color: Unknown distance measure\n");
+ i_fatal(3,"i_nearest_color: Unknown distance measure\n");
}
for(p = 1; p<num; p++) {
curdist = i_max(xd*xd, yd*yd); /* manhattan distance */
break;
default:
- m_fatal(3,"i_nearest_color: Unknown distance measure\n");
+ i_fatal(3,"i_nearest_color: Unknown distance measure\n");
}
if (curdist < mindist) {
mindist = curdist;
mindist = i_max(xd*xd, yd*yd); /* manhattan distance */
break;
default:
- m_fatal(3,"i_nearest_color: Unknown distance measure\n");
+ i_fatal(3,"i_nearest_color: Unknown distance measure\n");
}
for(p = 1; p<num; p++) {
curdist = i_max(xd*xd, yd*yd); /* manhattan distance */
break;
default:
- m_fatal(3,"i_nearest_color: Unknown distance measure\n");
+ i_fatal(3,"i_nearest_color: Unknown distance measure\n");
}
if (curdist < mindist) {
mindist = curdist;
/* rows can be 0 for some glyphs, for example ' ' */
if (bit->rows && bit->size / bit->rows != bit->cols) {
- m_fatal(0, "Integer overflow calculating bitmap size (%d, %d)\n",
+ i_fatal(0, "Integer overflow calculating bitmap size (%d, %d)\n",
bit->width, bit->rows);
}
mm_log((1,"i_tt_init_raster_map: bit->width %d, bit->cols %d, bit->rows %d, bit->size %d)\n", bit->width, bit->cols, bit->rows, bit->size ));
bit->bitmap = (void *) mymalloc( bit->size ); /* checked 6Nov05 tonyc */
- if ( !bit->bitmap ) m_fatal(0,"Not enough memory to allocate bitmap (%d)!\n",bit->size );
+ if ( !bit->bitmap ) i_fatal(0,"Not enough memory to allocate bitmap (%d)!\n",bit->size );
}
Size = GifFile->SWidth * sizeof(GifPixelType);
if ((GifRow = (GifRowType) mymalloc(Size)) == NULL)
- m_fatal(0,"Failed to allocate memory required, aborted."); /* First row. */
+ i_fatal(0,"Failed to allocate memory required, aborted."); /* First row. */
/* Scan the content of the GIF file and load the image(s) in: */
do {
int bytes = count_y * sizeof(i_int_hline_entry *);
if (bytes / count_y != sizeof(i_int_hline_entry *)) {
- m_fatal(3, "integer overflow calculating memory allocation\n");
+ i_fatal(3, "integer overflow calculating memory allocation\n");
}
hlines->start_y = start_y;
int x_limit = x + width;
if (width < 0) {
- m_fatal(3, "negative width %d passed to i_int_hlines_add\n", width);
+ i_fatal(3, "negative width %d passed to i_int_hlines_add\n", width);
}
/* just return if out of range */
mm_log((1,"ICL_new_internal(r %d,g %d,b %d,a %d)\n", r, g, b, a));
- if ( (cl=mymalloc(sizeof(i_color))) == NULL) m_fatal(2,"malloc() error\n");
+ if ( (cl=mymalloc(sizeof(i_color))) == NULL) i_fatal(2,"malloc() error\n");
cl->rgba.r = r;
cl->rgba.g = g;
cl->rgba.b = b;
mm_log((1,"ICL_set_internal(cl* %p,r %d,g %d,b %d,a %d)\n",cl,r,g,b,a));
if (cl == NULL)
if ( (cl=mymalloc(sizeof(i_color))) == NULL)
- m_fatal(2,"malloc() error\n");
+ i_fatal(2,"malloc() error\n");
cl->rgba.r=r;
cl->rgba.g=g;
cl->rgba.b=b;
mm_log((1,"i_fcolor_new(r %g,g %g,b %g,a %g)\n", r, g, b, a));
- if ( (cl=mymalloc(sizeof(i_fcolor))) == NULL) m_fatal(2,"malloc() error\n");
+ if ( (cl=mymalloc(sizeof(i_fcolor))) == NULL) i_fatal(2,"malloc() error\n");
cl->rgba.r = r;
cl->rgba.g = g;
cl->rgba.b = b;
mm_log((1,"i_img_struct()\n"));
if ( (im=mymalloc(sizeof(i_img))) == NULL)
- m_fatal(2,"malloc() error\n");
+ i_fatal(2,"malloc() error\n");
*im = IIM_base_8bit_direct;
im->xsize=0;
if (im == NULL)
if ( (im=mymalloc(sizeof(i_img))) == NULL)
- m_fatal(2,"malloc() error\n");
+ i_fatal(2,"malloc() error\n");
memcpy(im, &IIM_base_8bit_direct, sizeof(i_img));
i_tags_new(&im->tags);
im->ch_mask = MAXINT;
im->bytes=bytes;
if ( (im->idata=mymalloc(im->bytes)) == NULL)
- m_fatal(2,"malloc() error\n");
+ i_fatal(2,"malloc() error\n");
memset(im->idata,0,(size_t)im->bytes);
im->ext_data = NULL;
ifd_entry *entry;
unsigned long offset;
if (index < 0 || index >= tiff->ifd_size) {
- m_fatal(3, "tiff_get_tag_double_array() tag index out of range");
+ i_fatal(3, "tiff_get_tag_double_array() tag index out of range");
}
entry = tiff->ifd + index;
tiff_get_tag_double(imtiff *tiff, int index, double *result) {
ifd_entry *entry;
if (index < 0 || index >= tiff->ifd_size) {
- m_fatal(3, "tiff_get_tag_double() index out of range");
+ i_fatal(3, "tiff_get_tag_double() index out of range");
}
entry = tiff->ifd + index;
ifd_entry *entry;
unsigned long offset;
if (index < 0 || index >= tiff->ifd_size) {
- m_fatal(3, "tiff_get_tag_int_array() tag index out of range");
+ i_fatal(3, "tiff_get_tag_int_array() tag index out of range");
}
entry = tiff->ifd + index;
if (array_index < 0 || array_index >= entry->count) {
- m_fatal(3, "tiff_get_tag_int_array() array index out of range");
+ i_fatal(3, "tiff_get_tag_int_array() array index out of range");
}
offset = entry->offset + array_index * entry->item_size;
tiff_get_tag_int(imtiff *tiff, int index, int *result) {
ifd_entry *entry;
if (index < 0 || index >= tiff->ifd_size) {
- m_fatal(3, "tiff_get_tag_int() index out of range");
+ i_fatal(3, "tiff_get_tag_int() index out of range");
}
entry = tiff->ifd + index;
*workstr = '\0';
for (j = 0; j < entry->count; ++j) {
if (!tiff_get_tag_double_array(tiff, tag_index, &value, j)) {
- m_fatal(3, "unexpected failure from tiff_get_tag_double_array(..., %d, ..., %d)\n", tag_index, j);
+ i_fatal(3, "unexpected failure from tiff_get_tag_double_array(..., %d, ..., %d)\n", tag_index, j);
}
if (j)
strcat(workstr, " ");
*workstr = '\0';
for (j = 0; j < entry->count; ++j) {
if (!tiff_get_tag_int_array(tiff, tag_index, &value, j)) {
- m_fatal(3, "unexpected failure from tiff_get_tag_int_array(..., %d, ..., %d)\n", tag_index, j);
+ i_fatal(3, "unexpected failure from tiff_get_tag_int_array(..., %d, ..., %d)\n", tag_index, j);
}
if (j)
strcat(workstr, " ");
static unsigned
tiff_get16(imtiff *tiff, unsigned long offset) {
if (offset + 2 > tiff->size)
- m_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
+ i_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
if (tiff->type == tt_intel)
return tiff->base[offset] + 0x100 * tiff->base[offset+1];
static unsigned
tiff_get32(imtiff *tiff, unsigned long offset) {
if (offset + 4 > tiff->size)
- m_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
+ i_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
if (tiff->type == tt_intel)
return tiff->base[offset] + 0x100 * tiff->base[offset+1]
int result;
if (offset + 2 > tiff->size)
- m_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
+ i_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
if (tiff->type == tt_intel)
result = tiff->base[offset] + 0x100 * tiff->base[offset+1];
unsigned work;
if (offset + 4 > tiff->size)
- m_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
+ i_fatal(3, "attempt to get16 at %uld in %uld image", offset, tiff->size);
if (tiff->type == tt_intel)
work = tiff->base[offset] + 0x100 * tiff->base[offset+1]
tiff_get_rat(imtiff *tiff, unsigned long offset) {
unsigned long numer, denom;
if (offset + 8 > tiff->size)
- m_fatal(3, "attempt to get_rat at %lu in %lu image", offset, tiff->size);
+ i_fatal(3, "attempt to get_rat at %lu in %lu image", offset, tiff->size);
numer = tiff_get32(tiff, offset);
denom = tiff_get32(tiff, offset+4);
tiff_get_rats(imtiff *tiff, unsigned long offset) {
long numer, denom;
if (offset + 8 > tiff->size)
- m_fatal(3, "attempt to get_rat at %lu in %lu image", offset, tiff->size);
+ i_fatal(3, "attempt to get_rat at %lu in %lu image", offset, tiff->size);
numer = tiff_get32s(tiff, offset);
denom = tiff_get32s(tiff, offset+4);
ssize_t rc, wl = i_min(wrlen, BBSIZ);
mm_log((1, "bufchain_seek: wrlen = %d, wl = %d\n", wrlen, wl));
rc = bufchain_write( ig, TB, wl );
- if (rc != wl) m_fatal(0, "bufchain_seek: Unable to extend file\n");
+ if (rc != wl) i_fatal(0, "bufchain_seek: Unable to extend file\n");
wrlen -= rc;
}
}
io_type inn = ig->source.type;
if ( inn != BUFCHAIN ) {
- m_fatal(0, "io_slurp: called on a source that is not from a bufchain\n");
+ i_fatal(0, "io_slurp: called on a source that is not from a bufchain\n");
}
ieb = ig->exdata;
rc = bufchain_read(ig, cc, ieb->length);
if (rc != ieb->length)
- m_fatal(1, "io_slurp: bufchain_read returned an incomplete read: rc = %d, request was %d\n", rc, ieb->length);
+ i_fatal(1, "io_slurp: bufchain_read returned an incomplete read: rc = %d, request was %d\n", rc, ieb->length);
return rc;
}
}
void
-m_fatal(int exitcode,const char *fmt, ... ) {
+i_fatal(int exitcode,const char *fmt, ... ) {
va_list ap;
time_t timi;
struct tm *str_tm;
*/
void i_init_log(const char* name,int onoff) {}
-void m_fatal(int exitcode,const char *fmt, ... ) { exit(exitcode); }
+void i_fatal(int exitcode,const char *fmt, ... ) { exit(exitcode); }
#endif