From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8C7801F47C for ; Mon, 9 Jan 2023 07:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673250003; bh=ICnSZ55bxCAotJp9C7N0wDTKmNdaRjv97ffr57VWSgU=; h=From:To:Subject:Date:From; b=xcpDYvhexRWO5IuwB2VgO02mB6d5/SBUGfKw0AwWsTbuUkWidvMWFoxGIPRLVfHdG FHsYdb8NnRkuFZYWjuFbxgWqAtn5SwmZQ5OyEeGoAG7YRivretOtQpd7snapqOFUcP Uz5x57OAAFWlH5LPqCblhAJRmji0YKOuEqnGOjwI= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH] simplify mw_perl_src_file_cstr to avoid gcc warning Date: Mon, 9 Jan 2023 07:40:03 +0000 Message-Id: <20230109074003.2547679-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This works around a gcc (Debian 10.2.1-6) warning, and is less code, even --- mwrap_core.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mwrap_core.h b/mwrap_core.h index 15df857..deb3bb3 100644 --- a/mwrap_core.h +++ b/mwrap_core.h @@ -389,10 +389,8 @@ static const char *mw_perl_src_file_cstr(unsigned *lineno) { const COP *cop = mwp_curcop(); if (!cop) return NULL; - const char *fn = CopFILE(cop); - if (!fn) return NULL; *lineno = CopLINE(cop); - return fn; + return CopFILE(cop); } # define SRC_FILE_CSTR(lineno) mw_perl_src_file_cstr(lineno) #endif /* MWRAP_PERL */