mesa: add AllowGLSLCrossStageInterpolationMismatch workaround
[mesa.git] / src / mesa / main / mm.c
index 3ef38e94be9ce82cc607074c88078e3ca68105cb..473e90fc2d5be879f13eb2ad7346ccb5494b60d2 100644 (file)
  *
  */
 
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "compiler.h"
 #include "mm.h"
 
 
@@ -60,11 +65,11 @@ mmInit(unsigned ofs, unsigned size)
    if (!size) 
       return NULL;
 
-   heap = (struct mem_block *) calloc(1, sizeof(struct mem_block));
+   heap = calloc(1, sizeof(struct mem_block));
    if (!heap) 
       return NULL;
    
-   block = (struct mem_block *) calloc(1, sizeof(struct mem_block));
+   block = calloc(1, sizeof(struct mem_block));
    if (!block) {
       free(heap);
       return NULL;
@@ -98,7 +103,7 @@ SliceBlock(struct mem_block *p,
 
    /* break left  [p, newblock, p->next], then p = newblock */
    if (startofs > p->ofs) {
-      newblock = (struct mem_block*) calloc(1, sizeof(struct mem_block));
+      newblock = calloc(1, sizeof(struct mem_block));
       if (!newblock)
         return NULL;
       newblock->ofs = startofs;
@@ -122,7 +127,7 @@ SliceBlock(struct mem_block *p,
 
    /* break right, also [p, newblock, p->next] */
    if (size < p->size) {
-      newblock = (struct mem_block*) calloc(1, sizeof(struct mem_block));
+      newblock = calloc(1, sizeof(struct mem_block));
       if (!newblock)
         return NULL;
       newblock->ofs = startofs + size;
@@ -206,7 +211,7 @@ mmFindBlock(struct mem_block *heap, unsigned start)
 }
 
 
-static INLINE int
+static inline int
 Join2Blocks(struct mem_block *p)
 {
    /* XXX there should be some assertions here */