From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC214211963D9 for ; Fri, 30 Nov 2018 14:45:43 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id z5so6703646wrt.11 for ; Fri, 30 Nov 2018 14:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4Uy8Bp4M8idmWCFRJIYIS2dQLLVPHhT3WBpuTEGJi6I=; b=DlOop96tj7B+HsOX2f+bVCO0ttz7uK+rNxiO6qImApKlzb7Cztyw7IkW6YT3IrS9n5 8RG3pw3uIhZakrjCTFGJoW8u2Py5Kvfh7mayfm7Osih5n3MSkFIc7iPmEl0th5oYx8Gk g9wtM5s+OkfcRIPMEeLwvcUDWsjuBf7Oybuo8= 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:mime-version :content-transfer-encoding; bh=4Uy8Bp4M8idmWCFRJIYIS2dQLLVPHhT3WBpuTEGJi6I=; b=Cgd28eWBXIpeY/jLRkb4yuFgpoGCMucpw362dVhVFfwAtC5Ewvf8RwQcxLHMN39sFc T4E7hWToko8a2f7OkpIJ1F8vtxSRzkVsBFCa+8w5SLjwtOc5EKF8RM3fg0R8DB/eXAIU 77qUvXF9FHU6c7oGEOw50cAAKC3ZHcwX7UFN0N4C64EoTvrPMkre9XUn3A/l+ToYV2zm JUwGOy5+O/okx8xGhagnQOBxZ9SE6V0WU0J8IViZ18r98oRyTG7Gra335nJUg3l5Zn/v musZDvxID5Lx94A+3uCBiLs+0PNpbph3HRp7i2yYMwy0PKOG25eZCTjZujgBB+Snf4u5 uQKA== X-Gm-Message-State: AA+aEWY7gbeLio+l7Y91hDSpaLIfnABNBY2t/iIY/lL+0jLupYefPF2R ng0iVHADFOOaxXuGo+iOmjWsBvFXu/8= X-Google-Smtp-Source: AFSGD/Wpg6upCfTMvN2BQWbTHWgDAEzYyJKlEJe/FREIHViXLHJuRpT8ZFCVQbURf4911Xrek/adTQ== X-Received: by 2002:adf:c44a:: with SMTP id a10mr6511645wrg.145.1543617941548; Fri, 30 Nov 2018 14:45:41 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:d895:e032:7b00:86cd]) by smtp.gmail.com with ESMTPSA id m6sm10561195wrv.24.2018.11.30.14.45.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 14:45:40 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: Ard Biesheuvel , Laszlo Ersek , Yonghong Zhu , Liming Gao , Bob Feng , Jaben Carsey Date: Fri, 30 Nov 2018 23:45:31 +0100 Message-Id: <20181130224537.18936-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [PATCH v2 0/6] BaseTools: get rid of MAX_UINTN X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 22:45:44 -0000 Content-Transfer-Encoding: 8bit There should be no reason for the build tools to care about the native word size of a particular target, so relying on a definition of MAX_UINTN is definitely wrong, and most likely inaccurate on 32-bit build hosts. So refactor the code in CommonLib and DevicePath so we no longer rely on this definition. Changes since v1: - miss type change in #1 causing a build failure on MSVC - add acks from Jaben Cc: Laszlo Ersek Cc: Yonghong Zhu Cc: Liming Gao Cc: Bob Feng Cc: Jaben Carsey Ard Biesheuvel (6): BaseTools/CommonLib: avoid using 'native' word size in IP address handling BaseTools/CommonLib: use explicit 64-bit type in Strtoi() BaseTools/DevicePath: use explicit 64-bit number parsing routines BaseTools/DevicePath: use MAX_UINT16 as default device path max size BaseTools/CommonLib: get rid of 'native' type string parsing routines BaseTools/CommonLib: drop definition of MAX_UINTN BaseTools/Source/C/Common/CommonLib.h | 25 --- BaseTools/Source/C/Common/CommonLib.c | 206 ++---------------- .../Source/C/DevicePath/DevicePathFromText.c | 4 +- .../Source/C/DevicePath/DevicePathUtilities.c | 4 +- 4 files changed, 25 insertions(+), 214 deletions(-) -- 2.19.1