summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-10-01 22:28:08 +0800
committerIru Cai <mytbk920423@gmail.com>2018-10-01 22:28:08 +0800
commit826e8e554338035e97c1b64067fa97aa77d3023b (patch)
treec88ee9bb9123c21ebe1ae02795ac1c55bf3768c2
parentb1c77551dce9570b8a7fb6baeef0e17e23f3dda0 (diff)
downloadrich4-826e8e554338035e97c1b64067fa97aa77d3023b.tar.xz
fix graph_struct.c
-rw-r--r--csrc/mkf/graph_struct.c10
1 files 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 <string.h>
#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;
}