aboutsummaryrefslogtreecommitdiff
path: root/ui/sdl_zoom_template.h
diff options
context:
space:
mode:
authorLinaro Packagers <linaro-pkg@lists.launchpad.net>2013-02-25 10:33:42 +0000
committerFathi Boudra <fathi.boudra@linaro.org>2013-03-30 21:18:26 +0200
commitc3565b8703553405641c76a4c40961473d051edd (patch)
tree01be1a3169d8c72f8e0fd406b81eea561e7f87e7 /ui/sdl_zoom_template.h
parentedde41b3c75bce779549bd2e1dba18eb7beb8267 (diff)
parent050a840ead5e51a1a9f3bffe89cc89077b2f35ed (diff)
Imported Debian patch 1.4.0-2013.03-0ubuntu1~linaro1debian/1.4.0-2013.03-0ubuntu1_linaro1
Diffstat (limited to 'ui/sdl_zoom_template.h')
-rw-r--r--ui/sdl_zoom_template.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/ui/sdl_zoom_template.h b/ui/sdl_zoom_template.h
index 64bbca8..3bb508b 100644
--- a/ui/sdl_zoom_template.h
+++ b/ui/sdl_zoom_template.h
@@ -51,7 +51,7 @@
(((a) & (dpf->Amask >> dpf->Ashift)) << dpf->Ashift); \
} while (0);
-static int glue(sdl_zoom_rgb, BPP)(SDL_Surface *src, SDL_Surface *dst, int smooth,
+static void glue(sdl_zoom_rgb, BPP)(SDL_Surface *src, SDL_Surface *dst, int smooth,
SDL_Rect *dst_rect)
{
int x, y, sx, sy, *sax, *say, *csax, *csay, csx, csy, ex, ey, t1, t2, sstep, sstep_jump;
@@ -71,13 +71,8 @@ static int glue(sdl_zoom_rgb, BPP)(SDL_Surface *src, SDL_Surface *dst, int smoot
sy = (int) (65536.0 * (float) src->h / (float) dst->h);
}
- if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) {
- return (-1);
- }
- if ((say = (int *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) {
- free(sax);
- return (-1);
- }
+ sax = g_new(int, dst->w + 1);
+ say = g_new(int, dst->h + 1);
sp = csp = (SDL_TYPE *) src->pixels;
dp = (SDL_TYPE *) (dst->pixels + dst_rect->y * dst->pitch +
@@ -216,9 +211,8 @@ static int glue(sdl_zoom_rgb, BPP)(SDL_Surface *src, SDL_Surface *dst, int smoot
}
}
- free(sax);
- free(say);
- return (0);
+ g_free(sax);
+ g_free(say);
}
#undef SDL_TYPE