From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A51273858C20 for ; Wed, 16 Feb 2022 15:39:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A51273858C20 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-122-4vG-BNHRP6-2ZLKBLQ6UHA-1; Wed, 16 Feb 2022 10:39:44 -0500 X-MC-Unique: 4vG-BNHRP6-2ZLKBLQ6UHA-1 Received: by mail-wr1-f71.google.com with SMTP id m8-20020adfa3c8000000b001e3381fdf45so1221396wrb.4 for ; Wed, 16 Feb 2022 07:39:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sHNcTZB3bT87oq0goCjMfp2//Hd8Vyzh2KvyJFXc7xU=; b=0zq+KvWWaExDdOqHpjuStHgIooVpa/WCy5wiQnozkJ7pI59PgztqhXRVh2fPKjh3tT o27MnZrEtVNsNkdltbpDrr0+iHI2CVCTDl38b5D6TeFK/itsrbod3ZJMkRmyZKnCJgNF Pfh7pXINmUD2c5TEzDnJGqots0bYybbfmcj+kM4AHd8w3SOkpo2mNEiWg6Kx/jOsZHER w+l3AxaXeitAIyqHJFIZhs+QPguwhMLy8Jk5pdyQJ1fmUAU0+lk1FZUg9eKtMw7akdfF OoiD4qPYpPW2g+ngOMU4zNNWRZ4XcgLbMEAIBkZ0AiD62QVIGPebzd97plL68RrgORER S/Ww== X-Gm-Message-State: AOAM5304M1fBi7B9RbEWmsTjEWm869nkwQYjNKdH2gwT+9Hb4iis6jw8 TyhOa3YLguNjyMDb/WI4X8BcUTNV7TWLWQ2yqMscjmWMScoaSwx3w/70k85Ll4fJvx8Ta4c5wcn /d0SQ/I4AUsTUUkW0Qo0AZQ== X-Received: by 2002:adf:bc14:0:b0:1e2:b035:9c46 with SMTP id s20-20020adfbc14000000b001e2b0359c46mr2785093wrg.386.1645025982736; Wed, 16 Feb 2022 07:39:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFzni/gcREizzFML8doDctpOJgfInQ1ehsBR+nwGgrGuU12Ok+2XZPelk443oXL2y1oLw6HQ== X-Received: by 2002:adf:bc14:0:b0:1e2:b035:9c46 with SMTP id s20-20020adfbc14000000b001e2b0359c46mr2785082wrg.386.1645025982537; Wed, 16 Feb 2022 07:39:42 -0800 (PST) Received: from localhost (host86-134-151-224.range86-134.btcentralplus.com. [86.134.151.224]) by smtp.gmail.com with ESMTPSA id h17sm17851200wmm.15.2022.02.16.07.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 07:39:42 -0800 (PST) Date: Wed, 16 Feb 2022 15:39:41 +0000 From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 02/18] Boolify need_escape in generic_emit_char Message-ID: <20220216153941.GF2571@redhat.com> References: <20220216135518.3162480-1-tom@tromey.com> <20220216135518.3162480-3-tom@tromey.com> MIME-Version: 1.0 In-Reply-To: <20220216135518.3162480-3-tom@tromey.com> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 15:39:27 up 5 days, 5:18, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2022 15:39:47 -0000 * Tom Tromey [2022-02-16 06:55:02 -0700]: > This changes 'need_escape' in generic_emit_char to be of type bool, > rather than int. LGTM. Thanks, Andrew > --- > gdb/valprint.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/gdb/valprint.c b/gdb/valprint.c > index e4d68381189..e758c1d1066 100644 > --- a/gdb/valprint.c > +++ b/gdb/valprint.c > @@ -2191,11 +2191,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 = *need_escapep; > + bool need_escape = *need_escapep; > > - *need_escapep = 0; > + *need_escapep = false; > > /* iswprint implementation on Windows returns 1 for tab character. > In order to avoid different printout on this host, we explicitly > @@ -2265,7 +2265,7 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, > ++i; > } > > - *need_escapep = 1; > + *need_escapep = true; > } > break; > } > @@ -2283,7 +2283,7 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream, > enum bfd_endian byte_order > = type_byte_order (type); > gdb_byte *c_buf; > - int need_escape = 0; > + bool need_escape = false; > > c_buf = (gdb_byte *) alloca (TYPE_LENGTH (type)); > pack_long (c_buf, type, c); > @@ -2448,7 +2448,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, > const converted_character *elem; > enum {START, SINGLE, REPEAT, INCOMPLETE, FINISH} state, last; > gdb_wchar_t wide_quote_char = gdb_btowc (quote_char); > - int need_escape = 0; > + bool need_escape = false; > > /* Set the start state. */ > idx = 0; > -- > 2.31.1 >