Received: by 10.213.65.68 with SMTP id h4csp1741157imn; Sun, 1 Apr 2018 13:42:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Mp4C25bmPjNnNteJ8kABfz9XzaFIaM8Ph7uTt4d8912tgExSS7cTcJ/gwh068B87PeEam X-Received: by 2002:a17:902:3204:: with SMTP id y4-v6mr7319101plb.226.1522615371350; Sun, 01 Apr 2018 13:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615371; cv=none; d=google.com; s=arc-20160816; b=eS+UH+rfGvhL7H9CE9QoBenyfEM00QhXpAIAspcwD8xirK0Qp/UjHrIId9+wRFnIrK t37tcpoiqno00vDH6FUoiY0RnQPO5i+s4NBJ7lV8XbYRQC3SZIwgyyeFlod6VNlR/r2c Own/9eA5w3TycK+Cp/1MCU0HDOacRgRrPKAotghhGLIVDXE40QmujqGNMx2xD7nnJGGN wxahPnm8cKValgLz6Hc/eXNqR9jDq5fRM52F7yUo3taS4/+VDt2brRoJM31PXwzY9fMs KhDIEQN/dvnQVugfYgCEV0au6tmNTXsDerIOiUOrJRmjKuQJmLXtCBI3eQoF/zR5bhoC lMoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject :organization:arc-authentication-results; bh=GGJ2SvvqLyaBW0OxBu1vGRLEvns6Nc8dB4qbvtCYTTw=; b=07gtx2UE7TtJ5N/m5h4sUWNMZxPkhDVbRhg7uQJImcFVm8eVf1rk3IcD7oFtnKCtzv jzoKqbh5YIJIEqCS/VFNtlojnvlic6l1FlpIAnHGk6mRQy61jiNwfhBbKNVJzGptk0iq yTFKA7PHQ3Xb/1Q5LndRDGxKK2hrYm6N9gjsoszk9woJBfNF9/T21gkKtHm3lMX7rF6y /QkMBxWtgF0v/4T9hIb+f0WBUC24+owS5VdW/RDiStkkjhdphgwUdRNnEoPoEWYy1rcv qIrjvl2KdZXVcpzimGisbLxrz/u6RLVKy3n2E9vI0i3upXcpmghEYjkSe6jZFa5s7pTK YdZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j33-v6si13271464pld.395.2018.04.01.13.42.37; Sun, 01 Apr 2018 13:42:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754093AbeDAUky (ORCPT + 99 others); Sun, 1 Apr 2018 16:40:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754082AbeDAUkw (ORCPT ); Sun, 1 Apr 2018 16:40:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 334A2406E96B for ; Sun, 1 Apr 2018 20:40:52 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-59.rdu2.redhat.com [10.10.120.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7108215CDAC; Sun, 1 Apr 2018 20:40:51 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 06/45] C++: Do some basic C++ type definition From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:40:51 +0100 Message-ID: <152261525140.30503.4153878451546376512.stgit@warthog.procyon.org.uk> In-Reply-To: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:40:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:40:52 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NULL should be defined as nullptr rather than (void *)0 as nullptr is a special compiler type. Don't define bool, true and false as these are defined by the compiler. Signed-off-by: David Howells --- include/linux/stddef.h | 12 ++++++------ include/linux/types.h | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/linux/stddef.h b/include/linux/stddef.h index 998a4ba28eba..470cf32e9119 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h @@ -4,13 +4,13 @@ #include -#undef NULL -#define NULL ((void *)0) +/* + * The type of the NULL pointer. This is a special C++ pointer type. + */ +typedef decltype(nullptr) nullptr_t; -enum { - false = 0, - true = 1 -}; +#undef NULL +#define NULL nullptr #undef offsetof #ifdef __compiler_offsetof diff --git a/include/linux/types.h b/include/linux/types.h index 31e8258ac048..68323cb03910 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -31,8 +31,6 @@ typedef __kernel_timer_t timer_t; typedef __kernel_clockid_t clockid_t; typedef __kernel_mqd_t mqd_t; -typedef _Bool bool; - typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_uid16_t uid16_t;