Cleanup: use listbase clear
authorCampbell Barton <ideasman42@gmail.com>
Sat, 20 Jun 2015 07:09:05 +0000 (17:09 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 20 Jun 2015 07:09:05 +0000 (17:09 +1000)
source/blender/blenkernel/intern/curve.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/makesrna/intern/rna_define.c
source/blender/render/intern/source/pipeline.c

index 6322570d562ebe28e323957266229fa9c00705b7..1a67ac76937a46cb232a957d19b3a48a50f6eb24 100644 (file)
@@ -2546,7 +2546,8 @@ void BKE_curve_bevelList_free(ListBase *bev)
                }
                MEM_freeN(bl);
        }
-       bev->first = bev->last = NULL;
+
+       BLI_listbase_clear(bev);
 }
 
 void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
index c3dbd260ea43e387c16d9ec8816d756ea05626ec..a3d2cef02e7684c2260ca70b261a502f3e69c3ce 100644 (file)
@@ -3449,7 +3449,7 @@ static void direct_link_image(FileData *fd, Image *ima)
                ima->packedfile = direct_link_packedfile(fd, ima->packedfile);
        }
 
-       ima->anims.first = ima->anims.last = NULL;
+       BLI_listbase_clear(&ima->anims);
        ima->preview = direct_link_preview_image(fd, ima->preview);
        ima->stereo3d_format = newdataadr(fd, ima->stereo3d_format);
        ima->ok = 1;
@@ -5408,7 +5408,7 @@ static void lib_link_scene(FileData *fd, Main *main)
                                                seq->scene_sound = BKE_sound_add_scene_sound_defaults(sce, seq);
                                        }
                                }
-                               seq->anims.first = seq->anims.last = NULL;
+                               BLI_listbase_clear(&seq->anims);
 
                                lib_link_sequence_modifiers(fd, sce, &seq->modifiers);
                        }
index 26237890539e4f6e8ce1a46f6e6cf4669ad87688..2c6e9d753375e04781c3b7b3ea78f7b42b6c0c85 100644 (file)
@@ -247,7 +247,7 @@ void ED_gpencil_strokes_copybuf_free(void)
                BLI_freelinkN(&gp_strokes_copypastebuf, gps);
        }
        
-       gp_strokes_copypastebuf.first = gp_strokes_copypastebuf.last = NULL;
+       BLI_listbase_clear(&gp_strokes_copypastebuf);
 }
 
 /* --------------------- */
index dd2a49c838062be43747d6e02a0d1b8ae8118aaa..a239bf3ae4c90f60ca464382d70309835da72d61 100644 (file)
@@ -533,7 +533,7 @@ BlenderRNA *RNA_create(void)
        brna = MEM_callocN(sizeof(BlenderRNA), "BlenderRNA");
 
        DefRNA.sdna = DNA_sdna_from_data(DNAstr,  DNAlen, false);
-       DefRNA.structs.first = DefRNA.structs.last = NULL;
+       BLI_listbase_clear(&DefRNA.structs);
        DefRNA.error = 0;
        DefRNA.preprocess = 1;
 
@@ -720,8 +720,8 @@ StructRNA *RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRN
                 * use MEM_dupallocN, data structs may not be alloced but builtin */
                memcpy(srna, srnafrom, sizeof(StructRNA));
                srna->cont.prophash = NULL;
-               srna->cont.properties.first = srna->cont.properties.last = NULL;
-               srna->functions.first = srna->functions.last = NULL;
+               BLI_listbase_clear(&srna->cont.properties);
+               BLI_listbase_clear(&srna->functions);
                srna->py_type = NULL;
 
                if (DefRNA.preprocess) {
index 9444d3ef3c644609df3a61a567d440780bfe51dd..1fa2673f12c302f924706a126bf292e39df69efe 100644 (file)
@@ -2205,7 +2205,7 @@ static void free_all_freestyle_renders(void)
                        /* detach the window manager from freestyle bmain (see comments
                         * in add_freestyle() for more detail)
                         */
-                       re1->freestyle_bmain->wm.first = re1->freestyle_bmain->wm.last = NULL;
+                       BLI_listbase_clear(&re1->freestyle_bmain->wm);
 
                        BKE_main_free(re1->freestyle_bmain);
                        re1->freestyle_bmain = NULL;