From patchwork Thu Aug 6 18:28:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?B?Wm9sdMOhbiBLxZF2w6Fnw7M=?= X-Patchwork-Id: 504905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 38EF51402B3 for ; Fri, 7 Aug 2015 06:56:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=QkfbtQsB; dkim-atps=neutral Received: from localhost ([::1]:46658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNSCu-0005lH-2U for incoming@patchwork.ozlabs.org; Thu, 06 Aug 2015 16:56:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNPuG-00082I-Lj for qemu-devel@nongnu.org; Thu, 06 Aug 2015 14:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNPuC-0001Eg-Ih for qemu-devel@nongnu.org; Thu, 06 Aug 2015 14:28:44 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:35385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNPuC-0001E6-Ah for qemu-devel@nongnu.org; Thu, 06 Aug 2015 14:28:40 -0400 Received: by wibxm9 with SMTP id xm9so33383748wib.0 for ; Thu, 06 Aug 2015 11:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=OTW4O+MrEisc0xhyWnKEIwHzhrgFIbtndrBnmXOtTUk=; b=QkfbtQsBBzikvR4VFVNclIKB1IAXtNvgnhPkewj+Z2zZ/8REc0eUz6TKz2cyiwz+1e 0iBl//CXtUFD7ziA3gF2WnEvt27Ff/W5CqyezCWhhkyrdkWly57OWtWs2rIm2teqqqyn wPqDcJJH0mX8HvDHzc3OpsdIocYY1Cr5iwH8s2Z1qgtG12I6w7z8MLc77lYEaBkzXIKX AXllweDiOywcRbGYpozlTcGuLJnPWr5/As5YtiaRZzbUFkfriBFW+ZwbKLXP3dW0sbi2 9DQHDUHqPs+rytQgyyeZYzjfCpQu9X1PJF1PC4GPV7h3NF4EcnyEI0e827gGvlmeBs8L vULQ== X-Received: by 10.194.60.226 with SMTP id k2mr5863293wjr.10.1438885719791; Thu, 06 Aug 2015 11:28:39 -0700 (PDT) Received: from nullptr.home.dirty-ice.org (84-236-21-48.pool.digikabel.hu. [84.236.21.48]) by smtp.gmail.com with ESMTPSA id i6sm10726509wje.33.2015.08.06.11.28.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Aug 2015 11:28:39 -0700 (PDT) From: "=?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?=" X-Google-Original-From: =?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?= To: qemu-devel@nongnu.org Date: Thu, 6 Aug 2015 20:28:29 +0200 Message-Id: X-Mailer: git-send-email 2.4.5 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22a Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, audio_MAX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently the gcc specific version only evaluates the arguments once, while the generic version evaluates one argument twice, which can cause debugging headaches when an argument has a side effect. This patch at least provides consistent behavior between compilers. Signed-off-by: Kővágó, Zoltán Reviewed-by: Marc-André Lureau --- audio/audio.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 68545b6..3a54e17 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -150,22 +150,8 @@ static inline void *advance (void *p, int incr) return (d + incr); } -#ifdef __GNUC__ -#define audio_MIN(a, b) ( __extension__ ({ \ - __typeof (a) ta = a; \ - __typeof (b) tb = b; \ - ((ta)>(tb)?(tb):(ta)); \ -})) - -#define audio_MAX(a, b) ( __extension__ ({ \ - __typeof (a) ta = a; \ - __typeof (b) tb = b; \ - ((ta)<(tb)?(tb):(ta)); \ -})) -#else #define audio_MIN(a, b) ((a)>(b)?(b):(a)) #define audio_MAX(a, b) ((a)<(b)?(b):(a)) -#endif int wav_start_capture(AudioState *state, CaptureState *s, const char *path, int freq, int bits, int nchannels);