summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/pipebuffer
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-02-06 14:37:49 +0900
committerJosé Fonseca <[email protected]>2008-02-06 14:37:49 +0900
commit9791d7f64c5a58b9c1bf32d00c71e0e031f54f70 (patch)
tree8b942442af70cfe2a786aee35f250b46b9bb13f9 /src/mesa/pipe/pipebuffer
parent78bce9c2dcd45d1d8706bb9bab3b3a73943de990 (diff)
gallium: Use p_debug.h instead of non-portable stdio.h/assert.h functions.
Diffstat (limited to 'src/mesa/pipe/pipebuffer')
-rw-r--r--src/mesa/pipe/pipebuffer/pb_buffer.h4
-rw-r--r--src/mesa/pipe/pipebuffer/pb_buffer_fenced.c4
-rw-r--r--src/mesa/pipe/pipebuffer/pb_buffer_fenced.h2
-rw-r--r--src/mesa/pipe/pipebuffer/pb_buffer_malloc.c4
-rw-r--r--src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c4
-rw-r--r--src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c21
-rw-r--r--src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c8
7 files changed, 18 insertions, 29 deletions
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer.h b/src/mesa/pipe/pipebuffer/pb_buffer.h
index 17551b3b50e..97beb5f72a9 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer.h
+++ b/src/mesa/pipe/pipebuffer/pb_buffer.h
@@ -44,10 +44,8 @@
#define PB_BUFFER_H_
-#include <assert.h>
-#include <stdlib.h>
-
#include "pipe/p_compiler.h"
+#include "pipe/p_debug.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c
index 4cf4222db9d..f4fc3f6d714 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c
+++ b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c
@@ -34,12 +34,10 @@
*/
-#include <assert.h>
-#include <stdlib.h>
-
#include "linked_list.h"
#include "p_compiler.h"
+#include "p_debug.h"
#include "p_winsys.h"
#include "p_thread.h"
#include "p_util.h"
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.h b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.h
index 09082a53909..c40b9c75e18 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.h
+++ b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.h
@@ -51,7 +51,7 @@
#define PB_BUFFER_FENCED_H_
-#include <assert.h>
+#include "pipe/p_debug.h"
struct pipe_winsys;
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_malloc.c b/src/mesa/pipe/pipebuffer/pb_buffer_malloc.c
index 2151f1d691e..c1b7759874c 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer_malloc.c
+++ b/src/mesa/pipe/pipebuffer/pb_buffer_malloc.c
@@ -34,9 +34,7 @@
*/
-#include <assert.h>
-#include <stdlib.h>
-
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pb_buffer.h"
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c b/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c
index 3b341c64c28..c535d3276c9 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c
+++ b/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c
@@ -34,9 +34,7 @@
*/
-#include <assert.h>
-#include <stdlib.h>
-
+#include "p_debug.h"
#include "p_util.h"
#include "pb_buffer.h"
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c b/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
index b6af7cdedc2..8b1b51c0e28 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
+++ b/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
@@ -34,11 +34,10 @@
*/
-#include <assert.h>
-
#include "linked_list.h"
#include "p_defines.h"
+#include "p_debug.h"
#include "p_thread.h"
#include "p_util.h"
#include "pb_buffer.h"
@@ -69,28 +68,28 @@ struct mem_block
static void
mmDumpMemInfo(const struct mem_block *heap)
{
- fprintf(stderr, "Memory heap %p:\n", (void *)heap);
+ debug_printf("Memory heap %p:\n", (void *)heap);
if (heap == 0) {
- fprintf(stderr, " heap == 0\n");
+ debug_printf(" heap == 0\n");
} else {
const struct mem_block *p;
for(p = heap->next; p != heap; p = p->next) {
- fprintf(stderr, " Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
+ debug_printf(" Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
}
- fprintf(stderr, "\nFree list:\n");
+ debug_printf("\nFree list:\n");
for(p = heap->next_free; p != heap; p = p->next_free) {
- fprintf(stderr, " FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
+ debug_printf(" FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
}
}
- fprintf(stderr, "End of memory blocks\n");
+ debug_printf("End of memory blocks\n");
}
#endif
@@ -308,11 +307,11 @@ mmFreeMem(struct mem_block *b)
return 0;
if (b->free) {
- fprintf(stderr, "block already free\n");
+ debug_printf("block already free\n");
return -1;
}
if (b->reserved) {
- fprintf(stderr, "block is reserved\n");
+ debug_printf("block is reserved\n");
return -1;
}
@@ -479,7 +478,7 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
mm_buf->block = mmAllocMem(mm->heap, size, mm->align2, 0);
if(!mm_buf->block) {
- fprintf(stderr, "warning: heap full\n");
+ debug_printf("warning: heap full\n");
#if 0
mmDumpMemInfo(mm->heap);
#endif
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c b/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c
index f80c7e34c07..bcd4b3e2571 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c
+++ b/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c
@@ -35,12 +35,10 @@
*/
-#include <assert.h>
-#include <stdlib.h>
-
#include "linked_list.h"
#include "p_compiler.h"
+#include "p_debug.h"
#include "p_thread.h"
#include "p_defines.h"
#include "p_util.h"
@@ -178,7 +176,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
if (pool->numFree == 0) {
_glthread_UNLOCK_MUTEX(pool->mutex);
- fprintf(stderr, "warning: out of fixed size buffer objects\n");
+ debug_printf("warning: out of fixed size buffer objects\n");
return NULL;
}
@@ -186,7 +184,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
if (item == &pool->free) {
_glthread_UNLOCK_MUTEX(pool->mutex);
- fprintf(stderr, "error: fixed size buffer pool corruption\n");
+ debug_printf("error: fixed size buffer pool corruption\n");
return NULL;
}