mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-13 13:32:53 +08:00
fix compile warning
This commit is contained in:
parent
aec079cbd3
commit
91938e444f
@ -3,4 +3,6 @@ rm ./cmake_install.cmake
|
||||
rm -r ./CMakeFiles
|
||||
rm ./Makefile
|
||||
rm ./CMakeCache.txt
|
||||
find . -name 'moc_*.cpp*' | xargs rm -rf
|
||||
find . -name 'qrc_*.cpp' | xargs rm -rf
|
||||
echo "rm cmake cache end..."
|
||||
|
@ -173,7 +173,7 @@ private:
|
||||
|
||||
QString _error_message;
|
||||
|
||||
std::auto_ptr<boost::thread> _decode_thread;
|
||||
std::unique_ptr<boost::thread> _decode_thread;
|
||||
decode_state _decode_state;
|
||||
|
||||
bool _options_changed;
|
||||
|
@ -192,9 +192,7 @@ void LogicSnapshot::get_subsampled_edges(
|
||||
float min_length, int sig_index)
|
||||
{
|
||||
uint64_t index = start;
|
||||
unsigned int level;
|
||||
bool last_sample;
|
||||
bool fast_forward;
|
||||
|
||||
assert(end <= get_sample_count());
|
||||
assert(start <= end);
|
||||
@ -447,9 +445,9 @@ bool LogicSnapshot::get_pre_edge(
|
||||
// If resolution is less than a mip map block,
|
||||
// round up to the beginning of the mip-map block
|
||||
// for this level of detail
|
||||
const int min_level_scale_power =
|
||||
const unsigned int min_level_scale_power =
|
||||
(level + 1) * MipMapScalePower;
|
||||
if (index < (1 << min_level_scale_power))
|
||||
if (index < (uint64_t)(1 << min_level_scale_power))
|
||||
index = 0;
|
||||
else
|
||||
index = pow2_ceil(index, min_level_scale_power) - (1 << min_level_scale_power) - 1;
|
||||
@ -539,16 +537,13 @@ bool LogicSnapshot::get_pre_edge(
|
||||
// do a linear search for the next transition within the
|
||||
// block
|
||||
if (min_length < MipMapScaleFactor) {
|
||||
for (; index >= 0; index--) {
|
||||
for (; index > 0; index--) {
|
||||
const bool sample = (get_sample(index) &
|
||||
sig_mask) != 0;
|
||||
if (sample != last_sample) {
|
||||
index++;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (index == 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -632,7 +632,6 @@ bool MainWindow::load_session(QString name)
|
||||
bool isEnabled = false;
|
||||
foreach (const QJsonValue &value, sessionObj["channel"].toArray()) {
|
||||
QJsonObject obj = value.toObject();
|
||||
qDebug("obj.index = %d", obj["index"].toDouble());
|
||||
if ((probe->index == obj["index"].toDouble()) &&
|
||||
(probe->type == obj["type"].toDouble())) {
|
||||
isEnabled = true;
|
||||
|
@ -32,20 +32,20 @@
|
||||
using boost::optional;
|
||||
using namespace std;
|
||||
|
||||
#define INT8_MIN (-0x7f - 1)
|
||||
#define INT16_MIN (-0x7fff - 1)
|
||||
#define INT32_MIN (-0x7fffffff - 1)
|
||||
#define INT64_MIN (-0x7fffffffffffffff - 1)
|
||||
|
||||
#define INT8_MAX 0x7f
|
||||
#define INT16_MAX 0x7fff
|
||||
#define INT32_MAX 0x7fffffff
|
||||
#define INT64_MAX 0x7fffffffffffffff
|
||||
|
||||
#define UINT8_MAX 0xff
|
||||
#define UINT16_MAX 0xffff
|
||||
#define UINT32_MAX 0xffffffff
|
||||
#define UINT64_MAX 0xffffffffffffffff
|
||||
//#define INT8_MIN (-0x7f - 1)
|
||||
//#define INT16_MIN (-0x7fff - 1)
|
||||
//#define INT32_MIN (-0x7fffffff - 1)
|
||||
//#define INT64_MIN (-0x7fffffffffffffff - 1)
|
||||
//
|
||||
//#define INT8_MAX 0x7f
|
||||
//#define INT16_MAX 0x7fff
|
||||
//#define INT32_MAX 0x7fffffff
|
||||
//#define INT64_MAX 0x7fffffffffffffff
|
||||
//
|
||||
//#define UINT8_MAX 0xff
|
||||
//#define UINT16_MAX 0xffff
|
||||
//#define UINT32_MAX 0xffffffff
|
||||
//#define UINT64_MAX 0xffffffffffffffff
|
||||
|
||||
namespace pv {
|
||||
namespace prop {
|
||||
|
@ -205,7 +205,7 @@ QList<QString> SigSession::getSuportedExportFormats(){
|
||||
format.append((*supportedModules)->id);
|
||||
format.append(")");
|
||||
list.append(format);
|
||||
*supportedModules++;
|
||||
supportedModules++;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@ -245,7 +245,7 @@ void SigSession::export_file(const QString name, QWidget* parent, const QString
|
||||
outModule = *supportedModules;
|
||||
break;
|
||||
}
|
||||
*supportedModules++;
|
||||
supportedModules++;
|
||||
}
|
||||
if(outModule == NULL)
|
||||
return;
|
||||
@ -283,8 +283,8 @@ void SigSession::export_file(const QString name, QWidget* parent, const QString
|
||||
unsigned char* datat = (unsigned char*)snapshot->get_data();
|
||||
unsigned int numsamples = snapshot->get_sample_count()*snapshot->unit_size();
|
||||
GString *data_out;
|
||||
int usize = 8192;
|
||||
int size = usize;
|
||||
unsigned int usize = 8192;
|
||||
unsigned int size = usize;
|
||||
struct sr_datafeed_logic lp;
|
||||
struct sr_datafeed_packet p;
|
||||
for(uint64_t i = 0; i < numsamples; i+=usize){
|
||||
@ -311,8 +311,8 @@ void SigSession::export_file(const QString name, QWidget* parent, const QString
|
||||
unsigned char* datat = (unsigned char*)snapshot->get_data();
|
||||
unsigned int numsamples = snapshot->get_sample_count();
|
||||
GString *data_out;
|
||||
int usize = 8192;
|
||||
int size = usize;
|
||||
unsigned int usize = 8192;
|
||||
unsigned int size = usize;
|
||||
struct sr_datafeed_dso dp;
|
||||
struct sr_datafeed_packet p;
|
||||
for(uint64_t i = 0; i < numsamples; i+=usize){
|
||||
|
@ -251,10 +251,10 @@ private:
|
||||
boost::shared_ptr<data::GroupSnapshot> _cur_group_snapshot;
|
||||
int _group_cnt;
|
||||
|
||||
std::auto_ptr<boost::thread> _sampling_thread;
|
||||
std::unique_ptr<boost::thread> _sampling_thread;
|
||||
|
||||
libusb_hotplug_callback_handle _hotplug_handle;
|
||||
std::auto_ptr<boost::thread> _hotplug;
|
||||
std::unique_ptr<boost::thread> _hotplug;
|
||||
bool _hot_attach;
|
||||
bool _hot_detach;
|
||||
|
||||
|
@ -151,7 +151,8 @@ void Cursor::paint_fix_label(QPainter &p, const QRect &rect,
|
||||
|
||||
void Cursor::compute_text_size(QPainter &p, unsigned int prefix)
|
||||
{
|
||||
_text_size = p.boundingRect(QRectF(), 0,
|
||||
(void)prefix;
|
||||
_text_size = p.boundingRect(QRectF(), 0,
|
||||
Ruler::format_real_time(_index, _view.session().get_device()->get_sample_rate())).size();
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,6 @@ LogicSignal::LogicSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
|
||||
Signal(dev_inst, probe, SR_CHANNEL_LOGIC),
|
||||
_data(data)
|
||||
{
|
||||
assert(probe->index >= 0);
|
||||
_colour = SignalColours[probe->index % countof(SignalColours)];
|
||||
}
|
||||
|
||||
@ -82,7 +81,6 @@ LogicSignal::LogicSignal(const Signal &s,
|
||||
Signal(s, probe),
|
||||
_data(data)
|
||||
{
|
||||
assert(probe->index >= 0);
|
||||
}
|
||||
|
||||
LogicSignal::~LogicSignal()
|
||||
|
@ -53,7 +53,7 @@ const QPen Trace::SignalAxisPen = QColor(128, 128, 128, 64);
|
||||
const QPen Trace::AxisPen(QColor(128, 128, 128, 64));
|
||||
const int Trace::LabelHitPadding = 2;
|
||||
|
||||
Trace::Trace(QString name, int index, int type) :
|
||||
Trace::Trace(QString name, uint16_t index, int type) :
|
||||
_view(NULL),
|
||||
_name(name),
|
||||
_v_offset(INT_MAX),
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
static const QPen SignalAxisPen;
|
||||
|
||||
protected:
|
||||
Trace(QString name, int index, int type);
|
||||
Trace(QString name, uint16_t index, int type);
|
||||
Trace(QString name, std::list<int> index_list, int type, int sec_index);
|
||||
|
||||
/**
|
||||
|
@ -444,7 +444,7 @@ void Viewport::mousePressEvent(QMouseEvent *event)
|
||||
_dso_xm_index[i-1] = min(_dso_xm_index[i-1], _dso_xm_index[i]);
|
||||
_dso_xm_index[i] = max_index;
|
||||
}
|
||||
_dso_xm_stage = (++_dso_xm_stage) % (DsoMeasureStages + 1);
|
||||
_dso_xm_stage = (_dso_xm_stage + 1) % (DsoMeasureStages + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@
|
||||
*/
|
||||
|
||||
/** @private */
|
||||
SR_PRIV struct sr_channel *sr_channel_new(int index, int type,
|
||||
SR_PRIV struct sr_channel *sr_channel_new(uint16_t index, int type,
|
||||
gboolean enabled, const char *name)
|
||||
{
|
||||
struct sr_channel *probe;
|
||||
@ -156,7 +156,7 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
|
||||
*
|
||||
* @since 0.1.0 (but the API changed in 0.2.0)
|
||||
*/
|
||||
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
|
||||
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, uint16_t probenum,
|
||||
const char *trigger)
|
||||
{
|
||||
GSList *l;
|
||||
|
@ -606,7 +606,7 @@ static int init(struct sr_context *sr_ctx)
|
||||
|
||||
static int set_probes(struct sr_dev_inst *sdi, int num_probes)
|
||||
{
|
||||
int j;
|
||||
uint16_t j;
|
||||
struct sr_channel *probe;
|
||||
|
||||
for (j = 0; j < num_probes; j++) {
|
||||
@ -627,7 +627,7 @@ static int set_probes(struct sr_dev_inst *sdi, int num_probes)
|
||||
|
||||
static int adjust_probes(struct sr_dev_inst *sdi, int num_probes)
|
||||
{
|
||||
int j;
|
||||
uint16_t j;
|
||||
GSList *l;
|
||||
struct sr_channel *probe;
|
||||
GSList *p;
|
||||
|
@ -676,7 +676,7 @@ static int init(struct sr_context *sr_ctx)
|
||||
|
||||
static int set_probes(struct sr_dev_inst *sdi, int num_probes)
|
||||
{
|
||||
int j;
|
||||
uint16_t j;
|
||||
struct sr_channel *probe;
|
||||
|
||||
for (j = 0; j < num_probes; j++) {
|
||||
@ -696,7 +696,7 @@ static int set_probes(struct sr_dev_inst *sdi, int num_probes)
|
||||
|
||||
static int adjust_probes(struct sr_dev_inst *sdi, int num_probes)
|
||||
{
|
||||
int j;
|
||||
uint16_t j;
|
||||
GSList *l;
|
||||
struct sr_channel *probe;
|
||||
GSList *p;
|
||||
|
@ -204,7 +204,7 @@ static GSList *hw_scan(GSList *options)
|
||||
struct drv_context *drvc;
|
||||
struct dev_context *devc;
|
||||
GSList *devices;
|
||||
int i;
|
||||
uint16_t i;
|
||||
|
||||
(void)options;
|
||||
|
||||
@ -396,7 +396,8 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
|
||||
struct sr_channel *ch,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int i, ret;
|
||||
uint16_t i;
|
||||
int ret;
|
||||
const char *stropt;
|
||||
struct sr_channel *probe;
|
||||
|
||||
|
@ -53,7 +53,7 @@ static int format_match(const char *filename)
|
||||
static int init(struct sr_input *in, const char *filename)
|
||||
{
|
||||
struct sr_channel *probe;
|
||||
int num_probes, i;
|
||||
uint16_t num_probes, i;
|
||||
char name[SR_MAX_PROBENAME_LEN + 1];
|
||||
char *param;
|
||||
struct context *ctx;
|
||||
|
@ -319,7 +319,7 @@ static int format_match(const char *filename)
|
||||
static int init(struct sr_input *in, const char *filename)
|
||||
{
|
||||
struct sr_channel *probe;
|
||||
int num_probes, i;
|
||||
uint16_t num_probes, i;
|
||||
char name[SR_MAX_PROBENAME_LEN + 1];
|
||||
char *param;
|
||||
struct context *ctx;
|
||||
|
@ -83,7 +83,7 @@ SR_PRIV int sr_err(const char *format, ...);
|
||||
|
||||
/*--- device.c --------------------------------------------------------------*/
|
||||
|
||||
SR_PRIV struct sr_channel *sr_channel_new(int index, int type,
|
||||
SR_PRIV struct sr_channel *sr_channel_new(uint16_t index, int type,
|
||||
gboolean enabled, const char *name);
|
||||
SR_PRIV void sr_dev_probes_free(struct sr_dev_inst *sdi);
|
||||
|
||||
|
@ -556,7 +556,7 @@ enum {
|
||||
|
||||
struct sr_channel {
|
||||
/* The index field will go: use g_slist_length(sdi->channels) instead. */
|
||||
int index;
|
||||
uint16_t index;
|
||||
int type;
|
||||
gboolean enabled;
|
||||
char *name;
|
||||
|
@ -49,7 +49,7 @@ SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi,
|
||||
int probenum, const char *name);
|
||||
SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
|
||||
gboolean state);
|
||||
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
|
||||
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, uint16_t probenum,
|
||||
const char *trigger);
|
||||
SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key);
|
||||
SR_API GSList *sr_dev_list(const struct sr_dev_driver *driver);
|
||||
|
@ -121,8 +121,10 @@ SR_API int sr_session_load(const char *filename)
|
||||
struct zip_stat zs;
|
||||
struct sr_dev_inst *sdi;
|
||||
struct sr_channel *probe;
|
||||
int ret, probenum, devcnt, version, i, j;
|
||||
uint64_t tmp_u64, total_probes, enabled_probes, p;
|
||||
int ret, devcnt, i, j;
|
||||
uint16_t probenum;
|
||||
uint64_t tmp_u64, total_probes, enabled_probes;
|
||||
uint16_t p;
|
||||
char **sections, **keys, *metafile, *val, s[11];
|
||||
char probename[SR_MAX_PROBENAME_LEN + 1];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user