Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
04e10f95
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
大约 1 年 前同步成功
通知
34
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
04e10f95
编写于
1月 18, 2017
作者:
M
Mark VanderVoord
提交者:
GitHub
1月 18, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #249 from jsalling/feature/no-print-mask
No print masking of integers, bounds on hex printing (Thanks!)
上级
f1fdc47e
437c474b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
7 addition
and
19 deletion
+7
-19
src/unity.c
src/unity.c
+7
-19
未找到文件。
src/unity.c
浏览文件 @
04e10f95
...
...
@@ -52,21 +52,6 @@ static const char UnityStrResultsIgnored[] = " Ignored ";
static
const
char
UnityStrDetail1Name
[]
=
UNITY_DETAIL1_NAME
" "
;
static
const
char
UnityStrDetail2Name
[]
=
" "
UNITY_DETAIL2_NAME
" "
;
/* compiler-generic print formatting masks */
static
const
UNITY_UINT
UnitySizeMask
[]
=
{
255u
,
/* 0xFF */
65535u
,
/* 0xFFFF */
65535u
,
4294967295u
,
/* 0xFFFFFFFF */
4294967295u
,
4294967295u
,
4294967295u
#ifdef UNITY_SUPPORT_64
,
0xFFFFFFFFFFFFFFFF
#endif
};
/*-----------------------------------------------
* Pretty Printers & Test Result Output Handlers
*-----------------------------------------------*/
...
...
@@ -155,13 +140,13 @@ void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T
}
else
if
((
style
&
UNITY_DISPLAY_RANGE_UINT
)
==
UNITY_DISPLAY_RANGE_UINT
)
{
UnityPrintNumberUnsigned
(
(
UNITY_UINT
)
number
&
UnitySizeMask
[((
UNITY_UINT
)
style
&
(
UNITY_UINT
)
0x0F
)
-
1
]
);
UnityPrintNumberUnsigned
(
(
UNITY_UINT
)
number
);
}
else
{
UNITY_OUTPUT_CHAR
(
'0'
);
UNITY_OUTPUT_CHAR
(
'x'
);
UnityPrintNumberHex
((
UNITY_UINT
)
number
,
(
char
)((
style
&
0x
000F
)
<<
1
));
UnityPrintNumberHex
((
UNITY_UINT
)
number
,
(
char
)((
style
&
0x
F
)
*
2
));
}
}
...
...
@@ -203,12 +188,15 @@ void UnityPrintNumberUnsigned(const UNITY_UINT number)
/*-----------------------------------------------*/
void
UnityPrintNumberHex
(
const
UNITY_UINT
number
,
const
char
nibbles_to_print
)
{
UNITY_UINT
nibble
;
int
nibble
;
char
nibbles
=
nibbles_to_print
;
if
((
unsigned
)
nibbles
>
(
2
*
sizeof
(
number
)))
nibbles
=
2
*
sizeof
(
number
);
while
(
nibbles
>
0
)
{
nibble
=
(
number
>>
(
--
nibbles
<<
2
))
&
0x0000000F
;
nibbles
--
;
nibble
=
(
number
>>
(
nibbles
*
4
))
&
0x0F
;
if
(
nibble
<=
9
)
{
UNITY_OUTPUT_CHAR
((
char
)(
'0'
+
nibble
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录