diff options
author | Brian Paul <[email protected]> | 2008-06-17 10:10:53 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-06-17 10:10:53 -0600 |
commit | 47d046c93f7d6ea97feae193d201e74aebfd4394 (patch) | |
tree | bbdfd46963bd063b6f444595193bd773d09ff69d /src/mesa | |
parent | 718724deeb23099ee74ee3a3dc23d2447d004f02 (diff) |
mesa: make mm.c use unsigned ints for offsets.
If you have a GPU using this code and it has the offsets up in this space,
this fails.
cherry-picked from master
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/mm.c | 8 | ||||
-rw-r--r-- | src/mesa/main/mm.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index 846c329c70d..fb7809ed221 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -53,7 +53,7 @@ mmDumpMemInfo(const struct mem_block *heap) } struct mem_block * -mmInit(int ofs, int size) +mmInit(unsigned int ofs, int size) { struct mem_block *heap, *block; @@ -91,7 +91,7 @@ mmInit(int ofs, int size) static struct mem_block * SliceBlock(struct mem_block *p, - int startofs, int size, + unsigned int startofs, int size, int reserved, int alignment) { struct mem_block *newblock; @@ -164,8 +164,8 @@ mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch) { struct mem_block *p; const int mask = (1 << align2)-1; - int startofs = 0; - int endofs; + unsigned int startofs = 0; + unsigned int endofs; if (!heap || align2 < 0 || size <= 0) return NULL; diff --git a/src/mesa/main/mm.h b/src/mesa/main/mm.h index 26d59fff139..5ad3ffd6d15 100644 --- a/src/mesa/main/mm.h +++ b/src/mesa/main/mm.h @@ -39,7 +39,8 @@ struct mem_block { struct mem_block *next, *prev; struct mem_block *next_free, *prev_free; struct mem_block *heap; - int ofs,size; + unsigned int ofs; + int size; unsigned int free:1; unsigned int reserved:1; }; @@ -50,7 +51,7 @@ struct mem_block { * input: total size in bytes * return: a heap pointer if OK, NULL if error */ -extern struct mem_block *mmInit(int ofs, int size); +extern struct mem_block *mmInit(unsigned int ofs, int size); /** * Allocate 'size' bytes with 2^align2 bytes alignment, |