Skip to content

Commit c6a9549

Browse files
fix: use SAL2 _In_, _Out_ to prevent conflicts (#7042)
Codebase cleanup (Updating old SAL annotations to SAL2, fixing a pointer cast to remove a warning) Updating CI for new Ubuntu versions.
1 parent d2dd4c8 commit c6a9549

File tree

182 files changed

+965
-821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+965
-821
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,32 @@ jobs:
3333
maxParallel: 6
3434
matrix:
3535
Linux.Debug:
36-
image_name: 'ubuntu-22.04'
36+
image_name: 'ubuntu-24.04'
3737
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
3838
build_type: 'Debug'
3939
libtype_flag: ''
4040
Linux.NoJit:
41-
image_name: 'ubuntu-22.04'
41+
image_name: 'ubuntu-24.04'
4242
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
4343
build_type: 'Debug'
4444
libtype_flag: '-DDISABLE_JIT=ON'
4545
Linux.ReleaseWithDebug:
46-
image_name: 'ubuntu-22.04'
46+
image_name: 'ubuntu-24.04'
4747
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
4848
build_type: 'RelWithDebInfo'
4949
libtype_flag: ''
5050
Linux.Release:
51-
image_name: 'ubuntu-22.04'
51+
image_name: 'ubuntu-24.04'
5252
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
5353
build_type: 'Release'
5454
libtype_flag: ''
55-
Ubuntu20.ReleaseWithDebug:
56-
image_name: 'ubuntu-20.04'
55+
Ubuntu22.ReleaseWithDebug:
56+
image_name: 'ubuntu-22.04'
5757
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
5858
build_type: 'RelWithDebInfo'
5959
libtype_flag: ''
60-
Ubuntu20.Release:
61-
image_name: 'ubuntu-20.04'
60+
Ubuntu22.Release:
61+
image_name: 'ubuntu-22.04'
6262
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
6363
build_type: 'Release'
6464
libtype_flag: ''

bin/ChakraCore/ChakraCoreDllFunc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "Runtime.h"
@@ -174,7 +175,7 @@ void ChakraBinaryAutoSystemInfoInit(AutoSystemInfo * autoSystemInfo)
174175

175176
#if !ENABLE_NATIVE_CODEGEN
176177
HRESULT JsInitializeJITServer(
177-
__in GUID* connectionUuid,
178+
_In_ GUID* connectionUuid,
178179
__in_opt void* securityDescriptor,
179180
__in_opt void* alpcSecurityDescriptor)
180181
{

bin/ChakraCore/ConfigParserExternals.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "Common.h"
67
#include "Core/ConfigParser.h"
78

8-
bool ConfigParserAPI::FillConsoleTitle(__ecount(cchBufferSize) LPWSTR buffer, size_t cchBufferSize, __in LPWSTR moduleName)
9+
bool ConfigParserAPI::FillConsoleTitle(__ecount(cchBufferSize) LPWSTR buffer, size_t cchBufferSize, _In_ LPWSTR moduleName)
910
{
1011
return false;
1112
}
1213

13-
void ConfigParserAPI::DisplayInitialOutput(__in LPWSTR moduleName)
14+
void ConfigParserAPI::DisplayInitialOutput(_In_ LPWSTR moduleName)
1415
{
1516
}
1617

bin/ChakraCore/TestHooks.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "Runtime.h"
@@ -28,7 +29,7 @@ namespace Js
2829

2930
#ifdef ENABLE_TEST_HOOKS
3031

31-
HRESULT __stdcall SetConfigFlags(__in int argc, __in_ecount(argc) LPWSTR argv[], ICustomConfigFlags* customConfigFlags)
32+
HRESULT __stdcall SetConfigFlags(_In_ int argc, __in_ecount(argc) LPWSTR argv[], ICustomConfigFlags* customConfigFlags)
3233
{
3334
CmdLineArgsParser parser(customConfigFlags);
3435
if (parser.Parse(argc, argv) != 0)
@@ -39,7 +40,7 @@ HRESULT __stdcall SetConfigFlags(__in int argc, __in_ecount(argc) LPWSTR argv[],
3940
return S_OK;
4041
}
4142

42-
HRESULT __stdcall SetConfigFile(__in LPWSTR strConfigFile)
43+
HRESULT __stdcall SetConfigFile(_In_ LPWSTR strConfigFile)
4344
{
4445
CmdLineArgsParser parser;
4546
ConfigParser::ParseCustomConfigFile(parser, strConfigFile);

bin/GCStress/GCStress.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#pragma once
@@ -148,7 +149,7 @@ class Location
148149
VerifyCondition(found);
149150

150151
// Zero pointers in order to eliminate false-positives
151-
memset(holder, 0, heapObject.GetSize());
152+
memset((void*)holder, 0, heapObject.GetSize());
152153

153154
bool success = heapObject.ClearImplicitRootBit();
154155
VerifyCondition(success);

bin/GCStress/StubExternalApi.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "Common.h"
67
#include "CommonInl.h" // TODO: Try to remove this later
78

89
#include "Core/ConfigParser.h"
910

10-
bool ConfigParserAPI::FillConsoleTitle(__ecount(cchBufferSize) LPWSTR buffer, size_t cchBufferSize, __in LPWSTR moduleName)
11+
bool ConfigParserAPI::FillConsoleTitle(__ecount(cchBufferSize) LPWSTR buffer, size_t cchBufferSize, _In_ LPWSTR moduleName)
1112
{
1213
swprintf_s(buffer, cchBufferSize, _u("Chakra GC: %lu - %s"), GetCurrentProcessId(), moduleName);
1314

1415
return true;
1516
}
1617

17-
void ConfigParserAPI::DisplayInitialOutput(__in LPWSTR moduleName)
18+
void ConfigParserAPI::DisplayInitialOutput(_In_ LPWSTR moduleName)
1819
{
1920
Output::Print(_u("Chakra GC\n"));
2021
Output::Print(_u("INIT: PID : %d\n"), GetCurrentProcessId());

bin/NativeTests/BigUIntTest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56

@@ -17,7 +18,7 @@ namespace Js
1718
Assert(false);
1819
}
1920

20-
bool Throw::ReportAssert(__in char const *, unsigned int, __in char const *, __in char const *)
21+
bool Throw::ReportAssert(_In_ char const *, unsigned int, _In_ char const *, _In_ char const *)
2122
{
2223
return false;
2324
}

bin/ch/ChakraRtInterface.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66
#pragma once
@@ -342,8 +342,8 @@ class ChakraRTInterface
342342
static void UnloadChakraDll(HINSTANCE library);
343343

344344
static HRESULT SetAssertToConsoleFlag(bool flag) { return CHECKED_CALL(SetAssertToConsoleFlag, flag); }
345-
static HRESULT SetConfigFlags(__in int argc, __in_ecount(argc) LPWSTR argv[], ICustomConfigFlags* customConfigFlags) { return CHECKED_CALL(SetConfigFlags, argc, argv, customConfigFlags); }
346-
static HRESULT SetConfigFile(__in LPWSTR strConfigFileName) { return CHECKED_CALL(SetConfigFile, strConfigFileName); }
345+
static HRESULT SetConfigFlags(_In_ int argc, __in_ecount(argc) LPWSTR argv[], ICustomConfigFlags* customConfigFlags) { return CHECKED_CALL(SetConfigFlags, argc, argv, customConfigFlags); }
346+
static HRESULT SetConfigFile(_In_ LPWSTR strConfigFileName) { return CHECKED_CALL(SetConfigFile, strConfigFileName); }
347347
static HRESULT GetFileNameFlag(BSTR * filename) { return CHECKED_CALL(GetFilenameFlag, filename); }
348348
static HRESULT PrintConfigFlagsUsageString() { m_usageStringPrinted = true; return CHECKED_CALL(PrintConfigFlagsUsageString); }
349349

bin/ch/Helpers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "stdafx.h"
@@ -423,7 +424,7 @@ LPCWSTR Helpers::JsErrorCodeToString(JsErrorCode jsErrorCode)
423424
}
424425
}
425426

426-
void Helpers::LogError(__in __nullterminated const char16 *msg, ...)
427+
void Helpers::LogError(_In_ __nullterminated const char16 *msg, ...)
427428
{
428429
va_list args;
429430
va_start(args, msg);

bin/ch/Helpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#pragma once
@@ -9,7 +10,7 @@ class Helpers
910
public :
1011
static HRESULT LoadScriptFromFile(LPCSTR filename, LPCSTR& contents, UINT* lengthBytesOut = nullptr, std::string* fullPath = nullptr, bool shouldMute = false);
1112
static LPCWSTR JsErrorCodeToString(JsErrorCode jsErrorCode);
12-
static void LogError(__in __nullterminated const char16 *msg, ...);
13+
static void LogError(_In_ __nullterminated const char16 *msg, ...);
1314
static HRESULT LoadBinaryFile(LPCSTR filename, LPCSTR& contents, UINT& lengthBytes, bool printFileOpenError = true);
1415

1516
static void TTReportLastIOErrorAsNeeded(BOOL ok, const char* msg);

0 commit comments

Comments
 (0)