summaryrefslogtreecommitdiffstats
path: root/gatchat/ringbuffer.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/ringbuffer.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/ringbuffer.c')
-rw-r--r--gatchat/ringbuffer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gatchat/ringbuffer.c b/gatchat/ringbuffer.c
index 5e9b6340..becd3f8f 100644
--- a/gatchat/ringbuffer.c
+++ b/gatchat/ringbuffer.c
@@ -51,11 +51,11 @@ struct ring_buffer *ring_buffer_new(unsigned int size)
return NULL;
buffer = g_try_new(struct ring_buffer, 1);
- if (!buffer)
+ if (buffer == NULL)
return NULL;
buffer->buffer = g_try_new(unsigned char, real_size);
- if (!buffer->buffer) {
+ if (buffer->buffer == NULL) {
g_free(buffer);
return NULL;
}
@@ -164,7 +164,7 @@ unsigned char *ring_buffer_read_ptr(struct ring_buffer *buf,
int ring_buffer_len(struct ring_buffer *buf)
{
- if (!buf)
+ if (buf == NULL)
return -1;
return buf->in - buf->out;
@@ -172,7 +172,7 @@ int ring_buffer_len(struct ring_buffer *buf)
void ring_buffer_reset(struct ring_buffer *buf)
{
- if (!buf)
+ if (buf == NULL)
return;
buf->in = 0;
@@ -181,7 +181,7 @@ void ring_buffer_reset(struct ring_buffer *buf)
int ring_buffer_avail(struct ring_buffer *buf)
{
- if (!buf)
+ if (buf == NULL)
return -1;
return buf->size - buf->in + buf->out;
@@ -189,7 +189,7 @@ int ring_buffer_avail(struct ring_buffer *buf)
int ring_buffer_capacity(struct ring_buffer *buf)
{
- if (!buf)
+ if (buf == NULL)
return -1;
return buf->size;
@@ -197,7 +197,7 @@ int ring_buffer_capacity(struct ring_buffer *buf)
void ring_buffer_free(struct ring_buffer *buf)
{
- if (!buf)
+ if (buf == NULL)
return;
g_free(buf->buffer);