changeset 5930:8a9716d0ccff libavcodec

cosmetic (remove != 0 / != NULL)
author michael
date Mon, 19 Nov 2007 20:26:35 +0000
parents aaeed46a74fd
children 3bb292a4ae12
files dvbsubdec.c
diffstat 1 files changed, 44 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/dvbsubdec.c	Mon Nov 19 20:18:30 2007 +0000
+++ b/dvbsubdec.c	Mon Nov 19 20:26:35 2007 +0000
@@ -234,7 +234,7 @@
 {
     DVBSubObject *ptr = ctx->object_list;
 
-    while (ptr != NULL && ptr->id != object_id) {
+    while (ptr && ptr->id != object_id) {
         ptr = ptr->next;
     }
 
@@ -245,7 +245,7 @@
 {
     DVBSubCLUT *ptr = ctx->clut_list;
 
-    while (ptr != NULL && ptr->id != clut_id) {
+    while (ptr && ptr->id != clut_id) {
         ptr = ptr->next;
     }
 
@@ -256,7 +256,7 @@
 {
     DVBSubRegion *ptr = ctx->region_list;
 
-    while (ptr != NULL && ptr->id != region_id) {
+    while (ptr && ptr->id != region_id) {
         ptr = ptr->next;
     }
 
@@ -268,16 +268,16 @@
     DVBSubObject *object, *obj2, **obj2_ptr;
     DVBSubObjectDisplay *display, *obj_disp, **obj_disp_ptr;
 
-    while (region->display_list != NULL) {
+    while (region->display_list) {
         display = region->display_list;
 
         object = get_object(ctx, display->object_id);
 
-        if (object != NULL) {
+        if (object) {
             obj_disp = object->display_list;
             obj_disp_ptr = &object->display_list;
 
-            while (obj_disp != NULL && obj_disp != display) {
+            while (obj_disp && obj_disp != display) {
                 obj_disp_ptr = &obj_disp->object_list_next;
                 obj_disp = obj_disp->object_list_next;
             }
@@ -289,7 +289,7 @@
                     obj2 = ctx->object_list;
                     obj2_ptr = &ctx->object_list;
 
-                    while (obj2 != NULL && obj2 != object) {
+                    while (obj2 && obj2 != object) {
                         obj2_ptr = &obj2->next;
                         obj2 = obj2->next;
                     }
@@ -313,20 +313,20 @@
     DVBSubRegion *region;
     DVBSubCLUT *clut;
 
-    while (ctx->region_list != NULL)
+    while (ctx->region_list)
     {
         region = ctx->region_list;
 
         ctx->region_list = region->next;
 
         delete_region_display_list(ctx, region);
-        if (region->pbuf != NULL)
+        if (region->pbuf)
             av_free(region->pbuf);
 
         av_free(region);
     }
 
-    while (ctx->clut_list != NULL)
+    while (ctx->clut_list)
     {
         clut = ctx->clut_list;
 
@@ -336,7 +336,7 @@
     }
 
     /* Should already be null */
-    if (ctx->object_list != NULL)
+    if (ctx->object_list)
         av_log(0, AV_LOG_ERROR, "Memory deallocation error!\n");
 }
 
@@ -420,7 +420,7 @@
 
     delete_state(ctx);
 
-    while (ctx->display_list != NULL)
+    while (ctx->display_list)
     {
         display = ctx->display_list;
         ctx->display_list = display->next;
@@ -446,9 +446,9 @@
     while (get_bits_count(&gb) < (buf_size << 8) && pixels_read < dbuf_len) {
         bits = get_bits(&gb, 2);
 
-        if (bits != 0) {
+        if (bits) {
             if (non_mod != 1 || bits != 1) {
-                if (map_table != NULL)
+                if (map_table)
                     *destbuf++ = map_table[bits];
                 else
                     *destbuf++ = bits;
@@ -463,7 +463,7 @@
                 if (non_mod == 1 && bits == 1)
                     pixels_read += run_length;
                 else {
-                    if (map_table != NULL)
+                    if (map_table)
                         bits = map_table[bits];
                     while (run_length-- > 0 && pixels_read < dbuf_len) {
                         *destbuf++ = bits;
@@ -481,7 +481,7 @@
                         if (non_mod == 1 && bits == 1)
                             pixels_read += run_length;
                         else {
-                            if (map_table != NULL)
+                            if (map_table)
                                 bits = map_table[bits];
                             while (run_length-- > 0 && pixels_read < dbuf_len) {
                                 *destbuf++ = bits;
@@ -495,7 +495,7 @@
                         if (non_mod == 1 && bits == 1)
                             pixels_read += run_length;
                         else {
-                            if (map_table != NULL)
+                            if (map_table)
                                 bits = map_table[bits];
                             while (run_length-- > 0 && pixels_read < dbuf_len) {
                                 *destbuf++ = bits;
@@ -504,7 +504,7 @@
                         }
                     } else if (bits == 1) {
                         pixels_read += 2;
-                        if (map_table != NULL)
+                        if (map_table)
                             bits = map_table[0];
                         else
                             bits = 0;
@@ -517,7 +517,7 @@
                         return pixels_read;
                     }
                 } else {
-                    if (map_table != NULL)
+                    if (map_table)
                         bits = map_table[0];
                     else
                         bits = 0;
@@ -528,7 +528,7 @@
         }
     }
 
-    if (get_bits(&gb, 6) != 0)
+    if (get_bits(&gb, 6))
         av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
 
     (*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
@@ -551,9 +551,9 @@
     while (get_bits_count(&gb) < (buf_size << 8) && pixels_read < dbuf_len) {
         bits = get_bits(&gb, 4);
 
-        if (bits != 0) {
+        if (bits) {
             if (non_mod != 1 || bits != 1) {
-                if (map_table != NULL)
+                if (map_table)
                     *destbuf++ = map_table[bits];
                 else
                     *destbuf++ = bits;
@@ -571,7 +571,7 @@
 
                 run_length += 2;
 
-                if (map_table != NULL)
+                if (map_table)
                     bits = map_table[0];
                 else
                     bits = 0;
@@ -589,7 +589,7 @@
                     if (non_mod == 1 && bits == 1)
                         pixels_read += run_length;
                     else {
-                        if (map_table != NULL)
+                        if (map_table)
                             bits = map_table[bits];
                         while (run_length-- > 0 && pixels_read < dbuf_len) {
                             *destbuf++ = bits;
@@ -605,7 +605,7 @@
                         if (non_mod == 1 && bits == 1)
                             pixels_read += run_length;
                         else {
-                            if (map_table != NULL)
+                            if (map_table)
                                 bits = map_table[bits];
                             while (run_length-- > 0 && pixels_read < dbuf_len) {
                                 *destbuf++ = bits;
@@ -619,7 +619,7 @@
                         if (non_mod == 1 && bits == 1)
                             pixels_read += run_length;
                         else {
-                            if (map_table != NULL)
+                            if (map_table)
                                 bits = map_table[bits];
                             while (run_length-- > 0 && pixels_read < dbuf_len) {
                                 *destbuf++ = bits;
@@ -628,7 +628,7 @@
                         }
                     } else if (bits == 1) {
                         pixels_read += 2;
-                        if (map_table != NULL)
+                        if (map_table)
                             bits = map_table[0];
                         else
                             bits = 0;
@@ -637,7 +637,7 @@
                             *destbuf++ = bits;
                         }
                     } else {
-                        if (map_table != NULL)
+                        if (map_table)
                             bits = map_table[0];
                         else
                             bits = 0;
@@ -649,7 +649,7 @@
         }
     }
 
-    if (get_bits(&gb, 8) != 0)
+    if (get_bits(&gb, 8))
         av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
 
     (*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
@@ -669,9 +669,9 @@
     while (*srcbuf < sbuf_end && pixels_read < dbuf_len) {
         bits = *(*srcbuf)++;
 
-        if (bits != 0) {
+        if (bits) {
             if (non_mod != 1 || bits != 1) {
-                if (map_table != NULL)
+                if (map_table)
                     *destbuf++ = map_table[bits];
                 else
                     *destbuf++ = bits;
@@ -685,7 +685,7 @@
                     return pixels_read;
                 }
 
-                if (map_table != NULL)
+                if (map_table)
                     bits = map_table[0];
                 else
                     bits = 0;
@@ -698,7 +698,7 @@
 
                 if (non_mod == 1 && bits == 1)
                     pixels_read += run_length;
-                if (map_table != NULL)
+                if (map_table)
                     bits = map_table[bits];
                 else while (run_length-- > 0 && pixels_read < dbuf_len) {
                     *destbuf++ = bits;
@@ -708,7 +708,7 @@
         }
     }
 
-    if (*(*srcbuf)++ != 0)
+    if (*(*srcbuf)++)
         av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
 
     return pixels_read;
@@ -749,7 +749,7 @@
             av_log(avctx, AV_LOG_INFO, "\n");
     }
 
-    if (i % 16 != 0)
+    if (i % 16)
         av_log(avctx, AV_LOG_INFO, "\n");
 
 #endif
@@ -872,7 +872,7 @@
             return;
         }
 
-        for (display = object->display_list; display != 0; display = display->object_list_next) {
+        for (display = object->display_list; display; display = display->object_list_next) {
             block = buf;
 
             dvbsub_parse_pixel_data_block(avctx, display, block, top_field_len, 0,
@@ -919,7 +919,7 @@
             av_log(avctx, AV_LOG_INFO, "\n");
     }
 
-    if (i % 16 != 0)
+    if (i % 16)
         av_log(avctx, AV_LOG_INFO, "\n");
 
 #endif
@@ -1024,7 +1024,7 @@
     buf += 2;
 
     if (region->width * region->height != region->buf_size) {
-        if (region->pbuf != 0)
+        if (region->pbuf)
             av_free(region->pbuf);
 
         region->buf_size = region->width * region->height;
@@ -1141,7 +1141,7 @@
         display = tmp_display_list;
         tmp_ptr = &tmp_display_list;
 
-        while (display != NULL && display->region_id != region_id) {
+        while (display && display->region_id != region_id) {
             tmp_ptr = &display->next;
             display = display->next;
         }
@@ -1167,7 +1167,7 @@
 #endif
     }
 
-    while (tmp_display_list != 0) {
+    while (tmp_display_list) {
         display = tmp_display_list;
 
         tmp_display_list = display->next;
@@ -1196,7 +1196,7 @@
     width = 0;
     height = 0;
 
-    for (display = ctx->display_list; display != NULL; display = display->next) {
+    for (display = ctx->display_list; display; display = display->next) {
         region = get_region(ctx, display->region_id);
 
         if (x_pos == -1) {
@@ -1229,7 +1229,7 @@
 
         pbuf = av_malloc(width * height * 4);
 
-        for (display = ctx->display_list; display != NULL; display = display->next) {
+        for (display = ctx->display_list; display; display = display->next) {
             region = get_region(ctx, display->region_id);
 
             x_off = display->x_pos - x_pos;
@@ -1297,7 +1297,7 @@
 
     i = 0;
 
-    for (display = ctx->display_list; display != NULL; display = display->next) {
+    for (display = ctx->display_list; display; display = display->next) {
         region = get_region(ctx, display->region_id);
         rect = &sub->rects[i];
 
@@ -1370,7 +1370,7 @@
             av_log(avctx, AV_LOG_INFO, "\n");
     }
 
-    if (i % 16 != 0)
+    if (i % 16)
         av_log(avctx, AV_LOG_INFO, "\n");
 
 #endif