From 823ec3d8401759a4be2d2996bd665710058ba955 Mon Sep 17 00:00:00 2001 From: "Evgeniy A. Dushistov" Date: Fri, 24 Jun 2022 21:17:31 +0300 Subject: [PATCH] clang-format for mapfile --- .clang-format | 2 +- src/mapfile.hpp | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.clang-format b/.clang-format index d24b5aa..539e010 100644 --- a/.clang-format +++ b/.clang-format @@ -15,7 +15,7 @@ BreakBeforeBinaryOperators: true BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: true BinPackParameters: true -ColumnLimit: 0 +ColumnLimit: 120 ConstructorInitializerAllOnOneLineOrOnePerLine: false DerivePointerAlignment: false ExperimentalAutoDetectBinPacking: false diff --git a/src/mapfile.hpp b/src/mapfile.hpp index ca5a681..66833ea 100644 --- a/src/mapfile.hpp +++ b/src/mapfile.hpp @@ -40,20 +40,18 @@ inline bool MapFile::open(const char *file_name, unsigned long file_size) size = file_size; #ifdef HAVE_MMAP if ((mmap_fd = ::open(file_name, O_RDONLY)) < 0) { - //g_print("Open file %s failed!\n",fullfilename); + // g_print("Open file %s failed!\n",fullfilename); return false; } data = (gchar *)mmap(nullptr, file_size, PROT_READ, MAP_SHARED, mmap_fd, 0); if ((void *)data == (void *)(-1)) { - //g_print("mmap file %s failed!\n",idxfilename); + // g_print("mmap file %s failed!\n",idxfilename); data = nullptr; return false; } #elif defined(_WIN32) - hFile = CreateFile(file_name, GENERIC_READ, 0, nullptr, OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL, 0); - hFileMap = CreateFileMapping(hFile, nullptr, PAGE_READONLY, 0, - file_size, nullptr); + hFile = CreateFile(file_name, GENERIC_READ, 0, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + hFileMap = CreateFileMapping(hFile, nullptr, PAGE_READONLY, 0, file_size, nullptr); data = (gchar *)MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, file_size); #else gsize read_len;