diff options
author | Paul Eggert <[email protected]> | 2013-12-14 13:36:44 -0800 |
---|---|---|
committer | Paul Eggert <[email protected]> | 2013-12-14 13:36:44 -0800 |
commit | 96c0686368d8b7d481cb40239db896ff37df416a (patch) | |
tree | 84d8ee02271476dd4aaaee52c5302f2c576089ef /lib-src | |
parent | 5ae811ddef14ea1989088c259a9ed2d14d5332b4 (diff) |
Use bool for boolean, focusing on headers.
* configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
Use bool for boolean.
* lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE):
Remove. All uses replaced with uncapitalized version.
* lib-src/emacsclient.c (message):
* lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
* lib-src/hexl.c (un_flag, iso_flag, endian):
* lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
(pop_trash):
Use bool for boolean.
* lib-src/etags.c (bool): Remove.
* lib-src/etags.c (globals, members, declarations, no_line_directive)
(no_duplicates): Use 'int' for boolean values that getopt requires
to be 'int'. Formerly, these were 'bool' and 'bool' was 'int',
but we can no longer rely on this implementation.
* lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
* lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
* src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c:
No need to include <stdbool.h>, since conf_post.h does it now.
* src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
(BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
(SET_PER_BUFFER_VALUE_P):
* src/ccl.c, src/ccl.h (setup_ccl_program):
* src/ccl.h (CHECK_CCL_PROGRAM):
* src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
(CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
(PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
(DEC_BOTH, BUF_INC_POS, BUF_DEC_POS):
* src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
(CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
(CHARSET_FAST_MAP_SET):
* src/coding.c (decode_coding_ccl, encode_coding_ccl):
* src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
(CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
(JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
(ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
(decode_coding_c_string):
* src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
* src/conf_post.h (has_attribute):
* src/dispextern.h (trace_redisplay_p):
(INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
(SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
(SET_GLYPH_FROM_CHAR_GLYPH):
(WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
(FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
(PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
(cursor_in_mouse_face_p):
* src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
(blank_row, prepare_desired_row)
(build_frame_matrix_from_leaf_window, make_current)
(mirror_make_current, mirrored_line_dance, mirror_line_dance)
(update_window, scrolling_window, update_frame_line):
* src/disptab.h (GLYPH_FOLLOW_ALIASES):
* src/editfns.c (Fformat):
* src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
(FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
(FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
(FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
(FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
(CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
(FONT_DEFERRED_LOG):
* src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
(FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
(FRAME_MOUSE_UPDATE):
* src/fringe.c (Fdefine_fringe_bitmap):
* src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
(x_create_bitmap_from_xpm_data, xpm_load_image):
* src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
(set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
(MERGE_INTERVAL_CACHE):
* src/keymap.h (KEYMAPP):
* src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
(STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
(CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
(CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
(RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
(SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
* src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
(SETUP_BUFFER_SYNTAX_TABLE):
* src/systime.h (timespec_valid_p):
* src/term.c (save_and_enable_current_matrix):
* src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
* src/xdisp.c (in_display_vector_p, display_tool_bar_line)
(redisplay_internal, try_window_reusing_current_matrix)
(sync_frame_with_window_matrix_rows, try_window_id)
(display_menu_bar, display_tty_menu_item, display_mode_line)
(coords_in_mouse_face_p, cursor_in_mouse_face_p):
* src/xmenu.c (xmenu_show):
* src/xterm.c (use_xim, x_term_init):
* src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
(struct x_bitmap_record):
Use bool for booleans.
* src/ccl.c (struct buffer_text):
* src/ccl.h (struct ccl_program):
* src/charset.h (struct charset):
* src/cm.h (struct cm):
* src/coding.h (struct iso_2022_spec, struct coding_system):
* src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
(struct glyph_string, struct face, struct face_cache)
(struct bidi_string_data, struct bidi_it)
(struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
(struct image):
* src/editfns.c (Fformat):
* src/frame.h (struct frame):
* src/fringe.c (struct fringe_bitmap):
* src/intervals.h (struct interval):
* src/keyboard.h (struct kboard):
* src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
(struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
(struct Lisp_Buffer_Local_Value, union specbinding):
* src/macfont.m (struct macfont_info):
* src/process.h (struct Lisp_Process):
* src/termchar.h (struct tty_display_info):
* src/window.h (struct window):
* src/xterm.h (struct x_output):
Use bool_bf for boolean bit-fields.
* src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
All callers changed.
* src/ccl.h (struct ccl_program): Remove unused members private_state,
src_multibyte, dst_multibyte, cr_consumed, suppress_error,
eight_bit_control.
(struct ccl_spec): Remove unused members cr_carryover,
eight_bit_carryover.
* src/conf_post.h: Include <stdbool.h>.
(bool_bf): New type.
* src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
* src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
Surround statement macro with proper 'do { ... } while (false)' brackets.
(SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
(PRODUCE_GLYPHS): Simplify use of boolean.
* src/fileio.c (Fcopy_file):
If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
* src/lisp.h (UNGCPRO): Return void, not int.
(FOR_EACH_TAIL): Use void expression, not int expression.
* src/region-cache.c: Reindent.
* src/region-cache.h: Copy comments from region-cache.c, to fix
incorrect remarks about booleans.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/ChangeLog | 18 | ||||
-rw-r--r-- | lib-src/emacsclient.c | 92 | ||||
-rw-r--r-- | lib-src/etags.c | 574 | ||||
-rw-r--r-- | lib-src/hexl.c | 18 | ||||
-rw-r--r-- | lib-src/pop.c | 12 | ||||
-rw-r--r-- | lib-src/pop.h | 7 |
6 files changed, 362 insertions, 359 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 2010444743..d7442e51fd 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,21 @@ +2013-12-14 Paul Eggert <[email protected]> + + Use bool for boolean, focusing on headers. + * emacsclient.c, etags.c, hexl.c (FALSE, TRUE): + Remove. All uses replaced with uncapitalized version. + * emacsclient.c (message): + * etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names): + * hexl.c (un_flag, iso_flag, endian): + * pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next) + (pop_trash): + Use bool for boolean. + * etags.c (bool): Remove. + * etags.c (globals, members, declarations, no_line_directive) + (no_duplicates): Use 'int' for boolean values that getopt requires + to be 'int'. Formerly, these were 'bool' and 'bool' was 'int', + but we can no longer rely on this implementation. + * pop.h (struct _popserver): Use bool_bf for boolean bit-fields. + 2013-11-14 Paul Eggert <[email protected]> * ebrowse.c (xstrdup): diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 74ccfa2625..42958fe6b5 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -103,14 +103,6 @@ char *getenv (const char *); #define EXIT_FAILURE 1 #endif -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - /* Additional space when allocating buffers for filenames, etc. */ #define EXTRA_SPACE 100 @@ -433,9 +425,9 @@ ttyname (int fd) /* Display a normal or error message. On Windows, use a message box if compiled as a Windows app. */ -static void message (int, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); +static void message (bool, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); static void -message (int is_error, const char *format, ...) +message (bool is_error, const char *format, ...) { va_list args; @@ -528,7 +520,7 @@ decode_options (int argc, char **argv) break; case 'V': - message (FALSE, "emacsclient %s\n", VERSION); + message (false, "emacsclient %s\n", VERSION); exit (EXIT_SUCCESS); break; @@ -555,7 +547,7 @@ decode_options (int argc, char **argv) break; default: - message (TRUE, "Try `%s --help' for more information\n", progname); + message (true, "Try `%s --help' for more information\n", progname); exit (EXIT_FAILURE); break; } @@ -614,7 +606,7 @@ decode_options (int argc, char **argv) if (alternate_editor && alternate_editor[0] == '\0') { - message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\ + message (true, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\ an empty string"); exit (EXIT_FAILURE); } @@ -629,7 +621,7 @@ print_help_and_exit (void) message aligns properly both in a tty and in a Windows message box. Please try to preserve them; otherwise the output is very hard to read when using emacsclientw. */ - message (FALSE, + message (false, "Usage: %s [OPTIONS] FILE...\n%s%s%s", progname, "\ Tell the Emacs server to visit the specified files.\n\ Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ @@ -679,7 +671,7 @@ fail (void) int i = optind - 1; execvp (alternate_editor, main_argv + i); - message (TRUE, "%s: error executing alternate editor \"%s\"\n", + message (true, "%s: error executing alternate editor \"%s\"\n", progname, alternate_editor); } exit (EXIT_FAILURE); @@ -693,7 +685,7 @@ main (int argc, char **argv) { main_argv = argv; progname = argv[0]; - message (TRUE, "%s: Sorry, the Emacs server is supported only\n" + message (true, "%s: Sorry, the Emacs server is supported only\n" "on systems with Berkeley sockets.\n", argv[0]); fail (); @@ -724,11 +716,11 @@ sock_err_message (const char *function_name) | FORMAT_MESSAGE_ARGUMENT_ARRAY, NULL, WSAGetLastError (), 0, (LPTSTR)&msg, 0, NULL); - message (TRUE, "%s: %s: %s\n", progname, function_name, msg); + message (true, "%s: %s: %s\n", progname, function_name, msg); LocalFree (msg); #else - message (TRUE, "%s: %s: %s\n", progname, function_name, strerror (errno)); + message (true, "%s: %s: %s\n", progname, function_name, strerror (errno)); #endif } @@ -759,7 +751,7 @@ send_to_emacs (HSOCKET s, const char *data) int sent = send (s, send_buffer, sblen, 0); if (sent < 0) { - message (TRUE, "%s: failed to send %d bytes to socket: %s\n", + message (true, "%s: failed to send %d bytes to socket: %s\n", progname, sblen, strerror (errno)); fail (); } @@ -854,25 +846,25 @@ static int file_name_absolute_p (const char *filename) { /* Sanity check, it shouldn't happen. */ - if (! filename) return FALSE; + if (! filename) return false; /* /xxx is always an absolute path. */ - if (filename[0] == '/') return TRUE; + if (filename[0] == '/') return true; /* Empty filenames (which shouldn't happen) are relative. */ - if (filename[0] == '\0') return FALSE; + if (filename[0] == '\0') return false; #ifdef WINDOWSNT /* X:\xxx is always absolute. */ if (isalpha ((unsigned char) filename[0]) && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/')) - return TRUE; + return true; /* Both \xxx and \\xxx\yyy are absolute. */ - if (filename[0] == '\\') return TRUE; + if (filename[0] == '\\') return true; #endif - return FALSE; + return false; } #ifdef WINDOWSNT @@ -891,7 +883,7 @@ initialize_sockets (void) if (WSAStartup (MAKEWORD (2, 0), &wsaData)) { - message (TRUE, "%s: error initializing WinSock2\n", progname); + message (true, "%s: error initializing WinSock2\n", progname); exit (EXIT_FAILURE); } @@ -942,14 +934,14 @@ get_server_config (const char *config_file, struct sockaddr_in *server, } if (! config) - return FALSE; + return false; if (fgets (dotted, sizeof dotted, config) && (port = strchr (dotted, ':'))) *port++ = '\0'; else { - message (TRUE, "%s: invalid configuration info\n", progname); + message (true, "%s: invalid configuration info\n", progname); exit (EXIT_FAILURE); } @@ -959,13 +951,13 @@ get_server_config (const char *config_file, struct sockaddr_in *server, if (! fread (authentication, AUTH_KEY_LENGTH, 1, config)) { - message (TRUE, "%s: cannot read authentication info\n", progname); + message (true, "%s: cannot read authentication info\n", progname); exit (EXIT_FAILURE); } fclose (config); - return TRUE; + return true; } static HSOCKET @@ -980,7 +972,7 @@ set_tcp_socket (const char *local_server_file) return INVALID_SOCKET; if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet) - message (FALSE, "%s: connected to remote socket at %s\n", + message (false, "%s: connected to remote socket at %s\n", progname, inet_ntoa (server.sin_addr)); /* Open up an AF_INET socket. */ @@ -1033,7 +1025,7 @@ find_tty (const char **tty_type, const char **tty_name, int noabort) return 0; else { - message (TRUE, "%s: could not get terminal name\n", progname); + message (true, "%s: could not get terminal name\n", progname); fail (); } } @@ -1044,7 +1036,7 @@ find_tty (const char **tty_type, const char **tty_name, int noabort) return 0; else { - message (TRUE, "%s: please set the TERM variable to your terminal type\n", + message (true, "%s: please set the TERM variable to your terminal type\n", progname); fail (); } @@ -1057,7 +1049,7 @@ find_tty (const char **tty_type, const char **tty_name, int noabort) else { /* This causes nasty, MULTI_KBOARD-related input lockouts. */ - message (TRUE, "%s: opening a frame in an Emacs term buffer" + message (true, "%s: opening a frame in an Emacs term buffer" " is not supported\n", progname); fail (); } @@ -1188,7 +1180,7 @@ set_local_socket (const char *local_socket_name) /* Open up an AF_UNIX socket in this person's home directory. */ if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { - message (TRUE, "%s: socket: %s\n", progname, strerror (errno)); + message (true, "%s: socket: %s\n", progname, strerror (errno)); return INVALID_SOCKET; } @@ -1239,7 +1231,7 @@ set_local_socket (const char *local_socket_name) strcpy (server.sun_path, local_socket_name); else { - message (TRUE, "%s: socket-name %s too long\n", + message (true, "%s: socket-name %s too long\n", progname, local_socket_name); fail (); } @@ -1278,7 +1270,7 @@ set_local_socket (const char *local_socket_name) strcpy (server.sun_path, user_socket_name); else { - message (TRUE, "%s: socket-name %s too long\n", + message (true, "%s: socket-name %s too long\n", progname, user_socket_name); exit (EXIT_FAILURE); } @@ -1302,7 +1294,7 @@ set_local_socket (const char *local_socket_name) we are root. */ if (0 != geteuid ()) { - message (TRUE, "%s: Invalid socket owner\n", progname); + message (true, "%s: Invalid socket owner\n", progname); return INVALID_SOCKET; } break; @@ -1310,12 +1302,12 @@ set_local_socket (const char *local_socket_name) case 2: /* `stat' failed */ if (saved_errno == ENOENT) - message (TRUE, + message (true, "%s: can't find socket; have you started the server?\n\ To start the server in Emacs, type \"M-x server-start\".\n", progname); else - message (TRUE, "%s: can't stat %s: %s\n", + message (true, "%s: can't stat %s: %s\n", progname, server.sun_path, strerror (saved_errno)); return INVALID_SOCKET; } @@ -1324,7 +1316,7 @@ To start the server in Emacs, type \"M-x server-start\".\n", if (connect (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2) < 0) { - message (TRUE, "%s: connect: %s\n", progname, strerror (errno)); + message (true, "%s: connect: %s\n", progname, strerror (errno)); return INVALID_SOCKET; } @@ -1347,7 +1339,7 @@ set_socket (int no_exit_if_error) s = set_local_socket (socket_name); if ((s != INVALID_SOCKET) || no_exit_if_error) return s; - message (TRUE, "%s: error accessing socket \"%s\"\n", + message (true, "%s: error accessing socket \"%s\"\n", progname, socket_name); exit (EXIT_FAILURE); } @@ -1363,7 +1355,7 @@ set_socket (int no_exit_if_error) if ((s != INVALID_SOCKET) || no_exit_if_error) return s; - message (TRUE, "%s: error accessing server file \"%s\"\n", + message (true, "%s: error accessing server file \"%s\"\n", progname, local_server_file); exit (EXIT_FAILURE); } @@ -1381,7 +1373,7 @@ set_socket (int no_exit_if_error) return s; /* No implicit or explicit socket, and no alternate editor. */ - message (TRUE, "%s: No socket or alternate editor. Please use:\n\n" + message (true, "%s: No socket or alternate editor. Please use:\n\n" #ifndef NO_SOCKETS_IN_FILE_SYSTEM "\t--socket-name\n" #endif @@ -1490,15 +1482,15 @@ start_daemon_and_retry_set_socket (void) if ((w == -1) || !WIFEXITED (status) || WEXITSTATUS (status)) { - message (TRUE, "Error: Could not start the Emacs daemon\n"); + message (true, "Error: Could not start the Emacs daemon\n"); exit (EXIT_FAILURE); } /* Try connecting, the daemon should have started by now. */ - message (TRUE, "Emacs daemon should have started, trying to connect again\n"); + message (true, "Emacs daemon should have started, trying to connect again\n"); if ((emacs_socket = set_socket (1)) == INVALID_SOCKET) { - message (TRUE, "Error: Cannot connect even after starting the Emacs daemon\n"); + message (true, "Error: Cannot connect even after starting the Emacs daemon\n"); exit (EXIT_FAILURE); } } @@ -1526,7 +1518,7 @@ start_daemon_and_retry_set_socket (void) d_argv[1] = daemon_arg; } execvp ("emacs", d_argv); - message (TRUE, "%s: error starting emacs daemon\n", progname); + message (true, "%s: error starting emacs daemon\n", progname); } #endif /* WINDOWSNT */ } @@ -1556,7 +1548,7 @@ main (int argc, char **argv) if ((argc - optind < 1) && !eval && current_frame) { - message (TRUE, "%s: file name or argument required\n" + message (true, "%s: file name or argument required\n" "Try `%s --help' for more information\n", progname, progname); exit (EXIT_FAILURE); @@ -1579,7 +1571,7 @@ main (int argc, char **argv) cwd = get_current_dir_name (); if (cwd == 0) { - message (TRUE, "%s: %s\n", progname, + message (true, "%s: %s\n", progname, "Cannot get current working directory"); fail (); } diff --git a/lib-src/etags.c b/lib-src/etags.c index 21cf3654b9..c3ed5fa07b 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -80,14 +80,11 @@ University of California, as described above. */ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; -#define TRUE 1 -#define FALSE 0 - #ifdef DEBUG # undef DEBUG -# define DEBUG TRUE +# define DEBUG true #else -# define DEBUG FALSE +# define DEBUG false # define NDEBUG /* disable assert */ #endif @@ -107,12 +104,12 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; #ifdef MSDOS # undef MSDOS -# define MSDOS TRUE +# define MSDOS true # include <fcntl.h> # include <sys/param.h> # include <io.h> #else -# define MSDOS FALSE +# define MSDOS false #endif /* MSDOS */ #ifdef WINDOWSNT @@ -150,9 +147,9 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; tag tables and tags typedefs, #defines and struct/union/enum by default. */ #ifdef CTAGS # undef CTAGS -# define CTAGS TRUE +# define CTAGS true #else -# define CTAGS FALSE +# define CTAGS false #endif #define streq(s,t) (assert ((s)!=NULL || (t)!=NULL), !strcmp (s, t)) @@ -194,8 +191,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; (char *) (op), (n) * sizeof (Type))) #endif -#define bool int - typedef void Lang_function (FILE *); typedef struct @@ -401,7 +396,7 @@ static const char *midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; static bool append_to_tagfile; /* -a: append to tags */ -/* The next five default to TRUE in C and derived languages. */ +/* The next five default to true in C and derived languages. */ static bool typedefs; /* -t: create tags for C and Ada typedefs */ static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */ /* 0 struct/enum/union decls, and C++ */ @@ -409,18 +404,18 @@ static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */ static bool constantypedefs; /* -d: create tags for C #define, enum */ /* constants and variables. */ /* -D: opposite of -d. Default under ctags. */ -static bool globals; /* create tags for global variables */ -static bool members; /* create tags for C member variables */ -static bool declarations; /* --declarations: tag them and extern in C&Co*/ -static bool no_line_directive; /* ignore #line directives (undocumented) */ -static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */ +static int globals; /* create tags for global variables */ +static int members; /* create tags for C member variables */ +static int declarations; /* --declarations: tag them and extern in C&Co*/ +static int no_line_directive; /* ignore #line directives (undocumented) */ +static int no_duplicates; /* no duplicate tags for ctags (undocumented) */ static bool update; /* -u: update tags */ static bool vgrind_style; /* -v: create vgrind style index output */ static bool no_warnings; /* -w: suppress warnings (undocumented) */ static bool cxref_style; /* -x: create cxref style output */ static bool cplusplus; /* .[hc] means C++, not C (undocumented) */ static bool ignoreindent; /* -I: ignore indentation in C */ -static bool packages_only; /* --packages-only: in Ada, only tag packages*/ +static int packages_only; /* --packages-only: in Ada, only tag packages*/ /* STDIN is defined in LynxOS system headers */ #ifdef STDIN @@ -436,17 +431,17 @@ static bool need_filebuf; /* some regexes are multi-line */ static struct option longopts[] = { { "append", no_argument, NULL, 'a' }, - { "packages-only", no_argument, &packages_only, TRUE }, + { "packages-only", no_argument, &packages_only, 1 }, { "c++", no_argument, NULL, 'C' }, - { "declarations", no_argument, &declarations, TRUE }, - { "no-line-directive", no_argument, &no_line_directive, TRUE }, - { "no-duplicates", no_argument, &no_duplicates, TRUE }, + { "declarations", no_argument, &declarations, 1 }, + { "no-line-directive", no_argument, &no_line_directive, 1 }, + { "no-duplicates", no_argument, &no_duplicates, 1 }, { "help", no_argument, NULL, 'h' }, { "help", no_argument, NULL, 'H' }, { "ignore-indentation", no_argument, NULL, 'I' }, { "language", required_argument, NULL, 'l' }, - { "members", no_argument, &members, TRUE }, - { "no-members", no_argument, &members, FALSE }, + { "members", no_argument, &members, 1 }, + { "no-members", no_argument, &members, 0 }, { "output", required_argument, NULL, 'o' }, { "regex", required_argument, NULL, 'r' }, { "no-regex", no_argument, NULL, 'R' }, @@ -458,7 +453,7 @@ static struct option longopts[] = { "backward-search", no_argument, NULL, 'B' }, { "cxref", no_argument, NULL, 'x' }, { "defines", no_argument, NULL, 'd' }, - { "globals", no_argument, &globals, TRUE }, + { "globals", no_argument, &globals, 1 }, { "typedefs", no_argument, NULL, 't' }, { "typedefs-and-c++", no_argument, NULL, 'T' }, { "update", no_argument, NULL, 'u' }, @@ -467,7 +462,7 @@ static struct option longopts[] = #else /* Etags options */ { "no-defines", no_argument, NULL, 'D' }, - { "no-globals", no_argument, &globals, FALSE }, + { "no-globals", no_argument, &globals, 0 }, { "include", required_argument, NULL, 'i' }, #endif { NULL } @@ -761,7 +756,7 @@ static language lang_names [] = { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, { "tex", TeX_help, TeX_commands, TeX_suffixes }, { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, - { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,TRUE}, + { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,true}, { "auto", auto_help }, /* default guessing scheme */ { "none", none_help, just_read_file }, /* regexp matching only */ { NULL } /* end of list */ @@ -820,13 +815,13 @@ print_version (void) } #ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP -# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE +# define PRINT_UNDOCUMENTED_OPTIONS_HELP false #endif static _Noreturn void print_help (argument *argbuffer) { - bool help_for_lang = FALSE; + bool help_for_lang = false; for (; argbuffer->arg_type != at_end; argbuffer++) if (argbuffer->arg_type == at_language) @@ -834,7 +829,7 @@ print_help (argument *argbuffer) if (help_for_lang) puts (""); puts (argbuffer->lang->help); - help_for_lang = TRUE; + help_for_lang = true; } if (help_for_lang) @@ -1005,7 +1000,7 @@ main (int argc, char **argv) argument *argbuffer; int current_arg, file_count; linebuffer filename_lb; - bool help_asked = FALSE; + bool help_asked = false; ptrdiff_t len; char *optstring; int opt; @@ -1030,8 +1025,8 @@ main (int argc, char **argv) * Also default to find macro constants, enum constants, struct * members and global variables. Do it for both etags and ctags. */ - typedefs = typedefs_or_cplusplus = constantypedefs = TRUE; - globals = members = TRUE; + typedefs = typedefs_or_cplusplus = constantypedefs = true; + globals = members = true; /* When the optstring begins with a '-' getopt_long does not rearrange the non-options arguments to be at the end, but leaves them alone. */ @@ -1069,12 +1064,12 @@ main (int argc, char **argv) ++file_count; if (parsing_stdin) fatal ("cannot parse standard input more than once", (char *)NULL); - parsing_stdin = TRUE; + parsing_stdin = true; break; /* Common options. */ - case 'a': append_to_tagfile = TRUE; break; - case 'C': cplusplus = TRUE; break; + case 'a': append_to_tagfile = true; break; + case 'C': cplusplus = true; break; case 'f': /* for compatibility with old makefiles */ case 'o': if (tagfile) @@ -1087,7 +1082,7 @@ main (int argc, char **argv) break; case 'I': case 'S': /* for backward compatibility */ - ignoreindent = TRUE; + ignoreindent = true; break; case 'l': { @@ -1122,22 +1117,22 @@ main (int argc, char **argv) break; case 'h': case 'H': - help_asked = TRUE; + help_asked = true; break; /* Etags options */ - case 'D': constantypedefs = FALSE; break; + case 'D': constantypedefs = false; break; case 'i': included_files[nincluded_files++] = optarg; break; /* Ctags options. */ case 'B': searchar = '?'; break; - case 'd': constantypedefs = TRUE; break; - case 't': typedefs = TRUE; break; - case 'T': typedefs = typedefs_or_cplusplus = TRUE; break; - case 'u': update = TRUE; break; - case 'v': vgrind_style = TRUE; /*FALLTHRU*/ - case 'x': cxref_style = TRUE; break; - case 'w': no_warnings = TRUE; break; + case 'd': constantypedefs = true; break; + case 't': typedefs = true; break; + case 'T': typedefs = typedefs_or_cplusplus = true; break; + case 'u': update = true; break; + case 'v': vgrind_style = true; /*FALLTHRU*/ + case 'x': cxref_style = true; break; + case 'w': no_warnings = true; break; default: suggest_asking_for_help (); /* NOTREACHED */ @@ -1308,7 +1303,7 @@ main (int argc, char **argv) fatal ("failed to execute shell command", (char *)NULL); } free (cmd); - append_to_tagfile = TRUE; + append_to_tagfile = true; } tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -1605,9 +1600,9 @@ process_file (FILE *fh, char *fn, language *lang) to the directory of the tags file. */ fdp->taggedfname = relative_filename (fn, tagfiledir); } - fdp->usecharno = TRUE; /* use char position when making tags */ + fdp->usecharno = true; /* use char position when making tags */ fdp->prop = NULL; - fdp->written = FALSE; /* not written on tags file yet */ + fdp->written = false; /* not written on tags file yet */ fdhead = fdp; curfdp = fdhead; /* the current file description */ @@ -1653,26 +1648,27 @@ process_file (FILE *fh, char *fn, language *lang) * This routine sets up the boolean pseudo-functions which work * by setting boolean flags dependent upon the corresponding character. * Every char which is NOT in that string is not a white char. Therefore, - * all of the array "_wht" is set to FALSE, and then the elements - * subscripted by the chars in "white" are set to TRUE. Thus "_wht" - * of a char is TRUE if it is the string "white", else FALSE. + * all of the array "_wht" is set to false, and then the elements + * subscripted by the chars in "white" are set to true. Thus "_wht" + * of a char is true if it is the string "white", else false. */ static void init (void) { - register const char *sp; - register int i; + const char *sp; + int i; for (i = 0; i < CHARS; i++) - iswhite (i) = notinname (i) = begtoken (i) = intoken (i) = endtoken (i) = FALSE; - for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE; - for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE; + iswhite (i) = notinname (i) = begtoken (i) = intoken (i) = endtoken (i) + = false; + for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = true; + for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = true; notinname ('\0') = notinname ('\n'); - for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE; + for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = true; begtoken ('\0') = begtoken ('\n'); - for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE; + for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = true; intoken ('\0') = intoken ('\n'); - for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE; + for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = true; endtoken ('\0') = endtoken ('\n'); } @@ -1696,7 +1692,7 @@ find_entries (FILE *inf) /* Else try to guess the language given the file name. */ if (parser == NULL) { - lang = get_language_from_filename (curfdp->infname, TRUE); + lang = get_language_from_filename (curfdp->infname, true); if (lang != NULL && lang->function != NULL) { curfdp->lang = lang; @@ -1743,7 +1739,7 @@ find_entries (FILE *inf) /* Else try to guess the language given the case insensitive file name. */ if (parser == NULL) { - lang = get_language_from_filename (curfdp->infname, FALSE); + lang = get_language_from_filename (curfdp->infname, false); if (lang != NULL && lang->function != NULL) { curfdp->lang = lang; @@ -1841,7 +1837,7 @@ find_entries (FILE *inf) static void make_tag (const char *name, /* tag name, or NULL if unnamed */ int namelen, /* tag length */ - int is_func, /* tag is a function */ + bool is_func, /* tag is a function */ char *linestart, /* start of the line where tag is */ int linelen, /* length of the line where tag is */ int lno, /* line number */ @@ -1869,7 +1865,7 @@ make_tag (const char *name, /* tag name, or NULL if unnamed */ && (cp == linestart || notinname (cp[-1])) /* rule #3 */ && strneq (name, cp, namelen)) /* rule #2 */ - named = FALSE; /* use implicit tag name */ + named = false; /* use implicit tag name */ } } @@ -1881,7 +1877,8 @@ make_tag (const char *name, /* tag name, or NULL if unnamed */ /* Record a tag. */ static void -pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int cno) +pfnote (char *name, bool is_func, char *linestart, int linelen, int lno, + long int cno) /* tag name, or NULL if unnamed */ /* tag is a function */ /* start of the line where tag is */ @@ -1908,8 +1905,8 @@ pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int } else np->name = name; - np->valid = TRUE; - np->been_warned = FALSE; + np->valid = true; + np->been_warned = false; np->fdp = curfdp; np->is_func = is_func; np->lno = lno; @@ -2043,7 +2040,7 @@ add_node (node *np, node **cur_node_p) (stderr, "Duplicate entry in files %s and %s: %s (Warning only)\n", np->fdp->infname, cur_node->fdp->infname, np->name); - cur_node->been_warned = TRUE; + cur_node->been_warned = true; } return; } @@ -2071,7 +2068,7 @@ invalidate_nodes (fdesc *badfdp, node **npp) if (np->left != NULL) invalidate_nodes (badfdp, &np->left); if (np->fdp == badfdp) - np->valid = FALSE; + np->valid = false; if (np->right != NULL) invalidate_nodes (badfdp, &np->right); } @@ -2154,7 +2151,7 @@ put_entries (register node *np) fdp = np->fdp; fprintf (tagf, "\f\n%s,%d\n", fdp->taggedfname, total_size_of_entries (np)); - fdp->written = TRUE; + fdp->written = true; } fputs (np->regex, tagf); fputc ('\177', tagf); @@ -2625,7 +2622,7 @@ static void make_C_tag (bool); * function or variable, or corresponds to a typedef, or * is a struct/union/enum tag, or #define, or an enum constant. * - * *IS_FUNC gets TRUE if the token is a function or #define macro + * *IS_FUNC_OR_VAR gets true if the token is a function or #define macro * with args. C_EXTP points to which language we are looking at. * * Globals @@ -2637,7 +2634,8 @@ static void make_C_tag (bool); */ static bool -consider_token (register char *str, register int len, register int c, int *c_extp, int bracelev, int parlev, int *is_func_or_var) +consider_token (char *str, int len, int c, int *c_extp, + int bracelev, int parlev, bool *is_func_or_var) /* IN: token pointer */ /* IN: token length */ /* IN: first char after the token */ @@ -2661,8 +2659,8 @@ consider_token (register char *str, register int len, register int c, int *c_ext */ if (toktype == st_C_attribute) { - inattribute = TRUE; - return FALSE; + inattribute = true; + return false; } /* @@ -2675,7 +2673,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext if (toktype == st_C_gnumacro) { fvdef = fdefunkey; - return FALSE; + return false; } break; case dsharpseen: @@ -2687,20 +2685,20 @@ consider_token (register char *str, register int len, register int c, int *c_ext { definedef = dignorerest; } - return FALSE; + return false; case ddefineseen: /* * Make a tag for any macro, unless it is a constant - * and constantypedefs is FALSE. + * and constantypedefs is false. */ definedef = dignorerest; *is_func_or_var = (c == '('); if (!*is_func_or_var && !constantypedefs) - return FALSE; + return false; else - return TRUE; + return true; case dignorerest: - return FALSE; + return false; default: error ("internal error: definedef value."); } @@ -2715,9 +2713,9 @@ consider_token (register char *str, register int len, register int c, int *c_ext { if (typedefs) typdef = tkeyseen; - fvextern = FALSE; + fvextern = false; fvdef = fvnone; - return FALSE; + return false; } break; case tkeyseen: @@ -2734,7 +2732,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext if (structdef == snone && fvdef == fvnone) { fvdef = fvnameseen; - return TRUE; + return true; } break; case tend: @@ -2743,9 +2741,9 @@ consider_token (register char *str, register int len, register int c, int *c_ext case st_C_class: case st_C_struct: case st_C_enum: - return FALSE; + return false; } - return TRUE; + return true; } switch (toktype) @@ -2753,7 +2751,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext case st_C_javastruct: if (structdef == stagseen) structdef = scolonseen; - return FALSE; + return false; case st_C_template: case st_C_class: if ((*c_extp & C_AUTO) /* automatic detection of C++ language */ @@ -2777,13 +2775,13 @@ consider_token (register char *str, register int len, register int c, int *c_ext if (fvdef == fvnameseen) fvdef = fvnone; } - return FALSE; + return false; } if (structdef == skeyseen) { structdef = stagseen; - return TRUE; + return true; } if (typdef != tnone) @@ -2797,27 +2795,27 @@ consider_token (register char *str, register int len, register int c, int *c_ext { case st_C_objprot: objdef = oprotocol; - return FALSE; + return false; case st_C_objimpl: objdef = oimplementation; - return FALSE; + return false; } break; case oimplementation: /* Save the class tag for functions or variables defined inside. */ objtag = savenstr (str, len); objdef = oinbody; - return FALSE; + return false; case oprotocol: /* Save the class tag for categories. */ objtag = savenstr (str, len); objdef = otagseen; - *is_func_or_var = TRUE; - return TRUE; + *is_func_or_var = true; + return true; case oparenseen: objdef = ocatseen; - *is_func_or_var = TRUE; - return TRUE; + *is_func_or_var = true; + return true; case oinbody: break; case omethodsign: @@ -2828,13 +2826,13 @@ consider_token (register char *str, register int len, register int c, int *c_ext linebuffer_setlen (&token_name, len); memcpy (token_name.buffer, str, len); token_name.buffer[len] = '\0'; - return TRUE; + return true; } - return FALSE; + return false; case omethodcolon: if (parlev == 0) objdef = omethodparm; - return FALSE; + return false; case omethodparm: if (parlev == 0) { @@ -2844,9 +2842,9 @@ consider_token (register char *str, register int len, register int c, int *c_ext linebuffer_setlen (&token_name, oldlen + len); memcpy (token_name.buffer + oldlen, str, len); token_name.buffer[oldlen + len] = '\0'; - return TRUE; + return true; } - return FALSE; + return false; case oignore: if (toktype == st_C_objend) { @@ -2858,14 +2856,14 @@ consider_token (register char *str, register int len, register int c, int *c_ext free (objtag); */ objdef = onone; } - return FALSE; + return false; } /* A function, variable or enum constant? */ switch (toktype) { case st_C_extern: - fvextern = TRUE; + fvextern = true; switch (fvdef) { case finlist: @@ -2876,39 +2874,39 @@ consider_token (register char *str, register int len, register int c, int *c_ext default: fvdef = fvnone; } - return FALSE; + return false; case st_C_ignore: - fvextern = FALSE; + fvextern = false; fvdef = vignore; - return FALSE; + return false; case st_C_operator: fvdef = foperator; - *is_func_or_var = TRUE; - return TRUE; + *is_func_or_var = true; + return true; case st_none: if (constantypedefs && structdef == snone && structtype == st_C_enum && bracelev > structbracelev) - return TRUE; /* enum constant */ + return true; /* enum constant */ switch (fvdef) { case fdefunkey: if (bracelev > 0) break; fvdef = fdefunname; /* GNU macro */ - *is_func_or_var = TRUE; - return TRUE; + *is_func_or_var = true; + return true; case fvnone: switch (typdef) { case ttypeseen: - return FALSE; + return false; case tnone: if ((strneq (str, "asm", 3) && endtoken (str[3])) || (strneq (str, "__asm__", 7) && endtoken (str[7]))) { fvdef = vignore; - return FALSE; + return false; } break; } @@ -2919,19 +2917,19 @@ consider_token (register char *str, register int len, register int c, int *c_ext if (*c_extp & C_AUTO) /* automatic detection of C++ */ *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; fvdef = foperator; - *is_func_or_var = TRUE; - return TRUE; + *is_func_or_var = true; + return true; } if (bracelev > 0 && !instruct) break; fvdef = fvnameseen; /* function or variable */ - *is_func_or_var = TRUE; - return TRUE; + *is_func_or_var = true; + return true; } break; } - return FALSE; + return false; } @@ -2963,7 +2961,7 @@ do { \ curlinepos = charno; \ readline (&curlb, inf); \ lp = curlb.buffer; \ - quotednl = FALSE; \ + quotednl = false; \ newndx = curndx; \ } while (0) @@ -2973,16 +2971,16 @@ do { \ if (savetoken.valid) \ { \ token = savetoken; \ - savetoken.valid = FALSE; \ + savetoken.valid = false; \ } \ definedef = dnone; \ } while (0) static void -make_C_tag (int isfun) +make_C_tag (bool isfun) { - /* This function is never called when token.valid is FALSE, but + /* This function is never called when token.valid is false, but we must protect against invalid input or internal errors. */ if (token.valid) make_tag (token_name.buffer, token_name.len, isfun, token.line, @@ -2995,7 +2993,7 @@ make_C_tag (int isfun) error ("INVALID TOKEN"); } - token.valid = FALSE; + token.valid = false; } @@ -3043,11 +3041,11 @@ C_entries (int c_ext, FILE *inf) lp = curlb.buffer; *lp = 0; - fvdef = fvnone; fvextern = FALSE; typdef = tnone; + fvdef = fvnone; fvextern = false; typdef = tnone; structdef = snone; definedef = dnone; objdef = onone; - yacc_rules = FALSE; - midtoken = inquote = inchar = incomm = quotednl = FALSE; - token.valid = savetoken.valid = FALSE; + yacc_rules = false; + midtoken = inquote = inchar = incomm = quotednl = false; + token.valid = savetoken.valid = false; bracelev = bracketlev = parlev = attrparlev = templatelev = 0; if (cjava) { qualifier = "."; qlen = 1; } @@ -3065,7 +3063,7 @@ C_entries (int c_ext, FILE *inf) to read the next line. */ if (*lp == '\0') { - quotednl = TRUE; + quotednl = true; continue; } lp++; @@ -3079,7 +3077,7 @@ C_entries (int c_ext, FILE *inf) if (*lp == '/') { c = *lp++; - incomm = FALSE; + incomm = false; } break; case '\0': @@ -3095,7 +3093,7 @@ C_entries (int c_ext, FILE *inf) switch (c) { case '"': - inquote = FALSE; + inquote = false; break; case '\0': /* Newlines inside strings do not end macro definitions @@ -3115,7 +3113,7 @@ C_entries (int c_ext, FILE *inf) CNL (); /* FALLTHRU */ case '\'': - inchar = FALSE; + inchar = false; break; } continue; @@ -3123,7 +3121,7 @@ C_entries (int c_ext, FILE *inf) else switch (c) { case '"': - inquote = TRUE; + inquote = true; if (bracketlev > 0) continue; if (inattribute) @@ -3137,26 +3135,26 @@ C_entries (int c_ext, FILE *inf) case vignore: break; default: - fvextern = FALSE; + fvextern = false; fvdef = fvnone; } continue; case '\'': - inchar = TRUE; + inchar = true; if (bracketlev > 0) continue; if (inattribute) break; if (fvdef != finlist && fvdef != fignore && fvdef != vignore) { - fvextern = FALSE; + fvextern = false; fvdef = fvnone; } continue; case '/': if (*lp == '*') { - incomm = TRUE; + incomm = true; lp++; c = ' '; if (bracketlev > 0) @@ -3172,9 +3170,9 @@ C_entries (int c_ext, FILE *inf) { /* Entering or exiting rules section in yacc file. */ lp++; - definedef = dnone; fvdef = fvnone; fvextern = FALSE; + definedef = dnone; fvdef = fvnone; fvextern = false; typdef = tnone; structdef = snone; - midtoken = inquote = inchar = incomm = quotednl = FALSE; + midtoken = inquote = inchar = incomm = quotednl = false; bracelev = 0; yacc_rules = !yacc_rules; continue; @@ -3185,7 +3183,7 @@ C_entries (int c_ext, FILE *inf) if (definedef == dnone) { char *cp; - bool cpptoken = TRUE; + bool cpptoken = true; /* Look back on this line. If all blanks, or nonblanks followed by an end of comment, this is a preprocessor @@ -3196,10 +3194,10 @@ C_entries (int c_ext, FILE *inf) if (*cp == '*' && cp[1] == '/') { cp++; - cpptoken = TRUE; + cpptoken = true; } else - cpptoken = FALSE; + cpptoken = false; } if (cpptoken) definedef = dsharpseen; @@ -3248,7 +3246,7 @@ C_entries (int c_ext, FILE *inf) } else { - bool funorvar = FALSE; + bool funorvar = false; if (yacc_rules || consider_token (newlb.buffer + tokoff, toklen, c, @@ -3267,7 +3265,7 @@ C_entries (int c_ext, FILE *inf) c = *lp++; toklen += lp - oldlp; } - token.named = FALSE; + token.named = false; if (!plainc && nestlev > 0 && definedef == dnone) /* in struct body */ @@ -3278,7 +3276,7 @@ C_entries (int c_ext, FILE *inf) linebuffer_setlen (&token_name, len+qlen+toklen); sprintf (token_name.buffer + len, "%s%.*s", qualifier, toklen, newlb.buffer + tokoff); - token.named = TRUE; + token.named = true; } else if (objdef == ocatseen) /* Objective C category */ @@ -3287,13 +3285,13 @@ C_entries (int c_ext, FILE *inf) linebuffer_setlen (&token_name, len); sprintf (token_name.buffer, "%s(%.*s)", objtag, toklen, newlb.buffer + tokoff); - token.named = TRUE; + token.named = true; } else if (objdef == omethodtag || objdef == omethodparm) /* Objective C method */ { - token.named = TRUE; + token.named = true; } else if (fvdef == fdefunname) /* GNU DEFUN and similar macros */ @@ -3341,7 +3339,7 @@ C_entries (int c_ext, FILE *inf) token.length = toklen; token.line = newlb.buffer; token.linepos = newlinepos; - token.valid = TRUE; + token.valid = true; if (definedef == dnone && (fvdef == fvnameseen @@ -3369,7 +3367,7 @@ C_entries (int c_ext, FILE *inf) fvdef = fvnone; } } - midtoken = FALSE; + midtoken = false; } } /* if (endtoken (c)) */ else if (intoken (c)) @@ -3395,7 +3393,7 @@ C_entries (int c_ext, FILE *inf) case flistseen: if (plainc || declarations) { - make_C_tag (TRUE); /* a function */ + make_C_tag (true); /* a function */ fvdef = fignore; } break; @@ -3414,7 +3412,7 @@ C_entries (int c_ext, FILE *inf) { tokoff = lp - 1 - newlb.buffer; toklen = 1; - midtoken = TRUE; + midtoken = true; } continue; } /* if (begtoken) */ @@ -3430,7 +3428,7 @@ C_entries (int c_ext, FILE *inf) break; if (yacc_rules && token.offset == 0 && token.valid) { - make_C_tag (FALSE); /* a yacc function */ + make_C_tag (false); /* a yacc function */ break; } if (definedef != dnone) @@ -3439,7 +3437,7 @@ C_entries (int c_ext, FILE *inf) { case otagseen: objdef = oignore; - make_C_tag (TRUE); /* an Objective C class */ + make_C_tag (true); /* an Objective C class */ break; case omethodtag: case omethodparm: @@ -3456,7 +3454,7 @@ C_entries (int c_ext, FILE *inf) /* Should be useless, but may be work as a safety net. */ if (cplpl && fvdef == flistseen) { - make_C_tag (TRUE); /* a function */ + make_C_tag (true); /* a function */ fvdef = fignore; break; } @@ -3468,7 +3466,7 @@ C_entries (int c_ext, FILE *inf) { case tend: case ttypeseen: - make_C_tag (FALSE); /* a typedef */ + make_C_tag (false); /* a typedef */ typdef = tnone; fvdef = fvnone; break; @@ -3484,10 +3482,10 @@ C_entries (int c_ext, FILE *inf) case fvnameseen: if ((globals && bracelev == 0 && (!fvextern || declarations)) || (members && instruct)) - make_C_tag (FALSE); /* a variable */ - fvextern = FALSE; + make_C_tag (false); /* a variable */ + fvextern = false; fvdef = fvnone; - token.valid = FALSE; + token.valid = false; break; case flistseen: if ((declarations @@ -3495,16 +3493,16 @@ C_entries (int c_ext, FILE *inf) && (typdef == tnone || (typdef != tignore && instruct))) || (members && plainc && instruct)) - make_C_tag (TRUE); /* a function */ + make_C_tag (true); /* a function */ /* FALLTHRU */ default: - fvextern = FALSE; + fvextern = false; fvdef = fvnone; if (declarations && cplpl && structdef == stagseen) - make_C_tag (FALSE); /* forward declaration */ + make_C_tag (false); /* forward declaration */ else - token.valid = FALSE; + token.valid = false; } /* switch (fvdef) */ /* FALLTHRU */ default: @@ -3521,7 +3519,7 @@ C_entries (int c_ext, FILE *inf) { case omethodtag: case omethodparm: - make_C_tag (TRUE); /* an Objective C method */ + make_C_tag (true); /* an Objective C method */ objdef = oinbody; break; } @@ -3544,18 +3542,18 @@ C_entries (int c_ext, FILE *inf) && templatelev == 0 && (!fvextern || declarations)) || (members && instruct))) - make_C_tag (FALSE); /* a variable */ + make_C_tag (false); /* a variable */ break; case flistseen: if ((declarations && typdef == tnone && !instruct) || (members && typdef != tignore && instruct)) { - make_C_tag (TRUE); /* a function */ + make_C_tag (true); /* a function */ fvdef = fvnameseen; } else if (!declarations) fvdef = fvnone; - token.valid = FALSE; + token.valid = false; break; default: fvdef = fvnone; @@ -3573,7 +3571,7 @@ C_entries (int c_ext, FILE *inf) case ttypeseen: case tend: typdef = tignore; - make_C_tag (FALSE); /* a typedef */ + make_C_tag (false); /* a typedef */ break; case tnone: case tinbody: @@ -3588,7 +3586,7 @@ C_entries (int c_ext, FILE *inf) if ((members && bracelev == 1) || (globals && bracelev == 0 && (!fvextern || declarations))) - make_C_tag (FALSE); /* a variable */ + make_C_tag (false); /* a variable */ /* FALLTHRU */ default: fvdef = fvnone; @@ -3615,7 +3613,7 @@ C_entries (int c_ext, FILE *inf) { /* This handles constructs like: typedef void OperatorFun (int fun); */ - make_C_tag (FALSE); + make_C_tag (false); typdef = tignore; fvdef = fignore; break; @@ -3634,14 +3632,14 @@ C_entries (int c_ext, FILE *inf) if (inattribute) { if (--attrparlev == 0) - inattribute = FALSE; + inattribute = false; break; } if (definedef != dnone) break; if (objdef == ocatseen && parlev == 1) { - make_C_tag (TRUE); /* an Objective C category */ + make_C_tag (true); /* an Objective C category */ objdef = oignore; } if (--parlev == 0) @@ -3658,7 +3656,7 @@ C_entries (int c_ext, FILE *inf) || typdef == ttypeseen)) { typdef = tignore; - make_C_tag (FALSE); /* a typedef */ + make_C_tag (false); /* a typedef */ } } else if (parlev < 0) /* can happen due to ill-conceived #if's. */ @@ -3677,7 +3675,7 @@ C_entries (int c_ext, FILE *inf) switch (fvdef) { case flistseen: - make_C_tag (TRUE); /* a function */ + make_C_tag (true); /* a function */ /* FALLTHRU */ case fignore: fvdef = fvnone; @@ -3686,12 +3684,12 @@ C_entries (int c_ext, FILE *inf) switch (objdef) { case otagseen: - make_C_tag (TRUE); /* an Objective C class */ + make_C_tag (true); /* an Objective C class */ objdef = oignore; break; case omethodtag: case omethodparm: - make_C_tag (TRUE); /* an Objective C method */ + make_C_tag (true); /* an Objective C method */ objdef = oinbody; break; default: @@ -3712,7 +3710,7 @@ C_entries (int c_ext, FILE *inf) case scolonseen: /* a class */ pushclass_above (bracelev,token.line+token.offset, token.length); structdef = snone; - make_C_tag (FALSE); /* a struct or enum */ + make_C_tag (false); /* a struct or enum */ break; } bracelev += 1; @@ -3723,7 +3721,7 @@ C_entries (int c_ext, FILE *inf) if (fvdef == fstartlist) { fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ - token.valid = FALSE; + token.valid = false; } break; case '}': @@ -3733,13 +3731,13 @@ C_entries (int c_ext, FILE *inf) if (!ignoreindent && lp == newlb.buffer + 1) { if (bracelev != 0) - token.valid = FALSE; /* unexpected value, token unreliable */ + token.valid = false; /* unexpected value, token unreliable */ bracelev = 0; /* reset brace level if first column */ parlev = 0; /* also reset paren level, just in case... */ } else if (bracelev < 0) { - token.valid = FALSE; /* something gone amiss, token unreliable */ + token.valid = false; /* something gone amiss, token unreliable */ bracelev = 0; } if (bracelev == 0 && fvdef == vignore) @@ -3766,7 +3764,7 @@ C_entries (int c_ext, FILE *inf) case fvnameseen: if ((members && bracelev == 1) || (globals && bracelev == 0 && (!fvextern || declarations))) - make_C_tag (FALSE); /* a variable */ + make_C_tag (false); /* a variable */ /* FALLTHRU */ default: fvdef = vignore; @@ -3815,7 +3813,7 @@ C_entries (int c_ext, FILE *inf) case '\0': if (objdef == otagseen) { - make_C_tag (TRUE); /* an Objective C class */ + make_C_tag (true); /* an Objective C class */ objdef = oignore; } /* If a macro spans multiple lines don't reset its state. */ @@ -3885,18 +3883,18 @@ Yacc_entries (FILE *inf) && /* instructions at start of loop */ \ (readline (&line_buffer, file_pointer), \ char_pointer = line_buffer.buffer, \ - TRUE); \ + true); \ ) #define LOOKING_AT(cp, kw) /* kw is the keyword, a literal string */ \ - ((assert ("" kw), TRUE) /* syntax error if not a literal string */ \ + ((assert ("" kw), true) /* syntax error if not a literal string */ \ && strneq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \ && notinname ((cp)[sizeof (kw)-1]) /* end of kw */ \ && ((cp) = skip_spaces ((cp)+sizeof (kw)-1))) /* skip spaces */ /* Similar to LOOKING_AT but does not use notinname, does not skip */ #define LOOKING_AT_NOCASE(cp, kw) /* the keyword is a literal string */ \ - ((assert ("" kw), TRUE) /* syntax error if not a literal string */ \ + ((assert ("" kw), true) /* syntax error if not a literal string */ \ && strncaseeq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \ && ((cp) += sizeof (kw)-1)) /* skip spaces */ @@ -3959,7 +3957,7 @@ F_getit (FILE *inf) return; for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++) continue; - make_tag (dbp, cp-dbp, TRUE, + make_tag (dbp, cp-dbp, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } @@ -4036,7 +4034,7 @@ Fortran_functions (FILE *inf) { dbp = skip_spaces (dbp); if (*dbp == '\0') /* assume un-named */ - make_tag ("blockdata", 9, TRUE, + make_tag ("blockdata", 9, true, lb.buffer, dbp - lb.buffer, lineno, linecharno); else F_getit (inf); /* look for name */ @@ -4109,7 +4107,7 @@ Ada_getit (FILE *inf, const char *name_qualifier) *cp = '\0'; name = concat (dbp, name_qualifier, ""); *cp = c; - make_tag (name, strlen (name), TRUE, + make_tag (name, strlen (name), true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); free (name); if (c == '"') @@ -4121,8 +4119,8 @@ Ada_getit (FILE *inf, const char *name_qualifier) static void Ada_funcs (FILE *inf) { - bool inquote = FALSE; - bool skip_till_semicolumn = FALSE; + bool inquote = false; + bool skip_till_semicolumn = false; LOOP_ON_INPUT_LINES (inf, lb, dbp) { @@ -4134,13 +4132,13 @@ Ada_funcs (FILE *inf) dbp = etags_strchr (dbp + !inquote, '"'); if (dbp != NULL) { - inquote = FALSE; + inquote = false; dbp += 1; continue; /* advance char */ } else { - inquote = TRUE; + inquote = true; break; /* advance line */ } } @@ -4162,7 +4160,7 @@ Ada_funcs (FILE *inf) if (skip_till_semicolumn) { if (*dbp == ';') - skip_till_semicolumn = FALSE; + skip_till_semicolumn = false; dbp++; continue; /* advance char */ } @@ -4199,7 +4197,7 @@ Ada_funcs (FILE *inf) { /* when tagging types, avoid tagging use type Pack.Typename; for this, we will skip everything till a ; */ - skip_till_semicolumn = TRUE; + skip_till_semicolumn = true; continue; /* advance char */ } @@ -4248,7 +4246,7 @@ Asm_labels (FILE *inf) cp++; if (*cp == ':' || iswhite (*cp)) /* Found end of label, so copy it and add it to the table. */ - make_tag (lb.buffer, cp - lb.buffer, TRUE, + make_tag (lb.buffer, cp - lb.buffer, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } @@ -4292,7 +4290,7 @@ Perl_functions (FILE *inf) if ((pos = etags_strchr (sp, ':')) != NULL && pos < cp && pos[1] == ':') /* The name is already qualified. */ - make_tag (sp, cp - sp, TRUE, + make_tag (sp, cp - sp, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); else /* Qualify it. */ @@ -4303,7 +4301,7 @@ Perl_functions (FILE *inf) *cp = '\0'; name = concat (package, "::", sp); *cp = savechar; - make_tag (name, strlen (name), TRUE, + make_tag (name, strlen (name), true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); free (name); } @@ -4346,7 +4344,7 @@ Perl_functions (FILE *inf) else continue; - make_tag (varstart, cp - varstart, FALSE, + make_tag (varstart, cp - varstart, false, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } @@ -4373,7 +4371,7 @@ Python_functions (FILE *inf) char *name = cp; while (!notinname (*cp) && *cp != ':') cp++; - make_tag (name, cp - name, TRUE, + make_tag (name, cp - name, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } @@ -4393,8 +4391,8 @@ Python_functions (FILE *inf) static void PHP_functions (FILE *inf) { - register char *cp, *name; - bool search_identifier = FALSE; + char *cp, *name; + bool search_identifier = false; LOOP_ON_INPUT_LINES (inf, lb, cp) { @@ -4405,9 +4403,9 @@ PHP_functions (FILE *inf) { while (!notinname (*cp)) cp++; - make_tag (name, cp - name, TRUE, + make_tag (name, cp - name, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - search_identifier = FALSE; + search_identifier = false; } else if (LOOKING_AT (cp, "function")) { @@ -4418,11 +4416,11 @@ PHP_functions (FILE *inf) name = cp; while (!notinname (*cp)) cp++; - make_tag (name, cp - name, TRUE, + make_tag (name, cp - name, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } else - search_identifier = TRUE; + search_identifier = true; } else if (LOOKING_AT (cp, "class")) { @@ -4431,11 +4429,11 @@ PHP_functions (FILE *inf) name = cp; while (*cp != '\0' && !iswhite (*cp)) cp++; - make_tag (name, cp - name, FALSE, + make_tag (name, cp - name, false, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } else - search_identifier = TRUE; + search_identifier = true; } else if (strneq (cp, "define", 6) && (cp = skip_spaces (cp+6)) @@ -4446,7 +4444,7 @@ PHP_functions (FILE *inf) name = cp; while (*cp != quote && *cp != '\0') cp++; - make_tag (name, cp - name, FALSE, + make_tag (name, cp - name, false, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } else if (members @@ -4456,7 +4454,7 @@ PHP_functions (FILE *inf) name = cp; while (!notinname (*cp)) cp++; - make_tag (name, cp - name, FALSE, + make_tag (name, cp - name, false, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } @@ -4487,7 +4485,7 @@ Cobol_paragraphs (FILE *inf) for (ep = bp; ISALNUM (*ep) || *ep == '-'; ep++) continue; if (*ep++ == '.') - make_tag (bp, ep - bp, TRUE, + make_tag (bp, ep - bp, true, lb.buffer, ep - lb.buffer + 1, lineno, linecharno); } } @@ -4516,7 +4514,7 @@ Makefile_targets (FILE *inf) while (--bp > namestart) if (!notinname (*bp)) break; - make_tag (namestart, bp - namestart + 1, TRUE, + make_tag (namestart, bp - namestart + 1, true, lb.buffer, bp - lb.buffer + 2, lineno, linecharno); } } @@ -4540,7 +4538,7 @@ Pascal_functions (FILE *inf) int save_lineno, namelen, taglen; char c, *name; - bool /* each of these flags is TRUE if: */ + bool /* each of these flags is true if: */ incomment, /* point is inside a comment */ inquote, /* point is inside '..' string */ get_tagname, /* point is after PROCEDURE/FUNCTION @@ -4558,11 +4556,11 @@ Pascal_functions (FILE *inf) *dbp = '\0'; linebuffer_init (&tline); - incomment = inquote = FALSE; - found_tag = FALSE; /* have a proc name; check if extern */ - get_tagname = FALSE; /* found "procedure" keyword */ - inparms = FALSE; /* found '(' after "proc" */ - verify_tag = FALSE; /* check if "extern" is ahead */ + incomment = inquote = false; + found_tag = false; /* have a proc name; check if extern */ + get_tagname = false; /* found "procedure" keyword */ + inparms = false; /* found '(' after "proc" */ + verify_tag = false; /* check if "extern" is ahead */ while (!feof (inf)) /* long main loop to get next char */ @@ -4583,46 +4581,46 @@ Pascal_functions (FILE *inf) if (incomment) { if (c == '}') /* within { } comments */ - incomment = FALSE; + incomment = false; else if (c == '*' && *dbp == ')') /* within (* *) comments */ { dbp++; - incomment = FALSE; + incomment = false; } continue; } else if (inquote) { if (c == '\'') - inquote = FALSE; + inquote = false; continue; } else switch (c) { case '\'': - inquote = TRUE; /* found first quote */ + inquote = true; /* found first quote */ continue; case '{': /* found open { comment */ - incomment = TRUE; + incomment = true; continue; case '(': if (*dbp == '*') /* found open (* comment */ { - incomment = TRUE; + incomment = true; dbp++; } else if (found_tag) /* found '(' after tag, i.e., parm-list */ - inparms = TRUE; + inparms = true; continue; case ')': /* end of parms list */ if (inparms) - inparms = FALSE; + inparms = false; continue; case ';': if (found_tag && !inparms) /* end of proc or fn stmt */ { - verify_tag = TRUE; + verify_tag = true; break; } continue; @@ -4636,23 +4634,23 @@ Pascal_functions (FILE *inf) { if (nocase_tail ("extern")) /* superfluous, really! */ { - found_tag = FALSE; - verify_tag = FALSE; + found_tag = false; + verify_tag = false; } } else if (lowcase (*dbp) == 'f') { if (nocase_tail ("forward")) /* check for forward reference */ { - found_tag = FALSE; - verify_tag = FALSE; + found_tag = false; + verify_tag = false; } } if (found_tag && verify_tag) /* not external proc, so make tag */ { - found_tag = FALSE; - verify_tag = FALSE; - make_tag (name, namelen, TRUE, + found_tag = false; + verify_tag = false; + make_tag (name, namelen, true, tline.buffer, taglen, save_lineno, save_lcno); continue; } @@ -4678,8 +4676,8 @@ Pascal_functions (FILE *inf) taglen = cp - lb.buffer + 1; dbp = cp; /* set dbp to e-o-token */ - get_tagname = FALSE; - found_tag = TRUE; + get_tagname = false; + found_tag = true; continue; /* And proceed to check for "extern". */ @@ -4691,11 +4689,11 @@ Pascal_functions (FILE *inf) { case 'p': if (nocase_tail ("rocedure")) /* c = 'p', dbp has advanced */ - get_tagname = TRUE; + get_tagname = true; continue; case 'f': if (nocase_tail ("unction")) - get_tagname = TRUE; + get_tagname = true; continue; } } @@ -4824,7 +4822,7 @@ PS_functions (FILE *inf) *ep != '\0' && *ep != ' ' && *ep != '{'; ep++) continue; - make_tag (bp, ep - bp, TRUE, + make_tag (bp, ep - bp, true, lb.buffer, ep - lb.buffer + 1, lineno, linecharno); } else if (LOOKING_AT (bp, "defineps")) @@ -4954,14 +4952,14 @@ TeX_commands (FILE *inf) for (key = TEX_toktab; key->buffer != NULL; key++) if (strneq (cp, key->buffer, key->len)) { - register char *p; + char *p; int namelen, linelen; - bool opgrp = FALSE; + bool opgrp = false; cp = skip_spaces (cp + key->len); if (*cp == TEX_opgrp) { - opgrp = TRUE; + opgrp = true; cp++; } for (p = cp; @@ -4977,7 +4975,7 @@ TeX_commands (FILE *inf) p++; linelen = p - lb.buffer + 1; } - make_tag (cp, namelen, TRUE, + make_tag (cp, namelen, true, lb.buffer, linelen, lineno, linecharno); goto tex_next_line; /* We only tag a line once */ } @@ -5081,7 +5079,7 @@ Texinfo_nodes (FILE *inf) start = cp; while (*cp != '\0' && *cp != ',') cp++; - make_tag (start, cp - start, TRUE, + make_tag (start, cp - start, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } @@ -5097,10 +5095,10 @@ Texinfo_nodes (FILE *inf) static void HTML_labels (FILE *inf) { - bool getnext = FALSE; /* next text outside of HTML tags is a tag */ - bool skiptag = FALSE; /* skip to the end of the current HTML tag */ - bool intag = FALSE; /* inside an html tag, looking for ID= */ - bool inanchor = FALSE; /* when INTAG, is an anchor, look for NAME= */ + bool getnext = false; /* next text outside of HTML tags is a tag */ + bool skiptag = false; /* skip to the end of the current HTML tag */ + bool intag = false; /* inside an html tag, looking for ID= */ + bool inanchor = false; /* when INTAG, is an anchor, look for NAME= */ char *end; @@ -5116,7 +5114,7 @@ HTML_labels (FILE *inf) if (*dbp == '>') { dbp += 1; - skiptag = FALSE; + skiptag = false; continue; /* look on the same line */ } break; /* go to next line */ @@ -5132,7 +5130,7 @@ HTML_labels (FILE *inf) if (*dbp == '>') { dbp += 1; - intag = FALSE; + intag = false; continue; /* look on the same line */ } if ((inanchor && LOOKING_AT_NOCASE (dbp, "name=")) @@ -5151,9 +5149,9 @@ HTML_labels (FILE *inf) token_name.buffer[end - dbp] = '\0'; dbp = end; - intag = FALSE; /* we found what we looked for */ - skiptag = TRUE; /* skip to the end of the tag */ - getnext = TRUE; /* then grab the text */ + intag = false; /* we found what we looked for */ + skiptag = true; /* skip to the end of the tag */ + getnext = true; /* then grab the text */ continue; /* look on the same line */ } dbp += 1; @@ -5166,17 +5164,17 @@ HTML_labels (FILE *inf) break; /* go to next line */ if (*dbp == '<') { - intag = TRUE; + intag = true; inanchor = (lowcase (dbp[1]) == 'a' && !intoken (dbp[2])); continue; /* look on the same line */ } for (end = dbp + 1; *end != '\0' && *end != '<'; end++) continue; - make_tag (token_name.buffer, token_name.len, TRUE, + make_tag (token_name.buffer, token_name.len, true, dbp, end - dbp, lineno, linecharno); linebuffer_setlen (&token_name, 0); /* no name in buffer */ - getnext = FALSE; + getnext = false; break; /* go to next line */ } @@ -5186,10 +5184,10 @@ HTML_labels (FILE *inf) dbp++; if (*dbp == '\0') break; /* go to next line */ - intag = TRUE; + intag = true; if (lowcase (dbp[1]) == 'a' && !intoken (dbp[2])) { - inanchor = TRUE; + inanchor = true; continue; /* look on the same line */ } else if (LOOKING_AT_NOCASE (dbp, "<title>") @@ -5197,8 +5195,8 @@ HTML_labels (FILE *inf) || LOOKING_AT_NOCASE (dbp, "<h2>") || LOOKING_AT_NOCASE (dbp, "<h3>")) { - intag = FALSE; - getnext = TRUE; + intag = false; + getnext = true; continue; /* look on the same line */ } dbp += 1; @@ -5303,7 +5301,7 @@ prolog_pr (char *s, char *last) || len != strlen (last) || !strneq (s, last, len))) { - make_tag (s, len, TRUE, s, pos, lineno, linecharno); + make_tag (s, len, true, s, pos, lineno, linecharno); return len; } else @@ -5459,7 +5457,7 @@ erlang_func (char *s, char *last) || len != (int)strlen (last) || !strneq (s, last, len))) { - make_tag (s, len, TRUE, s, pos, lineno, linecharno); + make_tag (s, len, true, s, pos, lineno, linecharno); return len; } @@ -5486,7 +5484,7 @@ erlang_attribute (char *s) { int len = erlang_atom (skip_spaces (cp)); if (len > 0) - make_tag (cp, len, TRUE, s, cp + len - s, lineno, linecharno); + make_tag (cp, len, true, s, cp + len - s, lineno, linecharno); } return; } @@ -5539,7 +5537,7 @@ scan_separators (char *name) { char sep = name[0]; char *copyto = name; - bool quoted = FALSE; + bool quoted = false; for (++name; *name != '\0'; ++name) { @@ -5567,10 +5565,10 @@ scan_separators (char *name) } break; } - quoted = FALSE; + quoted = false; } else if (*name == '\\') - quoted = TRUE; + quoted = true; else if (*name == sep) break; else @@ -5664,10 +5662,10 @@ add_regex (char *regexp_pattern, language *lang) struct re_pattern_buffer *patbuf; regexp *rp; bool - force_explicit_name = TRUE, /* do not use implicit tag names */ - ignore_case = FALSE, /* case is significant */ - multi_line = FALSE, /* matches are done one line at a time */ - single_line = FALSE; /* dot does not match newline */ + force_explicit_name = true, /* do not use implicit tag names */ + ignore_case = false, /* case is significant */ + multi_line = false, /* matches are done one line at a time */ + single_line = false; /* dot does not match newline */ if (strlen (regexp_pattern) < 3) @@ -5703,17 +5701,17 @@ add_regex (char *regexp_pattern, language *lang) case 'N': if (modifiers == name) error ("forcing explicit tag name but no name, ignoring"); - force_explicit_name = TRUE; + force_explicit_name = true; break; case 'i': - ignore_case = TRUE; + ignore_case = true; break; case 's': - single_line = TRUE; + single_line = true; /* FALLTHRU */ case 'm': - multi_line = TRUE; - need_filebuf = TRUE; + multi_line = true; + need_filebuf = true; break; default: error ("invalid regexp modifier `%c', ignoring", modifiers[0]); @@ -5757,7 +5755,7 @@ add_regex (char *regexp_pattern, language *lang) p_head->lang = lang; p_head->pat = patbuf; p_head->name = savestr (name); - p_head->error_signaled = FALSE; + p_head->error_signaled = false; p_head->force_explicit_name = force_explicit_name; p_head->ignore_case = ignore_case; p_head->multi_line = multi_line; @@ -5871,7 +5869,7 @@ regex_tag_multiline (void) { error ("regexp stack overflow while matching \"%s\"", rp->pattern); - rp->error_signaled = TRUE; + rp->error_signaled = true; } break; case -1: @@ -5884,7 +5882,7 @@ regex_tag_multiline (void) { error ("regexp matches the empty string: \"%s\"", rp->pattern); - rp->error_signaled = TRUE; + rp->error_signaled = true; } match = -3; /* exit from while loop */ break; @@ -5901,10 +5899,10 @@ regex_tag_multiline (void) name = substitute (buffer, rp->name, &rp->regs); if (rp->force_explicit_name) /* Force explicit tag name, if a name is there. */ - pfnote (name, TRUE, buffer + linecharno, + pfnote (name, true, buffer + linecharno, charno - linecharno + 1, lineno, linecharno); else - make_tag (name, strlen (name), TRUE, buffer + linecharno, + make_tag (name, strlen (name), true, buffer + linecharno, charno - linecharno + 1, lineno, linecharno); break; } @@ -5923,9 +5921,9 @@ nocase_tail (const char *cp) if (*cp == '\0' && !intoken (dbp[len])) { dbp += len; - return TRUE; + return true; } - return FALSE; + return false; } static void @@ -5938,7 +5936,7 @@ get_tag (register char *bp, char **namepp) /* Go till you get to white space or a syntactic break */ for (cp = bp + 1; !notinname (*cp); cp++) continue; - make_tag (bp, cp - bp, TRUE, + make_tag (bp, cp - bp, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } @@ -6073,7 +6071,7 @@ readline (linebuffer *lbp, FILE *stream) char *taggedfname; /* name of original file as given */ char *name; /* temp var */ - discard_until_line_directive = FALSE; /* found it */ + discard_until_line_directive = false; /* found it */ name = lbp->buffer + start; *endp = '\0'; canonicalize_filename (name); @@ -6121,7 +6119,7 @@ readline (linebuffer *lbp, FILE *stream) for (fdp = fdhead; fdp != NULL; fdp = fdp->next) if (streq (fdp->infabsname, taggedabsname)) { - discard_until_line_directive = TRUE; + discard_until_line_directive = true; free (taggedfname); break; } @@ -6137,9 +6135,9 @@ readline (linebuffer *lbp, FILE *stream) fdhead->infabsname = savestr (curfdp->infabsname); fdhead->infabsdir = savestr (curfdp->infabsdir); fdhead->taggedfname = taggedfname; - fdhead->usecharno = FALSE; + fdhead->usecharno = false; fdhead->prop = NULL; - fdhead->written = FALSE; + fdhead->written = false; curfdp = fdhead; } } @@ -6162,7 +6160,7 @@ readline (linebuffer *lbp, FILE *stream) return; } /* End of file. */ - discard_until_line_directive = FALSE; + discard_until_line_directive = false; return; } } /* if #line directives should be considered */ @@ -6192,7 +6190,7 @@ readline (linebuffer *lbp, FILE *stream) { error ("regexp stack overflow while matching \"%s\"", rp->pattern); - rp->error_signaled = TRUE; + rp->error_signaled = true; } break; case -1: @@ -6203,7 +6201,7 @@ readline (linebuffer *lbp, FILE *stream) if (!rp->error_signaled) { error ("regexp matches the empty string: \"%s\"", rp->pattern); - rp->error_signaled = TRUE; + rp->error_signaled = true; } break; default: @@ -6215,9 +6213,9 @@ readline (linebuffer *lbp, FILE *stream) name = substitute (lbp->buffer, rp->name, &rp->regs); if (rp->force_explicit_name) /* Force explicit tag name, if a name is there. */ - pfnote (name, TRUE, lbp->buffer, match, lineno, linecharno); + pfnote (name, true, lbp->buffer, match, lineno, linecharno); else - make_tag (name, strlen (name), TRUE, + make_tag (name, strlen (name), true, lbp->buffer, match, lineno, linecharno); break; } diff --git a/lib-src/hexl.c b/lib-src/hexl.c index 3208a895aa..b308256a66 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c @@ -37,12 +37,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define DEFAULT_GROUPING 0x01 #define DEFAULT_BASE 16 -#undef TRUE -#undef FALSE -#define TRUE (1) -#define FALSE (0) - -int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1; +int base = DEFAULT_BASE; +bool un_flag = false, iso_flag = false, endian = true; int group_by = DEFAULT_GROUPING; char *progname; @@ -83,7 +79,7 @@ main (int argc, char **argv) } else if (!strcmp (*argv, "-un") || !strcmp (*argv, "-de")) { - un_flag = TRUE; + un_flag = true; --argc; argv++; } else if (!strcmp (*argv, "-hex")) @@ -93,7 +89,7 @@ main (int argc, char **argv) } else if (!strcmp (*argv, "-iso")) { - iso_flag = TRUE; + iso_flag = true; --argc; argv++; } else if (!strcmp (*argv, "-oct")) @@ -103,12 +99,12 @@ main (int argc, char **argv) } else if (!strcmp (*argv, "-big-endian")) { - endian = 1; + endian = true; --argc; argv++; } else if (!strcmp (*argv, "-little-endian")) { - endian = 0; + endian = false; --argc; argv++; } else if (!strcmp (*argv, "-group-by-8-bits")) @@ -129,7 +125,7 @@ main (int argc, char **argv) else if (!strcmp (*argv, "-group-by-64-bits")) { group_by = 0x07; - endian = 0; + endian = false; --argc; argv++; } else diff --git a/lib-src/pop.c b/lib-src/pop.c index a269144c91..ea89ad47ea 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -124,7 +124,7 @@ static char *find_crlf (char *, int); #endif char pop_error[ERROR_MAX]; -int pop_debug = 0; +bool pop_debug = false; /* * Function: pop_open (char *host, char *username, char *password, @@ -269,8 +269,8 @@ pop_open (char *host, char *username, char *password, int flags) server->data = 0; server->buffer_index = 0; server->buffer_size = GETLINE_MIN; - server->in_multi = 0; - server->trash_started = 0; + server->in_multi = false; + server->trash_started = false; if (getok (server)) return (0); @@ -686,7 +686,7 @@ pop_multi_first (popserver server, const char *command, char **response) else if (0 == strncmp (*response, "+OK", 3)) { for (*response += 3; **response == ' '; (*response)++) /* empty */; - server->in_multi = 1; + server->in_multi = true; return (0); } else @@ -728,7 +728,7 @@ pop_multi_next (popserver server, char **line) if (! fromserver[1]) { *line = 0; - server->in_multi = 0; + server->in_multi = false; return (0); } else @@ -1546,7 +1546,7 @@ pop_trash (popserver server) /* avoid recursion; sendline can call pop_trash */ if (server->trash_started) return; - server->trash_started = 1; + server->trash_started = true; sendline (server, "RSET"); sendline (server, "QUIT"); diff --git a/lib-src/pop.h b/lib-src/pop.h index dbc7c8dbe6..ac5f315bde 100644 --- a/lib-src/pop.h +++ b/lib-src/pop.h @@ -27,15 +27,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* size when it needs to grow */ extern char pop_error[]; -extern int pop_debug; +extern bool pop_debug; struct _popserver { int file, data; char *buffer; int buffer_size, buffer_index; - int in_multi; - int trash_started; + bool_bf in_multi : 1; + bool_bf trash_started : 1; }; typedef struct _popserver *popserver; @@ -73,4 +73,3 @@ extern int pop_last (popserver server); extern int pop_reset (popserver server); extern int pop_quit (popserver server); extern void pop_close (popserver); - |