mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 19:05:00 +01:00
reformat: use auto on certain types
This commit is contained in:
@@ -2684,7 +2684,7 @@ static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata)
|
||||
} else {
|
||||
if (hh->num_remaining_in_head_chunk == 0) {
|
||||
int count = (size < 32 ? 2000 : size < 128 ? 800 : 100);
|
||||
stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata);
|
||||
auto c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata);
|
||||
if (c == NULL)
|
||||
return NULL;
|
||||
c->next = hh->head;
|
||||
@@ -2764,7 +2764,7 @@ static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, i
|
||||
#elif STBTT_RASTERIZER_VERSION == 2
|
||||
static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata)
|
||||
{
|
||||
stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata);
|
||||
auto z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata);
|
||||
float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
|
||||
STBTT_assert(z != NULL);
|
||||
//STBTT_assert(e->y0 <= start_point);
|
||||
@@ -3796,9 +3796,9 @@ static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rect
|
||||
|
||||
STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context)
|
||||
{
|
||||
stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context);
|
||||
auto context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context);
|
||||
int num_nodes = pw - padding;
|
||||
stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context);
|
||||
auto nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context);
|
||||
|
||||
if (context == NULL || nodes == NULL) {
|
||||
if (context != NULL) STBTT_free(context, alloc_context);
|
||||
|
||||
Reference in New Issue
Block a user