Commit 1b0339ad authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

replaced a for-loop with a call to memcpy().

2003-02-21  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-render.c (render_image_rgb):
	replaced a for-loop with a call to memcpy().

	* app/display/gimpdisplay.c: use g_memdup() instead of g_new()
	followed by memcpy().
parent 361c288c
2003-02-21 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-render.c (render_image_rgb):
replaced a for-loop with a call to memcpy().
* app/display/gimpdisplay.c: use g_memdup() instead of g_new()
followed by memcpy().
2003-02-21 Michael Natterer <mitch@gimp.org>
 
* app/tools/gimptransformoptions.c
......
......@@ -18,8 +18,6 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "display-types.h"
......@@ -506,9 +504,7 @@ gimp_display_idlerender_init (GimpDisplay *gdisp)
{
area = (GimpArea *) list->data;
new_area = g_new (GimpArea, 1);
memcpy (new_area, area, sizeof (GimpArea));
new_area = g_memdup (area, sizeof (GimpArea));
gdisp->idle_render.update_areas =
gimp_display_area_list_process (gdisp->idle_render.update_areas,
......
......@@ -18,8 +18,6 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "display-types.h"
......@@ -506,9 +504,7 @@ gimp_display_idlerender_init (GimpDisplay *gdisp)
{
area = (GimpArea *) list->data;
new_area = g_new (GimpArea, 1);
memcpy (new_area, area, sizeof (GimpArea));
new_area = g_memdup (area, sizeof (GimpArea));
gdisp->idle_render.update_areas =
gimp_display_area_list_process (gdisp->idle_render.update_areas,
......
......@@ -676,11 +676,9 @@ render_image_gray_a (RenderInfo *info)
static void
render_image_rgb (RenderInfo *info)
{
guchar *src;
guchar *dest;
gint byte_order;
gint y, ye;
gint x, xe;
gint xe;
gint initial;
gfloat error;
gfloat step;
......@@ -706,21 +704,9 @@ render_image_rgb (RenderInfo *info)
}
else
{
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
/* replace this with memcpy, or better yet, avoid it altogether? */
for (x = info->x; x < xe; x++)
{
dest[0] = src[0];
dest[1] = src[1];
dest[2] = src[2];
g_return_if_fail (info->src != NULL);
src += 3;
dest += 3;
}
memcpy (info->dest, info->src, 3 * info->w);
}
info->dest += info->dest_bpl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment