Skip to content
Snippets Groups Projects
Commit e0427f67 authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

Fix to work with static modules.

Rev: src/post_modules/GL/auto.c.in:1.13
parent b76b9a51
Branches
Tags
No related merge requests found
/* /*
* $Id: auto.c.in,v 1.12 1999/08/17 20:59:12 marcus Exp $ * $Id: auto.c.in,v 1.13 1999/08/18 15:16:20 marcus Exp $
* *
*/ */
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "config.h" #include "config.h"
RCSID("$Id: auto.c.in,v 1.12 1999/08/17 20:59:12 marcus Exp $"); RCSID("$Id: auto.c.in,v 1.13 1999/08/18 15:16:20 marcus Exp $");
#include "stralloc.h" #include "stralloc.h"
#include "pike_macros.h" #include "pike_macros.h"
#include "object.h" #include "object.h"
...@@ -56,8 +56,6 @@ struct zimage { ...@@ -56,8 +56,6 @@ struct zimage {
int alloc; int alloc;
}; };
static struct program *image_program=NULL;
static int check_234_args(char *func, INT32 args, int mn, int mx, int ty, static int check_234_args(char *func, INT32 args, int mn, int mx, int ty,
int rty, struct zvalue4 *ret) int rty, struct zvalue4 *ret)
{ {
...@@ -149,6 +147,22 @@ static void check_img_arg(struct svalue *a, struct zimage *img, ...@@ -149,6 +147,22 @@ static void check_img_arg(struct svalue *a, struct zimage *img,
struct { unsigned char r, g, b; } *p1, *p2; struct { unsigned char r, g, b; } *p1, *p2;
INT32 cnt; INT32 cnt;
static struct program *image_program=NULL;
if(image_program == NULL) {
push_string(make_shared_string("Image")); push_int(0);
SAFE_APPLY_MASTER("resolv",2);
if (sp[-1].type==T_OBJECT)
{
push_string(make_shared_string("image"));
f_index(2);
image_program=program_from_svalue(sp-1);
pop_stack();
}
if(image_program == NULL)
error("%s: Can't resolve Image.image!\n", func);
}
img->alloc = 0; img->alloc = 0;
if(a->type == T_MAPPING) { if(a->type == T_MAPPING) {
struct svalue *v; struct svalue *v;
...@@ -334,16 +348,6 @@ static int check_1n_args(char *func, INT32 args, int ty, int rty, ...@@ -334,16 +348,6 @@ static int check_1n_args(char *func, INT32 args, int ty, int rty,
static void pre_init() static void pre_init()
{ {
image_program = NULL;
push_string(make_shared_string("Image")); push_int(0);
SAFE_APPLY_MASTER("resolv",2);
if (sp[-1].type==T_OBJECT)
{
push_string(make_shared_string("image"));
f_index(2);
image_program=program_from_svalue(sp-1);
pop_stack();
}
} }
static void post_init() static void post_init()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment