projects
/
profile
/
ivi
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80b359f
)
mesa: Use appropriate unsigned/signed, float/integer types.
author
José Fonseca
<jrfonseca@tungstengraphics.com>
Tue, 24 Jun 2008 02:34:46 +0000
(11:34 +0900)
committer
José Fonseca
<jrfonseca@tungstengraphics.com>
Tue, 24 Jun 2008 02:34:46 +0000
(11:34 +0900)
src/mesa/main/mm.c
patch
|
blob
|
history
src/mesa/shader/program.c
patch
|
blob
|
history
src/mesa/shader/shader_api.c
patch
|
blob
|
history
src/mesa/shader/slang/slang_compile.c
patch
|
blob
|
history
src/mesa/shader/slang/slang_print.c
patch
|
blob
|
history
src/mesa/state_tracker/st_cb_drawpixels.c
patch
|
blob
|
history
src/mesa/state_tracker/st_cb_readpixels.c
patch
|
blob
|
history
src/mesa/state_tracker/st_draw.c
patch
|
blob
|
history
src/mesa/state_tracker/st_extensions.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/mm.c
b/src/mesa/main/mm.c
index
fb7809e
..
9f3aa00
100644
(file)
--- a/
src/mesa/main/mm.c
+++ b/
src/mesa/main/mm.c
@@
-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;
{
struct mem_block *p;
const int mask = (1 << align2)-1;
-
unsigned
int startofs = 0;
-
unsigned
int endofs;
+ int startofs = 0;
+ int endofs;
if (!heap || align2 < 0 || size <= 0)
return NULL;
if (!heap || align2 < 0 || size <= 0)
return NULL;
diff --git
a/src/mesa/shader/program.c
b/src/mesa/shader/program.c
index
a0817a9
..
b27ed6b
100644
(file)
--- a/
src/mesa/shader/program.c
+++ b/
src/mesa/shader/program.c
@@
-467,7
+467,7
@@
_mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count)
for (i = 0; i < prog->NumInstructions; i++) {
struct prog_instruction *inst = prog->Instructions + i;
if (inst->BranchTarget > 0) {
for (i = 0; i < prog->NumInstructions; i++) {
struct prog_instruction *inst = prog->Instructions + i;
if (inst->BranchTarget > 0) {
- if (inst->BranchTarget >= start) {
+ if (
(GLuint)
inst->BranchTarget >= start) {
inst->BranchTarget += count;
}
}
inst->BranchTarget += count;
}
}
diff --git
a/src/mesa/shader/shader_api.c
b/src/mesa/shader/shader_api.c
index
856179e
..
97edb25
100644
(file)
--- a/
src/mesa/shader/shader_api.c
+++ b/
src/mesa/shader/shader_api.c
@@
-1079,7
+1079,7
@@
update_textures_used(struct gl_program *prog)
*/
static void
set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location,
*/
static void
set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location,
- GLenum type, GL
int
count, GLint elems, const void *values)
+ GLenum type, GL
sizei
count, GLint elems, const void *values)
{
if (program->Parameters->Parameters[location].Type == PROGRAM_SAMPLER) {
/* This controls which texture unit which is used by a sampler */
{
if (program->Parameters->Parameters[location].Type == PROGRAM_SAMPLER) {
/* This controls which texture unit which is used by a sampler */
@@
-1111,7
+1111,7
@@
set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location,
}
else {
/* ordinary uniform variable */
}
else {
/* ordinary uniform variable */
- GL
uint
k, i;
+ GL
sizei
k, i;
if (count * elems > program->Parameters->Parameters[location].Size) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)");
if (count * elems > program->Parameters->Parameters[location].Size) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)");
diff --git
a/src/mesa/shader/slang/slang_compile.c
b/src/mesa/shader/slang/slang_compile.c
index
cdea1c5
..
8485103
100644
(file)
--- a/
src/mesa/shader/slang/slang_compile.c
+++ b/
src/mesa/shader/slang/slang_compile.c
@@
-1934,7
+1934,7
@@
compile_with_grammar(grammar id, const char *source, slang_code_unit * unit,
byte *prod;
GLuint size, start, version;
slang_string preprocessed;
byte *prod;
GLuint size, start, version;
slang_string preprocessed;
- int maxVersion;
+
GLu
int maxVersion;
#if FEATURE_ARB_shading_language_120
maxVersion = 120;
#if FEATURE_ARB_shading_language_120
maxVersion = 120;
diff --git
a/src/mesa/shader/slang/slang_print.c
b/src/mesa/shader/slang/slang_print.c
index
f3e127c
..
4a7d4bb
100644
(file)
--- a/
src/mesa/shader/slang/slang_print.c
+++ b/
src/mesa/shader/slang/slang_print.c
@@
-182,14
+182,14
@@
static void
print_generic2(const slang_operation *op, const char *oper,
const char *s, int indent)
{
print_generic2(const slang_operation *op, const char *oper,
const char *s, int indent)
{
- int i;
+
GLu
int i;
if (oper) {
spaces(indent);
printf("[%p locals %p] %s %s\n", (void*) op, (void*) op->locals, oper, s);
}
for (i = 0; i < op->num_children; i++) {
spaces(indent);
if (oper) {
spaces(indent);
printf("[%p locals %p] %s %s\n", (void*) op, (void*) op->locals, oper, s);
}
for (i = 0; i < op->num_children; i++) {
spaces(indent);
- printf("//child %
d
:\n", i);
+ printf("//child %
u
:\n", i);
slang_print_tree(&op->children[i], indent);
}
}
slang_print_tree(&op->children[i], indent);
}
}
@@
-804,7
+804,7
@@
int
slang_checksum_tree(const slang_operation *op)
{
int s = op->num_children;
slang_checksum_tree(const slang_operation *op)
{
int s = op->num_children;
- int i;
+
GLu
int i;
for (i = 0; i < op->num_children; i++) {
s += slang_checksum_tree(&op->children[i]);
for (i = 0; i < op->num_children; i++) {
s += slang_checksum_tree(&op->children[i]);
diff --git
a/src/mesa/state_tracker/st_cb_drawpixels.c
b/src/mesa/state_tracker/st_cb_drawpixels.c
index
a486581
..
8fdeb5c
100644
(file)
--- a/
src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/
src/mesa/state_tracker/st_cb_drawpixels.c
@@
-517,7
+517,7
@@
draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
struct pipe_context *pipe = ctx->st->pipe;
struct cso_context *cso = ctx->st->cso_context;
GLfloat x0, y0, x1, y1;
struct pipe_context *pipe = ctx->st->pipe;
struct cso_context *cso = ctx->st->cso_context;
GLfloat x0, y0, x1, y1;
- GL
uint
maxSize;
+ GL
sizei
maxSize;
/* limit checks */
/* XXX if DrawPixels image is larger than max texture size, break
/* limit checks */
/* XXX if DrawPixels image is larger than max texture size, break
@@
-574,14
+574,14
@@
draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
const float width = ctx->DrawBuffer->Width;
const float height = ctx->DrawBuffer->Height;
struct pipe_viewport_state vp;
const float width = ctx->DrawBuffer->Width;
const float height = ctx->DrawBuffer->Height;
struct pipe_viewport_state vp;
- vp.scale[0] = 0.5 * width;
- vp.scale[1] = -0.5 * height;
- vp.scale[2] = 1.0;
- vp.scale[3] = 1.0;
- vp.translate[0] = 0.5 * width;
- vp.translate[1] = 0.5 * height;
- vp.translate[2] = 0.0;
- vp.translate[3] = 0.0;
+ vp.scale[0] = 0.5
f
* width;
+ vp.scale[1] = -0.5
f
* height;
+ vp.scale[2] = 1.0
f
;
+ vp.scale[3] = 1.0
f
;
+ vp.translate[0] = 0.5
f
* width;
+ vp.translate[1] = 0.5
f
* height;
+ vp.translate[2] = 0.0
f
;
+ vp.translate[3] = 0.0
f
;
cso_set_viewport(cso, &vp);
}
cso_set_viewport(cso, &vp);
}
diff --git
a/src/mesa/state_tracker/st_cb_readpixels.c
b/src/mesa/state_tracker/st_cb_readpixels.c
index
08934af
..
c519363
100644
(file)
--- a/
src/mesa/state_tracker/st_cb_readpixels.c
+++ b/
src/mesa/state_tracker/st_cb_readpixels.c
@@
-177,7
+177,8
@@
st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
struct pipe_screen *screen = pipe->screen;
GLfloat temp[MAX_WIDTH][4];
const GLbitfield transferOps = ctx->_ImageTransferState;
struct pipe_screen *screen = pipe->screen;
GLfloat temp[MAX_WIDTH][4];
const GLbitfield transferOps = ctx->_ImageTransferState;
- GLint i, yStep, dfStride;
+ GLsizei i, j;
+ GLint yStep, dfStride;
GLfloat *df;
struct st_renderbuffer *strb;
struct gl_pixelstore_attrib clippedPacking = *pack;
GLfloat *df;
struct st_renderbuffer *strb;
struct gl_pixelstore_attrib clippedPacking = *pack;
@@
-258,7
+259,7
@@
st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
surf->format == PIPE_FORMAT_X8Z24_UNORM) {
if (format == GL_DEPTH_COMPONENT) {
for (i = 0; i < height; i++) {
surf->format == PIPE_FORMAT_X8Z24_UNORM) {
if (format == GL_DEPTH_COMPONENT) {
for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH]
, j
;
+ GLuint ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / ((1 << 24) - 1);
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / ((1 << 24) - 1);
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
@@
-283,7
+284,7
@@
st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
else if (surf->format == PIPE_FORMAT_Z16_UNORM) {
for (i = 0; i < height; i++) {
}
else if (surf->format == PIPE_FORMAT_Z16_UNORM) {
for (i = 0; i < height; i++) {
- GLushort ztemp[MAX_WIDTH]
, j
;
+ GLushort ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / 0xffff;
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / 0xffff;
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
@@
-298,7
+299,7
@@
st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
else if (surf->format == PIPE_FORMAT_Z32_UNORM) {
for (i = 0; i < height; i++) {
}
else if (surf->format == PIPE_FORMAT_Z32_UNORM) {
for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH]
, j
;
+ GLuint ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / 0xffffffff;
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
GLfloat zfloat[MAX_WIDTH];
const double scale = 1.0 / 0xffffffff;
pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0);
diff --git
a/src/mesa/state_tracker/st_draw.c
b/src/mesa/state_tracker/st_draw.c
index
6867d50
..
2191177
100644
(file)
--- a/
src/mesa/state_tracker/st_draw.c
+++ b/
src/mesa/state_tracker/st_draw.c
@@
-216,7
+216,7
@@
setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count,
(ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL)) {
/* need edge flags */
(ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL)) {
/* need edge flags */
- GL
u
int i;
+ GLint i;
unsigned *vec;
struct st_buffer_object *stobj = st_buffer_object(array->BufferObj);
ubyte *map;
unsigned *vec;
struct st_buffer_object *stobj = st_buffer_object(array->BufferObj);
ubyte *map;
diff --git
a/src/mesa/state_tracker/st_extensions.c
b/src/mesa/state_tracker/st_extensions.c
index
6f94ba3
..
d804d2b
100644
(file)
--- a/
src/mesa/state_tracker/st_extensions.c
+++ b/
src/mesa/state_tracker/st_extensions.c
@@
-43,7
+43,7
@@
static int _min(int a, int b)
return (a < b) ? a : b;
}
return (a < b) ? a : b;
}
-static
int _max(int a, in
t b)
+static
float _maxf(float a, floa
t b)
{
return (a > b) ? a : b;
}
{
return (a > b) ? a : b;
}
@@
-94,17
+94,17
@@
void st_init_limits(struct st_context *st)
1, MAX_DRAW_BUFFERS);
c->MaxLineWidth
1, MAX_DRAW_BUFFERS);
c->MaxLineWidth
- = _max
(1.0
, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
+ = _max
f(1.0f
, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
c->MaxLineWidthAA
c->MaxLineWidthAA
- = _max
(1.0
, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
+ = _max
f(1.0f
, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
c->MaxPointSize
c->MaxPointSize
- = _max
(1.0
, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
+ = _max
f(1.0f
, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
c->MaxPointSizeAA
c->MaxPointSizeAA
- = _max
(1.0
, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
+ = _max
f(1.0f
, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
c->MaxTextureMaxAnisotropy
c->MaxTextureMaxAnisotropy
- = _max
(2.0
, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
+ = _max
f(2.0f
, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
c->MaxTextureLodBias
= screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);
c->MaxTextureLodBias
= screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);