diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b48ec3..b41eab3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,9 @@ ADD_EXECUTABLE(dsd-fme ${SRCS} ${HEADERS}) TARGET_LINK_LIBRARIES(dsd-fme ${LIBS}) target_compile_options(dsd-fme PRIVATE -Wunused-but-set-variable -Wunused-variable -Wunused-parameter - -Wempty-body -Wunused-label $<$:-Wpointer-sign>) + -Wempty-body -Wunused-label $<$:-Wpointer-sign> + -Wmisleading-indentation -Wparentheses -Wunused-value -Wreturn-type + -Wtautological-compare) include(GNUInstallDirs) install(TARGETS dsd-fme DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/include/dsd.h b/include/dsd.h index 3927f3b..a8e5c3d 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -1433,8 +1433,8 @@ int csvKeyImportHex(dsd_opts * opts, dsd_state * state); //UDP Socket Connect and UDP Socket Blaster (audio output) int udp_socket_connect(dsd_opts * opts, dsd_state * state); int udp_socket_connectA(dsd_opts * opts, dsd_state * state); -int udp_socket_blaster(dsd_opts * opts, dsd_state * state, size_t nsam, void * data); -int udp_socket_blasterA(dsd_opts * opts, dsd_state * state, size_t nsam, void * data); +void udp_socket_blaster(dsd_opts * opts, dsd_state * state, size_t nsam, void * data); +void udp_socket_blasterA(dsd_opts * opts, dsd_state * state, size_t nsam, void * data); int m17_socket_receiver(dsd_opts * opts, void * data); int udp_socket_connectM17(dsd_opts * opts, dsd_state * state); int m17_socket_blaster(dsd_opts * opts, dsd_state * state, size_t nsam, void * data); diff --git a/src/dsd_frame.c b/src/dsd_frame.c index 577169c..18f352a 100644 --- a/src/dsd_frame.c +++ b/src/dsd_frame.c @@ -113,7 +113,7 @@ processFrame (dsd_opts * opts, dsd_state * state) return; } //Start DMR Types - else if ((state->synctype >= 10) && (state->synctype <= 13) || (state->synctype == 32) || (state->synctype == 33) || (state->synctype == 34) ) //32-34 DMR MS and RC + else if ((state->synctype >= 10 && state->synctype <= 13) || (state->synctype == 32) || (state->synctype == 33) || (state->synctype == 34) ) //32-34 DMR MS and RC { //print manufacturer strings to branding, disabled 0x10 moto other systems can use that fid set diff --git a/src/dsd_frame_sync.c b/src/dsd_frame_sync.c index 062bb20..827c6d7 100644 --- a/src/dsd_frame_sync.c +++ b/src/dsd_frame_sync.c @@ -876,7 +876,7 @@ getFrameSync (dsd_opts * opts, dsd_state * state) state->min = ((state->min) + lmin) / 2; //state->directmode = 0; //fprintf (stderr, "DMR RC DATA\n"); - state->dmr_ms_rc == 1; //set flag for RC data, then process accordingly and reset back to 0 afterwards + state->dmr_ms_rc = 1; //set flag for RC data, then process accordingly and reset back to 0 afterwards if (0 == 0) //opts->inverted_dmr { // voice frame diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index a5442af..f5f6e1d 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2533,12 +2533,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw (" G: AGC;"); else printw (" G: %idB;", opts->rtl_gain_value); - printw (" V: %iX;", opts->rtl_volume_multiplier); - printw (" PPM: %i;", opts->rtlsdr_ppm_error); - printw (" SQ: %i;", opts->rtl_squelch_level); - printw (" RMS: %04li;", opts->rtl_rms); - printw (" BW: %i;", opts->rtl_bandwidth); - printw (" FRQ: %i;", opts->rtlsdr_center_freq); + printw (" V: %iX;", opts->rtl_volume_multiplier); + printw (" PPM: %i;", opts->rtlsdr_ppm_error); + printw (" SQ: %i;", opts->rtl_squelch_level); + printw (" RMS: %04li;", opts->rtl_rms); + printw (" BW: %i;", opts->rtl_bandwidth); + printw (" FRQ: %i;", opts->rtlsdr_center_freq); if (opts->rtl_udp_port != 0) printw ("\n| External RTL Tuning on UDP Port: %i", opts->rtl_udp_port); printw ("\n"); } @@ -2864,11 +2864,13 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) { printw ("| Voice Error: [%X][%X] Slot 1 (1)", state->errs&0xF, state->errs2&0xF); if (opts->slot1_on == 0) printw (" OFF"); - if (opts->slot1_on == 1) printw (" ON"); if (opts->slot_preference == 0) printw (" *Preferred"); + if (opts->slot1_on == 1) printw (" ON"); + if (opts->slot_preference == 0) printw (" *Preferred"); printw ("\n"); printw ("| Voice Error: [%X][%X] Slot 2 (2)", state->errsR&0xF, state->errs2R&0xF); if (opts->slot2_on == 0) printw (" OFF"); - if (opts->slot2_on == 1) printw (" ON"); if (opts->slot_preference == 1) printw (" *Preferred"); + if (opts->slot2_on == 1) printw (" ON"); + if (opts->slot_preference == 1) printw (" *Preferred"); printw ("\n"); } printw ("------------------------------------------------------------------------------\n"); diff --git a/src/dsd_rigctl.c b/src/dsd_rigctl.c index 581981e..4b75fd5 100644 --- a/src/dsd_rigctl.c +++ b/src/dsd_rigctl.c @@ -299,7 +299,7 @@ void rtl_udp_tune(dsd_opts * opts, dsd_state * state, long int frequency) close (handle); //close socket after sending. } -int udp_socket_blaster(dsd_opts * opts, dsd_state * state, size_t nsam, void * data) +void udp_socket_blaster(dsd_opts * opts, dsd_state * state, size_t nsam, void * data) { UNUSED(state); size_t err = 0; @@ -337,7 +337,7 @@ int m17_socket_receiver(dsd_opts * opts, void * data) } //Analog UDP port on +2 of normal open socket -int udp_socket_blasterA(dsd_opts * opts, dsd_state * state, size_t nsam, void * data) +void udp_socket_blasterA(dsd_opts * opts, dsd_state * state, size_t nsam, void * data) { UNUSED(state); size_t err = 0; @@ -404,6 +404,7 @@ int udp_socket_connect(dsd_opts * opts, dsd_state * state) return (err); } + return 0; } int udp_socket_connectA(dsd_opts * opts, dsd_state * state) @@ -443,6 +444,7 @@ int udp_socket_connectA(dsd_opts * opts, dsd_state * state) return (err); } + return 0; } int udp_socket_connectM17(dsd_opts * opts, dsd_state * state) @@ -482,6 +484,7 @@ int udp_socket_connectM17(dsd_opts * opts, dsd_state * state) return (err); } + return 0; } void return_to_cc (dsd_opts * opts, dsd_state * state) diff --git a/src/edacs-bch3.c b/src/edacs-bch3.c index 30e40a9..79e009d 100644 --- a/src/edacs-bch3.c +++ b/src/edacs-bch3.c @@ -436,10 +436,10 @@ decode_bch() d[u + 1] = alpha_to[s[u + 1]]; else d[u + 1] = 0; - for (i = 1; i <= l[u + 1]; i++) - if ((s[u + 1 - i] != -1) && (elp[u + 1][i] != 0)) - d[u + 1] ^= alpha_to[(s[u + 1 - i] - + index_of[elp[u + 1][i]]) % n]; + for (i = 1; i <= l[u + 1]; i++) + if ((s[u + 1 - i] != -1) && (elp[u + 1][i] != 0)) + d[u + 1] ^= alpha_to[(s[u + 1 - i] + + index_of[elp[u + 1][i]]) % n]; /* put d[u+1] into index form */ d[u + 1] = index_of[d[u + 1]]; } diff --git a/src/edacs-fme.c b/src/edacs-fme.c index 22eae8a..36cc417 100644 --- a/src/edacs-fme.c +++ b/src/edacs-fme.c @@ -723,7 +723,7 @@ void edacs(dsd_opts * opts, dsd_state * state) int plan = bank * 8; int first = 1; while (resident != 0) { - if (resident & 0x1 == 1) { + if ((resident & 0x1) == 1) { if (first == 1) { first = 0; @@ -743,7 +743,7 @@ void edacs(dsd_opts * opts, dsd_state * state) plan = bank * 8; first = 1; while (active != 0) { - if (active & 0x1 == 1) { + if ((active & 0x1) == 1) { if (first == 1) { first = 0; @@ -914,7 +914,7 @@ void edacs(dsd_opts * opts, dsd_state * state) int source = (msg_2 & 0xFFFFF); //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0) { state->edacs_vc_lcn = lcn; } state->lasttg = group; // 0 is a valid TG, it's the all-call for agency 0 if (source != 0) state->lastsrc = source; @@ -1156,7 +1156,7 @@ void edacs(dsd_opts * opts, dsd_state * state) int source = (msg_2 & 0xFFFFF); //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0) { state->edacs_vc_lcn = lcn; } state->lasttg = 0; if (source != 0) state->lastsrc = source; @@ -1327,7 +1327,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0){state->edacs_vc_lcn = lcn;} state->lasttg = group; state->lastsrc = lid; @@ -1434,7 +1434,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0){state->edacs_vc_lcn = lcn;} state->lasttg = target; state->lastsrc = 0; @@ -1497,7 +1497,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0){state->edacs_vc_lcn = lcn;} state->lasttg = 0; state->lastsrc = target; @@ -1567,7 +1567,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0){state->edacs_vc_lcn = lcn;} state->lasttg = target; //Alas, EDACS standard does not provide a source LID on channel updates - try to work around this on the display end instead state->lastsrc = 0; @@ -1706,7 +1706,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0){state->edacs_vc_lcn = lcn;} state->lasttg = target; state->lastsrc = source; @@ -1835,7 +1835,7 @@ void edacs(dsd_opts * opts, dsd_state * state) int plan = bank * 8; int first = 1; while (resident != 0) { - if (resident & 0x1 == 1) { + if ((resident & 0x1) == 1) { if (first == 1) { first = 0; @@ -1855,7 +1855,7 @@ void edacs(dsd_opts * opts, dsd_state * state) plan = bank * 8; first = 1; while (active != 0) { - if (active & 0x1 == 1) { + if ((active & 0x1) == 1) { if (first == 1) { first = 0; @@ -2001,7 +2001,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //Call info for state - if (lcn != 0) state->edacs_vc_lcn = lcn; + if (lcn != 0){state->edacs_vc_lcn = lcn;} state->lasttg = 0; state->lastsrc = lid; diff --git a/src/m17.c b/src/m17.c index c53371c..d7f7217 100644 --- a/src/m17.c +++ b/src/m17.c @@ -1112,7 +1112,7 @@ void processM17LSF_debug2(dsd_opts * opts, dsd_state * state, uint8_t * m17_rnd_ for (j = 0; j < 30; j++) { for (i = 0; i < 8; i++) - state->m17_lsf[k++] = (lsf_packed[j] >> 7-i) & 1; + state->m17_lsf[k++] = (lsf_packed[j] >> (7-i)) & 1; } uint16_t crc_cmp = crc16m17(lsf_packed, 28); @@ -1618,7 +1618,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //compose the 16-bit frame information from the above sub elements uint16_t lsf_fi = 0; lsf_fi = (lsf_ps & 1) + (lsf_dt << 1) + (lsf_et << 3) + (lsf_es << 5) + (lsf_cn << 7) + (lsf_rs << 11); - for (i = 0; i < 16; i++) m17_lsf[96+i] = (lsf_fi >> 15-i) & 1; + for (i = 0; i < 16; i++) m17_lsf[96+i] = (lsf_fi >> (15-i)) & 1; //Convert base40 CSD to numerical values (lifted from libM17) @@ -1677,8 +1677,8 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //TODO: Read UDP ACKN/NACK value, disable use_ip if NULL or nack return //load dst and src values into the LSF - for (i = 0; i < 48; i++) m17_lsf[i] = (dst >> 47ULL-(unsigned long long int)i) & 1; - for (i = 0; i < 48; i++) m17_lsf[i+48] = (src >> 47ULL-(unsigned long long int)i) & 1; + for (i = 0; i < 48; i++) m17_lsf[i] = (dst >> (47ULL-(unsigned long long int)i)) & 1; + for (i = 0; i < 48; i++) m17_lsf[i+48] = (src >> (47ULL-(unsigned long long int)i)) & 1; //load the nonce from packed bytes to a bitwise iv array uint8_t iv[112]; memset(iv, 0, sizeof(iv)); @@ -1686,7 +1686,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) for (j = 0; j < 14; j++) { for (i = 0; i < 8; i++) - iv[k++] = (nonce[j] >> 7-i)&1; + iv[k++] = (nonce[j] >> (7-i))&1; } //if AES enc employed, insert the iv into LSF @@ -1705,7 +1705,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) crc_cmp = crc16m17(lsf_packed, 28); //attach the crc16 bits to the end of the LSF data - for (i = 0; i < 16; i++) m17_lsf[224+i] = (crc_cmp >> 15-i) & 1; + for (i = 0; i < 16; i++) m17_lsf[224+i] = (crc_cmp >> (15-i)) & 1; //pack the CRC for (i = 28; i < 30; i++) @@ -1776,8 +1776,8 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) { state->m17_meta[14] <<= 1; state->m17_meta[15] <<= 1; - state->m17_meta[14] += ((fsn >> 7) >> 7-i) & 1; - state->m17_meta[15] += ((fsn >> 0) >> 7-i) & 1; + state->m17_meta[14] += ((fsn >> 7) >> (7-i)) & 1; + state->m17_meta[15] += ((fsn >> 0) >> (7-i)) & 1; } } } @@ -2027,8 +2027,8 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) { for (i = 0; i < 8; i++) { - v1_bits[k++] = (vc1_bytes[j] >> 7-i) & 1; - v2_bits[x++] = (vc2_bytes[j] >> 7-i) & 1; + v1_bits[k++] = (vc1_bytes[j] >> (7-i)) & 1; + v2_bits[x++] = (vc2_bytes[j] >> (7-i)) & 1; } } @@ -2064,7 +2064,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //set current frame number as bits 1-15 of the v1 stream for (i = 0; i < 15; i++) - m17_v1[i+1] = ( (uint8_t)(fsn >> 14-i) ) &1; + m17_v1[i+1] = ( (uint8_t)(fsn >> (14-i)) ) &1; //Use the convolutional encoder to encode the voice / data stream simple_conv_encoder (m17_v1, m17_v1c, 148); //was 144, not 144+4 @@ -2199,14 +2199,14 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) for (j = 0; j < 4; j++) { for (i = 0; i < 8; i++) - m17_ip_frame[k++] = (magic[j] >> 7-i) &1; + m17_ip_frame[k++] = (magic[j] >> (7-i)) &1; } //add StreamID for (j = 0; j < 2; j++) { for (i = 0; i < 8; i++) - m17_ip_frame[k++] = (sid[j] >> 7-i) &1; + m17_ip_frame[k++] = (sid[j] >> (7-i)) &1; } //add the current LSF, sans CRC @@ -2218,7 +2218,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //add current fsn value for (i = 0; i < 15; i++) - m17_ip_frame[k++] = (fsn >> 14-i)&1; + m17_ip_frame[k++] = (fsn >> (14-i))&1; //voice and/or data payload for (i = 0; i < 64; i++) @@ -2235,7 +2235,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //add CRC value to the ip frame for (i = 0; i < 16; i++) - m17_ip_frame[k++] = (ip_crc >> 15-i)&1; + m17_ip_frame[k++] = (ip_crc >> (15-i))&1; //pack CRC into the byte array as well for (i = 52; i < 54; i++) @@ -2277,14 +2277,14 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) for (j = 0; j < 4; j++) { for (i = 0; i < 8; i++) - m17_ip_frame[k++] = (magic[j] >> 7-i) &1; + m17_ip_frame[k++] = (magic[j] >> (7-i)) &1; } //add StreamID for (j = 0; j < 2; j++) { for (i = 0; i < 8; i++) - m17_ip_frame[k++] = (sid[j] >> 7-i) &1; + m17_ip_frame[k++] = (sid[j] >> (7-i)) &1; } //add the current LSF, sans CRC @@ -2296,7 +2296,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //add current fsn value for (i = 0; i < 15; i++) - m17_ip_frame[k++] = (fsn >> 14-i)&1; + m17_ip_frame[k++] = (fsn >> (14-i))&1; //voice and/or data payload for (i = 0; i < 64; i++) @@ -2313,7 +2313,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) //add CRC value to the ip frame for (i = 0; i < 16; i++) - m17_ip_frame[k++] = (ip_crc >> 15-i)&1; + m17_ip_frame[k++] = (ip_crc >> (15-i))&1; //pack CRC into the byte array as well for (i = 52; i < 54; i++) @@ -2357,7 +2357,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) for (j = 0; j < 14; j++) { for (i = 0; i < 8; i++) - iv[k++] = (nonce[j] >> 7-i)&1; + iv[k++] = (nonce[j] >> (7-i))&1; } //if AES enc employed, insert the iv into LSF @@ -2373,7 +2373,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) crc_cmp = crc16m17(lsf_packed, 28); //attach the crc16 bits to the end of the LSF data - for (i = 0; i < 16; i++) m17_lsf[224+i] = (crc_cmp >> 15-i) & 1; + for (i = 0; i < 16; i++) m17_lsf[224+i] = (crc_cmp >> (15-i)) & 1; //repack the CRC for (i = 28; i < 30; i++) @@ -2702,7 +2702,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) //compose the 16-bit frame information from the above sub elements uint16_t lsf_fi = 0; lsf_fi = (lsf_ps & 1) + (lsf_dt << 1) + (lsf_et << 3) + (lsf_es << 5) + (lsf_cn << 7) + (lsf_rs << 11); - for (i = 0; i < 16; i++) m17_lsf[96+i] = (lsf_fi >> 15-i) & 1; + for (i = 0; i < 16; i++) m17_lsf[96+i] = (lsf_fi >> (15-i)) & 1; //Convert base40 CSD to numerical values (lifted from libM17) @@ -2739,8 +2739,8 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) //end CSD conversion //load dst and src values into the LSF - for (i = 0; i < 48; i++) m17_lsf[i] = (dst >> 47ULL-(unsigned long long int)i) & 1; - for (i = 0; i < 48; i++) m17_lsf[i+48] = (src >> 47ULL-(unsigned long long int)i) & 1; + for (i = 0; i < 48; i++) m17_lsf[i] = (dst >> (47ULL-(unsigned long long int)i)) & 1; + for (i = 0; i < 48; i++) m17_lsf[i+48] = (src >> (47ULL-(unsigned long long int)i)) & 1; //TODO: Any extra meta fills (extended callsign, etc?) @@ -2753,7 +2753,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) crc_cmp = crc16m17(lsf_packed, 28); //attach the crc16 bits to the end of the LSF data - for (i = 0; i < 16; i++) m17_lsf[224+i] = (crc_cmp >> 15-i) & 1; + for (i = 0; i < 16; i++) m17_lsf[224+i] = (crc_cmp >> (15-i)) & 1; //pack the CRC for (i = 28; i < 30; i++) @@ -2802,7 +2802,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) //load protocol value into first 8 bits k = 0; for (i = 0; i < 8; i++) - m17_p1_full[k++] = (protocol >> 7-i) & 1; + m17_p1_full[k++] = (protocol >> (7-i)) & 1; //byte representation of a single string char uint8_t cbyte; @@ -2841,7 +2841,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) fprintf (stderr, "%c", cbyte); for (j = 0; j < 8; j++) - m17_p1_full[k++] = (cbyte >> 7-j) & 1; + m17_p1_full[k++] = (cbyte >> (7-j)) & 1; if (cbyte == 0) break; //if terminator reached @@ -2903,7 +2903,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) //attach the crc16 bits to the end of the PKT data // for (i = 0; i < 16; i++) m17_p1_full[ptr+i] = (crc_cmp >> 15-i) & 1; //this one puts it as the last 16-bits of the full payload - for (i = 0; i < 16; i++) m17_p1_full[k++] = (crc_cmp >> 15-i) & 1; //this one puts it immediately after the terminating byte + for (i = 0; i < 16; i++) m17_p1_full[k++] = (crc_cmp >> (15-i)) & 1; //this one puts it immediately after the terminating byte //debug the full payload fprintf (stderr, "\n M17 Packet FULL: "); @@ -2978,7 +2978,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) for (j = 0; j < 4; j++) { for (i = 0; i < 8; i++) - m17_ip_frame[k++] = (mpkt[j] >> 7-i) &1; + m17_ip_frame[k++] = (mpkt[j] >> (7-i)) &1; } //randomize ID @@ -2990,7 +2990,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) for (j = 0; j < 2; j++) { for (i = 0; i < 8; i++) - m17_ip_frame[k++] = (sid[j] >> 7-i) &1; + m17_ip_frame[k++] = (sid[j] >> (7-i)) &1; } //add the current LSF, sans CRC @@ -3011,7 +3011,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) //add CRC value to the ip frame uint8_t crc_bits[16]; memset (crc_bits, 0, sizeof(crc_bits)); for (i = 0; i < 16; i++) - crc_bits[i] = (ip_crc >> 15-i)&1; + crc_bits[i] = (ip_crc >> (15-i))&1; //pack CRC into the byte array as well for (i = x+34+1, j = 0; i < (x+34+3); i++, j++) //double check this @@ -3092,7 +3092,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) //set pbc counter to last 5 bits for (i = 0; i < 5; i++) - m17_p1[201+i] = (pbc >> 4-i) & 1; + m17_p1[201+i] = (pbc >> (4-i)) & 1; //Use the convolutional encoder to encode the packet data simple_conv_encoder (m17_p1, m17_p2c, 210); //206 + 4 trailing bits diff --git a/src/nxdn_voice.c b/src/nxdn_voice.c index 326151f..7443302 100644 --- a/src/nxdn_voice.c +++ b/src/nxdn_voice.c @@ -68,7 +68,7 @@ void nxdn_voice (dsd_opts * opts, dsd_state * state, int voice, uint8_t dbuf[182 if (voice == 2) start = 2; if (voice == 2 || voice == 3) stop = 4; - for (start; start < stop; start++) + for (; start < stop; start++) { w = nW; x = nX; diff --git a/src/p25_frequency.c b/src/p25_frequency.c index 8993e27..6b239ff 100644 --- a/src/p25_frequency.c +++ b/src/p25_frequency.c @@ -94,8 +94,8 @@ long int nxdn_channel_to_frequency(dsd_opts * opts, dsd_state * state, uint16_t else base = 0; //just set to zero, will be system definable most likely and won't be able to calc //determine the step value in Hz - if (state->nxdn_step = 2) step = 1250; //1.25 kHz - else if (state->nxdn_step = 3) step = 3125; //3.125 kHz + if (state->nxdn_step == 2) step = 1250; //1.25 kHz + else if (state->nxdn_step == 3) step = 3125; //3.125 kHz else step = 0; //just set to zero, will be system definable most likely and won't be able to calc //if we have a valid base and step, then calc frequency diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index 84694f5..a07fa10 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -871,7 +871,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon if ( (svc1 & 0x40) && (svc2 & 0x40) && opts->trunk_tune_enc_calls == 0) goto SKIPCALL; int loop = 1; - if (channelt2 == channelt2) loop = 1; + if (channelt1 == channelt2) loop = 1; else loop = 2; //assigned inside loop long int tunable_freq = 0; diff --git a/src/provoice.c b/src/provoice.c index 9809e91..c8cd862 100644 --- a/src/provoice.c +++ b/src/provoice.c @@ -298,11 +298,11 @@ void processProVoice (dsd_opts * opts, dsd_state * state) // spacer bits dibit = getDibit (opts, state); - spacer_bit[4]; + spacer_bit[4] = dibit; raw_bits[614+2] = dibit; dibit = getDibit (opts, state); - spacer_bit[5]; + spacer_bit[5] = dibit; raw_bits[615+2] = dibit; // imbe frames 3,4 second half diff --git a/src/ysf.c b/src/ysf.c index 8ed1910..eeca048 100644 --- a/src/ysf.c +++ b/src/ysf.c @@ -697,7 +697,7 @@ void ysf_ehr (dsd_opts * opts, dsd_state * state, uint8_t dbuf[180], int start, state->synctype = 28; uint8_t b1, b2; - for (start; start < stop; start++) + for (; start < stop; start++) { w = YnW; x = YnX; @@ -1083,7 +1083,7 @@ void processYSF(dsd_opts * opts, dsd_state * state) vstop = 5; } - for (dstart; dstart < dstop; dstart++) + for (; dstart < dstop; dstart++) { //get dibits for CSD3 Sub Header DCH -- still need samples to test this with for (j = 0; j < 36; j++) //dbufFR[2][190] @@ -1094,7 +1094,7 @@ void processYSF(dsd_opts * opts, dsd_state * state) } } - for (vstart; vstart < vstop; vstart++) + for (; vstart < vstop; vstart++) { //init a bunch of stuff