From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZ6cG-0006Ng-Bo for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:33:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZ6cE-0006M7-GF for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:33:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZ6cE-0006Ll-6m for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:33:06 -0400 Received: from [24.93.47.43] (helo=ms-smtp-04.texas.rr.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FZ6f9-00057U-2D for qemu-devel@nongnu.org; Thu, 27 Apr 2006 09:36:07 -0400 Received: from [192.168.0.11] (cpe-67-9-160-120.austin.res.rr.com [67.9.160.120]) by ms-smtp-04.texas.rr.com (8.13.6/8.13.6) with ESMTP id k3RDTtFp029345 for ; Thu, 27 Apr 2006 08:29:56 -0500 (CDT) Message-ID: <4450C74F.7030304@austin.rr.com> Date: Thu, 27 Apr 2006 08:29:51 -0500 From: Lonnie Mendez MIME-Version: 1.0 Subject: Re: [Qemu-devel] Large USB-Patch Documentation and todays CVS patch References: <44501D2B.8070409@gmx.de> <5583.1146131284@www031.gmx.net> In-Reply-To: <5583.1146131284@www031.gmx.net> Content-Type: multipart/mixed; boundary="------------040609070202070003090903" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------040609070202070003090903 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Johannes Schindelin wrote: >>>Also, you rename some things when it has no apparent use to rename them, >>>such as usb_device_add, or product_name. >>> >>> >>> >>Sorry but on that point you say things which are in no case provable by >>any study. >> >> > >Also kindly look into line 1417 and 1419 of your patch. You will find the >renaming o f product_name to prod_name. > That was my doing. manufacturer_name product_name I have a habit of making related variables short and uniform in length. --------------040609070202070003090903 Content-Type: text/plain; name="qemu-usb-linux-vars.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-usb-linux-vars.diff" --- qemu/usb-linux.c 2006-04-27 08:18:38.000000000 -0500 +++ qemu/usb-linux.c 2006-04-27 08:26:04.000000000 -0500 @@ -44,9 +44,9 @@ typedef int USBScanFunc(void *opaque, int bus_num, int addr, int vendor_id, int product_id, - const char *spec_version, - const char *manf_string, - const char *prod_string); + const char *specification_version, + const char *manufacturer_string, + const char *product_string); static int usb_host_find_device(int *pbus_num, int *paddr, const char *devname); int usb_host_handle_close(USBDevice *opaque); @@ -282,9 +282,9 @@ char buf[1024]; int bus_num, addr, device_count, product_id, vendor_id; int ret; - char manf_name[512]; - char prod_name[512]; - char spec_version[6]; + char manufacturer_name[512]; + char product_name[512]; + char specification_version[6]; f = fopen(USBDEVFS_PATH "/devices", "r"); if (!f) { @@ -303,7 +303,7 @@ if (device_count && (vendor_id || product_id)) { /* New device. Add the previously discovered device. */ ret = func(opaque, bus_num, addr, vendor_id, product_id, - spec_version, manf_name, prod_name); + specification_version, manufacturer_name, product_name); if (ret) goto the_end; } @@ -313,9 +313,9 @@ if (get_tag_value(buf, sizeof(buf), line, "Dev#=", " ") < 0) goto fail; addr = atoi(buf); - strcpy(spec_version, "01.10"); - strcpy(manf_name, "unknown"); - strcpy(prod_name, "unknown"); + strcpy(specification_version, "01.10"); + strcpy(manufacturer_name, "unknown"); + strcpy(product_name, "unknown"); device_count++; product_id = 0; vendor_id = 0; @@ -323,7 +323,7 @@ if (get_tag_value(&buf[1], sizeof(buf) - 1, line, "Ver=", " ") < 0) goto fail; buf[0] = '0'; - pstrcpy(spec_version, sizeof(spec_version), buf); + pstrcpy(specification_version, sizeof(specification_version), buf); } else if (line[0] == 'P' && line[1] == ':') { if (get_tag_value(buf, sizeof(buf), line, "Vendor=", " ") < 0) goto fail; @@ -336,18 +336,18 @@ if (get_tag_value(buf, sizeof(buf), line, "Product=", "") < 0) { goto fail; } else { - pstrcpy(prod_name, sizeof(prod_name), buf); + pstrcpy(product_name, sizeof(product_name), buf); } } else { - pstrcpy(manf_name, sizeof(manf_name), buf); + pstrcpy(manufacturer_name, sizeof(manufacturer_name), buf); } } fail: ; } if (device_count && (vendor_id || product_id)) { /* Add the last device. */ - ret = func(opaque, bus_num, addr, vendor_id, product_id, spec_version, - manf_name, prod_name); + ret = func(opaque, bus_num, addr, vendor_id, product_id, + specification_version, manufacturer_name, product_name); } the_end: fclose(f); @@ -363,9 +363,9 @@ static int usb_host_find_device_scan(void *opaque, int bus_num, int addr, int vendor_id, int product_id, - const char *spec_version, - const char *manf_string, - const char *prod_string) + const char *specification_version, + const char *manufacturer_string, + const char *product_string) { FindDeviceState *s = opaque; if (vendor_id == s->vendor_id && @@ -408,14 +408,14 @@ static int usb_host_info_device(void *opaque, int bus_num, int addr, int vendor_id, int product_id, - const char *spec_ver, - const char *manf_string, - const char *prod_string) + const char *specification_version, + const char *manufacturer_string, + const char *product_string) { term_printf(" Device host:%03d:%03d, Manufacturer %s, Product %s\n", - bus_num, addr, manf_string, prod_string ); + bus_num, addr, manufacturer_string, product_string ); term_printf(" VendorID:ProductID %04xx%04x, USB-Standard: %s\n", - vendor_id, product_id, spec_ver ); + vendor_id, product_id, specification_version ); return 0; } --------------040609070202070003090903--