mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
Cleanup: Fix Warnings in MacOS build.
Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
784eddc166
commit
8a64d1f4b9
10 changed files with 15 additions and 20 deletions
|
@ -439,7 +439,7 @@ static void cochran_parse_samples(struct dive *dive, const unsigned char *log,
|
|||
{
|
||||
const unsigned char *s;
|
||||
unsigned int offset = 0, profile_period = 1, sample_cnt = 0;
|
||||
double depth = 0, temp = 0, depth_sample = 0, psi = 0, sgc_rate = 0;
|
||||
double depth = 0, temp = 0, depth_sample = 0, psi = 0;
|
||||
//int ascent_rate = 0;
|
||||
unsigned int ndl = 0;
|
||||
unsigned int in_deco = 0, deco_ceiling = 0, deco_time = 0;
|
||||
|
@ -457,8 +457,6 @@ static void cochran_parse_samples(struct dive *dive, const unsigned char *log,
|
|||
+ log[CMD_START_DEPTH + 1] * 256) / 4;
|
||||
temp = log[CMD_START_TEMP];
|
||||
psi = log[CMD_START_PSI] + log[CMD_START_PSI + 1] * 256;
|
||||
sgc_rate = (double)(log[CMD_START_SGC]
|
||||
+ log[CMD_START_SGC + 1] * 256) / 2;
|
||||
profile_period = log[CMD_PROFILE_PERIOD];
|
||||
break;
|
||||
case TYPE_COMMANDER:
|
||||
|
@ -533,9 +531,6 @@ static void cochran_parse_samples(struct dive *dive, const unsigned char *log,
|
|||
case 2: // PSI change
|
||||
psi -= (double)(s[1] & 0x7f) * (s[1] & 0x80 ? 1 : -1) / 4;
|
||||
break;
|
||||
case 1: // SGC rate
|
||||
sgc_rate -= (double)(s[1] & 0x7f) * (s[1] & 0x80 ? 1 : -1) / 2;
|
||||
break;
|
||||
case 3: // Temperature
|
||||
temp = (double)s[1] / 2 + 20;
|
||||
break;
|
||||
|
|
|
@ -1599,7 +1599,7 @@ static bool cylinder_in_use(const struct dive *dive, int idx)
|
|||
bool is_cylinder_use_appropriate(const struct divecomputer &dc, const cylinder_t &cyl, bool allowNonUsable)
|
||||
{
|
||||
switch (cyl.cylinder_use) {
|
||||
case OC:
|
||||
case OC_GAS:
|
||||
if (dc.divemode == FREEDIVE)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "gettext.h"
|
||||
#include "tag.h"
|
||||
#include "errorhelper.h"
|
||||
#include "format.h"
|
||||
#include <string.h>
|
||||
#include "divecomputer.h"
|
||||
|
||||
|
@ -45,7 +46,6 @@ static int seac_dive(void *param, int, char **data, char **)
|
|||
{
|
||||
int retval = 0, cylnum = 0;
|
||||
int year, month, day, hour, min, sec, tz;
|
||||
char isodatetime[30];
|
||||
time_t divetime;
|
||||
struct gasmix lastgas, curgas;
|
||||
struct parser_state *state = (struct parser_state *)param;
|
||||
|
@ -123,8 +123,8 @@ static int seac_dive(void *param, int, char **data, char **)
|
|||
"-13:45", // 40
|
||||
"-14:00"}; // 41
|
||||
|
||||
sprintf(isodatetime, "%4i-%02i-%02iT%02i:%02i:%02i%6s", year, month, day, hour, min, sec, timezoneoffset[tz]);
|
||||
divetime = get_dive_datetime_from_isostring(isodatetime);
|
||||
std::string isodatetime = format_string_std("%4i-%02i-%02iT%02i:%02i:%02i%6s", year, month, day, hour, min, sec, timezoneoffset[tz]);
|
||||
divetime = get_dive_datetime_from_isostring(isodatetime.c_str());
|
||||
state->cur_dive->when = divetime;
|
||||
|
||||
// 6 = dive_type
|
||||
|
|
|
@ -917,7 +917,7 @@ QString get_dive_date_string(timestamp_t when)
|
|||
}
|
||||
|
||||
// Get local seconds since Epoch from ISO formatted UTC date time + offset string
|
||||
time_t get_dive_datetime_from_isostring(char *when) {
|
||||
time_t get_dive_datetime_from_isostring(const char *when) {
|
||||
QDateTime divetime = QDateTime::fromString(when, Qt::ISODate);
|
||||
return (time_t)(divetime.toSecsSinceEpoch());
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ std::string local_file_path(const struct picture &picture);
|
|||
std::string hashfile_name();
|
||||
enum deco_mode decoMode(bool in_planner);
|
||||
void parse_seabear_header(const char *filename, struct xml_params *params);
|
||||
time_t get_dive_datetime_from_isostring(char *when);
|
||||
time_t get_dive_datetime_from_isostring(const char *when);
|
||||
void print_qt_versions();
|
||||
void lock_planner();
|
||||
void unlock_planner();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "core/event.h"
|
||||
|
||||
class DiveCartesianAxis;
|
||||
class DivePixmaps;
|
||||
struct DivePixmaps;
|
||||
struct event;
|
||||
struct plot_info;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class DiveGasPressureItem;
|
|||
class DiveHeartrateItem;
|
||||
class DiveMeanDepthItem;
|
||||
class DivePercentageItem;
|
||||
class DivePixmaps;
|
||||
struct DivePixmaps;
|
||||
class DivePlannerPointsModel;
|
||||
class DiveProfileItem;
|
||||
class DiveReportedCeiling;
|
||||
|
|
|
@ -586,7 +586,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
|
|||
|
||||
if (DiveEventItem *item = dynamic_cast<DiveEventItem *>(sceneItem)) {
|
||||
m.addAction(tr("Remove event"), [this,item] { removeEvent(item); });
|
||||
m.addAction(tr("Hide event"), [this, item] { hideEvent(item); });
|
||||
m.addAction(tr("Hide event"), [this, item] { hideOneEvent(item); });
|
||||
m.addAction(tr("Hide events of type '%1'").arg(event_type_name(item->ev)),
|
||||
[this, item] { hideEventType(item); });
|
||||
if (item->ev.type == SAMPLE_EVENT_BOOKMARK)
|
||||
|
@ -678,7 +678,7 @@ void ProfileWidget2::renameCurrentDC()
|
|||
Command::editDeviceNickname(currentdc, newName);
|
||||
}
|
||||
|
||||
void ProfileWidget2::hideEvent(DiveEventItem *item)
|
||||
void ProfileWidget2::hideOneEvent(DiveEventItem *item)
|
||||
{
|
||||
if (!d)
|
||||
return;
|
||||
|
|
|
@ -126,7 +126,7 @@ private:
|
|||
void splitDive(int seconds);
|
||||
void addSetpointChange(int seconds);
|
||||
void removeEvent(DiveEventItem *item);
|
||||
void hideEvent(DiveEventItem *item);
|
||||
void hideOneEvent(DiveEventItem *item);
|
||||
void hideEventType(DiveEventItem *item);
|
||||
void editName(DiveEventItem *item);
|
||||
void unhideEvents();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "core/divelist.h"
|
||||
#include "core/divelog.h"
|
||||
#include "core/event.h"
|
||||
#include "core/format.h"
|
||||
#include "core/subsurface-string.h"
|
||||
#include "qt-models/cylindermodel.h"
|
||||
#include "core/metrics.h" // For defaultModelFont().
|
||||
|
@ -1271,13 +1272,12 @@ void DivePlannerPointsModel::computeVariations(std::unique_ptr<struct diveplan>
|
|||
auto shorter = plan(&ds, plan_copy, dive.get(), dcNr, 1, cache, true, false);
|
||||
save.restore(&ds, false);
|
||||
|
||||
char buf[200];
|
||||
sprintf(buf, ", %s: %c %d:%02d /%s %c %d:%02d /min", qPrintable(tr("Stop times")),
|
||||
std::string buf = format_string_std(", %s: %c %d:%02d /%s %c %d:%02d /min", qPrintable(tr("Stop times")),
|
||||
SIGNED_FRAC_TRIPLET(analyzeVariations(shallower, original, deeper, qPrintable(depth_units)), 60), qPrintable(depth_units),
|
||||
SIGNED_FRAC_TRIPLET(analyzeVariations(shorter, original, longer, qPrintable(time_units)), 60));
|
||||
|
||||
// By using a signal, we can transport the variations to the main thread.
|
||||
emit variationsComputed(QString(buf));
|
||||
emit variationsComputed(QString::fromStdString(buf));
|
||||
#ifdef DEBUG_STOPVAR
|
||||
printf("\n\n");
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue