#include "glxclient.h"
#include "indirect.h"
+#include "util/rounding.h"
#if !defined(__GNUC__)
# define __builtin_expect(x, y) x
switch (pname) {
case GL_PACK_ROW_LENGTH:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storePack.rowLength = a;
break;
case GL_PACK_IMAGE_HEIGHT:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storePack.imageHeight = a;
break;
case GL_PACK_SKIP_ROWS:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storePack.skipRows = a;
break;
case GL_PACK_SKIP_PIXELS:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storePack.skipPixels = a;
break;
case GL_PACK_SKIP_IMAGES:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storePack.skipImages = a;
break;
case GL_PACK_ALIGNMENT:
- a = (GLint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
switch (a) {
case 1:
case 2:
break;
case GL_UNPACK_ROW_LENGTH:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storeUnpack.rowLength = a;
break;
case GL_UNPACK_IMAGE_HEIGHT:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storeUnpack.imageHeight = a;
break;
case GL_UNPACK_SKIP_ROWS:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storeUnpack.skipRows = a;
break;
case GL_UNPACK_SKIP_PIXELS:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storeUnpack.skipPixels = a;
break;
case GL_UNPACK_SKIP_IMAGES:
- a = (GLuint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
if (((GLint) a) < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
state->storeUnpack.skipImages = a;
break;
case GL_UNPACK_ALIGNMENT:
- a = (GLint) (param + 0.5);
+ a = _mesa_lroundevenf(param);
switch (a) {
case 1:
case 2: