Branch: Tag:

1999-06-18

1999-06-18 19:19:29 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

autoconverted a lot of 'bad arg' and 'out of memory' type errors

Rev: src/modules/Image/blit.c:1.37
Rev: src/modules/Image/colors.c:1.22
Rev: src/modules/Image/colortable.c:1.71
Rev: src/modules/Image/dct.c:1.14
Rev: src/modules/Image/font.c:1.52
Rev: src/modules/Image/image.c:1.146
Rev: src/modules/Image/matrix.c:1.20
Rev: src/modules/Image/orient.c:1.12
Rev: src/modules/Image/search.c:1.12

1: - /* $Id: font.c,v 1.51 1999/06/03 17:20:11 mirar Exp $ */ + /* $Id: font.c,v 1.52 1999/06/18 19:19:21 mirar Exp $ */   #include "global.h"      #define SPACE_CHAR 'i'
9:   /*   **! module Image   **! note - **! $Id: font.c,v 1.51 1999/06/03 17:20:11 mirar Exp $ + **! $Id: font.c,v 1.52 1999/06/18 19:19:21 mirar Exp $   **! class Font   **!   **! note
557:    maxwidth2=1;       width_of=(int *)malloc((args+1)*sizeof(int)); -  if(!width_of) error("Out of memory\n"); +  if(!width_of) resource_error(NULL,0,0,"memory",0,"Out of memory.\n");       for (j=0; j<args; j++)    {    int max;    if (sp[j-args].type!=T_STRING) -  error("font->write: illegal argument(s)\n"); +  bad_arg_error("font->write",sp-args,args,0,"",sp-args, +  "Bad arguments to font->write()\n");       xsize = max = 1;    to_write_len = sp[j-args].u.string->len;
625:    img->rgb.r=img->rgb.g=img->rgb.b=255;    img->img=malloc(img->xsize*img->ysize*sizeof(rgb_group)+1);    -  if (!img) { free_object(o); free(width_of); error("Out of memory\n"); } +  if (!img) { free_object(o); free(width_of); resource_error(NULL,0,0,"memory",0,"Out of memory.\n"); }       MEMSET(img->img,0,img->xsize*img->ysize*sizeof(rgb_group));   
757:    p_wchar2 *to_write2;    int to_write_len;    if (sp[j-args].type!=T_STRING) -  error("font->write: illegal argument(s)\n"); +  bad_arg_error("font->write",sp-args,args,0,"",sp-args, +  "Bad arguments to font->write()\n");       xsize = max = 1;    to_write_len = sp[j-args].u.string->len;