Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/common


Modified Files:
        evas_scale_sample.c 


Log Message:


use alloca - not malloc :)

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_scale_sample.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- evas_scale_sample.c 4 Apr 2007 09:55:39 -0000       1.9
+++ evas_scale_sample.c 30 Apr 2007 03:28:05 -0000      1.10
@@ -225,24 +225,21 @@
    if (dst_clip_h <= 0) return;
 
    /* allocate scale lookup tables */
-   lin_ptr = malloc(dst_clip_w * sizeof(int));
-   if (!lin_ptr) goto no_lin_ptr;
-   row_ptr = malloc(dst_clip_h * sizeof(DATA32 *));
-   if (!row_ptr) goto no_row_ptr;
+   lin_ptr = alloca(dst_clip_w * sizeof(int));
+   row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
 
    /* figure out dst jump */
    dst_jump = dst_w - dst_clip_w;
 
    /* figure out dest start ptr */
    dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
-
+   
    if (dc->mul.use)
-       func = evas_common_gfx_func_composite_pixel_color_span_get(src, 
dc->mul.col, dst, dst_clip_w, dc->render_op);
+     func = evas_common_gfx_func_composite_pixel_color_span_get(src, 
dc->mul.col, dst, dst_clip_w, dc->render_op);
    else
-       func = evas_common_gfx_func_composite_pixel_span_get(src, dst, 
dst_clip_w, dc->render_op);
+     func = evas_common_gfx_func_composite_pixel_span_get(src, dst, 
dst_clip_w, dc->render_op);
 
-   if ((dst_region_w == src_region_w) &&
-       (dst_region_h == src_region_h))
+   if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
      {
        ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + 
(dst_clip_x - dst_region_x) + src_region_x;
        for (y = 0; y < dst_clip_h; y++)
@@ -273,8 +270,8 @@
             (!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
             (!dc->mul.use))
          {
-           for (y = 0; y < dst_clip_h; y++)
-             {
+            for (y = 0; y < dst_clip_h; y++)
+              {
 #ifdef EVAS_SLI
                 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
 #endif
@@ -295,8 +292,6 @@
          {
            /* a scanline buffer */
            buf = alloca(dst_clip_w * sizeof(DATA32));
-           if (!buf) goto no_buf;
-
            for (y = 0; y < dst_clip_h; y++)
              {
 #ifdef EVAS_SLI
@@ -317,15 +312,6 @@
              }
          }
      }
-
-   no_buf:
-   /* free scale tables */
-   free(row_ptr);
-   no_row_ptr:
-   free(lin_ptr);
-
-   //_WIN32_WCE
-   no_lin_ptr: ;
 }
 #else
 #ifdef BUILD_SCALE_SMOOTH



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to