On May 14, 2010, at 13:35, Jamey Sharp wrote:

> This patch looks fine to me:
> 
> Reviewed-by: Jamey Sharp <[email protected]>
> 
> I have some nitpicks and suggestions though. The big suggestion is
> that it seems like it should be easier to write this loop in
> _XConnectXCB instead of directly in OpenDisplay. For the nitpicks:
> 
> On Fri, May 14, 2010 at 1:10 PM, Jeremy Huddleston <[email protected]> wrote:
>> -       long int conn_buf_size;
>> -       char *xlib_buffer_size;
>> +       long int conn_buf_size;
>> +       char *xlib_buffer_size;
> 
> There doesn't seem to have been a reason to touch these.

The misalignment bothered me, and since I touched the next line, I figured I'd 
adjust it.

> 
>> +                       if(!buf) {
>> +                               dpy->display_name = fullname;
>> +                               OutOfMemory(dpy, NULL);
>> +                               return NULL;
>> +                       }
>> +
>> +                       for(s = protocols; *s; s++) {
>> +                               snprintf(buf, buf_size, "%s/%s", *s, 
>> display_name);
>> +                               if(_XConnectXCB(dpy, buf, &fullname, 
>> &iscreen))
>> +                                       goto fallback_success;
>> +                       }
>> +               }
>> +
>>                dpy->display_name = fullname;
>>                OutOfMemory(dpy, NULL);
>>                return NULL;
>>        }
>> +fallback_success:
> 
> You can eliminate the extra OutOfMemory block by wrapping the for loop
> in "if(buf)", instead of having an "if(!buf)" check.

Oops, yeah.  I meant to do that and then forgot.

Thanks,
Jeremy

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to