From nobody Tue Feb 14 06:04:25 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG9dj5pDWz3rBV8; Tue, 14 Feb 2023 06:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PG9dj5H9zz4J3t; Tue, 14 Feb 2023 06:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676354665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NfmqG/mDanPpW1edJ1yBwM4gmjO5WcuCRCMC9l+2Gg=; b=OQ+xC7td46BYMJkZp8N3bvLPGys6l3WUSyw8t6OEpoIIUlprnipww/SgFXpbKW8tNrLDo9 kkNHlCM3zIvjHhAWtphEfXjolmJ4hPmgIwkQJHGEeAkkSV4CtQtb9gVKp3B95wPJfQkgR7 GakkkLqy6WbYG7coDHpEpgByD2nCjwtEO0r8YKcOSo/eS9GYVVvjDacUUAATQjrZ8lQmd5 0x6AiU1b5wRL6mYLVkHTUNSSoffSSyaGyDfNuKnlMxJNhZkND6Om0SB+v8k0I3xTKcmbcc cwXAi+tP1LuOSf2H14wYLA5I/DYUVpUQ31LkvfDH2U1idpUFEAxw4Gtqdxz7mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676354665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NfmqG/mDanPpW1edJ1yBwM4gmjO5WcuCRCMC9l+2Gg=; b=iA3BPOa4c8JSVN7Z/kLj4N0NQ6myKvwun9sKN69nfD7RfrlNg0CIpTQvBBoCMMIEdw8R7b 8j//5ZBomOrP5MDD/EZn8p18KoGU7yKnf80a6XYqJ3Bns17UH1qNjCOCc6LFRFlk8/ak8u uIyG29amDkTBduB52Sz2eo+FM2S8fw76xXyXBNYa30N1SMbdV+jDyo+dwElZh1yWBX6i1+ adjmB4hB3MfkPlQApXr0A5hGwhhbg9g4AJZwdNQ2trwEEmRSmHZFGFDk00VzsU+9hlBN/7 PxJW6VZ1ajA/9AyBTf8W0l4MYvuHojckrPlOlsxIKV2o61Cm2JfJSnP3Y8DM0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676354665; a=rsa-sha256; cv=none; b=p32VRGXxgleXyRsOZA7zw+NZ055tv4znUUIBWQ7eoJ1UFWzGl5PmBd9T4gQ56b3dlGA1xi g+Ib0clVPoaa7NgpVqLGwxkx1O4RWfVP+Q9fRA6EfZgQ/a3u+JUSY8okGFP1qW7sBclRlV QBuFyx4luvBSSXsPhibv4akNVNx+iFfS+gBeoi/yLnOFuKlHMhyBgSyht88fps2KSpKHbI ghrLRZ/Y6izAQ3OlVDvY7XyleV7hsiIZLhuXoGjnWRiGFzudMTSaRIGartzK2aNziUSErv 6wdCgpOY5WnIy7n0E40vCZkN6U7FoYH2AloTpd8GdOrSonzn0Z65nZU3r9hlwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PG9dj4Kdnznqh; Tue, 14 Feb 2023 06:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31E64P24029033; Tue, 14 Feb 2023 06:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E64PSQ029032; Tue, 14 Feb 2023 06:04:25 GMT (envelope-from git) Date: Tue, 14 Feb 2023 06:04:25 GMT Message-Id: <202302140604.31E64PSQ029032@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: 77ed2a8a5a09 - main - games/{gtk,net}radiant: fix getting file length on Unix-like systems List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77ed2a8a5a0908bc06e9258dda820bf656eb27a0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=77ed2a8a5a0908bc06e9258dda820bf656eb27a0 commit 77ed2a8a5a0908bc06e9258dda820bf656eb27a0 Author: Alexey Dokuchaev AuthorDate: 2023-02-14 05:59:28 +0000 Commit: Alexey Dokuchaev CommitDate: 2023-02-14 05:59:28 +0000 games/{gtk,net}radiant: fix getting file length on Unix-like systems Decloak Q_filelength() which takes a pointer to FILE, not an integer file descriptor, and optimize away superfluous call thereof. Reported by: pkg-fallout (clang 15) --- .../files/patch-tools_quake3_q3data_md3lib.c | 24 ++++++++++++++++++++++ .../files/patch-tools_quake3_q3data_md3lib.c | 24 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/games/gtkradiant/files/patch-tools_quake3_q3data_md3lib.c b/games/gtkradiant/files/patch-tools_quake3_q3data_md3lib.c new file mode 100644 index 000000000000..bc91176a3ebe --- /dev/null +++ b/games/gtkradiant/files/patch-tools_quake3_q3data_md3lib.c @@ -0,0 +1,24 @@ +--- tools/quake3/q3data/md3lib.c.orig 2006-02-10 22:01:20 UTC ++++ tools/quake3/q3data/md3lib.c +@@ -25,10 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + #endif + #include "md3lib.h" + +-#if defined (__linux__) || defined (__APPLE__) +-#define filelength Q_filelength +-#endif +- + /* + ** MD3_ComputeTagFromTri + */ +@@ -149,8 +145,8 @@ void MD3_Dump( const char *filename ) + Error( "Unable to open '%s'\n", filename ); + } + +- fileSize = filelength( fileno( fp ) ); +- _buffer = malloc( filelength( fileno( fp ) ) ); ++ fileSize = Q_filelength( fp ); ++ _buffer = malloc( fileSize ); + fread( _buffer, fileSize, 1, fp ); + fclose( fp ); + diff --git a/games/netradiant/files/patch-tools_quake3_q3data_md3lib.c b/games/netradiant/files/patch-tools_quake3_q3data_md3lib.c new file mode 100644 index 000000000000..78fead3efc19 --- /dev/null +++ b/games/netradiant/files/patch-tools_quake3_q3data_md3lib.c @@ -0,0 +1,24 @@ +--- tools/quake3/q3data/md3lib.c.orig 2015-06-21 12:05:40 UTC ++++ tools/quake3/q3data/md3lib.c +@@ -25,10 +25,6 @@ + #endif + #include "md3lib.h" + +-#if defined ( __linux__ ) || defined ( __APPLE__ ) +-#define filelength Q_filelength +-#endif +- + /* + ** MD3_ComputeTagFromTri + */ +@@ -149,8 +145,8 @@ void MD3_Dump( const char *filename ){ + Error( "Unable to open '%s'\n", filename ); + } + +- fileSize = filelength( fileno( fp ) ); +- _buffer = malloc( filelength( fileno( fp ) ) ); ++ fileSize = Q_filelength( fp ); ++ _buffer = malloc( fileSize ); + fread( _buffer, fileSize, 1, fp ); + fclose( fp ); +