[PATCH] wined3d: Fix the OpenGL driver version for Mac OS X NVIDIA driver.

Huang, Zhangrong hzhrong at gmail.com
Thu Jul 24 10:58:20 CDT 2008


Hi,

2008/7/24 Michael Karcher <wine at mkarcher.dialup.fu-berlin.de>:
>
> What is the advantage of that compared to
>        major = strtol(gl_string, &gl_string_cursor,10);
> ?
>
> Or even replace the whole scanning code by
>
>        if(sscanf(gl_string, "%d.%d", &major, &minor) != 2)
>                ERR_(d3d_caps)(...)
>

It looks much better.

This patch was copied & modified from existing code:

            /* Apple and Mesa version strings look differently, but
both provide intel drivers */
            if(strstr(gl_string, "APPLE")) {
                /* [0-9]+.[0-9]+ APPLE-[0-9]+.[0.9]+.[0.9]+
                 * We only need the first part, and use the APPLE as
identification
                 * "1.2 APPLE-1.4.56"
                 */
                gl_string_cursor = gl_string;
                major = atoi(gl_string_cursor);
                while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') {
                    ++gl_string_cursor;
                }

>
>


-- 
$ apt-get moo
 (__)
 (oo)
 /------\/
 / | ||
 * /\---/\
 ~~ ~~
...."Have you mooed today?"...



More information about the wine-devel mailing list