Skip to content
Snippets Groups Projects
Commit a00ca98f authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Fixed bug and threading-bug.

Rev: src/modules/Image/x.c:1.14
parent 99f1eab0
Branches
Tags
No related merge requests found
/* $Id: x.c,v 1.13 1997/11/07 06:06:18 mirar Exp $ */ /* $Id: x.c,v 1.14 1997/11/08 00:10:03 grubba Exp $ */
/* /*
**! module Image **! module Image
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "stralloc.h" #include "stralloc.h"
#include "global.h" #include "global.h"
RCSID("$Id: x.c,v 1.13 1997/11/07 06:06:18 mirar Exp $"); RCSID("$Id: x.c,v 1.14 1997/11/08 00:10:03 grubba Exp $");
#include "pike_macros.h" #include "pike_macros.h"
#include "object.h" #include "object.h"
#include "constants.h" #include "constants.h"
...@@ -24,6 +24,7 @@ RCSID("$Id: x.c,v 1.13 1997/11/07 06:06:18 mirar Exp $"); ...@@ -24,6 +24,7 @@ RCSID("$Id: x.c,v 1.13 1997/11/07 06:06:18 mirar Exp $");
#include "port.h" #include "port.h"
#include "image.h" #include "image.h"
#include "colortable.h"
#include "builtin_functions.h" #include "builtin_functions.h"
extern struct program *image_colortable_program; extern struct program *image_colortable_program;
...@@ -52,7 +53,8 @@ void image_to8bit(INT32 args) /* compat function */ ...@@ -52,7 +53,8 @@ void image_to8bit(INT32 args) /* compat function */
{ {
struct neo_colortable *nct; struct neo_colortable *nct;
struct object *o; struct object *o;
struct pike_string *res = begin_shared_string((THIS->xsize*THIS->ysize)); struct image *this = THIS;
struct pike_string *res = begin_shared_string((this->xsize*this->ysize));
unsigned long i; unsigned long i;
rgb_group *s; rgb_group *s;
unsigned char *d; unsigned char *d;
...@@ -62,14 +64,14 @@ void image_to8bit(INT32 args) /* compat function */ ...@@ -62,14 +64,14 @@ void image_to8bit(INT32 args) /* compat function */
o=clone_object(image_colortable_program,args); o=clone_object(image_colortable_program,args);
nct=get_storage(o,image_colortable_program); nct=get_storage(o,image_colortable_program);
i=THIS->xsize*THIS->ysize; i=this->xsize*this->ysize;
s=THIS->img; s=this->img;
d=(unsigned char *)res->str; d=(unsigned char *)res->str;
THREADS_ALLOW(); THREADS_ALLOW();
image_colortable_index_8bit_image(nct,THIS->img, image_colortable_index_8bit_image(nct,this->img,d,
THIS->xsize*THIS->ysize,THIS->xsize); this->xsize*this->ysize,this->xsize);
THREADS_DISALLOW(); THREADS_DISALLOW();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment