From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=vinT7Ucl; spf=pass (domain: linaro.org, ip: 209.85.221.68, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by groups.io with SMTP; Fri, 31 May 2019 05:50:19 -0700 Received: by mail-wr1-f68.google.com with SMTP id h1so6463372wro.4 for ; Fri, 31 May 2019 05:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jLYeCeE6IqnMDBADhYoxa8Xu5id59u0X06lnLr2Ds6M=; b=vinT7Ucl9WrFNSwU3QnpAbsdq/A6A8FamRaqDMY4Mcgn2Qi+dhvhbqpPjyL+FGK2Vs w4VI/ekcXuKNT4Hhmr+lGlA+ZnvXO/C+oZCKoBw4kgygfppH+0sLOtlXYMpBn9nIIJcn CVC51uVUmGliTk0MMnUkCy/YdXsJYtEGKVQOqBMNVfq7bNXocCO6FUgVNwAXXDcpo+hf o6jFxn5VTJGX+88DcHMFxBxOzpl20WV9DSIEIjenMGjsgQgTbqGKVlPZ/GcsqAKiWQLx 54Um/yAQrVQKgq5kE2ouM1Gj3opwzaG+nD1yfprM2Dop6Sh0ImKzNLfRWyymjYgSaUEP EChA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jLYeCeE6IqnMDBADhYoxa8Xu5id59u0X06lnLr2Ds6M=; b=XP1/asZx04+c3YevXNapi49JzgkTgshZOsH5rR1gvSsdQYbStugL+cLgrfh7qAUKGE hBpCkPuJq80ZkZOINVTuwvOnXQmpK9jmg4yJQKASlmRiMTVa84OF0MPZ9CXPv3xEJfL/ nQds8ryKtR8lkMK9Kw0ba90AKSn4ea/yDQ0D0OBCfO8ovGvIUi7RD+fHhAEwpGXnMbo8 zKv09Oy9Ifw/DmCEam0dNt4ejgSws8Aliz8W7atdlprkVT7vCVrV52STq9rMxS/VZdTC iTZivnUkdomleVnViT3wc4v8xIXqZLODGOKHO2l0ks20r9GVjiWGquSLjJYbuHNjFshm 8Dmg== X-Gm-Message-State: APjAAAWQTkD42393lyfUOG9QXOUzJZ1bJcEDNGxCeM/bODKNUqNTziRT DQYvcfXfqzcuH3o03Nb0rbcBZu0aph8= X-Google-Smtp-Source: APXvYqydHgxZ6IrnB5KCzOKLMNcCxxCEfzU0kxk19zt+Kcz0KYParGbEZlPv2uFMP4K63a/vrHbFiQ== X-Received: by 2002:a05:6000:110:: with SMTP id o16mr6314832wrx.200.1559307017341; Fri, 31 May 2019 05:50:17 -0700 (PDT) Return-Path: Received: from sudo.home ([2a01:cb1d:112:6f00:c225:e9ff:fe2e:ea8]) by smtp.gmail.com with ESMTPSA id b9sm6385076wma.29.2019.05.31.05.50.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 05:50:16 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Laszlo Ersek , "Gao, Liming" , "Wang, Jian J" , Leif Lindholm , Michael D Kinney Subject: [PATCH v3 7/7] MdePkg: avoid redeclaration of typedefs Date: Fri, 31 May 2019 14:49:58 +0200 Message-Id: <20190531124958.8421-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190531124958.8421-1-ard.biesheuvel@linaro.org> References: <20190531124958.8421-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The usual pattern of defining a protocol in EDK2 is typedef struct _FOO_PROTOCOL FOO_PROTOCOL; struct _FOO_PROTOCOL { ... }; However, in the definition of EFI_HII_POPUP_PROTOCOL and EFI_RESET_NOTIFICATION_PROTOCOL, we are deviating from this for no good reason, and instead, the struct definition is combined with a redefinition of the first typedef, and this is not permitted before C11. Signed-off-by: Ard Biesheuvel --- MdePkg/Include/Protocol/HiiPopup.h | 4 ++-- MdePkg/Include/Protocol/ResetNotification.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdePkg/Include/Protocol/HiiPopup.h b/MdePkg/Include/Protocol/HiiPopup.h index e8161c3701ad..d7be784723b8 100644 --- a/MdePkg/Include/Protocol/HiiPopup.h +++ b/MdePkg/Include/Protocol/HiiPopup.h @@ -67,10 +67,10 @@ EFI_STATUS OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL ); -typedef struct _EFI_HII_POPUP_PROTOCOL { +struct _EFI_HII_POPUP_PROTOCOL { UINT64 Revision; EFI_HII_CREATE_POPUP CreatePopup; -} EFI_HII_POPUP_PROTOCOL; +}; extern EFI_GUID gEfiHiiPopupProtocolGuid; diff --git a/MdePkg/Include/Protocol/ResetNotification.h b/MdePkg/Include/Protocol/ResetNotification.h index 1142424e4610..b9aa321f639a 100644 --- a/MdePkg/Include/Protocol/ResetNotification.h +++ b/MdePkg/Include/Protocol/ResetNotification.h @@ -68,10 +68,10 @@ EFI_STATUS IN EFI_RESET_SYSTEM ResetFunction ); -typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL { +struct _EFI_RESET_NOTIFICATION_PROTOCOL { EFI_REGISTER_RESET_NOTIFY RegisterResetNotify; EFI_UNREGISTER_RESET_NOTIFY UnregisterResetNotify; -} EFI_RESET_NOTIFICATION_PROTOCOL; +}; extern EFI_GUID gEfiResetNotificationProtocolGuid; -- 2.20.1