mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-24 06:45:07 +00:00
[CoreSupport] Resolve some Mac compilation warnings.
This commit is contained in:
parent
6571358ea7
commit
e35345d4db
@ -7,8 +7,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stddef.h> /* For size_t */
|
#include <stddef.h> /* For size_t */
|
||||||
#include <string.h> /* memset, etc */
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define glewGetContext and related helper macros.
|
* Define glewGetContext and related helper macros.
|
||||||
@ -207,15 +205,21 @@ static GLuint _glewStrCLen (const GLubyte* s, GLubyte c)
|
|||||||
|
|
||||||
static GLubyte *_glewStrDup (const GLubyte *s)
|
static GLubyte *_glewStrDup (const GLubyte *s)
|
||||||
{
|
{
|
||||||
int n = _glewStrLen(s) + 1;
|
int n = _glewStrLen(s);
|
||||||
GLubyte *dup = malloc(n);
|
GLubyte *dup = malloc(n+1);
|
||||||
if (dup)
|
if (dup)
|
||||||
{
|
{
|
||||||
strcpy((char *) dup, (const char *) s);
|
GLubyte *i = dup;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
*i = *s;
|
||||||
|
if (*i) { ++i; ++s; } else break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return dup;
|
return dup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||||
static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
|
static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
|
||||||
{
|
{
|
||||||
GLuint i=0;
|
GLuint i=0;
|
||||||
@ -224,6 +228,7 @@ static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
|
|||||||
while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++;
|
while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++;
|
||||||
return i == n ? GL_TRUE : GL_FALSE;
|
return i == n ? GL_TRUE : GL_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
|
static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
|
||||||
{
|
{
|
||||||
@ -284,6 +289,7 @@ static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b,
|
|||||||
* other extension names. Could use strtok() but the constant
|
* other extension names. Could use strtok() but the constant
|
||||||
* string returned by glGetString might be in read-only memory.
|
* string returned by glGetString might be in read-only memory.
|
||||||
*/
|
*/
|
||||||
|
#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||||
static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end)
|
static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end)
|
||||||
{
|
{
|
||||||
const GLubyte* p;
|
const GLubyte* p;
|
||||||
@ -297,3 +303,4 @@ static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, c
|
|||||||
}
|
}
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -147,7 +147,7 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
|||||||
char *j;
|
char *j;
|
||||||
GLboolean *enable;
|
GLboolean *enable;
|
||||||
|
|
||||||
ext = (const char *) glGetString(GL_EXTENSIONS);
|
ext = glGetString(GL_EXTENSIONS);
|
||||||
|
|
||||||
if (ext)
|
if (ext)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user