summaryrefslogtreecommitdiff
path: root/screenshot.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-27 12:36:59 +0000
committerdarkvater <darkvater@openttd.org>2004-09-27 12:36:59 +0000
commitedf841fb6fb6baf414b30fa2d2a21d5faf5c373c (patch)
tree40b2139cd0a555ec553833629e9f82e58c708b6d /screenshot.c
parent0dbe38fba75b7363a9535b163e47efb6a191cbca (diff)
downloadopenttd-edf841fb6fb6baf414b30fa2d2a21d5faf5c373c.tar.xz
(svn r328) -Fix: remove some unlogical alloca()s (Tron)
Diffstat (limited to 'screenshot.c')
-rw-r--r--screenshot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/screenshot.c b/screenshot.c
index fa94c8acd..3b17028dd 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -53,7 +53,7 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
{
BitmapFileHeader bfh;
BitmapInfoHeader bih;
- RgbQuad *rq = alloca(sizeof(RgbQuad) * 256);
+ RgbQuad rq[256];
byte *buff;
FILE *f;
uint i, padw;
@@ -99,7 +99,7 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
// write file header and info header and palette
fwrite(&bfh, 1, sizeof(bfh), f);
fwrite(&bih, 1, sizeof(bih), f);
- fwrite(rq, 1, sizeof(RgbQuad) * 256, f);
+ fwrite(rq, 1, sizeof(rq), f);
// use by default 64k temp memory
maxlines = clamp(65536 / padw, 16, 128);
@@ -146,7 +146,7 @@ static void PNGAPI png_my_warning(png_structp png_ptr, png_const_charp message)
static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const byte *palette)
{
- png_colorp rq = alloca(sizeof(png_color) * 256);
+ png_color rq[256];
byte *buff;
FILE *f;
uint i, y, n;