mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Remove type truncation warnings (#4770)
warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data warning C4805: '!=': unsafe mix of type 'int' and type 'bool' in operation warning C4305: 'argument': truncation from 'double' to 'float'
This commit is contained in:
@@ -98,7 +98,7 @@ public:
|
||||
bool getFieldBool(string name); ///< get value of bool field of VALUE OBJECT (objValue)
|
||||
|
||||
inline MVJSONValue* at(unsigned int i){ return arrayValue.at(i); }
|
||||
inline int size() { if (valueType == MVJSON_TYPE_ARRAY) return arrayValue.size(); else return 1; }
|
||||
inline size_t size() { if (valueType == MVJSON_TYPE_ARRAY) return arrayValue.size(); else return 1; }
|
||||
private:
|
||||
void init(MVJSON_TYPE valueType);
|
||||
};
|
||||
|
||||
@@ -28,12 +28,11 @@ void QwtPlotGappedCurve::drawSeries(QPainter *painter, const QwtScaleMap &xMap,
|
||||
if ( !painter || dataSize() <= 0 )
|
||||
return;
|
||||
|
||||
if (to < 0)
|
||||
to = dataSize();
|
||||
size_t samples = (to < 0) ? dataSize() : to;
|
||||
|
||||
int i = from;
|
||||
double last = 0;
|
||||
while (i < to)
|
||||
while (i < samples)
|
||||
{
|
||||
// First non-missed point will be the start of curve section.
|
||||
double x = sample(i).x();
|
||||
|
||||
@@ -514,7 +514,7 @@ void ZipReaderPrivate::scanFiles()
|
||||
int num_dir_entries = 0;
|
||||
EndOfDirectory eod;
|
||||
while (start_of_directory == -1) {
|
||||
size_t pos = device->size() - sizeof(EndOfDirectory) - i;
|
||||
qint64 pos = device->size() - sizeof(EndOfDirectory) - i;
|
||||
if (pos < 0 || i > 65535) {
|
||||
qWarning() << "QZip: EndOfDirectory not found";
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user