Skip to content

Commit

Permalink
bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (pyt…
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 authored May 13, 2020
1 parent b809717 commit fa0a66e
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit fa0a66e

Please sign in to comment.