1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 20:10:08 +03:00

Rename char2idx to char2zchar

This commit is contained in:
Bertrand Songis 2019-02-21 10:35:48 +01:00
parent 61af68caf8
commit e4fa31be28
10 changed files with 21 additions and 21 deletions

View file

@ -28,7 +28,7 @@ char hex2zchar(uint8_t hex)
return (hex >= 10 ? hex-9 : 27+hex);
}
char idx2char(int8_t idx)
char zchar2char(int8_t idx)
{
if (idx == 0) return ' ';
if (idx < 0) {
@ -44,7 +44,7 @@ char idx2char(int8_t idx)
return ' ';
}
int8_t char2idx(char c)
int8_t char2zchar(char c)
{
if (c == '_') return 37;
#if LEN_SPECIAL_CHARS > 0
@ -63,14 +63,14 @@ void str2zchar(char * dest, const char * src, int size)
{
memset(dest, 0, size);
for (int c=0; c<size && src[c]; c++) {
dest[c] = char2idx(src[c]);
dest[c] = char2zchar(src[c]);
}
}
int zchar2str(char * dest, const char * src, int size)
{
for (int c=0; c<size; c++) {
dest[c] = idx2char(src[c]);
dest[c] = zchar2char(src[c]);
}
do {
dest[size--] = '\0';
@ -122,7 +122,7 @@ char * strcat_zchar(char * dest, const char * name, uint8_t size, const char * d
len = i+1;
if (len) {
if (dest[i])
dest[i] = idx2char(dest[i]);
dest[i] = zchar2char(dest[i]);
else
dest[i] = '_';
}