[Bf-blender-cvs] [87608e66e17] master: WM: correct comment, variable name for addons

Campbell Barton noreply at git.blender.org
Wed Jan 31 09:02:06 CET 2018


Commit: 87608e66e174068f9471619a5fe153fd279c4947
Author: Campbell Barton
Date:   Wed Jan 31 19:02:43 2018 +1100
Branches: master
https://developer.blender.org/rB87608e66e174068f9471619a5fe153fd279c4947

WM: correct comment, variable name for addons

===================================================================

M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index e590e04fc6d..a7759a1d143 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -402,7 +402,6 @@ typedef struct bTheme {
 #define UI_THEMESPACE_START(btheme)  (CHECK_TYPE_INLINE(btheme, bTheme *),  &((btheme)->tbuts))
 #define UI_THEMESPACE_END(btheme)    (CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->tclip) + 1))
 
-/* for the moment only the name. may want to store options with this later */
 typedef struct bAddon {
 	struct bAddon *next, *prev;
 	char module[64];
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index c66ac26f928..489a841fb0b 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -401,15 +401,17 @@ static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *p
 
 static bAddon *rna_userdef_addon_new(void)
 {
+	ListBase *addons_list = &U.addons;
 	bAddon *bext = MEM_callocN(sizeof(bAddon), "bAddon");
-	BLI_addtail(&U.addons, bext);
+	BLI_addtail(addons_list, bext);
 	return bext;
 }
 
-static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *path_cmp_ptr)
+static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *bext_ptr)
 {
-	bAddon *bext = path_cmp_ptr->data;
-	if (BLI_findindex(&U.addons, bext) == -1) {
+	ListBase *addons_list = &U.addons;
+	bAddon *bext = bext_ptr->data;
+	if (BLI_findindex(addons_list, bext) == -1) {
 		BKE_report(reports, RPT_ERROR, "Add-on is no longer valid");
 		return;
 	}
@@ -419,8 +421,8 @@ static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *path_cmp_p
 		MEM_freeN(bext->prop);
 	}
 
-	BLI_freelinkN(&U.addons, bext);
-	RNA_POINTER_INVALIDATE(path_cmp_ptr);
+	BLI_freelinkN(addons_list, bext);
+	RNA_POINTER_INVALIDATE(bext_ptr);
 }
 
 static bPathCompare *rna_userdef_pathcompare_new(void)



More information about the Bf-blender-cvs mailing list