diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/debug.c | 6 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 2 | ||||
-rw-r--r-- | src/mesa/main/errors.c | 18 | ||||
-rw-r--r-- | src/mesa/main/macros.h | 9 | ||||
-rw-r--r-- | src/mesa/main/pbo.c | 2 | ||||
-rw-r--r-- | src/mesa/main/shaderapi.c | 1 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 6 | ||||
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 2 | ||||
-rw-r--r-- | src/mesa/main/version.c | 2 |
9 files changed, 29 insertions, 19 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 66ee2841b03..a646d4426ef 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -284,7 +284,7 @@ write_texture_image(struct gl_texture_object *texObj, GL_RGBA, GL_UNSIGNED_BYTE, buffer, img); /* make filename */ - _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); + snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); printf(" Writing image level %u to %s\n", level, s); write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); @@ -330,8 +330,8 @@ _mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb) format, type, &ctx->DefaultPacking, buffer); /* make filename */ - _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name); - _mesa_snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name); + snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name); + snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name); printf(" Writing renderbuffer image to %s\n", s); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 89d2e8a12a0..bd2ce8f5053 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -13548,7 +13548,7 @@ execute_list(struct gl_context *ctx, GLuint list) default: { char msg[1000]; - _mesa_snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d", + snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d", (int) opcode); _mesa_problem(ctx, "%s", msg); } diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 7c8cb3886d9..b3487efb522 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -86,7 +86,7 @@ output_if_debug(const char *prefixString, const char *outputString, * visible, so communicate with the debugger instead */ { char buf[4096]; - _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); OutputDebugStringA(buf); } #endif @@ -116,7 +116,7 @@ flush_delayed_errors( struct gl_context *ctx ) char s[MAX_DEBUG_MESSAGE_LENGTH]; if (ctx->ErrorDebugCount) { - _mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors", + snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors", ctx->ErrorDebugCount, _mesa_enum_to_string(ctx->ErrorValue)); @@ -140,7 +140,7 @@ _mesa_warning( struct gl_context *ctx, const char *fmtString, ... ) char str[MAX_DEBUG_MESSAGE_LENGTH]; va_list args; va_start( args, fmtString ); - (void) _mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args ); + (void) vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args ); va_end( args ); if (ctx) @@ -170,7 +170,7 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) numCalls++; va_start( args, fmtString ); - _mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args ); + vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args ); va_end( args ); fprintf(stderr, "Mesa " PACKAGE_VERSION " implementation error: %s\n", str); @@ -230,7 +230,7 @@ _mesa_gl_vdebugf(struct gl_context *ctx, _mesa_debug_get_id(id); - len = _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); + len = vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); if (len >= MAX_DEBUG_MESSAGE_LENGTH) /* message was truncated */ len = MAX_DEBUG_MESSAGE_LENGTH - 1; @@ -325,7 +325,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) va_list args; va_start(args, fmtString); - len = _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); + len = vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); va_end(args); if (len >= MAX_DEBUG_MESSAGE_LENGTH) { @@ -336,7 +336,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) return; } - len = _mesa_snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s", + len = snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s", _mesa_enum_to_string(error), s); if (len >= MAX_DEBUG_MESSAGE_LENGTH) { /* Same as above. */ @@ -382,7 +382,7 @@ _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) char s[MAX_DEBUG_MESSAGE_LENGTH]; va_list args; va_start(args, fmtString); - _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); + vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); va_end(args); output_if_debug("Mesa", s, GL_FALSE); #endif /* DEBUG */ @@ -397,7 +397,7 @@ _mesa_log(const char *fmtString, ...) char s[MAX_DEBUG_MESSAGE_LENGTH]; va_list args; va_start(args, fmtString); - _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); + vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); va_end(args); output_if_debug("", s, GL_FALSE); } diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index a4c5ec67a4a..3e1227328e1 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -787,4 +787,13 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y) /* Stringify */ #define STRINGIFY(x) #x +/* + * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers + * as offsets into buffer stores. Since the vertex array pointer and + * buffer store pointer are both pointers and we need to add them, we use + * this macro. + * Both pointers/offsets are expressed in bytes. + */ +#define ADD_POINTERS(A, B) ( (GLubyte *) (A) + (uintptr_t) (B) ) + #endif diff --git a/src/mesa/main/pbo.c b/src/mesa/main/pbo.c index 8ab782f3a33..7cb463d93fc 100644 --- a/src/mesa/main/pbo.c +++ b/src/mesa/main/pbo.c @@ -36,8 +36,8 @@ #include "bufferobj.h" #include "glformats.h" #include "image.h" -#include "util/imports.h" #include "mtypes.h" +#include "macros.h" #include "pbo.h" diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 0aa05475247..19d7a3ab440 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -63,6 +63,7 @@ #include "util/crc32.h" #include "util/os_file.h" #include "util/simple_list.h" +#include "util/u_string.h" /** * Return mask of GLSL_x flags by examining the MESA_GLSL env var. diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 986ee614915..ea93ac2f3b2 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1892,7 +1892,7 @@ texture_error_check( struct gl_context *ctx, * requires GL_OES_texture_float) are filtered elsewhere. */ char bufCallerName[20]; - _mesa_snprintf(bufCallerName, 20, "glTexImage%dD", dimensions); + snprintf(bufCallerName, 20, "glTexImage%dD", dimensions); if (_mesa_is_gles(ctx) && texture_format_error_check_gles(ctx, format, type, internalFormat, bufCallerName)) { @@ -1921,7 +1921,7 @@ texture_error_check( struct gl_context *ctx, if (type != GL_UNSIGNED_SHORT_8_8_MESA && type != GL_UNSIGNED_SHORT_8_8_REV_MESA) { char message[100]; - _mesa_snprintf(message, sizeof(message), + snprintf(message, sizeof(message), "glTexImage%dD(format/type YCBCR mismatch)", dimensions); _mesa_error(ctx, GL_INVALID_ENUM, "%s", message); @@ -1938,7 +1938,7 @@ texture_error_check( struct gl_context *ctx, } if (border != 0) { char message[100]; - _mesa_snprintf(message, sizeof(message), + snprintf(message, sizeof(message), "glTexImage%dD(format=GL_YCBCR_MESA and border=%d)", dimensions, border); _mesa_error(ctx, GL_INVALID_VALUE, "%s", message); diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index de594fcc3d7..db2f173dd2f 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -1594,7 +1594,7 @@ _mesa_sampler_uniforms_are_valid(const struct gl_shader_program *shProg, return true; if (!shProg->SamplersValidated) { - _mesa_snprintf(errMsg, errMsgLength, + snprintf(errMsg, errMsgLength, "active samplers with a different type " "refer to the same texture image unit"); return false; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index cacf22e7950..0cb0aabb896 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -120,7 +120,7 @@ create_version_string(struct gl_context *ctx, const char *prefix) ctx->VersionString = malloc(max); if (ctx->VersionString) { - _mesa_snprintf(ctx->VersionString, max, + snprintf(ctx->VersionString, max, "%s%u.%u%s Mesa " PACKAGE_VERSION MESA_GIT_SHA1, prefix, ctx->Version / 10, ctx->Version % 10, |