Commit 886b847c authored by DreamSourceLab's avatar DreamSourceLab

Warnings fix

parent 83d77b03
......@@ -36,6 +36,7 @@ DSView/ui_*.h
DSView/DSView
DSView/install_manifest.txt
DSView/qrc_DSView.cpp
DSView/qrc_style.cpp
moc_*.cpp
moc_*.cpp_parameters
......
......@@ -34,7 +34,7 @@ project(DSView)
option(DISABLE_WERROR "Build without -Werror" TRUE)
option(ENABLE_SIGNALS "Build with UNIX signals" TRUE)
option(ENABLE_DECODE "Build with libsigrokdecode" TRUE)
option(ENABLE_DECODE "Build with libsigrokdecode4DSL" TRUE)
option(ENABLE_COTIRE "Enable cotire" FALSE)
option(ENABLE_TESTS "Enable unit tests" FALSE)
option(STATIC_PKGDEPS_LIBS "Statically link to (pkg-config) libraries" FALSE)
......@@ -65,7 +65,7 @@ list(APPEND PKGDEPS
"libzip >= 0.10"
)
if(ENABLE_DECODE)
list(APPEND PKGDEPS "libsigrokdecode>=0.3.0")
list(APPEND PKGDEPS "libsigrokdecode4DSL>=0.4.0")
endif()
find_package(PkgConfig)
......@@ -148,7 +148,7 @@ set(DSView_SOURCES
pv/view/header.cpp
pv/view/cursor.cpp
pv/view/analogsignal.cpp
pv/prop/binding/binding_deviceoptions.cpp
pv/prop/binding/deviceoptions.cpp
pv/toolbars/trigbar.cpp
pv/toolbars/filebar.cpp
pv/dock/protocoldock.cpp
......@@ -267,10 +267,10 @@ set(DSView_FORMS
)
set(DSView_RESOURCES
DSView.qrc
DSView.qrc
darkstyle/style.qrc
)
if(ENABLE_DECODE)
list(APPEND DSView_SOURCES
pv/dock/protocoldock.cpp
......@@ -399,7 +399,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "/usr/local/lib")
# Install the executable.
install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
install(DIRECTORY res DESTINATION share/${PROJECT_NAME})
install(DIRECTORY ../libsigrokdecode4DSL/decoders DESTINATION share/${PROJECT_NAME})
install(FILES icons/logo.png DESTINATION share/${PROJECT_NAME} RENAME logo.png)
install(FILES DreamSourceLab.rules DESTINATION /etc/udev/rules.d/)
install(FILES DSView.desktop DESTINATION /usr/share/applications/)
......
[Desktop Entry]
Version=0.96
Exec=/usr/local/bin/DSView
Name=DSView
Comment=GUI Program for DreamSourceLab USB-based Instruments
Icon=/usr/local/share/DSView/logo.png
Type=Application
Terminal=false
Categories=Development
......@@ -22,7 +22,7 @@
#ifdef ENABLE_DECODE
#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
#include <libsigrokdecode4DSL/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
#endif
#include <stdint.h>
......
......@@ -338,7 +338,7 @@ void AnalogSnapshot::append_payload_to_envelope_levels()
int AnalogSnapshot::get_ch_order(int sig_index)
{
int order = 0;
uint16_t order = 0;
for (auto& iter:_ch_index) {
if (iter == sig_index)
break;
......
......@@ -20,7 +20,7 @@
*/
extern "C" {
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
}
#include <vector>
......
......@@ -20,7 +20,7 @@
*/
#include <libsigrok4DSL/libsigrok.h>
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include "decoder.h"
......
......@@ -20,7 +20,7 @@
#include "row.h"
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
namespace pv {
namespace data {
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>
......
......@@ -457,18 +457,6 @@ uint64_t DecoderStack::get_max_sample_count() const
return max_sample_count;
}
boost::optional<uint64_t> DecoderStack::wait_for_data() const
{
//unique_lock<mutex> input_lock(_input_mutex);
while(!boost::this_thread::interruption_requested() &&
!_frame_complete && (uint64_t)_samples_decoded >= _sample_count)
//_input_cond.wait(input_lock);
return boost::make_optional(
!boost::this_thread::interruption_requested() &&
((uint64_t)_samples_decoded < _sample_count || !_frame_complete),
_sample_count);
}
void DecoderStack::decode_data(
const uint64_t decode_start, const uint64_t decode_end,
srd_session *const session)
......
......@@ -21,7 +21,7 @@
#ifndef DSVIEW_PV_DATA_DECODERSTACK_H
#define DSVIEW_PV_DATA_DECODERSTACK_H
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include <list>
......@@ -145,8 +145,6 @@ public:
int64_t get_mark_index() const;
private:
boost::optional<uint64_t> wait_for_data() const;
void decode_data(const uint64_t decode_start, const uint64_t decode_end, srd_session *const session);
void decode_proc();
......
......@@ -165,7 +165,7 @@ void LogicSnapshot::first_payload(const sr_datafeed_logic &logic, uint64_t total
sr_channel *const probe = (sr_channel*)l->data;
if (probe->type == SR_CHANNEL_LOGIC && probe->enabled) {
std::vector<struct RootNode> root_vector;
for (int j = 0; j < rootnode_size; j++) {
for (uint64_t j = 0; j < rootnode_size; j++) {
struct RootNode rn;
rn.tog = 0;
rn.value = 0;
......@@ -250,11 +250,16 @@ void LogicSnapshot::append_cross_payload(
// bit align
while (((_ch_fraction != 0) || (_byte_fraction != 0)) && (len != 0)) {
uint8_t *dp_tmp = (uint8_t *)_dest_ptr;
uint8_t *sp_tmp = (uint8_t *)_src_ptr;
do {
*(uint8_t *)_dest_ptr++ = *(uint8_t *)_src_ptr++;
//*(uint8_t *)_dest_ptr++ = *(uint8_t *)_src_ptr++;
*dp_tmp++ = *sp_tmp++;
_byte_fraction = (_byte_fraction + 1) % ScaleSize;
len--;
} while ((_byte_fraction != 0) && (len != 0));
_dest_ptr = dp_tmp;
_src_ptr = sp_tmp;
if (_byte_fraction == 0) {
const uint64_t index0 = _ring_sample_count / RootNodeSamples;
const uint64_t index1 = (_ring_sample_count >> LeafBlockPower) % RootScale;
......@@ -283,7 +288,7 @@ void LogicSnapshot::append_cross_payload(
uint64_t pre_index0 = _ring_sample_count / RootNodeSamples;
uint64_t pre_index1 = (_ring_sample_count >> LeafBlockPower) % RootScale;
uint64_t pre_offset = (_ring_sample_count % LeafBlockSamples) / Scale;
uint64_t *src_ptr;
uint64_t *src_ptr = NULL;
uint64_t *dest_ptr;
int order = 0;
const uint64_t align_size = len / ScaleSize / _channel_num;
......@@ -345,15 +350,20 @@ void LogicSnapshot::append_cross_payload(
uint64_t offset = (_ring_sample_count % LeafBlockSamples) / 8;
_dest_ptr = (uint8_t *)_ch_data[_ch_fraction][index0].lbp[index1] + offset;
uint8_t *dp_tmp = (uint8_t *)_dest_ptr;
uint8_t *sp_tmp = (uint8_t *)_src_ptr;
while(len-- != 0) {
*(uint8_t *)_dest_ptr++ = *(uint8_t *)_src_ptr++;
//*(uint8_t *)_dest_ptr++ = *(uint8_t *)_src_ptr++;
*dp_tmp++ = *sp_tmp++;
if (++_byte_fraction == ScaleSize) {
_ch_fraction = (_ch_fraction + 1) % _channel_num;
_byte_fraction = 0;
_dest_ptr = (uint8_t *)_ch_data[_ch_fraction][index0].lbp[index1] + offset;
//_dest_ptr = (uint8_t *)_ch_data[_ch_fraction][index0].lbp[index1] + offset;
dp_tmp = (uint8_t *)_ch_data[_ch_fraction][index0].lbp[index1] + offset;
}
}
_dest_ptr = (uint8_t *)_dest_ptr + _byte_fraction;
//_dest_ptr = (uint8_t *)_dest_ptr + _byte_fraction;
_dest_ptr = dp_tmp + _byte_fraction;
}
}
......@@ -363,7 +373,7 @@ void LogicSnapshot::append_split_payload(
assert(logic.format == LA_SPLIT_DATA);
uint64_t samples = logic.length * 8;
int order = logic.order;
uint16_t order = logic.order;
assert(order < _ch_data.size());
if (_sample_cnt[order] >= _total_sample_count)
......@@ -459,9 +469,7 @@ const uint8_t *LogicSnapshot::get_samples(uint64_t start_sample, uint64_t &end_s
int sig_index)
{
//assert(data);
assert(start_sample >= 0);
assert(start_sample < get_sample_count());
assert(end_sample >= 0);
assert(end_sample < get_sample_count());
assert(start_sample <= end_sample);
......@@ -530,9 +538,9 @@ bool LogicSnapshot::get_display_edges(std::vector<std::pair<bool, bool> > &edges
bool has_edge = get_nxt_edge(index, last_sample, end, 0, sig_index);
// calc the edge position
int gap = (index / min_length) - pixels_offset;
int64_t gap = (index / min_length) - pixels_offset;
index = max((uint64_t)ceil((floor(index/min_length) + 1) * min_length), index + 1);
while(gap > edges.size() && edges.size() < width)
while(gap > (int64_t)edges.size() && edges.size() < width)
edges.push_back(pair<bool, bool>(false, last_sample));
if (index > end)
......@@ -576,7 +584,7 @@ bool LogicSnapshot::get_nxt_edge(
bool edge_hit = false;
// linear search for the next transition on the root level
for (int64_t i = root_index; !edge_hit && (index <= end) && i < _ch_data[order].size(); i++) {
for (int64_t i = root_index; !edge_hit && (index <= end) && i < (int64_t)_ch_data[order].size(); i++) {
uint64_t cur_mask = (~0ULL << root_pos);
do {
uint64_t cur_tog = _ch_data[order][i].tog & cur_mask;
......@@ -739,7 +747,6 @@ bool LogicSnapshot::block_pre_edge(uint64_t *lbp, uint64_t &index, bool last_sam
unsigned int level = min_level;
bool fast_forward = true;
bool within_block = true;
const uint64_t last = last_sample ? ~0ULL : 0;
uint64_t block_start = index & ~LeafMask;
......@@ -1067,7 +1074,7 @@ uint8_t *LogicSnapshot::get_block_buf(int block_index, int sig_index, bool &samp
int LogicSnapshot::get_ch_order(int sig_index)
{
int order = 0;
uint16_t order = 0;
for (auto& iter:_ch_index) {
if (iter == sig_index)
break;
......
......@@ -157,12 +157,13 @@ const std::vector<double> MathStack::get_fft_spectrum() const
return empty;
}
const double MathStack::get_fft_spectrum(uint64_t index) const
double MathStack::get_fft_spectrum(uint64_t index)
{
double ret = -1;
if (_math_state == Stopped && index < _power_spectrum.size())
return _power_spectrum[index];
else
return -1;
ret = _power_spectrum[index];
return ret;
}
void MathStack::calc_fft()
......
......@@ -86,7 +86,7 @@ public:
void set_sample_interval(int interval);
const std::vector<double> get_fft_spectrum() const;
const double get_fft_spectrum(uint64_t index) const;
double get_fft_spectrum(uint64_t index);
void calc_fft();
......
......@@ -83,7 +83,7 @@ GVariant* DevInst::get_config(const sr_channel *ch, const sr_channel_group *grou
return data;
}
bool DevInst::set_config(const sr_channel *ch, const sr_channel_group *group, int key, GVariant *data)
bool DevInst::set_config(sr_channel *ch, sr_channel_group *group, int key, GVariant *data)
{
assert(_owner);
sr_dev_inst *const sdi = dev_inst();
......
......@@ -63,7 +63,7 @@ public:
GVariant* get_config(const sr_channel *ch, const sr_channel_group *group, int key);
bool set_config(const sr_channel *ch, const sr_channel_group *group, int key, GVariant *data);
bool set_config(sr_channel *ch, sr_channel_group *group, int key, GVariant *data);
GVariant* list_config(const sr_channel_group *group, int key);
......
......@@ -78,10 +78,12 @@ QJsonArray File::get_decoders()
QJsonArray dec_array;
QJsonParseError error;
if (archive = zip_open(_path.toLocal8Bit().data(), 0, &ret)) {
archive = zip_open(_path.toLocal8Bit().data(), 0, &ret);
if (archive) {
/* read "decoders" */
if (zip_stat(archive, "decoders", 0, &zs) != -1) {
if (dec_file = (char *)g_try_malloc(zs.size)) {
dec_file = (char *)g_try_malloc(zs.size);
if (dec_file) {
zf = zip_fopen_index(archive, zs.index, 0);
zip_fread(zf, dec_file, zs.size);
zip_fclose(zf);
......
......@@ -48,6 +48,7 @@ sr_dev_inst* InputFile::dev_inst() const
void InputFile::use(SigSession *owner) throw(QString)
{
(void)owner;
assert(!_input);
// only *.dsl file is valid
......
......@@ -224,7 +224,7 @@ void FftOptions::accept()
mathTrace->get_math_stack()->set_sample_num(_len_combobox->currentData().toULongLong());
mathTrace->get_math_stack()->set_sample_interval(_interval_combobox->currentData().toInt());
mathTrace->get_math_stack()->set_windows_index(_window_combobox->currentData().toInt());
mathTrace->set_view_mode(_view_combobox->currentData().toInt());
mathTrace->set_view_mode(_view_combobox->currentData().toUInt());
//mathTrace->init_zoom();
mathTrace->set_dbv_range(_dbv_combobox->currentData().toInt());
mathTrace->set_enable(_en_checkbox->isChecked());
......
......@@ -27,8 +27,8 @@ namespace pv {
namespace dialogs {
Interval::Interval(SigSession &session, QWidget *parent) :
_session(session),
DSDialog(parent),
_session(session),
_button_box(QDialogButtonBox::Ok,
Qt::Horizontal, this)
{
......
......@@ -445,7 +445,7 @@ void MeasureDock::show_all_coursor()
cursor_dlg.setWindowFlags(Qt::FramelessWindowHint | Qt::Popup | Qt::WindowSystemMenuHint |
Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint);
int index = 0;
QHBoxLayout *hlayout;
QHBoxLayout *hlayout = NULL;
QVBoxLayout *vlayout = new QVBoxLayout(&cursor_dlg);
for(std::list<Cursor*>::iterator i = _view.get_cursorList().begin();
i != _view.get_cursorList().end(); i++) {
......@@ -634,7 +634,7 @@ void MeasureDock::update_probe_selector(QComboBox *selector)
void MeasureDock::del_cursor()
{
int del_index = 0;
Cursor* cursor;
Cursor* cursor = NULL;
for (QVector <QToolButton *>::const_iterator i = _cursor_del_btn_vec.begin();
i != _cursor_del_btn_vec.end(); i++) {
if ((*i)->isChecked()) {
......@@ -648,7 +648,8 @@ void MeasureDock::del_cursor()
del_index++;
}
_view.del_cursor(cursor);
if (cursor)
_view.del_cursor(cursor);
if (_view.get_cursorList().empty())
_view.show_cursors(false);
......
......@@ -615,7 +615,7 @@ void ProtocolDock::export_table_view()
void ProtocolDock::nav_table_view()
{
uint64_t row_index;
uint64_t row_index = 0;
pv::data::DecoderModel *decoder_model = _session.get_decoder_model();
boost::shared_ptr<pv::data::DecoderStack> decoder_stack = decoder_model->getDecoderStack();
if (decoder_stack) {
......
......@@ -23,7 +23,7 @@
#ifndef DSVIEW_PV_PROTOCOLDOCK_H
#define DSVIEW_PV_PROTOCOLDOCK_H
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include <QDockWidget>
#include <QPushButton>
......
......@@ -120,7 +120,6 @@ MainFrame::MainFrame(DeviceManager &device_manager,
_layout->addWidget(_bottom_right, 2, 2);
connect(&_timer, SIGNAL(timeout()), this, SLOT(unfreezing()));
connect(_mainWindow, SIGNAL(prgRate(int)), this, SLOT(setTaskbarProgress(int)));
//readSettings();
}
......
......@@ -22,7 +22,7 @@
#ifdef ENABLE_DECODE
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include "dock/protocoldock.h"
#endif
......@@ -819,6 +819,8 @@ bool MainWindow::load_session(QString name)
ss.load_decoders(_protocol_widget, sessionObj["decoder"].toArray());
}
#endif
return true;
}
bool MainWindow::store_session(QString name)
......
......@@ -80,7 +80,7 @@ QWidget* Binding::get_property_form(QWidget *parent,
}
std::map< boost::shared_ptr<Property>,
GVariant* >& Binding::get_property_value() const
GVariant* > Binding::get_property_value() const
{
std::map < boost::shared_ptr<Property>,
GVariant* > pvalue;
......@@ -89,6 +89,8 @@ std::map< boost::shared_ptr<Property>,
assert(p);
pvalue[p] = p->get_value();
}
return pvalue;
}
QString Binding::print_gvariant(GVariant *const gvar)
......
......@@ -56,7 +56,7 @@ public:
bool auto_commit = false) const;
std::map< boost::shared_ptr<Property>,
GVariant* >& get_property_value() const;
GVariant* > get_property_value() const;
static QString print_gvariant(GVariant *const gvar);
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#include "decoderoptions.h"
......
......@@ -142,7 +142,7 @@ GVariant* DeviceOptions::config_getter(
}
void DeviceOptions::config_setter(
const struct sr_dev_inst *sdi, int key, GVariant* value)
struct sr_dev_inst *sdi, int key, GVariant* value)
{
if (sr_config_set(sdi, NULL, NULL, key, value) != SR_OK)
qDebug() << "WARNING: Failed to set value of sample rate";
......
......@@ -47,7 +47,7 @@ private:
static GVariant* config_getter(
const struct sr_dev_inst *sdi, int key);
static void config_setter(
const struct sr_dev_inst *sdi, int key, GVariant* value);
struct sr_dev_inst *sdi, int key, GVariant* value);
void bind_bool(const QString &name, int key);
void bind_enum(const QString &name, int key,
......
......@@ -21,7 +21,7 @@
*/
#ifdef ENABLE_DECODE
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
#endif
#include "sigsession.h"
......@@ -861,7 +861,8 @@ void SigSession::feed_in_trigger(const ds_trigger_pos &trigger_pos)
{
_hw_replied = true;
if (_dev_inst->dev_inst()->mode != DSO) {
if (_trigger_flag = (trigger_pos.status & 0x01)) {
_trigger_flag = (trigger_pos.status & 0x01);
if (_trigger_flag) {
_trigger_pos = trigger_pos.real_pos;
receive_trigger(_trigger_pos);
}
......
......@@ -219,15 +219,17 @@ void StoreSession::save_proc(shared_ptr<data::Snapshot> snapshot)
}
}
} else {
int ch_type;
int ch_type = -1;
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _session.get_signals()) {
ch_type = s->get_type();
break;
}
uint64_t size = snapshot->get_sample_count() * snapshot->get_channel_num();
uint8_t *buf = (uint8_t *)snapshot->get_data();
sr_session_append(_file_name.toLocal8Bit().data(), buf, size,
0, 0, ch_type, 1);
if (ch_type != -1) {
uint64_t size = snapshot->get_sample_count() * snapshot->get_channel_num();
uint8_t *buf = (uint8_t *)snapshot->get_data();
sr_session_append(_file_name.toLocal8Bit().data(), buf, size,
0, 0, ch_type, 1);
}
}
progress_updated();
......@@ -276,7 +278,7 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
/* metadata */
fprintf(meta, "capturefile = data\n");
fprintf(meta, "total samples = %llu\n", snapshot->get_sample_count());
fprintf(meta, "total samples = %" PRIu64 "\n", snapshot->get_sample_count());
if (sdi->mode == DSO)
fprintf(meta, "total probes = %d\n", g_slist_length(sdi->channels));
......@@ -300,7 +302,7 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
gvar = _session.get_device()->get_config(NULL, NULL, SR_CONF_TIMEBASE);
if (gvar != NULL) {
uint64_t tmp_u64 = g_variant_get_uint64(gvar);
fprintf(meta, "hDiv = %llu\n", tmp_u64);
fprintf(meta, "hDiv = %" PRIu64 "\n", tmp_u64);
g_variant_unref(gvar);
}
gvar = _session.get_device()->get_config(NULL, NULL, SR_CONF_DSO_BITS);
......@@ -312,7 +314,7 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
} else if (sdi->mode == LOGIC) {
fprintf(meta, "trigger time = %lld\n", _session.get_trigger_time().toMSecsSinceEpoch());
}
fprintf(meta, "trigger pos = %llu\n", _session.get_trigger_pos());
fprintf(meta, "trigger pos = %" PRIu64 "\n", _session.get_trigger_pos());
probecnt = 1;
for (l = sdi->channels; l; l = l->next) {
......@@ -325,19 +327,19 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
if (sdi->mode == DSO) {
fprintf(meta, " enable%d = %d\n", probe->index, probe->enabled);
fprintf(meta, " coupling%d = %d\n", probe->index, probe->coupling);
fprintf(meta, " vDiv%d = %d\n", probe->index, probe->vdiv);
fprintf(meta, " vDiv%d = %" PRIu64 "\n", probe->index, probe->vdiv);
fprintf(meta, " vFactor%d = %d\n", probe->index, probe->vfactor);
fprintf(meta, " vPos%d = %lf\n", probe->index, probe->vpos);
fprintf(meta, " vTrig%d = %d\n", probe->index, probe->trig_value);
if (sr_status_get(sdi, &status, 0, 0) == SR_OK) {
if (probe->index == 0) {
fprintf(meta, " period%d = %llu\n", probe->index, status.ch0_period);
fprintf(meta, " pcnt%d = %lu\n", probe->index, status.ch0_pcnt);
fprintf(meta, " period%d = %" PRIu64 "\n", probe->index, status.ch0_period);
fprintf(meta, " pcnt%d = %" PRIu32 "\n", probe->index, status.ch0_pcnt);
fprintf(meta, " max%d = %d\n", probe->index, status.ch0_max);
fprintf(meta, " min%d = %d\n", probe->index, status.ch0_min);
} else {
fprintf(meta, " period%d = %llu\n", probe->index, status.ch1_period);
fprintf(meta, " pcnt%d = %lu\n", probe->index, status.ch1_pcnt);
fprintf(meta, " period%d = %" PRIu64 "\n", probe->index, status.ch1_period);
fprintf(meta, " pcnt%d = %" PRIu32 "\n", probe->index, status.ch1_pcnt);
fprintf(meta, " max%d = %d\n", probe->index, status.ch1_max);
fprintf(meta, " min%d = %d\n", probe->index, status.ch1_min);
}
......@@ -531,7 +533,7 @@ void StoreSession::export_proc(shared_ptr<data::Snapshot> snapshot)
progress_updated();
}
}
} else if (channel_type = SR_CHANNEL_DSO) {
} else if (channel_type == SR_CHANNEL_DSO) {
_unit_count = snapshot->get_sample_count();
unsigned char* datat = (unsigned char*)snapshot->get_data();
GString *data_out;
......@@ -844,7 +846,7 @@ void StoreSession::load_decoders(dock::ProtocolDock *widget, QJsonArray dec_arra
double StoreSession::get_double(GVariant *var)
{
double val;
double val = 0;
const GVariantType *const type = g_variant_get_type(var);
assert(type);
......
......@@ -30,7 +30,7 @@
#include <QObject>
#include <libsigrok4DSL/libsigrok.h>
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
namespace pv {
......
......@@ -572,7 +572,7 @@ void SamplingBar::update_sample_count_selector()
const uint64_t *elements = NULL;
gsize num_elements;
bool stream_mode = false;
uint64_t hw_depth;
uint64_t hw_depth = 0;
uint64_t sw_depth;
if (_updating_sample_count)
......
......@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
extern "C" {
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode4DSL/libsigrokdecode.h>
}
#include <extdef.h>
......@@ -495,7 +495,7 @@ void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
if (start > right + DrawPadding || end < left - DrawPadding)
return;
if (_decoder_stack->get_mark_index() == (a.start_sample()+ a.end_sample())/2) {
if (_decoder_stack->get_mark_index() == (int64_t)(a.start_sample()+ a.end_sample())/2) {
p.setPen(Signal::dsBlue);
int xpos = (start+end)/2;
int ypos = get_y()+_totalHeight*0.5 + 1;
......
......@@ -137,7 +137,7 @@ uint64_t dslDial::get_value()
return _value[_sel];
}
bool dslDial::set_value(uint64_t value)
void dslDial::set_value(uint64_t value)
{
assert(_value.contains(value));
_sel = _value.indexOf(value, 0);
......
......@@ -53,7 +53,7 @@ public:
// get current value
uint64_t get_value();
bool set_value(uint64_t value);
void set_value(uint64_t value);
// set/get factor
void set_factor(uint64_t factor);
......
......@@ -211,7 +211,6 @@ void DsoSignal::set_enable(bool enable)
set_vDialActive(false);
_dev_inst->set_config(_probe, NULL, SR_CONF_EN_CH,