comparison libdirac_libschro.c @ 10055:fdb318d12314 libavcodec

Simplify 'if' condition statements. Drop useless '!= 0' from 'exp != 0', replace 'exp == 0' by '!exp'.
author diego
date Sat, 15 Aug 2009 11:02:50 +0000
parents e9d9d946f213
children 646065f63290
comparison
equal deleted inserted replaced
10054:8ab9fbad11b2 10055:fdb318d12314
84 int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data) 84 int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data)
85 { 85 {
86 FfmpegDiracSchroQueueElement *p_new = 86 FfmpegDiracSchroQueueElement *p_new =
87 av_mallocz(sizeof(FfmpegDiracSchroQueueElement)); 87 av_mallocz(sizeof(FfmpegDiracSchroQueueElement));
88 88
89 if (p_new == NULL) 89 if (!p_new)
90 return -1; 90 return -1;
91 91
92 p_new->data = p_data; 92 p_new->data = p_data;
93 93
94 if (queue->p_head == NULL) 94 if (!queue->p_head)
95 queue->p_head = p_new; 95 queue->p_head = p_new;
96 else 96 else
97 queue->p_tail->next = p_new; 97 queue->p_tail->next = p_new;
98 queue->p_tail = p_new; 98 queue->p_tail = p_new;
99 99
103 103
104 void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue) 104 void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue)
105 { 105 {
106 FfmpegDiracSchroQueueElement *top = queue->p_head; 106 FfmpegDiracSchroQueueElement *top = queue->p_head;
107 107
108 if (top != NULL) { 108 if (top) {
109 void *data = top->data; 109 void *data = top->data;
110 queue->p_head = queue->p_head->next; 110 queue->p_head = queue->p_head->next;
111 --queue->size; 111 --queue->size;
112 av_freep (&top); 112 av_freep (&top);
113 return data; 113 return data;