[2/3] kernel32/process: Implement GetLogicalProcessorInformation using NtQuerySystemInformation

Vitaliy Margolen wine-devel at kievinfo.com
Tue Oct 5 09:17:12 CDT 2010


On 10/05/2010 04:46 AM, Rudolf Mayerhofer wrote:
> ---
>   dlls/kernel32/process.c |   21 ++++++++++++++++++---
>   1 files changed, 18 insertions(+), 3 deletions(-)
>

Please exchange patches 2 and 3.

And everywhere in your patches, please stick to _THE SAME_ formatting as the 
rest of the file you editing. Examples:

> +    if (status != STATUS_SUCCESS)
> +    {
> +        if( status == STATUS_INFO_LENGTH_MISMATCH )
Here you adding 2 differently formatted if () statements.

> +static ULONG_PTR sysfs_cpu_topology_getmap(int cpu, const char *type)
> +{
> +    char buf[256];
> +    FILE *fd;
> +    ULONG_PTR result;
> +    sprintf(buf, "/sys/devices/system/cpu/cpu%d/topology/%s",cpu,type);

Please add empty line between variable declarations and the rest of the 
code. All commas should always be followed by a space.

> +    fd = fopen(buf,"r");
> +    if(fscanf(fd,"%lx",&result) != 1)
You are not checking if fopen() succeeded.

> +static int sysfs_cpucache_getint(int cpu, int cache, const char *type)
> +{
> +    }else{
> +        val = -1;
> +    }
> +    fclose(fd);
> +    return val;
> +}
> ...
> +                    BYTE level = sysfs_cpucache_getint(cpucount,cachecount,"level");
Don't mix signed and unsigned integers. Especially that you return -1 in 
case of error. In that entire file curly braces go on a separate line.

Vitaliy.



More information about the wine-devel mailing list