summaryrefslogtreecommitdiffstats
path: root/gatchat/test-server.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-11-27 17:39:00 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-11-29 12:05:29 -0600
commit521071a7853b225713606de3e0421e680f187709 (patch)
tree57927fea85638f448436ea02706b99429ff13fc5 /gatchat/test-server.c
parent00cdf2b427a788492baeb0e29b9063a36ef1effe (diff)
downloadofono-521071a7853b225713606de3e0421e680f187709.tar.bz2
gatchat: explicitly compare pointers to NULL
This patch was generated by the following semantic patch (http://coccinelle.lip6.fr/) // <smpl> @fix disable is_null,isnt_null1@ expression *E; @@ - !E + E == NULL // </smpl>
Diffstat (limited to 'gatchat/test-server.c')
-rw-r--r--gatchat/test-server.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gatchat/test-server.c b/gatchat/test-server.c
index c405f41c..cb451e91 100644
--- a/gatchat/test-server.c
+++ b/gatchat/test-server.c
@@ -793,7 +793,7 @@ static void dial_cb(GAtServerRequestType type, GAtResult *cmd, gpointer user)
goto error;
dial_str = g_at_result_iter_raw_line(&iter);
- if (!dial_str)
+ if (dial_str == NULL)
goto error;
g_print("dial call %s\n", dial_str);
@@ -861,7 +861,7 @@ static gboolean create_tty(const char *modem_path)
char pty_name[256];
GIOChannel *server_io;
- if (!modem_path)
+ if (modem_path == NULL)
return FALSE;
if (openpty(&master, &slave, pty_name, NULL, NULL) < 0)
@@ -874,7 +874,7 @@ static gboolean create_tty(const char *modem_path)
server_io = g_io_channel_unix_new(master);
server = g_at_server_new(server_io);
- if (!server) {
+ if (server == NULL) {
g_io_channel_shutdown(server_io, FALSE, NULL);
g_io_channel_unref(server_io);
@@ -907,7 +907,7 @@ static gboolean on_socket_connected(GIOChannel *chan, GIOCondition cond,
server = g_at_server_new(client_io);
g_io_channel_unref(client_io);
- if (!server)
+ if (server == NULL)
goto error;
add_handler(server);
@@ -946,7 +946,7 @@ static struct sock_server *socket_common(int sk, struct sockaddr *addr,
}
sock = g_try_new0(struct sock_server, 1);
- if (!sock)
+ if (sock == NULL)
return FALSE;
sock->server_sock = sk;
@@ -961,7 +961,7 @@ static gboolean create_tcp(const char *modem_path, int port)
struct sock_server *server;
GIOChannel *server_io;
- if (!modem_path)
+ if (modem_path == NULL)
return FALSE;
sk = socket(PF_INET, SOCK_STREAM, 0);
@@ -978,7 +978,7 @@ static gboolean create_tcp(const char *modem_path, int port)
addr.sin_port = htons(port);
server = socket_common(sk, (struct sockaddr *) &addr, modem_path);
- if (!server)
+ if (server == NULL)
return FALSE;
g_print("new tcp is created at tcp port %d\n", port);
@@ -1004,7 +1004,7 @@ static gboolean create_unix(const char *modem_path, const char *sock_path)
struct sock_server *server;
GIOChannel *server_io;
- if (!modem_path)
+ if (modem_path == NULL)
return FALSE;
sk = socket(AF_UNIX, SOCK_STREAM, 0);
@@ -1024,7 +1024,7 @@ static gboolean create_unix(const char *modem_path, const char *sock_path)
unlink(addr.sun_path);
server = socket_common(sk, (struct sockaddr *) &addr, modem_path);
- if (!server)
+ if (server == NULL)
return FALSE;
g_print("new unix socket is created at %s\n", sock_path);