From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Charalampos Mitrodimas Newsgroups: gmane.emacs.bugs Subject: bug#74971: [PATCH] Fix format specifier warnings in nsterm.m Date: Thu, 19 Dec 2024 13:28:05 +0000 Message-ID: <20241219132805.9262-1-charmitro@posteo.net> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22795"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Charalampos Mitrodimas To: 74971@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 19 14:31:41 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tOGcv-0005ke-5e for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Dec 2024 14:31:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOGcI-0004We-Ul; Thu, 19 Dec 2024 08:31:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOGaN-0004Lf-Pg for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 08:29:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOGaN-0006Wv-FC for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 08:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=riabDtaXbv76U/smkvfhlTMXg8kQVnQGgIWvc8hndUQ=; b=qEKk4L8IgmuKk7Dw/WCzh92C4i8DN+r0yXxDp4o6Mpz/XAOlUpN9Ma3r5wArk79PSfV7dC+WlQUU8iUvj698gjHoUhxZPHyBRlee5v8dQW6SLV7CoC5cABfGYZ9Z61ZB90YvU2m3FR1ZyyRSHWIl9iWPmRO5BnN0eftlt9qyKrVeyqc6GQhu8Ad35xp6KWwbfnR9ty/LuFSUWas3876U4WxXbQ9VFEIbzJImhn/89b7ceMbdawrTJj9RzJAD58IIKxP4zIhXz0kXkRdBCXu4XRYq/spU/KuR3LwB00IJkl06VMRfr+CkLjkxyZWXZJ6VJ3gdusER9gX9ub22GPo4IQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOGaM-0008Df-C6 for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 08:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Charalampos Mitrodimas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Dec 2024 13:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74971 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173461490231532 (code B ref -1); Thu, 19 Dec 2024 13:29:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Dec 2024 13:28:22 +0000 Original-Received: from localhost ([127.0.0.1]:37917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOGZi-0008CW-D2 for submit@debbugs.gnu.org; Thu, 19 Dec 2024 08:28:22 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:58946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOGZf-0008CO-Vu for submit@debbugs.gnu.org; Thu, 19 Dec 2024 08:28:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOGZf-0004Ja-KB for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 08:28:19 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOGZd-0006I0-OP for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2024 08:28:19 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 69FE5240027 for ; Thu, 19 Dec 2024 14:28:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1734614893; bh=DdmDatiV2sTHJI7O443mjrHj8kCPaZv2zTS8O13XeOM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=q+FTi3Kv2aa32zdzxtZHkjolTc0he/6Aqqkj9CTSLbrpx5Izbx2jdugd3ajWd6U7D hJ+KhA8w3r3MQnT7BZKpJE07n/6tnEsN+JEjyflDLEDVHZQpEzmeRrC3QxyV3MqCW/ DT52IOL9cUbqRSPqa1hVVkxo6HyTxxgDe2DtI7Sg8bYzYc8e94D7OEgAk50e8bJC3v 4sMp4FYgPZ9+b85urmLAgPLUYkAF31S5cnQFbvhfdvOTS5X5d/D55bgKPP/xmI2347 5Vzi56Sj8nwzbFp7c3TP2N8UDaCNe5R3EEsNKL6CBWqqw2oBn556gHTwlRVq4LTsnn yMaN7uFCoUnjw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YDWZh50llz6tsb; Thu, 19 Dec 2024 14:28:12 +0100 (CET) Received-SPF: pass client-ip=185.67.36.65; envelope-from=charmitro@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297386 Archived-At: Resolve warnings caused by mismatched format specifiers in `NSLog` and `fprintf` calls. This was observed when compiled with Clang version 19.1.6 (arm64-apple-darwin). * src/nsterm.m: Cast `IOReturn` (aka `int`) to `unsigned int` for `%x` format specifiers in `NSLog`. Warnings fixed: - "format specifies type 'unsigned int' but the argument has type 'IOReturn' (aka 'int')" --- src/nsterm.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index c705a3c78f4..5793bb961e8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6955,8 +6955,12 @@ In that case we use UCKeyTranslate (ns_get_shifted_character) #ifndef NS_IMPL_GNUSTEP if (NS_KEYLOG) - fprintf (stderr, "keyDown: code =%x\tfnKey =%x\tflags = %x\tmods = %x\n", - code, fnKeysym, flags, emacs_event->modifiers); + fprintf (stderr, + "keyDown: code = %x\tfnKey = %x\tflags = %x\tmods = " + "%x\n", + (unsigned int) code, (unsigned int) fnKeysym, + (unsigned int) flags, + (unsigned int) emacs_event->modifiers); #endif /* If it was a function key or had control-like modifiers, pass @@ -10761,7 +10765,7 @@ - (CGContextRef) getContext IOReturn lockStatus = IOSurfaceLock (surface, 0, nil); if (lockStatus != kIOReturnSuccess) - NSLog (@"Failed to lock surface: %x", lockStatus); + NSLog (@"Failed to lock surface: %x", (unsigned int)lockStatus); [self copyContentsTo:surface]; @@ -10808,7 +10812,7 @@ - (void) releaseContext IOReturn lockStatus = IOSurfaceUnlock (currentSurface, 0, nil); if (lockStatus != kIOReturnSuccess) - NSLog (@"Failed to unlock surface: %x", lockStatus); + NSLog (@"Failed to unlock surface: %x", (unsigned int)lockStatus); } @@ -10849,7 +10853,8 @@ - (void) copyContentsTo: (IOSurfaceRef) destination lockStatus = IOSurfaceLock (source, kIOSurfaceLockReadOnly, nil); if (lockStatus != kIOReturnSuccess) - NSLog (@"Failed to lock source surface: %x", lockStatus); + NSLog (@"Failed to lock source surface: %x", + (unsigned int) lockStatus); sourceData = IOSurfaceGetBaseAddress (source); destinationData = IOSurfaceGetBaseAddress (destination); @@ -10861,7 +10866,7 @@ - (void) copyContentsTo: (IOSurfaceRef) destination lockStatus = IOSurfaceUnlock (source, kIOSurfaceLockReadOnly, nil); if (lockStatus != kIOReturnSuccess) - NSLog (@"Failed to unlock source surface: %x", lockStatus); + NSLog (@"Failed to unlock source surface: %x", (unsigned int)lockStatus); } #undef CACHE_MAX_SIZE -- 2.47.1