Age | Commit message (Collapse) | Author |
|
CID 208303
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
CID 60227
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
This fixes a bug where if the user entered very high ascent (or less commonly
descent) rates such that the time to ascend (or descend) from one level to the
next was less than 10s, that leg would be skipped in the dive plan notes.
Reported-by: Alexander Maier <maieralex@me.com>
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
|
|
clear_vpmb_state() was declared with incorrect signature, and all
functios in this change are extern, so declare them as such.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
CID 208315
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
Coverity CID 208330
Coverity CID 208301
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
This is basically to make Coverity happy.
Coverity CID 208300
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Realistically this is a false positive as we should never use a second
BTDiscovery instance - but there's nothing wrong with being extra certain.
Coverity CID 208319
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 45078
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 45121
Coverity CID 45163
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
The previous attempt to fix this in commit 652e382e68 ("Cleanup: avoid a
few memory leaks") was clearly bogus. Oops.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
|
|
Coverity CID 208323
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208289
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
sizeof() is clearly the wrong way to get to the size of that array...
Coverity CID 208294
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
sizeof() is clearly the wrong way to get to the size of that array...
Coverity CID 208290
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208298
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208308
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208314
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
No point in doing the strdup of the password if we then bail.
Coverity CID 208316
Coverity CID 209293
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Don't access cylinder[MAX_CYLINDERS]
Coverity CID 208324
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208327
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208333
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 208337
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Since we cannot store tanks / gases past MAX_CYLINDERS (currently 20),
there is no point in analyzing those data.
Coverity CID 208339
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
The JUMP macro includes a 'goto bail', so we need to free devdata there
Coverity CID 208340
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Coverity CID 215199
Coverity CID 215195
Coverity CID 215196
Coverity CID 215198
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
A very very trival fix, for a mysterious issue. When loading
GPS fix data from the server, the string date was parsed with
the format "yyy-M-d". And no, the "yyy" is no typo here, but
was the reason that data from the read from server got a
1/1/1970 data. And when a user decided to upload that data
to the server again, we ended up with 2 copies of the
GPS fix. One with correct data (as originally saved), and
one new with the bogus date.
In order to het rid of those weird 1/1/1970 GPS fixes, users
will have to remove them by hand.
Fixes: #567
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
For deep dives with long deco, the sum of deco stops could
overflow. This is prevent by turning it into long.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
|
|
There was a curious pattern of singletons being implemented based on
QScopedPointer<>s. This is an unnecessary level of indirection:
The lifetime of the smart pointer is the same as that of the
pointed-to object. Therefore, replace these pointers by the respective
objects.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
The two final newlines in the help message were removed in commit
0c74f7a2c8e0af7ac006c16fc9ef05e5f9245518.
Re-add them.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
|
|
in ./core/subsurface-qt/SettingsObjectWrapper.h
Code for this was removed here: 5b080beddef3e08b86eb53448e737b4867a50c1a
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
|
|
subsurface_OS_pref_setup() is not not used. Remove it.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
To access a QMap<> entry, the value() function is used with a sentinel
as default value. If the sentinel is returned, the code assumes that
the searched for entry doesn't exist.
Make this code more idiomatic by using an iterator and testing for
end().
This fixes a compiler warning, because only one of the elements of
the sentinel was initialized, but the remaining elements were
copied. Harmless, because the code would exit early if it found
the sentinel. Still not nice.
While redoing this function, the entry-not-found message was improved
(adding of function name, space between massage and timestamp) and
elevated from debug to warning level.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
plot_info->nr should always be > 0. If this is not the case, write a
message to stderr instead of crashing in add_plot_pressure(). This
silences an use-of-uninitialized-variable warning.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
last_ceiling was used before initialization in the first iteration
of the loop in calculate_deco_information().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Since the corresponding error message appears thrice, it is translated
once at the beginning of the function (even in the non-error case).
A single-byte fread() was transformed into getc().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
A small redo of 78bafe8f620a066. The quotes cause the original
functionality not to work. Ignore them as well.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
Unfortunately, in my commit 48d9c8eb6eb07a, I fixed only half of
the problems related to the functionality introduced by Stefan in
commit 46004c39e266fe7. The lonely m (that was fixed) caused
a parsing error, but forgotten where the single quotes around
the depth value. These quotes simply causes the new functionality
not to work. Again, the fix is simple: do not erroneously save
quotes. And as the new functionality is pretty obscure
(replanning a non-planned dive, and manually entering a gas switch
depth), another bug that could go unnoticed for years.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
In hindsight a very simple bug to fix, but it requires some
knowledge on the inner workings of our git storage. The changes
on merge of dive sites were simply not saved (completely) because
the git storage code has a cache that we need to invalidate
selectively (ie. for the dive we just gave a new dive site uuid)
to get things finally embedded in the overall commit.
The main reason this bug went unnoticed for more than 2 years is
that most people use the XML/SSRF format (where this problem is
non exsistent), and dive site merging is probably not a very
much used feature either.
Fixes: #939
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
A bogus key/value pair was introduced in the cylinder,
consisting of a lonely "m" without value. This is caused
by commit 46004c39e26 and fixed in 48d9c8eb6eb0. See referenced
commits for more info.
Just ignore this key/value pair. No processing is broken
due to this, as the git storage stores only metric SI type data.
In fact, the m unit is superfluous anyway.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
In a session with the profile I saw that the planner spends
a lot of time waiting to obtain the lock for the factor cache.
Most of the time we are only reading that cache and that
is save to do in parallel (according to the Qt IRC channel).
So we can use a QReadWriteLock instead of a QMutex. This
appears to be quite a performance boost, in particular
for VPM-B
Signed-off-by: Robert C. Helling <helling@atdotde.de>
|
|
I never realized that my hashes weren't written, because it only
outputs a debug instead of a warning message.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Commit 46004c39e266fe7 introduces a new field in the logbook outputs
(depth of a cylinder). While in XML the depth unit is stored with a space
between value and unit (m), in our git storage, the unit m is without
space. As the git storage parser uses a space to separate individual
key/value pairs, the erroneously saved space results in parsing warnings
when opening the logbook.
The unwanted space is normally saved just after download of a new dive
from the dive computers, so all desktop-git-storage uses are affected,
and more worrying, mobile beta users.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
|
|
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Somehow a whitespace fix snuck in here. Oops.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
|
|
Internal floating point (FP) calculations should be performed using double
unless there is a very good reason. This avoids headaches with conversions.
Indeed, the vast majority of FP calculations were already done using double.
This patch adapts most remaining calculations. Not converted where things
that were based on binary representations and variables which weren't used
anyway.
An analysis of all instances follows:
core/plannernotes.c, l.404:
This was a comparison between two floats. On the left side, first an integer
was cast to float then multiplied with and integer and divided by a constant
double. The right hand side was an integer cast to a float. Simply divide by
1000.0 first to convert to double and continue with calculations. On the right
hand side, remove the cast, because the integer will be implicitely cast to
double for comparison. This conversion actually emits less instructions,
because no conversion to double and back is performed.
core/planner.c, l.613:
Same analysis as previous case.
subsurface-desktop-main.cpp, l.155:
A local variable representing the version OpenGL version. Turn this into
integer logic. Not only does this avoid dreaded FP rounding issues, it also
works correctly for minor version > 10 (not that such a thing is to be
expected anytime soon).
abstractpreferenceswidget.[h/cpp]:
A widget where the position is described as a float. Turn into double.
desktop-widgets/divelogexportdialog.cpp, l.313:
total_weight is described as float. Use double arithmetics instead. This
instance fixes a truncation warning emitted by gcc.
|
|
The function isCloudUrl() was only called in one place, parse_file().
But, isCloudUrl() could only return true if the filename was of the
git-repository kind (url[branch]). In such a case, control flow would
never reach the point where isCloudUrl() is called, since
is_git_repository() returns non-NULL and the function returns early.
Therefore, remove this function. Moreover, adapt the affected if-statement
by replacing "str && !strcmp(str, ...)" with the more concise
"same_string(str, ...)".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
|
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
|