From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id NdZGB+EuHmLidwAAWB0awg (envelope-from ) for ; Tue, 01 Mar 2022 09:34:09 -0500 Received: by simark.ca (Postfix, from userid 112) id 123201F3CA; Tue, 1 Mar 2022 09:34:09 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 736171EA69 for ; Tue, 1 Mar 2022 09:34:08 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B240C385840B for ; Tue, 1 Mar 2022 14:34:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B240C385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646145247; bh=0+Rpj7T8UMcyiE7GbatNMjiB5CXEf3qhxrqY2GcOKRE=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=u86oUfQtRdFZEp1dgFHhX6Tlm2LVPXIXBzcCHqumFuv6GNjDVXhfG8YtzDaXNAsr2 mDXy6HPGeKAhIQlTwoBh40U6l+WguWK/Gu5Tyscm3dzGC/RXoDJrYNaofzLtKZEbgF w82yMHDyNNTtVsqNKh9FvgAptuIaOSZKUEfypm4M= Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 017003858C2C for ; Tue, 1 Mar 2022 14:32:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 017003858C2C Received: by mail-il1-x12b.google.com with SMTP id f2so12676973ilq.1 for ; Tue, 01 Mar 2022 06:32:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=0+Rpj7T8UMcyiE7GbatNMjiB5CXEf3qhxrqY2GcOKRE=; b=WEcYKyiErfxTxSKBsiUBghgwAiKQdJi3muGm9tOt0wYihostxbT8ubvDEO6AbHL/jd 5SIfuoce3BMojuPeH9WGNC0mTK4w3JDBFGrp712X1kfLJXiMMgkyv7deW+kd5RthXUFg xLm/Z82wgClwVM3b94+oHK0GJS87WWbTXi9Snt1HyVvt9hIeEo40RKA5X+pDUbrxX6vK n7wYS+BzxB2WkY4Mw+4W/zk69d3GbH0hQhxSzlzQC29AV+6/BCAESomcaTWFnT1ao0zo Rah/esFEHY0j9EzUwrndZvxGReziNxwEz0u+MgfK985A196YFYkSsqckn1h9UjlP/+X3 /mrQ== X-Gm-Message-State: AOAM533pp6pO3IS0ntwa8C8eA8+hk6BADNTDi38VBum6aATkBzJifbMq kdVn0FsdffU+2zmx9vDEGW83AiZuOGgNJA== X-Google-Smtp-Source: ABdhPJyVJ3NAKx3iTHqD4Dsz9npennjQewCdZQw+OEANLAb8uMuOBnD9K3V/7EeN190b+5dRoeZWow== X-Received: by 2002:a05:6e02:1526:b0:2bb:faba:4d77 with SMTP id i6-20020a056e02152600b002bbfaba4d77mr23223541ilu.231.1646145124367; Tue, 01 Mar 2022 06:32:04 -0800 (PST) Received: from murgatroyd (75-166-141-253.hlrn.qwest.net. [75.166.141.253]) by smtp.gmail.com with ESMTPSA id a2-20020a056e02120200b002c21a18437csm7810346ilq.40.2022.03.01.06.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:32:03 -0800 (PST) To: Simon Marchi Subject: Re: [PATCH 3/5] Let phex and phex_nz handle sizeof_l==1 References: <20220228183304.1162089-1-tromey@adacore.com> <20220228183304.1162089-4-tromey@adacore.com> X-Attribution: Tom Date: Tue, 01 Mar 2022 07:32:03 -0700 In-Reply-To: (Simon Marchi's message of "Tue, 1 Mar 2022 09:26:50 -0500") Message-ID: <87h78hlp5o.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: , From: Tom Tromey via Gdb-patches Reply-To: Tom Tromey Cc: gdb-patches@sourceware.org, Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" >>>>> "Simon" == Simon Marchi writes: >> str = get_print_cell (); >> xsnprintf (str, PRINT_CELL_SIZE, "%04x", (unsigned short) (l & 0xffff)); >> break; >> + case 1: >> + str = get_print_cell (); >> + xsnprintf (str, PRINT_CELL_SIZE, "%02x", (unsigned short) (l & 0xff)); Simon> I'm just wondering why you're casting to unsigned short specifically (and not Simon> unsigned char). But in practice it works, the patch LGTM. I just copied the code above. I think any integer type that isn't wider than "int" would be ok here, as they all get promoted. Tom