Attempt to fix sign conversion error happening on buildbot
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 13 Jun 2014 21:34:30 +0000 (03:34 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 13 Jun 2014 21:35:22 +0000 (03:35 +0600)
intern/guardedalloc/intern/mallocn_guarded_impl.c

index 206390e071093e0f8bb450d91a55cf87cfa78e0f..6e32844e2e7fd31d748501ec2742f42600de87bb 100644 (file)
@@ -548,7 +548,7 @@ void *MEM_guarded_mallocN_aligned(size_t len, size_t alignment, const char *str)
         * We only support small alignments which fits into short in
         * order to save some bits in MemHead structure.
         */
-       short extra_padding = (short)MEMHEAD_ALIGN_PADDING(alignment);
+       size_t extra_padding = MEMHEAD_ALIGN_PADDING(alignment);
 
        /* Huge alignment values doesn't make sense and they
         * wouldn't fit into 'short' used in the MemHead.
@@ -560,7 +560,7 @@ void *MEM_guarded_mallocN_aligned(size_t len, size_t alignment, const char *str)
 
        len = SIZET_ALIGN_4(len);
 
-       memh = (MemHead *)aligned_malloc(len + (size_t)extra_padding + sizeof(MemHead) + sizeof(MemTail), alignment);
+       memh = (MemHead *)aligned_malloc(len + extra_padding + sizeof(MemHead) + sizeof(MemTail), alignment);
 
        if (LIKELY(memh)) {
                /* We keep padding in the beginning of MemHead,