4141 * See: http://bugs.icu-project.org/trac/ticket/10924
4242 */
4343
44-
4544#include " node_i18n.h"
4645#include " node_external_reference.h"
4746#include " simdutf.h"
@@ -129,8 +128,8 @@ uint8_t* AllocRaw(size_t size) {
129128#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
130129#define MAP_ANON MAP_ANONYMOUS
131130#endif
132- void * ptr = mmap (nullptr , size, PROT_READ | PROT_WRITE ,
133- MAP_PRIVATE | MAP_ANON , -1 , 0 );
131+ void * ptr = mmap (
132+ nullptr , size, PROT_READ | PROT_WRITE , MAP_PRIVATE | MAP_ANON , -1 , 0 );
134133 if (ptr == MAP_FAILED ) {
135134 return nullptr ;
136135 }
@@ -222,12 +221,8 @@ uint8_t* MapIfSize(const std::string& path, size_t size) {
222221 CloseFd (fd);
223222 return nullptr ;
224223 }
225- HANDLE mapping = CreateFileMappingW (reinterpret_cast <HANDLE >(osf),
226- nullptr ,
227- PAGE_READONLY ,
228- 0 ,
229- 0 ,
230- nullptr );
224+ HANDLE mapping = CreateFileMappingW (
225+ reinterpret_cast <HANDLE >(osf), nullptr , PAGE_READONLY , 0 , 0 , nullptr );
231226 if (mapping == nullptr ) {
232227 CloseFd (fd);
233228 return nullptr ;
@@ -259,14 +254,13 @@ bool WriteAll(uv_file fd, const uint8_t* data, size_t size) {
259254 size_t off = 0 ;
260255 while (off < size) {
261256 size_t remain = size - off;
262- unsigned int chunk = remain > 0x40000000u
263- ? 0x40000000u
264- : static_cast <unsigned int >(remain);
257+ unsigned int chunk =
258+ remain > 0x40000000u ? 0x40000000u : static_cast <unsigned int >(remain);
265259 uv_buf_t buf = uv_buf_init (
266260 const_cast <char *>(reinterpret_cast <const char *>(data + off)), chunk);
267261 uv_fs_t req;
268- int n = uv_fs_write (nullptr , &req, fd, &buf, 1 ,
269- static_cast <int64_t >(off), nullptr );
262+ int n = uv_fs_write (
263+ nullptr , &req, fd, &buf, 1 , static_cast <int64_t >(off), nullptr );
270264 CleanupFs (&req);
271265 if (n <= 0 ) {
272266 return false ;
@@ -289,8 +283,11 @@ uint8_t* PublishCache(const uint8_t* data,
289283 }
290284 std::string tmp = path + " .tmp." + std::to_string (uv_os_getpid ());
291285 uv_fs_t req;
292- int fd = uv_fs_open (nullptr , &req, tmp.c_str (),
293- UV_FS_O_CREAT | UV_FS_O_EXCL | UV_FS_O_WRONLY , 0600 ,
286+ int fd = uv_fs_open (nullptr ,
287+ &req,
288+ tmp.c_str (),
289+ UV_FS_O_CREAT | UV_FS_O_EXCL | UV_FS_O_WRONLY ,
290+ 0600 ,
294291 nullptr );
295292 CleanupFs (&req);
296293 if (fd < 0 ) {
0 commit comments