]> sigrok.org Git - libsigrok.git/blobdiff - hardware/cem-dt-885x/protocol.c
build: Portability fixes.
[libsigrok.git] / hardware / cem-dt-885x / protocol.c
index 74531b1eee9dbfbda9ab9cd4f354331afbe609eb..19e083062c69331230589be10ab7e6ec34bab4e2 100644 (file)
@@ -134,7 +134,7 @@ static void process_mset(const struct sr_dev_inst *sdi)
                analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
                analog.mqflags = devc->cur_mqflags;
                analog.unit = SR_UNIT_DECIBEL_SPL;
-               analog.probes = sdi->probes;
+               analog.channels = sdi->channels;
                analog.num_samples = 1;
                analog.data = &devc->last_spl;
                packet.type = SR_DF_ANALOG;
@@ -193,7 +193,7 @@ static void send_data(const struct sr_dev_inst *sdi, unsigned char *data,
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.mqflags = devc->cur_mqflags;
        analog.unit = SR_UNIT_DECIBEL_SPL;
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = num_samples;
        analog.data = fbuf;
        packet.type = SR_DF_ANALOG;
@@ -405,7 +405,7 @@ SR_PRIV int cem_dt_885x_receive_data(int fd, int revents, void *cb_data)
 }
 
 
-static int wait_for_token(const struct sr_dev_inst *sdi, char *tokens, int timeout)
+static int wait_for_token(const struct sr_dev_inst *sdi, int8_t *tokens, int timeout)
 {
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
@@ -440,8 +440,8 @@ static int wait_for_token(const struct sr_dev_inst *sdi, char *tokens, int timeo
 
 /* cmd is the command to send, tokens are the tokens that denote the state
  * which the command affects. The first token is the desired state. */
-SR_PRIV int cem_dt_885x_toggle(const struct sr_dev_inst *sdi, uint8_t cmd,
-               char *tokens, int timeout)
+static int cem_dt_885x_toggle(const struct sr_dev_inst *sdi, uint8_t cmd,
+               int8_t *tokens, int timeout)
 {
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
@@ -469,7 +469,7 @@ SR_PRIV gboolean cem_dt_885x_recording_get(const struct sr_dev_inst *sdi,
                int *state)
 {
        struct dev_context *devc;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
        if (devc->recording == -1) {
@@ -490,7 +490,7 @@ SR_PRIV int cem_dt_885x_recording_set(const struct sr_dev_inst *sdi,
 {
        struct dev_context *devc;
        int ret;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -526,7 +526,7 @@ SR_PRIV int cem_dt_885x_weight_freq_get(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        int cur_setting;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -544,14 +544,13 @@ SR_PRIV int cem_dt_885x_weight_freq_get(const struct sr_dev_inst *sdi)
                        return SR_MQFLAG_SPL_FREQ_WEIGHT_C;
        } else
                return cur_setting;
-
 }
 
 SR_PRIV int cem_dt_885x_weight_freq_set(const struct sr_dev_inst *sdi, int freqw)
 {
        struct dev_context *devc;
        int cur_setting, ret;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -589,7 +588,7 @@ SR_PRIV int cem_dt_885x_weight_time_get(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        int cur_setting;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -607,14 +606,13 @@ SR_PRIV int cem_dt_885x_weight_time_get(const struct sr_dev_inst *sdi)
                        return SR_MQFLAG_SPL_TIME_WEIGHT_S;
        } else
                return cur_setting;
-
 }
 
 SR_PRIV int cem_dt_885x_weight_time_set(const struct sr_dev_inst *sdi, int timew)
 {
        struct dev_context *devc;
        int cur_setting, ret;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -652,7 +650,7 @@ SR_PRIV int cem_dt_885x_holdmode_get(const struct sr_dev_inst *sdi,
                gboolean *holdmode)
 {
        struct dev_context *devc;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -677,7 +675,7 @@ SR_PRIV int cem_dt_885x_holdmode_set(const struct sr_dev_inst *sdi, int holdmode
 {
        struct dev_context *devc;
        int cur_setting, ret;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
 
@@ -721,7 +719,7 @@ SR_PRIV int cem_dt_885x_meas_range_get(const struct sr_dev_inst *sdi,
                uint64_t *low, uint64_t *high)
 {
        struct dev_context *devc;
-       char tokens[5];
+       int8_t tokens[5];
 
        devc = sdi->priv;
        if (devc->cur_meas_range == 0) {
@@ -764,7 +762,7 @@ SR_PRIV int cem_dt_885x_meas_range_set(const struct sr_dev_inst *sdi,
 {
        struct dev_context *devc;
        int ret;
-       char token, tokens[6];
+       int8_t token, tokens[6];
 
        devc = sdi->priv;
        if (low == 30 && high == 130)