Skip to content

Commit fcdcc75

Browse files
committed
[common] Fix some compilation warnings
Remove excessive semicolons. Remove unused variables. Use python3.6 friendly alias instead of text param.
1 parent 7f1332e commit fcdcc75

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

source/adapters/level_zero/v2/command_list_cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void command_list_cache_t::addCommandList(
142142
raii::ze_command_list_handle_t cmdList) {
143143
// TODO: add a limit?
144144
std::unique_lock<ur_mutex> Lock(ZeCommandListCacheMutex);
145-
auto [it, _] = ZeCommandListCache.try_emplace(desc);
145+
auto it = ZeCommandListCache.try_emplace(desc).first;
146146
it->second.emplace(std::move(cmdList));
147147
}
148148

source/common/umf_helpers.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ using provider_unique_handle_t =
5656
return UMF_RESULT_ERROR_NOT_SUPPORTED; \
5757
}
5858

59-
DEFINE_CHECK_OP(get_ipc_handle_size);
60-
DEFINE_CHECK_OP(get_ipc_handle);
61-
DEFINE_CHECK_OP(put_ipc_handle);
62-
DEFINE_CHECK_OP(open_ipc_handle);
63-
DEFINE_CHECK_OP(close_ipc_handle);
59+
DEFINE_CHECK_OP(get_ipc_handle_size)
60+
DEFINE_CHECK_OP(get_ipc_handle)
61+
DEFINE_CHECK_OP(put_ipc_handle)
62+
DEFINE_CHECK_OP(open_ipc_handle)
63+
DEFINE_CHECK_OP(close_ipc_handle)
6464

6565
#define UMF_ASSIGN_OP(ops, type, func, default_return) \
6666
ops.func = [](void *obj, auto... args) { \

source/loader/layers/sanitizer/asan_buffer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) {
164164
}
165165

166166
ur_result_t MemBuffer::free() {
167-
for (const auto &[_, Ptr] : Allocations) {
167+
for (auto &&allocation : Allocations) {
168+
char *Ptr = allocation.second;
168169
ur_result_t URes =
169170
getContext()->interceptor->releaseMemory(Context, Ptr);
170171
if (URes != UR_RESULT_SUCCESS) {

source/loader/ur_lib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ void context_t::parseEnvEnabledLayers() {
5050
}
5151

5252
void context_t::initLayers() {
53-
for (auto &[layer, _] : layers) {
54-
layer->init(&urDdiTable, enabledLayerNames, codelocData);
53+
for (auto &&layer : layers) {
54+
layer.first->init(&urDdiTable, enabledLayerNames, codelocData);
5555
}
5656
}
5757

test/conformance/cts_exe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
result = subprocess.Popen([args.test_command, '--gtest_brief=1', # nosec B603
2929
f'--devices_count={args.devices_count}',
3030
f'--platforms_count={args.platforms_count}'],
31-
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
31+
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
3232

3333
pat = re.compile(r'\[( )*FAILED( )*\]')
3434
output_list = []

test/layers/validation/fixtures.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct valAllDevicesTest : valPlatformTest {
128128

129129
// We use this to avoid segfaults in the mock adapter when we're doing stuff
130130
// like double releases in the leak detection tests.
131-
inline ur_result_t genericSuccessCallback(void *) { return UR_RESULT_SUCCESS; };
131+
inline ur_result_t genericSuccessCallback(void *) { return UR_RESULT_SUCCESS; }
132132

133133
// This returns valid (non-null) handles that we can safely leak.
134134
inline ur_result_t fakeContext_urContextCreate(void *pParams) {

0 commit comments

Comments
 (0)