}
struct mem_block *
-mmInit(unsigned int ofs, int size)
+mmInit(unsigned ofs, unsigned size)
{
struct mem_block *heap, *block;
- if (size <= 0)
+ if (!size)
return NULL;
heap = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block));
static struct mem_block *
SliceBlock(struct mem_block *p,
- unsigned int startofs, int size,
- int reserved, int alignment)
+ unsigned startofs, unsigned size,
+ unsigned reserved, unsigned alignment)
{
struct mem_block *newblock;
struct mem_block *
-mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch)
+mmAllocMem(struct mem_block *heap, unsigned size, unsigned align2, unsigned startSearch)
{
struct mem_block *p;
- const int mask = (1 << align2)-1;
- int startofs = 0;
- int endofs;
+ const unsigned mask = (1 << align2)-1;
+ unsigned startofs = 0;
+ unsigned endofs;
- if (!heap || align2 < 0 || size <= 0)
+ if (!heap || !align2 || !size)
return NULL;
for (p = heap->next_free; p != heap; p = p->next_free) {
struct mem_block *
-mmFindBlock(struct mem_block *heap, int start)
+mmFindBlock(struct mem_block *heap, unsigned start)
{
struct mem_block *p;
struct mem_block *next, *prev;
struct mem_block *next_free, *prev_free;
struct mem_block *heap;
- unsigned int ofs;
- int size;
- unsigned int free:1;
- unsigned int reserved:1;
+ unsigned ofs;
+ unsigned size;
+ unsigned free:1;
+ unsigned reserved:1;
};
* input: total size in bytes
* return: a heap pointer if OK, NULL if error
*/
-extern struct mem_block *mmInit(unsigned int ofs, int size);
+extern struct mem_block *mmInit(unsigned ofs, unsigned size);
/**
* Allocate 'size' bytes with 2^align2 bytes alignment,
* startSearch = linear offset from start of heap to begin search
* return: pointer to the allocated block, 0 if error
*/
-extern struct mem_block *mmAllocMem(struct mem_block *heap, int size, int align2,
- int startSearch);
+extern struct mem_block *mmAllocMem(struct mem_block *heap, unsigned size,
+ unsigned align2, unsigned startSearch);
/**
* Free block starts at offset
* input: pointer to a heap, start offset
* return: pointer to a block
*/
-extern struct mem_block *mmFindBlock(struct mem_block *heap, int start);
+extern struct mem_block *mmFindBlock(struct mem_block *heap, unsigned start);
/**
* destroy MM
const GLfloat width = (GLfloat)fb->Width;
const GLfloat height = (GLfloat)fb->Height;
struct pipe_viewport_state vp;
- vp.scale[0] = 0.5 * width;
- vp.scale[1] = (GLfloat)(height * (invert ? -0.5 : 0.5));
- vp.scale[2] = 1.0;
- vp.scale[3] = 1.0;
- vp.translate[0] = (GLfloat)(0.5 * width);
- vp.translate[1] = (GLfloat)(0.5 * height);
- vp.translate[2] = 0.0;
- vp.translate[3] = 0.0;
+ vp.scale[0] = 0.5f * width;
+ vp.scale[1] = height * (invert ? -0.5f : 0.5f);
+ vp.scale[2] = 1.0f;
+ vp.scale[3] = 1.0f;
+ vp.translate[0] = 0.5f * width;
+ vp.translate[1] = 0.5f * height;
+ vp.translate[2] = 0.0f;
+ vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
const GLfloat fb_width = fb->Width;
const GLfloat fb_height = fb->Height;
- const GLfloat clip_x0 = x0 / fb_width * 2.0 - 1.0;
- const GLfloat clip_y0 = y0 / fb_height * 2.0 - 1.0;
- const GLfloat clip_x1 = x1 / fb_width * 2.0 - 1.0;
- const GLfloat clip_y1 = y1 / fb_height * 2.0 - 1.0;
- const GLfloat sLeft = 0.0F, sRight = 1.0F;
- const GLfloat tTop = invertTex, tBot = 1.0 - tTop;
+ const GLfloat clip_x0 = x0 / fb_width * 2.0f - 1.0f;
+ const GLfloat clip_y0 = y0 / fb_height * 2.0f - 1.0f;
+ const GLfloat clip_x1 = x1 / fb_width * 2.0f - 1.0f;
+ const GLfloat clip_y1 = y1 / fb_height * 2.0f - 1.0f;
+ const GLfloat sLeft = 0.0f, sRight = 1.0f;
+ const GLfloat tTop = invertTex, tBot = 1.0f - tTop;
GLuint tex, i;
/* upper-left */
if (color) {
for (i = 0; i < 4; i++) {
verts[i][0][2] = z; /*Z*/
- verts[i][0][3] = 1.0; /*W*/
+ verts[i][0][3] = 1.0f; /*W*/
verts[i][1][0] = color[0];
verts[i][1][1] = color[1];
verts[i][1][2] = color[2];
verts[i][1][3] = color[3];
- verts[i][2][2] = 0.0; /*R*/
- verts[i][2][3] = 1.0; /*Q*/
+ verts[i][2][2] = 0.0f; /*R*/
+ verts[i][2][3] = 1.0f; /*Q*/
}
}
else {
for (i = 0; i < 4; i++) {
verts[i][0][2] = z; /*Z*/
- verts[i][0][3] = 1.0; /*W*/
- verts[i][1][2] = 0.0; /*R*/
- verts[i][1][3] = 1.0; /*Q*/
+ verts[i][0][3] = 1.0f; /*W*/
+ verts[i][1][2] = 0.0f; /*R*/
+ verts[i][1][3] = 1.0f; /*Q*/
}
}
}