mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Remove some hardcoded values in favour of constants
darcs-hash:20060514132510-ac50b-2c703e8892d04b7d74555d05eb6618140e281a61.gz
This commit is contained in:
parent
9ebdc16be6
commit
32e54fd719
1 changed files with 18 additions and 3 deletions
21
common.c
21
common.c
|
@ -72,6 +72,21 @@ parts of fish.
|
|||
*/
|
||||
#define LOCKPOLLINTERVAL 10
|
||||
|
||||
/**
|
||||
Highest legal ascii value
|
||||
*/
|
||||
#define ASCII_MAX 127u
|
||||
|
||||
/**
|
||||
Highest legal 16-bit unicode value
|
||||
*/
|
||||
#define UCS2_MAX 0xffffu
|
||||
|
||||
/**
|
||||
Highest legal byte value
|
||||
*/
|
||||
#define BYTE_MAX 0xffu
|
||||
|
||||
struct termios shell_modes;
|
||||
|
||||
int error_max=1;
|
||||
|
@ -842,14 +857,14 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
|
|||
int base=16;
|
||||
|
||||
int byte = 0;
|
||||
wchar_t max_val = 127;
|
||||
wchar_t max_val = ASCII_MAX;
|
||||
|
||||
switch( in[in_pos] )
|
||||
{
|
||||
case L'u':
|
||||
{
|
||||
chars=4;
|
||||
max_val = 35535;
|
||||
max_val = UCS2_MAX;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -868,7 +883,7 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
|
|||
case L'X':
|
||||
{
|
||||
byte=1;
|
||||
max_val = 255;
|
||||
max_val = BYTE_MAX;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue