8000 gh-84461: Silence some compiler warnings on WASM (GH-93978) (#94025) · python/cpython@9d73adf · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d73adf

Browse files
vstinnertiran
andauthored
gh-84461: Silence some compiler warnings on WASM (GH-93978) (#94025)
(cherry picked from commit 774ef28) Co-authored-by: Christian Heimes <christian@python.org>
1 parent 8a1bade commit 9d73adf

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Modules/_io/bufferedio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ _enter_buffered_busy(buffered *self)
341341
: buffered_closed(self)))
342342

343343
#define CHECK_CLOSED(self, error_msg) \
344-
if (IS_CLOSED(self) & (Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t) == 0)) { \
344+
if (IS_CLOSED(self) && (Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t) == 0)) { \
345345
PyErr_SetString(PyExc_ValueError, error_msg); \
346346
retur 8000 n NULL; \
347347
} \

Modules/getnameinfo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
104104
u_long v4a;
105105
#ifdef ENABLE_IPV6
106106
u_char pfx;
107-
#endif
108107
int h_error;
108+
#endif
109109
char numserv[512];
110110
char numaddr[512];
111111

@@ -181,7 +181,6 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
181181
hp = getipnodebyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af, &h_error);
182182
#else
183183
hp = gethostbyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af);
184-
h_error = h_errno;
185184
#endif
186185

187186
if (hp) {

Modules/signalmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ compare_handler(PyObject *func, PyObject *dfl_ign_handler)
185185
return PyObject_RichCompareBool(func, dfl_ign_handler, Py_EQ) == 1;
186186
}
187187

188-
#ifdef HAVE_GETITIMER
189-
/* auxiliary functions for setitimer */
188+
#ifdef HAVE_SETITIMER
189+
/* auxiliary function for setitimer */
190190
static int
191191
timeval_from_double(PyObject *obj, struct timeval *tv)
192192
{
@@ -202,7 +202,10 @@ timeval_from_double(PyObject *obj, struct timeval *tv)
202202
}
203203
return _PyTime_AsTimeval(t, tv, _PyTime_ROUND_CEILING);
204204
}
205+
#endif
205206

207+
#if defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER)
208+
/* auxiliary functions for get/setitimer */
206209
Py_LOCAL_INLINE(double)
207210
double_from_timeval(struct timeval *tv)
208211
{

Modules/socketmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@ init_sockobject(PySocketSockObject *s,
996996
}
997997

998998

999+
#ifdef HAVE_SOCKETPAIR
9991000
/* Create a new socket object.
10001001
This just creates the object and initializes it.
10011002
If the creation fails, return NULL and set an exception (implicit
@@ -1015,6 +1016,7 @@ new_sockobject(SOCKET_T fd, int family, int type, int proto)
10151016
}
10161017
return s;
10171018
}
1019+
#endif
10181020

10191021

10201022
/* Lock to allow python interpreter to continue, but only allow one

0 commit comments

Comments
 (0)
0