mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-11-11 09:33:49 +00:00
[CoreSupport] Linux/GLX touch-ups for ANSI-C with gcc -pedantic compilation flag
This commit is contained in:
parent
e647f55311
commit
d89a349a31
@ -193,6 +193,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
* GLEW, just like OpenGL or GLU, does not rely on the standard C library.
|
||||
* These functions implement the functionality required in this file.
|
||||
*/
|
||||
|
||||
static GLuint _glewStrLen (const GLubyte* s)
|
||||
{
|
||||
GLuint i=0;
|
||||
@ -209,6 +210,17 @@ static GLuint _glewStrCLen (const GLubyte* s, GLubyte c)
|
||||
return (s[i] == '\0' || s[i] == c) ? i : 0;
|
||||
}
|
||||
|
||||
static GLubyte *_glewStrDup (const GLubyte *s)
|
||||
{
|
||||
int n = _glewStrLen(s) + 1;
|
||||
GLubyte *dup = malloc(n);
|
||||
if (dup)
|
||||
{
|
||||
strcpy((char *) dup, (const char *) s);
|
||||
}
|
||||
return dup;
|
||||
}
|
||||
|
||||
static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
|
||||
{
|
||||
GLuint i=0;
|
||||
|
@ -140,7 +140,7 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *ext;
|
||||
const GLubyte *ext;
|
||||
char *begin;
|
||||
char *end;
|
||||
char *i;
|
||||
@ -151,8 +151,8 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
|
||||
if (ext)
|
||||
{
|
||||
begin = strdup(ext);
|
||||
end = begin + strlen(begin);
|
||||
begin = (char *) _glewStrDup(ext);
|
||||
end = begin + _glewStrLen((GLubyte *) begin);
|
||||
for (i=begin; i<end; i = j + 1)
|
||||
{
|
||||
i = _glewNextNonSpace(i);
|
||||
|
Loading…
Reference in New Issue
Block a user