From cf1c989ad357e6379fd7ff37d992f391ade9fa4e Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Mon, 27 Apr 2009 14:31:11 +0300 Subject: [PATCH] open-osd: Assorted compiler warnings fixed gcc rightly complained about uninitialized variables. Fix that. All these tests had undefined results, for sure, and never worked before. (They might not work still but for other reasons) Signed-off-by: Boaz Harrosh --- osd-initiator/python/command.c | 4 ++-- osd-target/tests/osd-test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osd-initiator/python/command.c b/osd-initiator/python/command.c index 9f53503..b524b4c 100644 --- a/osd-initiator/python/command.c +++ b/osd-initiator/python/command.c @@ -912,7 +912,7 @@ static PyObject *pyosd_command_set_cas(PyObject *self, PyObject *args) int inlen, outlen; if (!PyArg_ParseTuple(args, "KKs#s#|KK:set_cas", &pid, &oid, - inbuf, inlen, outbuf, outlen, &len, &offset)) + &inbuf, &inlen, &outbuf, &outlen, &len, &offset)) return NULL; if (py_command->set) { PyErr_SetString(PyExc_RuntimeError, "command already set"); @@ -945,7 +945,7 @@ static PyObject *pyosd_command_set_fa(PyObject *self, PyObject *args) int inlen, outlen; if (!PyArg_ParseTuple(args, "KKs#s#|KK:set_fa", &pid, &oid, - inbuf, inlen, outbuf, outlen, &len, &offset)) + &inbuf, &inlen, &outbuf, &outlen, &len, &offset)) return NULL; if (py_command->set) { PyErr_SetString(PyExc_RuntimeError, "command already set"); diff --git a/osd-target/tests/osd-test.c b/osd-target/tests/osd-test.c index 9a0e426..ad3f6a2 100644 --- a/osd-target/tests/osd-test.c +++ b/osd-target/tests/osd-test.c @@ -331,7 +331,7 @@ static void test_osd_read_map(struct osd_device *osd) { int ret = 0; uint8_t *sense = Calloc(1, 1024); - uint32_t cdb_cont_len; + uint32_t cdb_cont_len = 0; void *wrbuf = Calloc(1, 256); uint8_t *outdata = Calloc(1, 1024); uint64_t used_outlen = 0; @@ -708,7 +708,7 @@ static void test_osd_create_user_tracking_collection(struct osd_device *osd) { int ret = 0; char buffer [50]; - uint8_t list_attr; + uint8_t list_attr = 0; uint64_t cid = 0; uint64_t oid = 0; uint64_t alloc_len;