瀏覽代碼

Add casts to quiet compiler warnings.

tags/mesa_4_1
Karl Schultz 23 年之前
父節點
當前提交
8eaa290216
共有 5 個文件被更改,包括 39 次插入14 次删除
  1. 22
    1
      src/mesa/main/macros.h
  2. 3
    3
      src/mesa/swrast/s_aatriangle.c
  3. 2
    2
      src/mesa/swrast/s_alphabuf.c
  4. 2
    2
      src/mesa/swrast/s_pointtemp.h
  5. 10
    6
      src/mesa/swrast/s_texture.c

+ 22
- 1
src/mesa/main/macros.h 查看文件

@@ -1,4 +1,4 @@
/* $Id: macros.h,v 1.29 2002/07/09 01:22:50 brianp Exp $ */
/* $Id: macros.h,v 1.30 2002/10/18 17:02:00 kschultz Exp $ */

/*
* Mesa 3-D graphics library
@@ -113,6 +113,27 @@ do { \
(DST)[3] = (SRC)[3]; \
} while (0)

#define COPY_2V_CAST( DST, SRC, CAST ) \
do { \
(DST)[0] = (CAST)(SRC)[0]; \
(DST)[1] = (CAST)(SRC)[1]; \
} while (0)

#define COPY_3V_CAST( DST, SRC, CAST ) \
do { \
(DST)[0] = (CAST)(SRC)[0]; \
(DST)[1] = (CAST)(SRC)[1]; \
(DST)[2] = (CAST)(SRC)[2]; \
} while (0)

#define COPY_4V_CAST( DST, SRC, CAST ) \
do { \
(DST)[0] = (CAST)(SRC)[0]; \
(DST)[1] = (CAST)(SRC)[1]; \
(DST)[2] = (CAST)(SRC)[2]; \
(DST)[3] = (CAST)(SRC)[3]; \
} while (0)

#if defined(__i386__)
#define COPY_4UBV(DST, SRC) \
do { \

+ 3
- 3
src/mesa/swrast/s_aatriangle.c 查看文件

@@ -1,4 +1,4 @@
/* $Id: s_aatriangle.c,v 1.24 2002/06/15 03:03:11 brianp Exp $ */
/* $Id: s_aatriangle.c,v 1.25 2002/10/18 17:02:01 kschultz Exp $ */

/*
* Mesa 3-D graphics library
@@ -361,8 +361,8 @@ compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4],
{
const GLfloat s = solve_plane(cx, cy, sPlane);
const GLfloat t = solve_plane(cx, cy, tPlane);
const GLfloat invQ_x1 = solve_plane_recip(cx+1.0, cy, qPlane);
const GLfloat invQ_y1 = solve_plane_recip(cx, cy+1.0, qPlane);
const GLfloat invQ_x1 = solve_plane_recip(cx+1.0F, cy, qPlane);
const GLfloat invQ_y1 = solve_plane_recip(cx, cy+1.0F, qPlane);
const GLfloat s_x1 = s - sPlane[0] / sPlane[2];
const GLfloat s_y1 = s - sPlane[1] / sPlane[2];
const GLfloat t_x1 = t - tPlane[0] / tPlane[2];

+ 2
- 2
src/mesa/swrast/s_alphabuf.c 查看文件

@@ -1,4 +1,4 @@
/* $Id: s_alphabuf.c,v 1.13 2002/10/11 17:41:06 brianp Exp $ */
/* $Id: s_alphabuf.c,v 1.14 2002/10/18 17:02:01 kschultz Exp $ */

/*
* Mesa 3-D graphics library
@@ -103,7 +103,7 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
void
_mesa_clear_alpha_buffers( GLcontext *ctx )
{
const GLchan aclear = ctx->Color.ClearColor[3];
const GLchan aclear = (GLchan) ctx->Color.ClearColor[3];
GLuint bufferBit;

ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers);

+ 2
- 2
src/mesa/swrast/s_pointtemp.h 查看文件

@@ -1,4 +1,4 @@
/* $Id: s_pointtemp.h,v 1.19 2002/10/04 17:37:47 brianp Exp $ */
/* $Id: s_pointtemp.h,v 1.20 2002/10/18 17:02:01 kschultz Exp $ */

/*
* Mesa 3-D graphics library
@@ -117,7 +117,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
const GLfloat q = vert->texcoord[u][3];
const GLfloat invQ = (q == 0.0 || q == 1.0) ? 1.0 : (1.0 / q);
const GLfloat invQ = (q == 0.0F || q == 1.0F) ? 1.0F : (1.0F / q);
texcoord[u][0] = vert->texcoord[u][0] * invQ;
texcoord[u][1] = vert->texcoord[u][1] * invQ;
texcoord[u][2] = vert->texcoord[u][2] * invQ;

+ 10
- 6
src/mesa/swrast/s_texture.c 查看文件

@@ -1,4 +1,4 @@
/* $Id: s_texture.c,v 1.70 2002/10/18 13:40:59 brianp Exp $ */
/* $Id: s_texture.c,v 1.71 2002/10/18 17:02:01 kschultz Exp $ */

/*
* Mesa 3-D graphics library
@@ -97,7 +97,7 @@
U = 1.0F - (S - (GLfloat) flr); /* flr is odd */ \
else \
U = S - (GLfloat) flr; /* flr is even */ \
U = (U * SIZE) - 0.5; \
U = (U * SIZE) - 0.5F; \
I0 = IFLOOR(U); \
I1 = I0 + 1; \
if (I0 < 0) \
@@ -2154,10 +2154,14 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit,
w11 = a * b ;

/* compute weighted average of samples */
rgba[i][0] = w00 * t00[0] + w10 * t10[0] + w01 * t01[0] + w11 * t11[0];
rgba[i][1] = w00 * t00[1] + w10 * t10[1] + w01 * t01[1] + w11 * t11[1];
rgba[i][2] = w00 * t00[2] + w10 * t10[2] + w01 * t01[2] + w11 * t11[2];
rgba[i][3] = w00 * t00[3] + w10 * t10[3] + w01 * t01[3] + w11 * t11[3];
rgba[i][0] =
(GLchan) (w00 * t00[0] + w10 * t10[0] + w01 * t01[0] + w11 * t11[0]);
rgba[i][1] =
(GLchan) (w00 * t00[1] + w10 * t10[1] + w01 * t01[1] + w11 * t11[1]);
rgba[i][2] =
(GLchan) (w00 * t00[2] + w10 * t10[2] + w01 * t01[2] + w11 * t11[2]);
rgba[i][3] =
(GLchan) (w00 * t00[3] + w10 * t10[3] + w01 * t01[3] + w11 * t11[3]);
}
}


Loading…
取消
儲存