diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-03 00:31:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-03 00:32:28 +0300 |
commit | c07eaa3384dfe90bc2671a9bb3be2b77ad33297d (patch) | |
tree | 0fdb4d7c21b10fa24a95be35aeab9dc58063403b /source/blender/blenloader/intern | |
parent | fcdd851858a61dbc7ec8cf79c0b9d022bb68f896 (diff) |
Cleanup: argument naming, redundant NULL checks
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 12 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_legacy.c | 40 |
2 files changed, 23 insertions, 29 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 72013bc6eed..d8e4f3d97a5 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -1673,15 +1673,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } for (scene = bmain->scenes.first; scene; scene = scene->id.next) { - if (scene) { - Sequence *seq; - SEQ_BEGIN (scene->ed, seq) { - if (seq->sat == 0.0f) { - seq->sat = 1.0f; - } + Sequence *seq; + SEQ_BEGIN (scene->ed, seq) { + if (seq->sat == 0.0f) { + seq->sat = 1.0f; } - SEQ_END; } + SEQ_END; } /* GSOC 2010 Sculpt - New settings for Brush */ diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 62bd605a2c2..1b30c7371a2 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -1705,19 +1705,17 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* add default radius values to old curve points */ for (cu = bmain->curves.first; cu; cu = cu->id.next) { for (nu = cu->nurb.first; nu; nu = nu->next) { - if (nu) { - if (nu->bezt) { - for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) { - if (!bezt->radius) { - bezt->radius = 1.0; - } + if (nu->bezt) { + for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) { + if (!bezt->radius) { + bezt->radius = 1.0; } } - else if (nu->bp) { - for (bp = nu->bp, a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) { - if (!bp->radius) { - bp->radius = 1.0; - } + } + else if (nu->bp) { + for (bp = nu->bp, a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) { + if (!bp->radius) { + bp->radius = 1.0; } } } @@ -2515,17 +2513,15 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (cu = bmain->curves.first; cu; cu = cu->id.next) { for (nu = cu->nurb.first; nu; nu = nu->next) { - if (nu) { - nu->radius_interp = 3; - - /* resolu and resolv are now used differently for surfaces - * rather than using the resolution to define the entire number of divisions, - * use it for the number of divisions per segment - */ - if (nu->pntsv > 1) { - nu->resolu = MAX2(1, (int)(((float)nu->resolu / (float)nu->pntsu) + 0.5f)); - nu->resolv = MAX2(1, (int)(((float)nu->resolv / (float)nu->pntsv) + 0.5f)); - } + nu->radius_interp = 3; + + /* resolu and resolv are now used differently for surfaces + * rather than using the resolution to define the entire number of divisions, + * use it for the number of divisions per segment + */ + if (nu->pntsv > 1) { + nu->resolu = MAX2(1, (int)(((float)nu->resolu / (float)nu->pntsu) + 0.5f)); + nu->resolv = MAX2(1, (int)(((float)nu->resolv / (float)nu->pntsv) + 0.5f)); } } } |