mirror of
https://github.com/RubyMetric/chsrc
synced 2026-10-25 17:36:32 +08:00
xy_int_to_str() 重命名
This commit is contained in:
3 files changed
+6
-6
No files matched your search
@@ -451,7 +451,7 @@ xy_strdup (const char *str)
|
||||
* return caller-free
|
||||
*/
|
||||
static char *
|
||||
xy_int_to_str (int value)
|
||||
xy_int2str (int value)
|
||||
{
|
||||
/**
|
||||
* sizeof (int) * CHAR_BIT
|
||||
|
||||
+2
-2
@@ -701,9 +701,9 @@ get_target (const char *input, TargetOp code, char *option)
|
||||
{
|
||||
int sub_count = xy_seq_len (target->sub_targets);
|
||||
|
||||
char *zh_msg = xy_strcat (4, input, " 由以下", xy_int_to_str(sub_count),
|
||||
char *zh_msg = xy_strcat (4, input, " 由以下", xy_int2str(sub_count),
|
||||
"个子目标组成,可使用 chsrc ls <sub-target> 分别查看\n");
|
||||
char *en_msg = xy_strcat (4, input, " consists of the following ", xy_int_to_str(sub_count),
|
||||
char *en_msg = xy_strcat (4, input, " consists of the following ", xy_int2str(sub_count),
|
||||
" sub targets, you can use `chsrc ls <sub-target>` to view each\n");
|
||||
|
||||
chsrc_log (bdyellow(CHINESE ? zh_msg : en_msg));
|
||||
|
||||
@@ -100,9 +100,9 @@ main (int argc, char const *argv[])
|
||||
assert_str ("abcdefg", xy_str_delete_prefix ("abcdefg", ""));
|
||||
assert_str ("defg", xy_str_delete_prefix ("abcdefg", "abc"));
|
||||
|
||||
assert_str ("0", xy_int_to_str (0));
|
||||
assert_str ("12345", xy_int_to_str (12345));
|
||||
assert_str ("-2147483648", xy_int_to_str (INT_MIN));
|
||||
assert_str ("0", xy_int2str (0));
|
||||
assert_str ("12345", xy_int2str (12345));
|
||||
assert_str ("-2147483648", xy_int2str (INT_MIN));
|
||||
|
||||
assert (0 == xy_str2int (NULL));
|
||||
assert (0 == xy_str2int (""));
|
||||
|
||||
Reference in new issue
Block a user