Browse Source

stb_rect_pack: Fix implicit conversion warnings.

Fabian Giesen 10 years ago
parent
commit
d9e121f4c7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      stb_rect_pack.h

+ 4 - 4
stb_rect_pack.h

@@ -231,7 +231,7 @@ STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height,
    context->extra[0].x = 0;
    context->extra[0].x = 0;
    context->extra[0].y = 0;
    context->extra[0].y = 0;
    context->extra[0].next = &context->extra[1];
    context->extra[0].next = &context->extra[1];
-   context->extra[1].x = width;
+   context->extra[1].x = (stbrp_coord) width;
 #ifdef STBRP_LARGE_RECTS
 #ifdef STBRP_LARGE_RECTS
    context->extra[1].y = (1<<30);
    context->extra[1].y = (1<<30);
 #else
 #else
@@ -406,8 +406,8 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i
 
 
    // on success, create new node
    // on success, create new node
    node = context->free_head;
    node = context->free_head;
-   node->x = res.x;
-   node->y = res.y + height;
+   node->x = (stbrp_coord) res.x;
+   node->y = (stbrp_coord) (res.y + height);
 
 
    context->free_head = node->next;
    context->free_head = node->next;
 
 
@@ -439,7 +439,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i
    node->next = cur;
    node->next = cur;
 
 
    if (cur->x < res.x + width)
    if (cur->x < res.x + width)
-      cur->x = res.x+width;
+      cur->x = (stbrp_coord) (res.x + width);
 
 
 #ifdef _DEBUG
 #ifdef _DEBUG
    cur = context->active_head;
    cur = context->active_head;