1 Star 0 Fork 36

杨显钊/secGear

forked from src-openEuler/secGear 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0032-del-size_to_aligned_size.patch 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
chenmaodong 提交于 2021-05-20 19:43 . 内容可能含有违规信息
From f31970aac34d3e6fb6c50508ec5d5d4e07da0e0a Mon Sep 17 00:00:00 2001
From: zgzxx <zhangguangzhi3@huawei.com>
Date: Fri, 21 May 2021 11:14:06 +0800
Subject: [PATCH] del size_to_aligned_size
---
tools/codegener/Commonfunc.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/codegener/Commonfunc.ml b/tools/codegener/Commonfunc.ml
index 42d62c4..6f3966a 100644
--- a/tools/codegener/Commonfunc.ml
+++ b/tools/codegener/Commonfunc.ml
@@ -428,7 +428,7 @@ let set_in_memcpy (fd : func_decl) =
sprintf "for (int i = 0; i < %s; i++) {\n if((%s + i)->%s) {\n memcpy(in_buf + %s_p + tmp_size, (uint8_t *)(%s + i)->%s, %s);\n tmp_size += size_to_aligned_size(%s);\n }\n }\n tmp_size = 0;\n " (get_param_count pty) decl.identifier mem_decl.identifier mem_decl.identifier decl.identifier mem_decl.identifier (get_sizestr_2 (mem_pty, mem_decl) decl) (get_sizestr_2 (mem_pty, mem_decl) decl) in
[
"/* Copy in_params to in_buf*/";
- sprintf "memcpy(in_buf, &args_size, size_to_aligned_size(sizeof(%s_size_t)));" fd.fname;
+ sprintf "memcpy(in_buf, &args_size, sizeof(%s_size_t));" fd.fname;
if in_memcpy <> [] then
concat "\n " in_memcpy ^ "\n " ^
concat "\n "
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xzyangha/secGear.git
git@gitee.com:xzyangha/secGear.git
xzyangha
secGear
secGear
master

搜索帮助