]> sigrok.org Git - libserialport.git/commitdiff
Random minor whitespace fixes.
authorUwe Hermann <redacted>
Sat, 28 Dec 2019 18:23:30 +0000 (19:23 +0100)
committerUwe Hermann <redacted>
Sat, 28 Dec 2019 18:23:30 +0000 (19:23 +0100)
serialport.c
windows.c

index 1b71cdbe59eb47ea84520157e0a9ec6998310979..f9b78bf0fee09d2d78e7c5dbb0193c2bec8d8acb 100644 (file)
@@ -323,7 +323,8 @@ SP_PRIV struct sp_port **list_append(struct sp_port **list,
        void *tmp;
        unsigned int count;
 
-       for (count = 0; list[count]; count++);
+       for (count = 0; list[count]; count++)
+               ;
        if (!(tmp = realloc(list, sizeof(struct sp_port *) * (count + 2))))
                goto fail;
        list = tmp;
@@ -1031,7 +1032,7 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf,
 
 #else
        size_t bytes_read = 0;
-       unsigned char *ptr = (unsigned char *) buf;
+       unsigned char *ptr = (unsigned char *)buf;
        struct timeval start, delta, now, end = {0, 0};
        int started = 0;
        fd_set fds;
@@ -1454,7 +1455,8 @@ SP_API enum sp_return sp_wait(struct sp_event_set *event_set,
 #else
        struct timeval start, delta, now, end = {0, 0};
        const struct timeval max_delta = {
-               (INT_MAX / 1000), (INT_MAX % 1000) * 1000};
+               (INT_MAX / 1000), (INT_MAX % 1000) * 1000
+       };
        int started = 0, timeout_overflow = 0;
        int result, timeout_remaining_ms;
        struct pollfd *pollfds;
@@ -1464,7 +1466,7 @@ SP_API enum sp_return sp_wait(struct sp_event_set *event_set,
                RETURN_ERROR(SP_ERR_MEM, "pollfds malloc() failed");
 
        for (i = 0; i < event_set->count; i++) {
-               pollfds[i].fd = ((int *) event_set->handles)[i];
+               pollfds[i].fd = ((int *)event_set->handles)[i];
                pollfds[i].events = 0;
                pollfds[i].revents = 0;
                if (event_set->masks[i] & SP_EVENT_RX_READY)
index 72ce3071ea45831456a42ef5166c359c46b703cf..ee15a11964a900e6224bb1ec93ac2e59dade22bf 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -220,7 +220,7 @@ static void enumerate_hub_ports(struct sp_port *port, HANDLE hub_device,
                        port->usb_pid = connection_info_ex->DeviceDescriptor.idProduct;
 
                        if (connection_info_ex->DeviceDescriptor.iManufacturer)
-                               port->usb_manufacturer = get_string_descriptor(hub_device,index,
+                               port->usb_manufacturer = get_string_descriptor(hub_device, index,
                                           connection_info_ex->DeviceDescriptor.iManufacturer);
                        if (connection_info_ex->DeviceDescriptor.iProduct)
                                port->usb_product = get_string_descriptor(hub_device, index,
@@ -381,7 +381,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port)
                        continue;
                }
                RegCloseKey(device_key);
-               value[sizeof(value)-1] = 0;
+               value[sizeof(value) - 1] = 0;
                if (strcmp(value, port->name))
                        continue;