Browse Source

libpipi: get rid of all remaining large stack allocations.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2942 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
92c813ec69
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      pipi/codec/oric.c

+ 6
- 5
pipi/codec/oric.c View File

@@ -524,15 +524,16 @@ static uint8_t bestmove(int const *in, uint8_t bg, uint8_t fg,

static void write_screen(float const *data, uint8_t *screen)
{
int src[(WIDTH + 1) * (HEIGHT + 1) * 3];
int dst[(WIDTH + 1) * (HEIGHT + 1) * 3];
int *srcl, *dstl;
int *src, *srcl, *dst, *dstl;
int stride, x, y, depth, c;

stride = (WIDTH + 1) * 3;

memset(src, 0, sizeof(src));
memset(dst, 0, sizeof(dst));
src = malloc((WIDTH + 1) * (HEIGHT + 1) * 3);
memset(src, 0, (WIDTH + 1) * (HEIGHT + 1) * 3);

dst = malloc((WIDTH + 1) * (HEIGHT + 1) * 3);
memset(dst, 0, (WIDTH + 1) * (HEIGHT + 1) * 3);

/* Import pixels into our custom format */
for(y = 0; y < HEIGHT; y++)


Loading…
Cancel
Save