diff options
| author | Paul Eggert | 2013-03-07 18:32:21 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-03-07 18:32:21 -0800 |
| commit | 0bce5d9eb88ed1020385874ca8b3367ad6ee4359 (patch) | |
| tree | 27b8a950e134236b42e0ce055cabd94f9c1d1684 /src | |
| parent | 6d7ebb726dd39b5e5e9f12e0341a4bb350caf637 (diff) | |
| download | emacs-0bce5d9eb88ed1020385874ca8b3367ad6ee4359.tar.gz emacs-0bce5d9eb88ed1020385874ca8b3367ad6ee4359.zip | |
print.c, process.c: Use bool for booleans.
* lisp.h (wait_reading_process_output):
* print.c (print_output_debug_flag, PRINTDECLARE, printchar)
(strout, debug_output_compilation_hack, float_to_string, print)
(print_object):
* process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
(decode_status, status_message, create_process, create_pty)
(Fmake_network_process, Fnetwork_interface_info)
(wait_reading_process_output, read_process_output)
(write_queue_push, write_queue_pop, process_send_signal)
(handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
* process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
Use bool for booleans.
* process.c (Fnetwork_interface_list): Remove unused local.
(connect_counter): Now EMACS_INT, not int.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 18 | ||||
| -rw-r--r-- | src/lisp.h | 8 | ||||
| -rw-r--r-- | src/print.c | 36 | ||||
| -rw-r--r-- | src/process.c | 82 | ||||
| -rw-r--r-- | src/process.h | 8 |
5 files changed, 86 insertions, 66 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 02c928f8f82..cadb7e11ce8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2013-03-08 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | print.c, process.c: Use bool for booleans. | ||
| 4 | * lisp.h (wait_reading_process_output): | ||
| 5 | * print.c (print_output_debug_flag, PRINTDECLARE, printchar) | ||
| 6 | (strout, debug_output_compilation_hack, float_to_string, print) | ||
| 7 | (print_object): | ||
| 8 | * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip) | ||
| 9 | (decode_status, status_message, create_process, create_pty) | ||
| 10 | (Fmake_network_process, Fnetwork_interface_info) | ||
| 11 | (wait_reading_process_output, read_process_output) | ||
| 12 | (write_queue_push, write_queue_pop, process_send_signal) | ||
| 13 | (handle_child_signal, keyboard_bit_set, kbd_on_hold_p): | ||
| 14 | * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p): | ||
| 15 | Use bool for booleans. | ||
| 16 | * process.c (Fnetwork_interface_list): Remove unused local. | ||
| 17 | (connect_counter): Now EMACS_INT, not int. | ||
| 18 | |||
| 1 | 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru> | 19 | 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 20 | ||
| 3 | * bidi.c (bidi_fetch_char): Swap first and second arguments | 21 | * bidi.c (bidi_fetch_char): Swap first and second arguments |
diff --git a/src/lisp.h b/src/lisp.h index 72bf4223d6b..6e10fc0f838 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3498,10 +3498,10 @@ extern bool running_asynch_code; | |||
| 3498 | extern Lisp_Object QCtype, Qlocal; | 3498 | extern Lisp_Object QCtype, Qlocal; |
| 3499 | extern Lisp_Object Qprocessp; | 3499 | extern Lisp_Object Qprocessp; |
| 3500 | extern void kill_buffer_processes (Lisp_Object); | 3500 | extern void kill_buffer_processes (Lisp_Object); |
| 3501 | extern int wait_reading_process_output (intmax_t, int, int, bool, | 3501 | extern bool wait_reading_process_output (intmax_t, int, int, bool, |
| 3502 | Lisp_Object, | 3502 | Lisp_Object, |
| 3503 | struct Lisp_Process *, | 3503 | struct Lisp_Process *, |
| 3504 | int); | 3504 | int); |
| 3505 | /* Max value for the first argument of wait_reading_process_output. */ | 3505 | /* Max value for the first argument of wait_reading_process_output. */ |
| 3506 | #if __GNUC__ == 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) | 3506 | #if __GNUC__ == 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) |
| 3507 | /* Work around a bug in GCC 3.4.2, known to be fixed in GCC 4.6.3. | 3507 | /* Work around a bug in GCC 3.4.2, known to be fixed in GCC 4.6.3. |
diff --git a/src/print.c b/src/print.c index 4aae4118152..03b46748454 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -84,7 +84,7 @@ static ptrdiff_t print_number_index; | |||
| 84 | static void print_interval (INTERVAL interval, Lisp_Object printcharfun); | 84 | static void print_interval (INTERVAL interval, Lisp_Object printcharfun); |
| 85 | 85 | ||
| 86 | /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ | 86 | /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ |
| 87 | int print_output_debug_flag EXTERNALLY_VISIBLE = 1; | 87 | bool print_output_debug_flag EXTERNALLY_VISIBLE = 1; |
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | /* Low level output routines for characters and strings. */ | 90 | /* Low level output routines for characters and strings. */ |
| @@ -101,7 +101,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1; | |||
| 101 | ptrdiff_t old_point = -1, start_point = -1; \ | 101 | ptrdiff_t old_point = -1, start_point = -1; \ |
| 102 | ptrdiff_t old_point_byte = -1, start_point_byte = -1; \ | 102 | ptrdiff_t old_point_byte = -1, start_point_byte = -1; \ |
| 103 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); \ | 103 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); \ |
| 104 | int free_print_buffer = 0; \ | 104 | bool free_print_buffer = 0; \ |
| 105 | bool multibyte \ | 105 | bool multibyte \ |
| 106 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ | 106 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ |
| 107 | Lisp_Object original | 107 | Lisp_Object original |
| @@ -241,7 +241,7 @@ printchar (unsigned int ch, Lisp_Object fun) | |||
| 241 | } | 241 | } |
| 242 | else | 242 | else |
| 243 | { | 243 | { |
| 244 | int multibyte_p | 244 | bool multibyte_p |
| 245 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 245 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 246 | 246 | ||
| 247 | setup_echo_area_for_printing (multibyte_p); | 247 | setup_echo_area_for_printing (multibyte_p); |
| @@ -290,7 +290,7 @@ strout (const char *ptr, ptrdiff_t size, ptrdiff_t size_byte, | |||
| 290 | here, that's the reason we don't call printchar to do the | 290 | here, that's the reason we don't call printchar to do the |
| 291 | job. */ | 291 | job. */ |
| 292 | int i; | 292 | int i; |
| 293 | int multibyte_p | 293 | bool multibyte_p |
| 294 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 294 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 295 | 295 | ||
| 296 | setup_echo_area_for_printing (multibyte_p); | 296 | setup_echo_area_for_printing (multibyte_p); |
| @@ -508,10 +508,10 @@ temp_output_buffer_setup (const char *bufname) | |||
| 508 | specbind (Qstandard_output, buf); | 508 | specbind (Qstandard_output, buf); |
| 509 | } | 509 | } |
| 510 | 510 | ||
| 511 | static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); | 511 | static void print (Lisp_Object, Lisp_Object, bool); |
| 512 | static void print_preprocess (Lisp_Object obj); | 512 | static void print_preprocess (Lisp_Object); |
| 513 | static void print_preprocess_string (INTERVAL interval, Lisp_Object arg); | 513 | static void print_preprocess_string (INTERVAL, Lisp_Object); |
| 514 | static void print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); | 514 | static void print_object (Lisp_Object, Lisp_Object, bool); |
| 515 | 515 | ||
| 516 | DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, | 516 | DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, |
| 517 | doc: /* Output a newline to stream PRINTCHARFUN. | 517 | doc: /* Output a newline to stream PRINTCHARFUN. |
| @@ -727,9 +727,9 @@ to make it write to the debugging output. */) | |||
| 727 | /* This function is never called. Its purpose is to prevent | 727 | /* This function is never called. Its purpose is to prevent |
| 728 | print_output_debug_flag from being optimized away. */ | 728 | print_output_debug_flag from being optimized away. */ |
| 729 | 729 | ||
| 730 | extern void debug_output_compilation_hack (int) EXTERNALLY_VISIBLE; | 730 | extern void debug_output_compilation_hack (bool) EXTERNALLY_VISIBLE; |
| 731 | void | 731 | void |
| 732 | debug_output_compilation_hack (int x) | 732 | debug_output_compilation_hack (bool x) |
| 733 | { | 733 | { |
| 734 | print_output_debug_flag = x; | 734 | print_output_debug_flag = x; |
| 735 | } | 735 | } |
| @@ -967,7 +967,7 @@ float_to_string (char *buf, double data) | |||
| 967 | static char const NaN_string[] = "0.0e+NaN"; | 967 | static char const NaN_string[] = "0.0e+NaN"; |
| 968 | int i; | 968 | int i; |
| 969 | union { double d; char c[sizeof (double)]; } u_data, u_minus_zero; | 969 | union { double d; char c[sizeof (double)]; } u_data, u_minus_zero; |
| 970 | int negative = 0; | 970 | bool negative = 0; |
| 971 | u_data.d = data; | 971 | u_data.d = data; |
| 972 | u_minus_zero.d = - 0.0; | 972 | u_minus_zero.d = - 0.0; |
| 973 | for (i = 0; i < sizeof (double); i++) | 973 | for (i = 0; i < sizeof (double); i++) |
| @@ -1064,7 +1064,7 @@ float_to_string (char *buf, double data) | |||
| 1064 | 1064 | ||
| 1065 | 1065 | ||
| 1066 | static void | 1066 | static void |
| 1067 | print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) | 1067 | print (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) |
| 1068 | { | 1068 | { |
| 1069 | new_backquote_output = 0; | 1069 | new_backquote_output = 0; |
| 1070 | 1070 | ||
| @@ -1314,7 +1314,7 @@ print_prune_string_charset (Lisp_Object string) | |||
| 1314 | } | 1314 | } |
| 1315 | 1315 | ||
| 1316 | static void | 1316 | static void |
| 1317 | print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) | 1317 | print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) |
| 1318 | { | 1318 | { |
| 1319 | char buf[max (sizeof "from..to..in " + 2 * INT_STRLEN_BOUND (EMACS_INT), | 1319 | char buf[max (sizeof "from..to..in " + 2 * INT_STRLEN_BOUND (EMACS_INT), |
| 1320 | max (sizeof " . #" + INT_STRLEN_BOUND (printmax_t), | 1320 | max (sizeof " . #" + INT_STRLEN_BOUND (printmax_t), |
| @@ -1396,7 +1396,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 1396 | ptrdiff_t size_byte; | 1396 | ptrdiff_t size_byte; |
| 1397 | /* 1 means we must ensure that the next character we output | 1397 | /* 1 means we must ensure that the next character we output |
| 1398 | cannot be taken as part of a hex character escape. */ | 1398 | cannot be taken as part of a hex character escape. */ |
| 1399 | int need_nonhex = 0; | 1399 | bool need_nonhex = 0; |
| 1400 | bool multibyte = STRING_MULTIBYTE (obj); | 1400 | bool multibyte = STRING_MULTIBYTE (obj); |
| 1401 | 1401 | ||
| 1402 | GCPRO1 (obj); | 1402 | GCPRO1 (obj); |
| @@ -1508,10 +1508,10 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 1508 | 1508 | ||
| 1509 | case Lisp_Symbol: | 1509 | case Lisp_Symbol: |
| 1510 | { | 1510 | { |
| 1511 | register int confusing; | 1511 | bool confusing; |
| 1512 | register unsigned char *p = SDATA (SYMBOL_NAME (obj)); | 1512 | unsigned char *p = SDATA (SYMBOL_NAME (obj)); |
| 1513 | register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj)); | 1513 | unsigned char *end = p + SBYTES (SYMBOL_NAME (obj)); |
| 1514 | register int c; | 1514 | int c; |
| 1515 | ptrdiff_t i, i_byte; | 1515 | ptrdiff_t i, i_byte; |
| 1516 | ptrdiff_t size_byte; | 1516 | ptrdiff_t size_byte; |
| 1517 | Lisp_Object name; | 1517 | Lisp_Object name; |
diff --git a/src/process.c b/src/process.c index 5b15ade1122..bafdca9bd63 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -146,13 +146,13 @@ Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; | |||
| 146 | Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime; | 146 | Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime; |
| 147 | Lisp_Object QCname, QCtype; | 147 | Lisp_Object QCname, QCtype; |
| 148 | 148 | ||
| 149 | /* Non-zero if keyboard input is on hold, zero otherwise. */ | 149 | /* True if keyboard input is on hold, zero otherwise. */ |
| 150 | 150 | ||
| 151 | static int kbd_is_on_hold; | 151 | static bool kbd_is_on_hold; |
| 152 | 152 | ||
| 153 | /* Nonzero means don't run process sentinels. This is used | 153 | /* Nonzero means don't run process sentinels. This is used |
| 154 | when exiting. */ | 154 | when exiting. */ |
| 155 | int inhibit_sentinels; | 155 | bool inhibit_sentinels; |
| 156 | 156 | ||
| 157 | #ifdef subprocesses | 157 | #ifdef subprocesses |
| 158 | 158 | ||
| @@ -234,9 +234,9 @@ static EMACS_INT update_tick; | |||
| 234 | 234 | ||
| 235 | static int process_output_delay_count; | 235 | static int process_output_delay_count; |
| 236 | 236 | ||
| 237 | /* Non-zero if any process has non-nil read_output_skip. */ | 237 | /* True if any process has non-nil read_output_skip. */ |
| 238 | 238 | ||
| 239 | static int process_output_skip; | 239 | static bool process_output_skip; |
| 240 | 240 | ||
| 241 | #else | 241 | #else |
| 242 | #define process_output_delay_count 0 | 242 | #define process_output_delay_count 0 |
| @@ -244,7 +244,7 @@ static int process_output_skip; | |||
| 244 | 244 | ||
| 245 | static void create_process (Lisp_Object, char **, Lisp_Object); | 245 | static void create_process (Lisp_Object, char **, Lisp_Object); |
| 246 | #ifdef USABLE_SIGIO | 246 | #ifdef USABLE_SIGIO |
| 247 | static int keyboard_bit_set (SELECT_TYPE *); | 247 | static bool keyboard_bit_set (SELECT_TYPE *); |
| 248 | #endif | 248 | #endif |
| 249 | static void deactivate_process (Lisp_Object); | 249 | static void deactivate_process (Lisp_Object); |
| 250 | static void status_notify (struct Lisp_Process *); | 250 | static void status_notify (struct Lisp_Process *); |
| @@ -527,7 +527,7 @@ status_convert (int w) | |||
| 527 | and store them individually through the three pointers. */ | 527 | and store them individually through the three pointers. */ |
| 528 | 528 | ||
| 529 | static void | 529 | static void |
| 530 | decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, int *coredump) | 530 | decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, bool *coredump) |
| 531 | { | 531 | { |
| 532 | Lisp_Object tem; | 532 | Lisp_Object tem; |
| 533 | 533 | ||
| @@ -554,7 +554,8 @@ status_message (struct Lisp_Process *p) | |||
| 554 | { | 554 | { |
| 555 | Lisp_Object status = p->status; | 555 | Lisp_Object status = p->status; |
| 556 | Lisp_Object symbol; | 556 | Lisp_Object symbol; |
| 557 | int code, coredump; | 557 | int code; |
| 558 | bool coredump; | ||
| 558 | Lisp_Object string, string2; | 559 | Lisp_Object string, string2; |
| 559 | 560 | ||
| 560 | decode_status (status, &symbol, &code, &coredump); | 561 | decode_status (status, &symbol, &code, &coredump); |
| @@ -1579,7 +1580,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1579 | sigset_t blocked; | 1580 | sigset_t blocked; |
| 1580 | /* Use volatile to protect variables from being clobbered by vfork. */ | 1581 | /* Use volatile to protect variables from being clobbered by vfork. */ |
| 1581 | volatile int forkin, forkout; | 1582 | volatile int forkin, forkout; |
| 1582 | volatile int pty_flag = 0; | 1583 | volatile bool pty_flag = 0; |
| 1583 | volatile Lisp_Object lisp_pty_name = Qnil; | 1584 | volatile Lisp_Object lisp_pty_name = Qnil; |
| 1584 | volatile Lisp_Object encoded_current_dir; | 1585 | volatile Lisp_Object encoded_current_dir; |
| 1585 | 1586 | ||
| @@ -1871,7 +1872,7 @@ void | |||
| 1871 | create_pty (Lisp_Object process) | 1872 | create_pty (Lisp_Object process) |
| 1872 | { | 1873 | { |
| 1873 | int inchannel, outchannel; | 1874 | int inchannel, outchannel; |
| 1874 | int pty_flag = 0; | 1875 | bool pty_flag = 0; |
| 1875 | 1876 | ||
| 1876 | inchannel = outchannel = -1; | 1877 | inchannel = outchannel = -1; |
| 1877 | 1878 | ||
| @@ -2819,8 +2820,9 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2819 | Lisp_Object tem; | 2820 | Lisp_Object tem; |
| 2820 | Lisp_Object name, buffer, host, service, address; | 2821 | Lisp_Object name, buffer, host, service, address; |
| 2821 | Lisp_Object filter, sentinel; | 2822 | Lisp_Object filter, sentinel; |
| 2822 | int is_non_blocking_client = 0; | 2823 | bool is_non_blocking_client = 0; |
| 2823 | int is_server = 0, backlog = 5; | 2824 | bool is_server = 0; |
| 2825 | int backlog = 5; | ||
| 2824 | int socktype; | 2826 | int socktype; |
| 2825 | int family = -1; | 2827 | int family = -1; |
| 2826 | 2828 | ||
| @@ -3497,7 +3499,7 @@ format; see the description of ADDRESS in `make-network-process'. */) | |||
| 3497 | struct ifreq *ifreq; | 3499 | struct ifreq *ifreq; |
| 3498 | void *buf = NULL; | 3500 | void *buf = NULL; |
| 3499 | ptrdiff_t buf_size = 512; | 3501 | ptrdiff_t buf_size = 512; |
| 3500 | int s, i; | 3502 | int s; |
| 3501 | Lisp_Object res; | 3503 | Lisp_Object res; |
| 3502 | 3504 | ||
| 3503 | s = socket (AF_INET, SOCK_STREAM, 0); | 3505 | s = socket (AF_INET, SOCK_STREAM, 0); |
| @@ -3535,7 +3537,6 @@ format; see the description of ADDRESS in `make-network-process'. */) | |||
| 3535 | int len = sizeof (*ifreq); | 3537 | int len = sizeof (*ifreq); |
| 3536 | #endif | 3538 | #endif |
| 3537 | char namebuf[sizeof (ifq->ifr_name) + 1]; | 3539 | char namebuf[sizeof (ifq->ifr_name) + 1]; |
| 3538 | i += len; | ||
| 3539 | ifreq = (struct ifreq *) ((char *) ifreq + len); | 3540 | ifreq = (struct ifreq *) ((char *) ifreq + len); |
| 3540 | 3541 | ||
| 3541 | if (ifq->ifr_addr.sa_family != AF_INET) | 3542 | if (ifq->ifr_addr.sa_family != AF_INET) |
| @@ -3645,7 +3646,7 @@ FLAGS is the current flags of the interface. */) | |||
| 3645 | Lisp_Object res = Qnil; | 3646 | Lisp_Object res = Qnil; |
| 3646 | Lisp_Object elt; | 3647 | Lisp_Object elt; |
| 3647 | int s; | 3648 | int s; |
| 3648 | int any = 0; | 3649 | bool any = 0; |
| 3649 | #if (! (defined SIOCGIFHWADDR && defined HAVE_STRUCT_IFREQ_IFR_HWADDR) \ | 3650 | #if (! (defined SIOCGIFHWADDR && defined HAVE_STRUCT_IFREQ_IFR_HWADDR) \ |
| 3650 | && defined HAVE_GETIFADDRS && defined LLADDR) | 3651 | && defined HAVE_GETIFADDRS && defined LLADDR) |
| 3651 | struct ifaddrs *ifap; | 3652 | struct ifaddrs *ifap; |
| @@ -3931,7 +3932,7 @@ Return non-nil if we received any output before the timeout expired. */) | |||
| 3931 | 3932 | ||
| 3932 | /* Accept a connection for server process SERVER on CHANNEL. */ | 3933 | /* Accept a connection for server process SERVER on CHANNEL. */ |
| 3933 | 3934 | ||
| 3934 | static int connect_counter = 0; | 3935 | static EMACS_INT connect_counter = 0; |
| 3935 | 3936 | ||
| 3936 | static void | 3937 | static void |
| 3937 | server_accept_connection (Lisp_Object server, int channel) | 3938 | server_accept_connection (Lisp_Object server, int channel) |
| @@ -4186,7 +4187,7 @@ wait_reading_process_output_1 (void) | |||
| 4186 | process. The return value is true if we read some input from | 4187 | process. The return value is true if we read some input from |
| 4187 | that process. | 4188 | that process. |
| 4188 | 4189 | ||
| 4189 | If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC | 4190 | If JUST_WAIT_PROC is nonzero, handle only output from WAIT_PROC |
| 4190 | (suspending output from other processes). A negative value | 4191 | (suspending output from other processes). A negative value |
| 4191 | means don't run any timers either. | 4192 | means don't run any timers either. |
| 4192 | 4193 | ||
| @@ -4194,22 +4195,23 @@ wait_reading_process_output_1 (void) | |||
| 4194 | received input from that process before the timeout elapsed. | 4195 | received input from that process before the timeout elapsed. |
| 4195 | Otherwise, return true if we received input from any process. */ | 4196 | Otherwise, return true if we received input from any process. */ |
| 4196 | 4197 | ||
| 4197 | int | 4198 | bool |
| 4198 | wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | 4199 | wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, |
| 4199 | bool do_display, | 4200 | bool do_display, |
| 4200 | Lisp_Object wait_for_cell, | 4201 | Lisp_Object wait_for_cell, |
| 4201 | struct Lisp_Process *wait_proc, int just_wait_proc) | 4202 | struct Lisp_Process *wait_proc, int just_wait_proc) |
| 4202 | { | 4203 | { |
| 4203 | register int channel, nfds; | 4204 | int channel, nfds; |
| 4204 | SELECT_TYPE Available; | 4205 | SELECT_TYPE Available; |
| 4205 | SELECT_TYPE Writeok; | 4206 | SELECT_TYPE Writeok; |
| 4206 | int check_write; | 4207 | bool check_write; |
| 4207 | int check_delay, no_avail; | 4208 | int check_delay; |
| 4209 | bool no_avail; | ||
| 4208 | int xerrno; | 4210 | int xerrno; |
| 4209 | Lisp_Object proc; | 4211 | Lisp_Object proc; |
| 4210 | EMACS_TIME timeout, end_time; | 4212 | EMACS_TIME timeout, end_time; |
| 4211 | int wait_channel = -1; | 4213 | int wait_channel = -1; |
| 4212 | int got_some_input = 0; | 4214 | bool got_some_input = 0; |
| 4213 | ptrdiff_t count = SPECPDL_INDEX (); | 4215 | ptrdiff_t count = SPECPDL_INDEX (); |
| 4214 | 4216 | ||
| 4215 | FD_ZERO (&Available); | 4217 | FD_ZERO (&Available); |
| @@ -4246,7 +4248,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4246 | 4248 | ||
| 4247 | while (1) | 4249 | while (1) |
| 4248 | { | 4250 | { |
| 4249 | int timeout_reduced_for_timers = 0; | 4251 | bool timeout_reduced_for_timers = 0; |
| 4250 | 4252 | ||
| 4251 | /* If calling from keyboard input, do not quit | 4253 | /* If calling from keyboard input, do not quit |
| 4252 | since we want to return C-g as an input character. | 4254 | since we want to return C-g as an input character. |
| @@ -4624,7 +4626,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4624 | unsigned old_timers_run = timers_run; | 4626 | unsigned old_timers_run = timers_run; |
| 4625 | struct buffer *old_buffer = current_buffer; | 4627 | struct buffer *old_buffer = current_buffer; |
| 4626 | Lisp_Object old_window = selected_window; | 4628 | Lisp_Object old_window = selected_window; |
| 4627 | int leave = 0; | 4629 | bool leave = 0; |
| 4628 | 4630 | ||
| 4629 | if (detect_input_pending_run_timers (do_display)) | 4631 | if (detect_input_pending_run_timers (do_display)) |
| 4630 | { | 4632 | { |
| @@ -4945,7 +4947,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 4945 | else | 4947 | else |
| 4946 | #endif | 4948 | #endif |
| 4947 | { | 4949 | { |
| 4948 | int buffered = 0 <= proc_buffered_char[channel]; | 4950 | bool buffered = 0 <= proc_buffered_char[channel]; |
| 4949 | if (buffered) | 4951 | if (buffered) |
| 4950 | { | 4952 | { |
| 4951 | chars[carryover] = proc_buffered_char[channel]; | 4953 | chars[carryover] = proc_buffered_char[channel]; |
| @@ -5261,7 +5263,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5261 | 5263 | ||
| 5262 | static void | 5264 | static void |
| 5263 | write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj, | 5265 | write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj, |
| 5264 | const char *buf, ptrdiff_t len, int front) | 5266 | const char *buf, ptrdiff_t len, bool front) |
| 5265 | { | 5267 | { |
| 5266 | ptrdiff_t offset; | 5268 | ptrdiff_t offset; |
| 5267 | Lisp_Object entry, obj; | 5269 | Lisp_Object entry, obj; |
| @@ -5286,10 +5288,10 @@ write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj, | |||
| 5286 | } | 5288 | } |
| 5287 | 5289 | ||
| 5288 | /* Remove the first element in the write_queue of process P, put its | 5290 | /* Remove the first element in the write_queue of process P, put its |
| 5289 | contents in OBJ, BUF and LEN, and return non-zero. If the | 5291 | contents in OBJ, BUF and LEN, and return true. If the |
| 5290 | write_queue is empty, return zero. */ | 5292 | write_queue is empty, return false. */ |
| 5291 | 5293 | ||
| 5292 | static int | 5294 | static bool |
| 5293 | write_queue_pop (struct Lisp_Process *p, Lisp_Object *obj, | 5295 | write_queue_pop (struct Lisp_Process *p, Lisp_Object *obj, |
| 5294 | const char **buf, ptrdiff_t *len) | 5296 | const char **buf, ptrdiff_t *len) |
| 5295 | { | 5297 | { |
| @@ -5650,7 +5652,7 @@ return t unconditionally. */) | |||
| 5650 | If CURRENT_GROUP is lambda, that means send to the process group | 5652 | If CURRENT_GROUP is lambda, that means send to the process group |
| 5651 | that currently owns the terminal, but only if it is NOT the shell itself. | 5653 | that currently owns the terminal, but only if it is NOT the shell itself. |
| 5652 | 5654 | ||
| 5653 | If NOMSG is zero, insert signal-announcements into process's buffers | 5655 | If NOMSG is false, insert signal-announcements into process's buffers |
| 5654 | right away. | 5656 | right away. |
| 5655 | 5657 | ||
| 5656 | If we can, we try to signal PROCESS by sending control characters | 5658 | If we can, we try to signal PROCESS by sending control characters |
| @@ -5659,12 +5661,12 @@ return t unconditionally. */) | |||
| 5659 | 5661 | ||
| 5660 | static void | 5662 | static void |
| 5661 | process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group, | 5663 | process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group, |
| 5662 | int nomsg) | 5664 | bool nomsg) |
| 5663 | { | 5665 | { |
| 5664 | Lisp_Object proc; | 5666 | Lisp_Object proc; |
| 5665 | register struct Lisp_Process *p; | 5667 | struct Lisp_Process *p; |
| 5666 | pid_t gid; | 5668 | pid_t gid; |
| 5667 | int no_pgrp = 0; | 5669 | bool no_pgrp = 0; |
| 5668 | 5670 | ||
| 5669 | proc = get_process (process); | 5671 | proc = get_process (process); |
| 5670 | p = XPROCESS (proc); | 5672 | p = XPROCESS (proc); |
| @@ -6161,7 +6163,7 @@ handle_child_signal (int sig) | |||
| 6161 | /* If process has terminated, stop waiting for its output. */ | 6163 | /* If process has terminated, stop waiting for its output. */ |
| 6162 | if (WIFSIGNALED (status) || WIFEXITED (status)) | 6164 | if (WIFSIGNALED (status) || WIFEXITED (status)) |
| 6163 | { | 6165 | { |
| 6164 | int clear_desc_flag = 0; | 6166 | bool clear_desc_flag = 0; |
| 6165 | p->alive = 0; | 6167 | p->alive = 0; |
| 6166 | if (p->infd >= 0) | 6168 | if (p->infd >= 0) |
| 6167 | clear_desc_flag = 1; | 6169 | clear_desc_flag = 1; |
| @@ -6504,10 +6506,10 @@ delete_gpm_wait_descriptor (int desc) | |||
| 6504 | 6506 | ||
| 6505 | # ifdef USABLE_SIGIO | 6507 | # ifdef USABLE_SIGIO |
| 6506 | 6508 | ||
| 6507 | /* Return nonzero if *MASK has a bit set | 6509 | /* Return true if *MASK has a bit set |
| 6508 | that corresponds to one of the keyboard input descriptors. */ | 6510 | that corresponds to one of the keyboard input descriptors. */ |
| 6509 | 6511 | ||
| 6510 | static int | 6512 | static bool |
| 6511 | keyboard_bit_set (fd_set *mask) | 6513 | keyboard_bit_set (fd_set *mask) |
| 6512 | { | 6514 | { |
| 6513 | int fd; | 6515 | int fd; |
| @@ -6557,7 +6559,7 @@ extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, | |||
| 6557 | 6559 | ||
| 6558 | Return true if we received input from any process. */ | 6560 | Return true if we received input from any process. */ |
| 6559 | 6561 | ||
| 6560 | int | 6562 | bool |
| 6561 | wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | 6563 | wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, |
| 6562 | bool do_display, | 6564 | bool do_display, |
| 6563 | Lisp_Object wait_for_cell, | 6565 | Lisp_Object wait_for_cell, |
| @@ -6589,7 +6591,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6589 | 6591 | ||
| 6590 | while (1) | 6592 | while (1) |
| 6591 | { | 6593 | { |
| 6592 | int timeout_reduced_for_timers = 0; | 6594 | bool timeout_reduced_for_timers = 0; |
| 6593 | SELECT_TYPE waitchannels; | 6595 | SELECT_TYPE waitchannels; |
| 6594 | int xerrno; | 6596 | int xerrno; |
| 6595 | 6597 | ||
| @@ -6940,9 +6942,9 @@ unhold_keyboard_input (void) | |||
| 6940 | kbd_is_on_hold = 0; | 6942 | kbd_is_on_hold = 0; |
| 6941 | } | 6943 | } |
| 6942 | 6944 | ||
| 6943 | /* Return non-zero if keyboard input is on hold, zero otherwise. */ | 6945 | /* Return true if keyboard input is on hold, zero otherwise. */ |
| 6944 | 6946 | ||
| 6945 | int | 6947 | bool |
| 6946 | kbd_on_hold_p (void) | 6948 | kbd_on_hold_p (void) |
| 6947 | { | 6949 | { |
| 6948 | return kbd_is_on_hold; | 6950 | return kbd_is_on_hold; |
diff --git a/src/process.h b/src/process.h index a003ffa147f..765e5d82567 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -159,7 +159,7 @@ struct Lisp_Process | |||
| 159 | gnutls_anon_client_credentials_t gnutls_anon_cred; | 159 | gnutls_anon_client_credentials_t gnutls_anon_cred; |
| 160 | int gnutls_log_level; | 160 | int gnutls_log_level; |
| 161 | int gnutls_handshakes_tried; | 161 | int gnutls_handshakes_tried; |
| 162 | int gnutls_p; | 162 | unsigned int gnutls_p : 1; |
| 163 | #endif | 163 | #endif |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| @@ -185,9 +185,9 @@ pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) | |||
| 185 | } | 185 | } |
| 186 | #endif | 186 | #endif |
| 187 | 187 | ||
| 188 | /* Nonzero means don't run process sentinels. This is used | 188 | /* True means don't run process sentinels. This is used |
| 189 | when exiting. */ | 189 | when exiting. */ |
| 190 | extern int inhibit_sentinels; | 190 | extern bool inhibit_sentinels; |
| 191 | 191 | ||
| 192 | extern Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname; | 192 | extern Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname; |
| 193 | extern Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime; | 193 | extern Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime; |
| @@ -209,7 +209,7 @@ extern Lisp_Object system_process_attributes (Lisp_Object); | |||
| 209 | 209 | ||
| 210 | extern void hold_keyboard_input (void); | 210 | extern void hold_keyboard_input (void); |
| 211 | extern void unhold_keyboard_input (void); | 211 | extern void unhold_keyboard_input (void); |
| 212 | extern int kbd_on_hold_p (void); | 212 | extern bool kbd_on_hold_p (void); |
| 213 | 213 | ||
| 214 | typedef void (*fd_callback) (int fd, void *data); | 214 | typedef void (*fd_callback) (int fd, void *data); |
| 215 | 215 | ||