From: Uwe Hermann Date: Tue, 6 Jun 2017 12:10:02 +0000 (+0200) Subject: Drop trailing whitespace in various files. X-Git-Tag: libsigrok-0.5.0~23 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=176d785d33a28a1bb24f2ee483595ec54f7b52b6;p=libsigrok.git Drop trailing whitespace in various files. --- diff --git a/NEWS b/NEWS index 57fac4d7..d85237ae 100644 --- a/NEWS +++ b/NEWS @@ -155,7 +155,7 @@ Note: This release DOES change the libsigrok API. That means it is NOT - Check for the numpy Python module (bug #533). - Check for zip_discard(), provide alternative if not available (bug #674). * Portability: - - Android: Add fallbacks for missing stoi()/stod(). + - Android: Add fallbacks for missing stoi()/stod(). - FreeBSD: Fix a libusb related compiler error. - FreeBSD: Fix an issue with libusb_get_port_numbers(). - FreeBSD: Fix an issue with BSD Make (bug #556). diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index be76263a..03b81edb 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -768,7 +768,7 @@ vector> ChannelGroup::channels() return result; } -Trigger::Trigger(shared_ptr context, string name) : +Trigger::Trigger(shared_ptr context, string name) : _structure(sr_trigger_new(name.c_str())), _context(move(context)) { @@ -812,7 +812,7 @@ TriggerStage::TriggerStage(struct sr_trigger_stage *structure) : TriggerStage::~TriggerStage() { } - + int TriggerStage::number() const { return _structure->stage; diff --git a/bindings/java/org/sigrok/core/classes/classes.i b/bindings/java/org/sigrok/core/classes/classes.i index df372af8..75793b25 100644 --- a/bindings/java/org/sigrok/core/classes/classes.i +++ b/bindings/java/org/sigrok/core/classes/classes.i @@ -11,25 +11,25 @@ %pragma(java) jniclassimports=%{ /** * @mainpage API Reference - * + * * Introduction * ------------ - * + * * The sigrok-java API provides an object-oriented Java interface to the * functionality in libsigrok. It is built on top of the libsigrokcxx C++ API. - * + * * Getting started * --------------- - * + * * Usage of the sigrok-java API needs to begin with a call to Context.create(). * This will create the global libsigrok context and returns a Context object. * Methods on this object provide access to the hardware drivers, input and * output formats supported by the library, as well as means of creating other * objects such as sessions and triggers. - * + * * Error handling * -------------- - * + * * When any libsigrok C API call returns an error, an Error exception is raised, * which provides access to the error code and description. */ @@ -197,7 +197,7 @@ MAP_COMMON(const sigrok::ConfigKey *, Glib::VariantBase, ConfigKey, Variant) %typemap(in, numinputs=0) JNIEnv * %{ $1 = jenv; -%} +%} /* Thread safe JNIEnv handling */ diff --git a/bindings/java/org/sigrok/core/interfaces/LogCallback.java b/bindings/java/org/sigrok/core/interfaces/LogCallback.java index 24ef4ed7..d0840861 100644 --- a/bindings/java/org/sigrok/core/interfaces/LogCallback.java +++ b/bindings/java/org/sigrok/core/interfaces/LogCallback.java @@ -2,7 +2,7 @@ package org.sigrok.core.interfaces; import org.sigrok.core.classes.LogLevel; -public interface LogCallback +public interface LogCallback { public void run(LogLevel loglevel, String message); } diff --git a/src/hardware/asix-sigma/protocol.h b/src/hardware/asix-sigma/protocol.h index 7e5d8497..e84badd9 100644 --- a/src/hardware/asix-sigma/protocol.h +++ b/src/hardware/asix-sigma/protocol.h @@ -276,7 +276,7 @@ struct dev_context { extern SR_PRIV const uint64_t samplerates[]; extern SR_PRIV const size_t samplerates_count; -SR_PRIV int sigma_write_register(uint8_t reg, uint8_t *data, size_t len, +SR_PRIV int sigma_write_register(uint8_t reg, uint8_t *data, size_t len, struct dev_context *devc); SR_PRIV int sigma_set_register(uint8_t reg, uint8_t value, struct dev_context *devc); SR_PRIV int sigma_write_trigger_lut(struct triggerlut *lut, struct dev_context *devc); diff --git a/src/hardware/brymen-dmm/parser.c b/src/hardware/brymen-dmm/parser.c index a5e8333a..2f55cdf7 100644 --- a/src/hardware/brymen-dmm/parser.c +++ b/src/hardware/brymen-dmm/parser.c @@ -130,21 +130,21 @@ SR_PRIV gboolean brymen_packet_is_valid(const uint8_t *buf) int i; uint8_t chksum = 0; uint8_t *payload; - + payload = (uint8_t *)(buf + sizeof(struct brymen_header)); hdr = (void *)buf; tail = (void *)(payload + hdr->len); - + for (i = 0; i< hdr->len; i++) chksum ^= payload[i]; - + if (tail->checksum != chksum) { sr_dbg("Packet has invalid checksum 0x%.2x. Expected 0x%.2x.", chksum, tail->checksum); return FALSE; } - + return TRUE; } diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 856e5185..3f80b93e 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -709,7 +709,7 @@ static int config_set(uint32_t key, GVariant *data, if (i < 0) return SR_ERR_ARG; devc->dslogic_clock_edge = i; - break; + break; default: ret = SR_ERR_NA; } diff --git a/src/hardware/fx2lafw/dslogic.c b/src/hardware/fx2lafw/dslogic.c index a7a50f7f..a3c45be9 100644 --- a/src/hardware/fx2lafw/dslogic.c +++ b/src/hardware/fx2lafw/dslogic.c @@ -363,7 +363,7 @@ SR_PRIV int dslogic_fpga_configure(const struct sr_dev_inst *sdi) v16 |= 1 << 2; } if (devc->limit_samples > DS_MAX_LOGIC_DEPTH * - ceil(devc->cur_samplerate * 1.0 / DS_MAX_LOGIC_SAMPLERATE) + ceil(devc->cur_samplerate * 1.0 / DS_MAX_LOGIC_SAMPLERATE) && !devc->dslogic_continuous_mode) { /* Enable RLE for long captures. * Without this, captured data present errors. diff --git a/src/hardware/gwinstek-gds-800/protocol.c b/src/hardware/gwinstek-gds-800/protocol.c index 723b4212..604ec54f 100644 --- a/src/hardware/gwinstek-gds-800/protocol.c +++ b/src/hardware/gwinstek-gds-800/protocol.c @@ -135,7 +135,7 @@ SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data) if (devc->cur_acq_frame == devc->frame_limit - 1) { /* All frames accquired. */ sr_spew("All frames acquired."); - + sdi->driver->dev_acquisition_stop(sdi); return TRUE; } else { @@ -143,7 +143,7 @@ SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data) if (devc->df_started) { packet.type = SR_DF_FRAME_END; sr_session_send(sdi, &packet); - + packet.type = SR_DF_FRAME_BEGIN; sr_session_send(sdi, &packet); } @@ -271,7 +271,7 @@ SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data) if (devc->df_started) { packet.type = SR_DF_FRAME_END; sr_session_send(sdi, &packet); - + packet.type = SR_DF_FRAME_BEGIN; sr_session_send(sdi, &packet); } diff --git a/src/hardware/link-mso19/protocol.c b/src/hardware/link-mso19/protocol.c index 3952dd99..29aacbda 100644 --- a/src/hardware/link-mso19/protocol.c +++ b/src/hardware/link-mso19/protocol.c @@ -100,7 +100,7 @@ SR_PRIV int mso_configure_trigger(const struct sr_dev_inst *sdi) trigger_config |= 0x20; //DSO level trigger & width < trigger_width break; case 2: - trigger_config |= 0x40; //DSO level trigger & width >= trigger_width + trigger_config |= 0x40; //DSO level trigger & width >= trigger_width break; case 3: trigger_config |= 0x60; //LA combination trigger diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index ca050bf6..269b99f7 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -113,7 +113,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (p_ols_open(devc) != SR_OK) { goto err_free_ftdic; } - + /* The discovery procedure is like this: first send the Reset * command (0x00) 5 times, since the device could be anywhere * in a 5-byte command. Then send the ID command (0x02). @@ -642,8 +642,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) sr_dbg("flag_reg = %x", devc->flag_reg); /* - * In demux mode the OLS is processing two 8-bit or 16-bit samples - * in parallel and for this to work the lower two bits of the four + * In demux mode the OLS is processing two 8-bit or 16-bit samples + * in parallel and for this to work the lower two bits of the four * "channel_disable" bits must be replicated to the upper two bits. */ flag_tmp = devc->flag_reg; diff --git a/src/hardware/pipistrello-ols/protocol.c b/src/hardware/pipistrello-ols/protocol.c index 421934b2..9948944d 100644 --- a/src/hardware/pipistrello-ols/protocol.c +++ b/src/hardware/pipistrello-ols/protocol.c @@ -128,7 +128,7 @@ SR_PRIV int p_ols_open(struct dev_context *devc) goto err_open_close_ftdic; } sr_dbg("FTDI chip read data chunk size set successfully."); - + return SR_OK; err_open_close_ftdic: @@ -443,7 +443,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) sr_spew("Received byte 0x%.2x.", byte); if ((devc->flag_reg & FLAG_DEMUX) && (devc->flag_reg & FLAG_RLE)) { - /* RLE in demux mode must be processed differently + /* RLE in demux mode must be processed differently * since in this case the RLE encoder is operating on pairs of samples. */ if (devc->num_bytes == num_channels * 2) { @@ -499,7 +499,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) * sample. */ devc->tmp_sample[i] = devc->sample[j++]; - } + } } /* Clear out the most significant bit of the sample */ devc->tmp_sample[devc->num_bytes - 1] &= 0x7f; @@ -517,7 +517,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) * sample. */ devc->tmp_sample2[i] = devc->sample[j++]; - } + } } /* Clear out the most significant bit of the sample */ devc->tmp_sample2[devc->num_bytes - 1] &= 0x7f; @@ -597,7 +597,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) * sample. */ devc->tmp_sample[i] = devc->sample[j++]; - } + } } memcpy(devc->sample, devc->tmp_sample, 4); sr_spew("Expanded sample: 0x%.8x.", sample); diff --git a/src/hardware/rigol-ds/protocol.c b/src/hardware/rigol-ds/protocol.c index e68fb08e..39462c28 100644 --- a/src/hardware/rigol-ds/protocol.c +++ b/src/hardware/rigol-ds/protocol.c @@ -177,7 +177,7 @@ static int rigol_ds_trigger_wait(const struct sr_dev_inst *sdi) if (!(devc = sdi->priv)) return SR_ERR; - /* + /* * If timebase < 50 msecs/DIV just sleep about one sweep time except * for really fast sweeps. */ diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index 32f5de7b..445b4274 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/api.c @@ -137,7 +137,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_ERR_DEV_CLOSED; std_session_send_df_header(sdi); - + sr_sw_limits_acquisition_start(&devc->limits); /* Poll every 500ms, or whenever some data comes in. */ diff --git a/src/hardware/uni-t-dmm/protocol.c b/src/hardware/uni-t-dmm/protocol.c index 5503584e..c0ed21f3 100644 --- a/src/hardware/uni-t-dmm/protocol.c +++ b/src/hardware/uni-t-dmm/protocol.c @@ -102,7 +102,7 @@ static int hid_chip_init(struct sr_dev_inst *sdi, uint16_t baudrate) struct sr_usb_dev_inst *usb; usb = sdi->conn; - + /* Detach kernel drivers which grabbed this device (if any). */ if (libusb_kernel_driver_active(usb->devhdl, 0) == 1) { ret = libusb_detach_kernel_driver(usb->devhdl, 0); diff --git a/src/input/vcd.c b/src/input/vcd.c index 1f200330..8d6edd1d 100644 --- a/src/input/vcd.c +++ b/src/input/vcd.c @@ -26,7 +26,7 @@ * * skip: Allows skipping until given timestamp in the file. * This can speed up analyzing of long captures. - * + * * Value < 0: Skip until first timestamp listed in * the file. (default) * diff --git a/src/modbus/modbus_serial_rtu.c b/src/modbus/modbus_serial_rtu.c index 2cb589b9..21205d94 100644 --- a/src/modbus/modbus_serial_rtu.c +++ b/src/modbus/modbus_serial_rtu.c @@ -152,11 +152,11 @@ static int modbus_serial_rtu_read_data(void *priv, uint8_t *buf, int maxlen) struct modbus_serial_rtu *modbus = priv; int ret; - ret = serial_read_nonblocking(modbus->serial, buf, maxlen); + ret = serial_read_nonblocking(modbus->serial, buf, maxlen); if (ret < 0) return ret; - modbus->crc = modbus_serial_rtu_crc(modbus->crc, buf, ret); - return ret; + modbus->crc = modbus_serial_rtu_crc(modbus->crc, buf, ret); + return ret; } static int modbus_serial_rtu_read_end(void *priv) diff --git a/src/output/wav.c b/src/output/wav.c index b266b203..6984c03d 100644 --- a/src/output/wav.c +++ b/src/output/wav.c @@ -46,7 +46,7 @@ static int realloc_chanbufs(const struct sr_output *o, int size) outc = o->priv; for (i = 0; i < outc->num_channels; i++) { - if (!(outc->chanbuf[i] = g_try_realloc(outc->chanbuf[i], sizeof(float) * size))) { + if (!(outc->chanbuf[i] = g_try_realloc(outc->chanbuf[i], sizeof(float) * size))) { sr_err("Unable to allocate enough output buffer memory."); return SR_ERR; } diff --git a/src/scpi/scpi_usbtmc_libusb.c b/src/scpi/scpi_usbtmc_libusb.c index decafdb6..5e8b2676 100644 --- a/src/scpi/scpi_usbtmc_libusb.c +++ b/src/scpi/scpi_usbtmc_libusb.c @@ -617,7 +617,7 @@ static int scpi_usbtmc_libusb_close(struct sr_scpi_dev_inst *scpi) if ((ret = libusb_release_interface(usb->devhdl, uscpi->interface)) < 0) sr_err("Failed to release interface: %s.", libusb_error_name(ret)); - + if (uscpi->detached_kernel_driver) { if ((ret = libusb_attach_kernel_driver(usb->devhdl, uscpi->interface)) < 0) diff --git a/src/usb.c b/src/usb.c index 35a3e80e..f53119a6 100644 --- a/src/usb.c +++ b/src/usb.c @@ -393,7 +393,7 @@ SR_PRIV GSList *sr_usb_find(libusb_context *usb_ctx, const char *conn) libusb_free_device_list(devlist, 1); sr_dbg("Found %d device(s).", g_slist_length(devices)); - + return devices; }