From 826e8e554338035e97c1b64067fa97aa77d3023b Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Mon, 1 Oct 2018 22:28:08 +0800 Subject: fix graph_struct.c --- csrc/mkf/graph_struct.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/csrc/mkf/graph_struct.c b/csrc/mkf/graph_struct.c index 52aa207..1c4253c 100644 --- a/csrc/mkf/graph_struct.c +++ b/csrc/mkf/graph_struct.c @@ -7,14 +7,10 @@ #include #include "graph_struct.h" -static inline void mem_copy_words(void *dst, void *src, size_t n) -{ - memcpy(dst, src, n*2); -} - struct graph_st * allocate_graph_st(int w, int h, int x, int y) { - struct graph_st * newst = (struct graph_st *)malloc(w * h * 2 + sizeof(graph_st)); + struct graph_st * newst = (struct graph_st *) + malloc(w * h * 2 + sizeof(struct graph_st)); newst->width = w; newst->height = h; newst->x = x; @@ -38,7 +34,7 @@ struct graph_st * crop_graph(struct graph_st *a1, struct graph_st *a2, int x, in int16_t *dst = a2->gdata; for (int i = 0; i < h; i++) { - mem_copy_words(esi, ebx, w); + memcpy(dst, src, w * 2); dst = dst + w; src = src + a1->width; } -- cgit v1.2.3