diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-01 07:43:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-01 07:43:10 +0400 |
commit | 9d04a61f3652565cfe84d8e8b5192bd93177ce1d (patch) | |
tree | b6754a0c2c412e1aeb5c2e9b9ab051a6dce6e9e8 /source/blender/blenlib/intern/boxpack2d.c | |
parent | 098cf9095675b46ea9860aab2014495b3a8a2af8 (diff) |
use strict flags for lasso, boxpack, gsqueue and quadric's.
for lasso also use unsigned ints rather then shorts for the path length.
Diffstat (limited to 'source/blender/blenlib/intern/boxpack2d.c')
-rw-r--r-- | source/blender/blenlib/intern/boxpack2d.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index 8a97fdcab67..1087b02b3bb 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -27,7 +27,9 @@ #include <stdlib.h> /* for qsort */ #include "MEM_guardedalloc.h" -#include "BLI_boxpack2d.h" +#include "BLI_strict_flags.h" + +#include "BLI_boxpack2d.h" /* own include */ /* BoxPacker for backing 2D rectangles into a square * @@ -169,11 +171,11 @@ void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float * } /* Sort boxes, biggest first */ - qsort(boxarray, len, sizeof(BoxPack), box_areasort); + qsort(boxarray, (size_t)len, sizeof(BoxPack), box_areasort); /* add verts to the boxes, these are only used internally */ - vert = vertarray = MEM_mallocN(len * 4 * sizeof(BoxVert), "BoxPack Verts"); - vertex_pack_indices = MEM_mallocN(len * 3 * sizeof(int), "BoxPack Indices"); + vert = vertarray = MEM_mallocN((size_t)len * 4 * sizeof(BoxVert), "BoxPack Verts"); + vertex_pack_indices = MEM_mallocN((size_t)len * 3 * sizeof(int), "BoxPack Indices"); for (box = boxarray, box_index = 0, i = 0; box_index < len; box_index++, box++) { @@ -241,7 +243,7 @@ void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float * box_width = box->w; box_height = box->h; - qsort(vertex_pack_indices, verts_pack_len, sizeof(int), vertex_sort); + qsort(vertex_pack_indices, (size_t)verts_pack_len, sizeof(int), vertex_sort); /* Pack the box in with the others */ /* sort the verts */ @@ -318,7 +320,7 @@ void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float * (*tot_height) = max_ff(BOXTOP(box), (*tot_height)); /* Place the box */ - vert->free &= ~quad_flags[j]; + vert->free &= (short)~quad_flags[j]; switch (j) { case TR: |