long delayed renaming of m_fatal() to i_fatal() to match Imager's
authorTony Cook <tony@develop=help.com>
Thu, 29 Jun 2006 10:56:09 +0000 (10:56 +0000)
committerTony Cook <tony@develop=help.com>
Thu, 29 Jun 2006 10:56:09 +0000 (10:56 +0000)
functions in general

bmp.c
datatypes.c
error.c
filters.c
font.c
gif.c
hlines.c
image.c
imexif.c
iolayer.c
log.c

diff --git a/bmp.c b/bmp.c
index f2a15cd81fdeeff4ff9a848f35222eb01b20581b..0e8dc62cc2da2b859478bae91b92a0ee46acb7d8 100644 (file)
--- a/bmp.c
+++ b/bmp.c
@@ -246,7 +246,7 @@ int read_packed(io_glue *ig, char *format, ...) {
       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;
   }
@@ -299,7 +299,7 @@ write_packed(io_glue *ig, char *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;
   }
index e8ecab1614d15e2734292cc06cb4ca82148d5a05..9c04b189ab27de585484d5056ec00220cca3a349 100644 (file)
@@ -132,7 +132,7 @@ llist_push(struct llist *l,void *data) {
   }
   /*   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");
   }
 }
 
diff --git a/error.c b/error.c
index 3dcab3cd1a9f5e0a1f544ecc1eb011881860e475..10c311955e5262dcefb919dc8ecdb3e9d0294705 100644 (file)
--- a/error.c
+++ b/error.c
@@ -321,7 +321,7 @@ int i_failed(int code, char const *msg) {
       ++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;
@@ -338,7 +338,7 @@ int i_failed(int code, char const *msg) {
     }
     /* lose the extra ": " */
     full[strlen(full)-2] = '\0';
-    m_fatal(EXIT_FAILURE, "%s", full);
+    i_fatal(EXIT_FAILURE, "%s", full);
   }
 
   return 0;
index 85d55c3c77b819da8b61c1c1fb2790cbc16ba077..8611f47d57dec441a7d1817f7e36af0fd1ecd9c0 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -984,7 +984,7 @@ i_gradgen(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure) {
        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];
     }
@@ -1037,7 +1037,7 @@ i_nearest_color_foo(i_img *im, int num, int *xo, int *yo, i_color *ival, int dme
       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++) {
@@ -1054,7 +1054,7 @@ i_nearest_color_foo(i_img *im, int num, int *xo, int *yo, i_color *ival, int dme
        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;
@@ -1197,7 +1197,7 @@ i_nearest_color(i_img *im, int num, int *xo, int *yo, i_color *oval, int dmeasur
       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++) {
@@ -1214,7 +1214,7 @@ i_nearest_color(i_img *im, int num, int *xo, int *yo, i_color *oval, int dmeasur
        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;
diff --git a/font.c b/font.c
index 9dfc83db461a3618f37e257ea381db9fc1db9d10..e228fbab859812813c4797d1ceac246868823379 100644 (file)
--- a/font.c
+++ b/font.c
@@ -1087,14 +1087,14 @@ i_tt_init_raster_map( TT_Raster_Map* bit, int width, int height, int smooth ) {
 
   /* 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 );
 }
 
 
diff --git a/gif.c b/gif.c
index 191f24cfd23889a96f833b991d76271adaa202ab..84b51bf17bff752cf1cc83317faccc1a44d75233 100644 (file)
--- a/gif.c
+++ b/gif.c
@@ -539,7 +539,7 @@ i_img **i_readgif_multi_low(GifFileType *GifFile, int *count, int page) {
   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 {
index 685ed164e4c4c68442e5157e6c30183b23eb6a3b..cd74f241ac60f613966074ec8906f30bb0dd3c2f 100644 (file)
--- a/hlines.c
+++ b/hlines.c
@@ -68,7 +68,7 @@ i_int_init_hlines(
   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;
@@ -111,7 +111,7 @@ i_int_hlines_add(i_int_hlines *hlines, int y, int x, int width) {
   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 */
diff --git a/image.c b/image.c
index 3d8880bab22c981d6e99b8602c39071ae25ea692..a96a383abdf81525c1074b62064e80bbd4b2ad6b 100644 (file)
--- a/image.c
+++ b/image.c
@@ -71,7 +71,7 @@ ICL_new_internal(unsigned char r,unsigned char g,unsigned char b,unsigned char a
 
   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;
@@ -100,7 +100,7 @@ ICL_set_internal(i_color *cl,unsigned char r,unsigned char g,unsigned char b,uns
   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;
@@ -173,7 +173,7 @@ i_fcolor *i_fcolor_new(double r, double g, double b, double a) {
 
   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;
@@ -300,7 +300,7 @@ i_img_new() {
   
   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;
@@ -372,7 +372,7 @@ i_img_empty_ch(i_img *im,int x,int y,int ch) {
 
   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);
@@ -382,7 +382,7 @@ i_img_empty_ch(i_img *im,int x,int y,int ch) {
   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;
index 186dbb3b04b05a175393b98365d6fc07793a3fa5..9741f7a7c6fc7e05767152cd5121208e844d32f9 100644 (file)
--- a/imexif.c
+++ b/imexif.c
@@ -1013,7 +1013,7 @@ tiff_get_tag_double_array(imtiff *tiff, int index, double *result,
   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;
@@ -1077,7 +1077,7 @@ static int
 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;
@@ -1108,12 +1108,12 @@ tiff_get_tag_int_array(imtiff *tiff, int index, int *result, int array_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;
@@ -1163,7 +1163,7 @@ static int
 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;
@@ -1290,7 +1290,7 @@ copy_num_array_tags(i_img *im, imtiff *tiff, tag_map *map, int map_count) {
          *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, " ");
@@ -1306,7 +1306,7 @@ copy_num_array_tags(i_img *im, imtiff *tiff, tag_map *map, int map_count) {
          *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, " ");
@@ -1383,7 +1383,7 @@ Retrieve a 16 bit unsigned integer from offset.
 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];
@@ -1402,7 +1402,7 @@ Retrieve a 32-bit unsigned integer from offset.
 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] 
@@ -1447,7 +1447,7 @@ tiff_get16s(imtiff *tiff, unsigned long offset) {
   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];
@@ -1473,7 +1473,7 @@ tiff_get32s(imtiff *tiff, unsigned long offset) {
   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] 
@@ -1501,7 +1501,7 @@ static double
 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);
@@ -1525,7 +1525,7 @@ static double
 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);
index 25f2ad6eec7216890d59e073df55a6820df3cff9..2ef6f501b3ae363935be9e3400ed6f464f481e92 100644 (file)
--- a/iolayer.c
+++ b/iolayer.c
@@ -761,7 +761,7 @@ bufchain_seek(io_glue *ig, off_t offset, int whence) {
       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;
     }
   }
@@ -1049,7 +1049,7 @@ io_slurp(io_glue *ig, unsigned char **c) {
   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;
@@ -1062,7 +1062,7 @@ io_slurp(io_glue *ig, unsigned char **c) {
   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;
 }
diff --git a/log.c b/log.c
index 52f3939771f5a0f3306354f24d31697bf067c774..fb08ffd4a91afb10bfe48f80eff2952a21631d78 100644 (file)
--- a/log.c
+++ b/log.c
@@ -38,7 +38,7 @@ i_init_log(const char* name,int level) {
 }
 
 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;
@@ -62,7 +62,7 @@ m_fatal(int exitcode,const char *fmt, ... ) {
  */
 
 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