From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 2C58938582B3; Mon, 10 Oct 2022 17:38:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C58938582B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665423514; bh=ocSDHbevGnElylT4hyza7VsLEJsTldhNnrXfBnB7ybk=; h=From:To:Subject:Date:From; b=U5zKRF1vAKwZFyXtezbUWFN8OnKQq/XPGB3ZAOUG7tAoZ7OkKBG9UUwStA0zR6khD ZMpWxYNLOV5MW2GjV+i/z3LDoGpBApoxT+7dksBvZWGz820QqIUswKE6JzIzn/oxQ9 z1xV5C40S2zayMrjcx9YOGHLaA6TyWxqlfdu7TeE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Boolify need_escape in generic_emit_char X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 1be8435c74de6738aec7ed623b59e381fa9bb644 X-Git-Newrev: 3a64633804aca8b4c4852241c70936177664c18a Message-Id: <20221010173834.2C58938582B3@sourceware.org> Date: Mon, 10 Oct 2022 17:38:34 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3a64633804ac= a8b4c4852241c70936177664c18a commit 3a64633804aca8b4c4852241c70936177664c18a Author: Tom Tromey Date: Thu Feb 10 16:57:34 2022 -0700 Boolify need_escape in generic_emit_char =20 This changes 'need_escape' in generic_emit_char to be of type bool, rather than int. Diff: --- gdb/valprint.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/valprint.c b/gdb/valprint.c index 395c6e9dd29..92d72521501 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2075,11 +2075,11 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, int orig_len, int width, enum bfd_endian byte_order, struct obstack *output, - int quoter, int *need_escapep) + int quoter, bool *need_escapep) { - int need_escape =3D *need_escapep; + bool need_escape =3D *need_escapep; =20 - *need_escapep =3D 0; + *need_escapep =3D false; =20 /* iswprint implementation on Windows returns 1 for tab character. In order to avoid different printout on this host, we explicitly @@ -2149,7 +2149,7 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, ++i; } =20 - *need_escapep =3D 1; + *need_escapep =3D true; } break; } @@ -2167,7 +2167,7 @@ generic_emit_char (int c, struct type *type, struct u= i_file *stream, enum bfd_endian byte_order =3D type_byte_order (type); gdb_byte *c_buf; - int need_escape =3D 0; + bool need_escape =3D false; =20 c_buf =3D (gdb_byte *) alloca (type->length ()); pack_long (c_buf, type, c); @@ -2332,7 +2332,7 @@ print_converted_chars_to_obstack (struct obstack *obs= tack, const converted_character *elem; enum {START, SINGLE, REPEAT, INCOMPLETE, FINISH} state, last; gdb_wchar_t wide_quote_char =3D gdb_btowc (quote_char); - int need_escape =3D 0; + bool need_escape =3D false; =20 /* Set the start state. */ idx =3D 0;