Skip to content
Merged
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
bpo-40613: Remove compiler warning from _xxsubinterpretersmodule
  • Loading branch information
corona10 committed May 13, 2020
commit f194ccc19deb2acaf3c5433e777752142c4b9cf4
8 changes: 8 additions & 0 deletions Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,15 @@ _objsnapshot_clear(_objsnapshot *osn)
// PyMem_Free(osn);
//}

#ifndef NDEBUG
static int
_objsnapshot_is_clear(_objsnapshot *osn)
{
return osn->serialized == NULL
&& _rawstring_is_clear(&osn->modname)
&& _rawstring_is_clear(&osn->clsname);
}
#endif

static void
_objsnapshot_summarize(_objsnapshot *osn, _rawstring *rawbuf, const char *msg)
Expand Down Expand Up @@ -597,13 +599,15 @@ _tbsnapshot_free(_tbsnapshot *tbs)
PyMem_Free(tbs);
}

#ifndef NDEBUG
static int
_tbsnapshot_is_clear(_tbsnapshot *tbs)
{
return tbs->tbs_lineno == -1 && tbs->tbs_next == NULL
&& _rawstring_is_clear(&tbs->tbs_funcname)
&& _rawstring_is_clear(&tbs->tbs_filename);
}
#endif

static int
_tbsnapshot_from_pytb(_tbsnapshot *tbs, PyTracebackObject *pytb)
Expand Down Expand Up @@ -748,6 +752,7 @@ _excsnapshot_free(_excsnapshot *es)
PyMem_Free(es);
}

#ifndef NDEBUG
static int
_excsnapshot_is_clear(_excsnapshot *es)
{
Expand All @@ -758,6 +763,7 @@ _excsnapshot_is_clear(_excsnapshot *es)
&& es->es_msg == NULL
&& _objsnapshot_is_clear(&es->es_object);
}
#endif

static PyObject *
_excsnapshot_get_exc_naive(_excsnapshot *es)
Expand Down Expand Up @@ -1085,13 +1091,15 @@ _sharedexception_free(_sharedexception *she)
PyMem_Free(she);
}

#ifndef NDEBUG
static int
_sharedexception_is_clear(_sharedexception *she)
{
return 1
&& _excsnapshot_is_clear(&she->snapshot)
&& _rawstring_is_clear(&she->msg);
}
#endif

static PyObject *
_sharedexception_get_cause(_sharedexception *sharedexc)
Expand Down