From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 340F01F9F3 for ; Tue, 21 Sep 2021 02:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348343AbhIUCXK (ORCPT ); Mon, 20 Sep 2021 22:23:10 -0400 Received: from cloud.peff.net ([104.130.231.41]:51360 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243656AbhIUCHP (ORCPT ); Mon, 20 Sep 2021 22:07:15 -0400 Received: (qmail 2944 invoked by uid 109); 21 Sep 2021 02:05:47 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 21 Sep 2021 02:05:47 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 26695 invoked by uid 111); 21 Sep 2021 02:05:46 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 20 Sep 2021 22:05:46 -0400 Authentication-Results: peff.net; auth=none Date: Mon, 20 Sep 2021 22:05:46 -0400 From: Jeff King To: Hamza Mahfooz Cc: git@vger.kernel.org, Junio C Hamano Subject: Re: [PATCH 2/2] grep: mark "haystack" buffers as const Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Sep 20, 2021 at 09:43:26PM -0400, Jeff King wrote: > When we're grepping in a buffer, we don't need to modify it. So we can > take "const char *" buffers, rather than "char *". This can avoid some > awkward casts in our callers. Sorry, this patch should have touched strip_timestamp(), too. I had originally done it in the earlier patch, but because we pass a pointer-to-pointer, the compiler got mad about the mis-matched type from the caller. So I reverted it there, but forgot to add it back in here. At any rate, these are mostly for illustration. They'd need a little rebasing if not put on top of your patches anyway. -Peff