From 6d1a76fb106b71c18ab0368adb0f877af30c0a5a Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Sun, 7 Jun 2009 14:13:06 +0200 Subject: [PATCH] wined3d: Fix (and simplify) the ATI case in IWineD3DImpl_FillGLCaps. --- dlls/wined3d/directx.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 6013cfe0047..05443fc8215 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -615,21 +615,15 @@ static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { major = minor = 0; gl_string_cursor = strchr(gl_string, '-'); if (gl_string_cursor) { - int error = 0; gl_string_cursor++; /* Check if version number is of the form x.y.z */ - if (*gl_string_cursor > '9' && *gl_string_cursor < '0') - error = 1; - if (!error && *(gl_string_cursor+2) > '9' && *(gl_string_cursor+2) < '0') - error = 1; - if (!error && *(gl_string_cursor+4) > '9' && *(gl_string_cursor+4) < '0') - error = 1; - if (!error && *(gl_string_cursor+1) != '.' && *(gl_string_cursor+3) != '.') - error = 1; - - /* Mark version number as malformed */ - if (error) + if ( *gl_string_cursor < '0' || *gl_string_cursor > '9' + || *(gl_string_cursor+1) != '.' + || *(gl_string_cursor+2) < '0' || *(gl_string_cursor+2) > '9' + || *(gl_string_cursor+3) != '.' + || *(gl_string_cursor+4) < '0' || *(gl_string_cursor+4) > '9' ) + /* Mark version number as malformed */ gl_string_cursor = 0; }