diff options
author | Aki Niemi <aki.niemi@nokia.com> | 2010-12-03 09:53:32 +0200 |
---|---|---|
committer | Aki Niemi <aki.niemi@nokia.com> | 2010-12-22 17:13:48 +0200 |
commit | 7d6e163184d09a605b051607b17e919ce734dd72 (patch) | |
tree | e55ec4bbdd7443dd573b0703eba3498a4fec3933 /gisi/pipe.c | |
parent | 0bfc0ea48774cb7711261efb2ad8f06bda7a3771 (diff) | |
download | ofono-7d6e163184d09a605b051607b17e919ce734dd72.tar.bz2 |
gisi: Explicit compare to NULL
Diffstat (limited to 'gisi/pipe.c')
-rw-r--r-- | gisi/pipe.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gisi/pipe.c b/gisi/pipe.c index 84ceb16c..31be675f 100644 --- a/gisi/pipe.c +++ b/gisi/pipe.c @@ -171,7 +171,8 @@ static void g_isi_pipe_handle_error(GIsiPipe *pipe, uint8_t code) static void g_isi_pipe_created(const GIsiMessage *msg, void *data) { - const struct isi_pipe_resp *resp = g_isi_msg_data(msg); + struct isi_pipe_resp *resp; + size_t len = sizeof(struct isi_pipe_resp); GIsiPipe *pipe = data; if (g_isi_msg_error(msg) < 0) { @@ -182,7 +183,7 @@ static void g_isi_pipe_created(const GIsiMessage *msg, void *data) if (g_isi_msg_id(msg) != PNS_PIPE_CREATE_RESP) return; - if (!resp || g_isi_msg_data_len(msg) != sizeof(struct isi_pipe_resp)) + if (!g_isi_msg_data_get_struct(msg, 0, (const void **) &resp, len)) return; if (resp->pipe_handle == PN_PIPE_INVALID_HANDLE) { @@ -259,7 +260,8 @@ GIsiPipe *g_isi_pipe_create(GIsiModem *modem, GIsiPipeHandler cb, uint16_t obj1, static void g_isi_pipe_enabled(const GIsiMessage *msg, void *data) { GIsiPipe *pipe = data; - const struct isi_pipe_resp *resp = g_isi_msg_data(msg); + const struct isi_pipe_resp *resp; + size_t len = sizeof(struct isi_pipe_resp); if (g_isi_msg_error(msg) < 0) { g_isi_pipe_handle_error(pipe, PN_PIPE_ERR_TIMEOUT); @@ -269,7 +271,7 @@ static void g_isi_pipe_enabled(const GIsiMessage *msg, void *data) if (g_isi_msg_id(msg) != PNS_PIPE_ENABLE_RESP) return; - if (!resp || g_isi_msg_data_len(msg) != sizeof(struct isi_pipe_resp)) + if (!g_isi_msg_data_get_struct(msg, 0, (const void **) &resp, len)) return; if (pipe->handle != resp->pipe_handle) @@ -320,7 +322,8 @@ int g_isi_pipe_start(GIsiPipe *pipe) static void g_isi_pipe_removed(const GIsiMessage *msg, void *data) { GIsiPipe *pipe = data; - const struct isi_pipe_resp *resp = g_isi_msg_data(msg); + struct isi_pipe_resp *resp; + size_t len = sizeof(struct isi_pipe_resp); if (g_isi_msg_error(msg) < 0) { g_isi_pipe_handle_error(pipe, PN_PIPE_ERR_TIMEOUT); @@ -330,7 +333,7 @@ static void g_isi_pipe_removed(const GIsiMessage *msg, void *data) if (g_isi_msg_id(msg) != PNS_PIPE_REMOVE_RESP) return; - if (!resp || g_isi_msg_data_len(msg) != sizeof(struct isi_pipe_resp)) + if (!g_isi_msg_data_get_struct(msg, 0, (const void **) &resp, len)) return; if (pipe->handle != resp->pipe_handle) |