AppPkg/Applications/Python: Explicitly initialize variables before use to keep newer compilers happy.

Explicitly initialize variables before any potential use.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15819 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Daryl McDaniel
2014-08-18 23:00:50 +00:00
committed by darylm503
parent 838b31a68c
commit de08c53b0f
5 changed files with 18 additions and 16 deletions

View File

@ -2824,7 +2824,7 @@ static PyObject *
sock_sendto(PySocketSockObject *s, PyObject *args) sock_sendto(PySocketSockObject *s, PyObject *args)
{ {
Py_buffer pbuf; Py_buffer pbuf;
PyObject *addro; PyObject *addro = NULL;
char *buf; char *buf;
Py_ssize_t len; Py_ssize_t len;
sock_addr_t addrbuf; sock_addr_t addrbuf;

View File

@ -470,11 +470,11 @@ PyObject_Str(PyObject *v)
PyObject * PyObject *
PyObject_Unicode(PyObject *v) PyObject_Unicode(PyObject *v)
{ {
PyObject *res; PyObject *res = NULL;
PyObject *func; PyObject *func = NULL;
PyObject *str; PyObject *str = NULL;
int unicode_method_found = 0; int unicode_method_found = 0;
static PyObject *unicodestr; static PyObject *unicodestr = NULL;
if (v == NULL) { if (v == NULL) {
res = PyString_FromString("<NULL>"); res = PyString_FromString("<NULL>");

View File

@ -4265,7 +4265,7 @@ PyString_Format(PyObject *format, PyObject *args)
int isnumok; int isnumok;
PyObject *v = NULL; PyObject *v = NULL;
PyObject *temp = NULL; PyObject *temp = NULL;
char *pbuf; char *pbuf = NULL;
int sign; int sign;
Py_ssize_t len; Py_ssize_t len;
char formatbuf[FORMATBUFLEN]; char formatbuf[FORMATBUFLEN];

View File

@ -8297,7 +8297,7 @@ PyObject *PyUnicode_Format(PyObject *format,
int isnumok; int isnumok;
PyObject *v = NULL; PyObject *v = NULL;
PyObject *temp = NULL; PyObject *temp = NULL;
Py_UNICODE *pbuf; Py_UNICODE *pbuf = NULL;
Py_UNICODE sign; Py_UNICODE sign;
Py_ssize_t len; Py_ssize_t len;
Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{int,char}() */ Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{int,char}() */

View File

@ -914,7 +914,9 @@ PyObject_ClearWeakRefs(PyObject *object)
PyWeakReference *current = *list; PyWeakReference *current = *list;
Py_ssize_t count = _PyWeakref_GetWeakrefCount(current); Py_ssize_t count = _PyWeakref_GetWeakrefCount(current);
int restore_error = PyErr_Occurred() ? 1 : 0; int restore_error = PyErr_Occurred() ? 1 : 0;
PyObject *err_type, *err_value, *err_tb; PyObject *err_type = NULL,
*err_value = NULL,
*err_tb = NULL;
if (restore_error) if (restore_error)
PyErr_Fetch(&err_type, &err_value, &err_tb); PyErr_Fetch(&err_type, &err_value, &err_tb);