Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ba813b

Browse filesBrowse files
thisalihassanaduh95
authored andcommitted
deps: cherry-pick libuv/libuv@a43e543
Original commit message: unix: fix pedantic compiler warnings (#5052) Fixes: libuv/libuv#5051 Fixes: #63196 Refs: libuv/libuv#5052 Refs: libuv/libuv@a43e543 PR-URL: #63222 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
1 parent 141de35 commit 3ba813b
Copy full SHA for 3ba813b

2 files changed

+14-13Lines changed: 14 additions & 13 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deps/uv/src/unix/fs.c‎

Copy file name to clipboardExpand all lines: deps/uv/src/unix/fs.c
+13-12Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -460,27 +460,28 @@ static ssize_t uv__preadv_or_pwritev(int fd,
460460
off_t off,
461461
_Atomic uintptr_t* cache,
462462
int is_pread) {
463-
ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t);
464-
void* p;
463+
union {
464+
ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t);
465+
void* p;
466+
} u;
465467

466-
p = (void*) atomic_load_explicit(cache, memory_order_relaxed);
467-
if (p == NULL) {
468+
u.p = (void*) atomic_load_explicit(cache, memory_order_relaxed);
469+
if (u.p == NULL) {
468470
#ifdef RTLD_DEFAULT
469471
/* Try _LARGEFILE_SOURCE version of preadv/pwritev first,
470472
* then fall back to the plain version, for libcs like musl.
471473
*/
472-
p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64");
473-
if (p == NULL)
474-
p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
474+
u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64");
475+
if (u.p == NULL)
476+
u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
475477
dlerror(); /* Clear errors. */
476478
#endif /* RTLD_DEFAULT */
477-
if (p == NULL)
478-
p = is_pread ? uv__preadv_emul : uv__pwritev_emul;
479-
atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed);
479+
if (u.p == NULL)
480+
u.f = is_pread ? uv__preadv_emul : uv__pwritev_emul;
481+
atomic_store_explicit(cache, (uintptr_t) u.p, memory_order_relaxed);
480482
}
481483

482-
f = p;
483-
return f(fd, bufs, nbufs, off);
484+
return u.f(fd, bufs, nbufs, off);
484485
}
485486

486487

Collapse file

‎deps/uv/src/uv-common.c‎

Copy file name to clipboardExpand all lines: deps/uv/src/uv-common.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
957957
int i;
958958

959959
for (i = 0; i < count; i++)
960-
uv__free(cpu_infos[i].model);
960+
uv__free((char*) cpu_infos[i].model);
961961

962962
uv__free(cpu_infos);
963963
#endif /* __linux__ */

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.