Revision: 15819
http://sourceforge.net/p/edk2/code/15819
Author: darylm503
Date: 2014-08-18 23:00:50 +0000 (Mon, 18 Aug 2014)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Reviewed-by: Erik Bjorge <[email protected]>
Modified Paths:
--------------
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Modules/socketmodule.c
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/object.c
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/stringobject.c
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/unicodeobject.c
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/weakrefobject.c
Modified:
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Modules/socketmodule.c
===================================================================
--- trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Modules/socketmodule.c
2014-08-18 20:00:08 UTC (rev 15818)
+++ trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Modules/socketmodule.c
2014-08-18 23:00:50 UTC (rev 15819)
@@ -1369,9 +1369,9 @@
{
struct sockaddr_hci *addr = (struct sockaddr_hci *)addr_ret;
#if defined(__NetBSD__) || defined(__DragonFly__)
- char *straddr = PyBytes_AS_STRING(args);
+ char *straddr = PyBytes_AS_STRING(args);
- _BT_HCI_MEMB(addr, family) = AF_BLUETOOTH;
+ _BT_HCI_MEMB(addr, family) = AF_BLUETOOTH;
if (straddr == NULL) {
PyErr_SetString(socket_error, "getsockaddrarg: "
"wrong format");
@@ -2824,7 +2824,7 @@
sock_sendto(PySocketSockObject *s, PyObject *args)
{
Py_buffer pbuf;
- PyObject *addro;
+ PyObject *addro = NULL;
char *buf;
Py_ssize_t len;
sock_addr_t addrbuf;
Modified: trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/object.c
===================================================================
--- trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/object.c
2014-08-18 20:00:08 UTC (rev 15818)
+++ trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/object.c
2014-08-18 23:00:50 UTC (rev 15819)
@@ -470,11 +470,11 @@
PyObject *
PyObject_Unicode(PyObject *v)
{
- PyObject *res;
- PyObject *func;
- PyObject *str;
+ PyObject *res = NULL;
+ PyObject *func = NULL;
+ PyObject *str = NULL;
int unicode_method_found = 0;
- static PyObject *unicodestr;
+ static PyObject *unicodestr = NULL;
if (v == NULL) {
res = PyString_FromString("<NULL>");
Modified:
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/stringobject.c
===================================================================
--- trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/stringobject.c
2014-08-18 20:00:08 UTC (rev 15818)
+++ trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/stringobject.c
2014-08-18 23:00:50 UTC (rev 15819)
@@ -4263,9 +4263,9 @@
int c = '\0';
int fill;
int isnumok;
- PyObject *v = NULL;
- PyObject *temp = NULL;
- char *pbuf;
+ PyObject *v = NULL;
+ PyObject *temp = NULL;
+ char *pbuf = NULL;
int sign;
Py_ssize_t len;
char formatbuf[FORMATBUFLEN];
Modified:
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/unicodeobject.c
===================================================================
--- trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/unicodeobject.c
2014-08-18 20:00:08 UTC (rev 15818)
+++ trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/unicodeobject.c
2014-08-18 23:00:50 UTC (rev 15819)
@@ -1865,11 +1865,11 @@
illegal prefix. See RFC 3629 for details */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00-0F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 70-7F */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80-8F */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -2221,7 +2221,7 @@
#endif
PyObject *errorHandler = NULL;
PyObject *exc = NULL;
-
+
q = (unsigned char *)s;
e = q + size;
@@ -8295,9 +8295,9 @@
Py_UNICODE c = '\0';
Py_UNICODE fill;
int isnumok;
- PyObject *v = NULL;
- PyObject *temp = NULL;
- Py_UNICODE *pbuf;
+ PyObject *v = NULL;
+ PyObject *temp = NULL;
+ Py_UNICODE *pbuf = NULL;
Py_UNICODE sign;
Py_ssize_t len;
Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{int,char}() */
Modified:
trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/weakrefobject.c
===================================================================
--- trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/weakrefobject.c
2014-08-18 20:00:08 UTC (rev 15818)
+++ trunk/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/weakrefobject.c
2014-08-18 23:00:50 UTC (rev 15819)
@@ -914,7 +914,9 @@
PyWeakReference *current = *list;
Py_ssize_t count = _PyWeakref_GetWeakrefCount(current);
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)
PyErr_Fetch(&err_type, &err_value, &err_tb);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits