Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
additional_dependencies:
- flake8==7.1.1
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
rev: v20.1.4
hooks:
- id: clang-format
types_or: [c, c++, cuda]
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/wholememory/communicator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024, NVIDIA CORPORATION.
* Copyright (c) 2019-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -481,7 +481,7 @@ void get_boot_id(char* host_id, size_t len)

void get_shm_devid(dev_t* shm_dev)
{
struct stat statbuf {};
struct stat statbuf{};
WHOLEMEMORY_CHECK(stat("/dev/shm", &statbuf) == 0);
*shm_dev = statbuf.st_dev;
}
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/wholememory/file_io.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024, NVIDIA CORPORATION.
* Copyright (c) 2019-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,7 @@ static bool IsFileExist(const char* filename, int mode) { return access(filename
static size_t StatFileSize(const char* filename)
{
auto filesize = static_cast<size_t>(-1);
struct stat statbuf {};
struct stat statbuf{};
if (stat(filename, &statbuf) < 0) { return filesize; }
filesize = statbuf.st_size;
return filesize;
Expand All @@ -49,7 +49,7 @@ static size_t StatFileSize(const char* filename)
static size_t StatFileBlockSize(const char* filename)
{
auto blocksize = static_cast<size_t>(-1);
struct stat statbuf {};
struct stat statbuf{};
if (stat(filename, &statbuf) < 0) { return blocksize; }
blocksize = statbuf.st_blksize;
return blocksize;
Expand Down
10 changes: 4 additions & 6 deletions cpp/src/wholememory/memory_handle.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024, NVIDIA CORPORATION.
* Copyright (c) 2019-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -746,9 +746,7 @@ class continuous_device_wholememory_impl : public wholememory_impl {
static int ipc_open_socket(const std::string& name)
{
int sock = -1;
struct sockaddr_un skt_addr {
0
};
struct sockaddr_un skt_addr{0};
if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) {
WHOLEMEMORY_FATAL("IPC failure: Socket creation error.");
}
Expand Down Expand Up @@ -830,7 +828,7 @@ class continuous_device_wholememory_impl : public wholememory_impl {
const ipc_sharable_cu_handle& sent_handle,
const std::string& dst_name)
{
struct msghdr message_header {};
struct msghdr message_header{};
struct iovec iov[1];

union {
Expand All @@ -839,7 +837,7 @@ class continuous_device_wholememory_impl : public wholememory_impl {
} control_un{};

struct cmsghdr* cmptr;
struct sockaddr_un cliaddr {};
struct sockaddr_un cliaddr{};

// Construct client address to send this Shareable handle to
bzero(&cliaddr, sizeof(cliaddr));
Expand Down