Re: [PATCH] Don't calculate with NaN when on 100% o2

2014-03-17 Thread Dirk Hohndel
On Mon, 2014-03-17 at 13:05 -0700, Linus Torvalds wrote: > On Mon, Mar 17, 2014 at 12:25 PM, Anton Lundin wrote: > > Fixes: 465 > > Actually, probably only on x86. > > > double ratio = (double)fhe / (1000.0 - fo2); > > + /* if we have 100% o2, ratio is nan */ > > +

Re: [PATCH] ticket #412 Saving edits requires to move focus first

2014-03-17 Thread Dirk Hohndel
On Tue, 2014-03-18 at 03:19 +0200, Gehad wrote: > after editing values in cylinders or weights hitting save will not > save the changes to save the edit one must move the focus to a > different field first which is unfriendly this is fixed by losing > the focus before accepting the changes This lo

[PATCH] ticket #412 Saving edits requires to move focus first

2014-03-17 Thread Gehad
after editing values in cylinders or weights hitting save will not save the changes to save the edit one must move the focus to a different field first which is unfriendly this is fixed by losing the focus before accepting the changes Signed-off-by: Gehad elrobey --- qt-ui/maintab.cpp | 1 + 1

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Thiago Macieira
Em seg 17 mar 2014, às 23:57:05, Lubomir I. Ivanov escreveu: > On 17 March 2014 23:50, Thiago Macieira wrote: > i see..so i guess it's right to optimize there since p does not point > at the top. Right. When I change the code to be &d->i, the check isn't eliminated (i is at the top of the object

Re: [PATCH v2] Translate using tr() to be Qt5-compatible

2014-03-17 Thread Anton Lundin
On 17 March, 2014 - Anton Lundin wrote: > There are no utf8 in those strings, and we can translate them as > everything else with tr() instead. > QApplication::UnicodeUTF8-part is deprecated and removed in Qt5. > > Signed-off-by: Anton Lundin > --- > qt-ui/maintab.cpp | 8 > 1 file cha

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 23:50, Thiago Macieira wrote: > Em seg 17 mar 2014, às 22:26:19, Lubomir I. Ivanov escreveu: >> > if (!p) >> > return -1; >> > return *p; >> > >> > } >> > >> > Clang 3.4 removes the check for !p. ICC 14.0 and GCC 4.9 don't. >> >> quite bogus; i don'

[PATCH v3] Translate using tr() to be Qt5-compatible

2014-03-17 Thread Anton Lundin
There are no utf8 in those strings, and we can translate them as everything else with tr() instead. QApplication::UnicodeUTF8-part is deprecated and removed in Qt5. Signed-off-by: Anton Lundin --- qt-ui/maintab.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qt-ui

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Thiago Macieira
Em seg 17 mar 2014, às 22:26:19, Lubomir I. Ivanov escreveu: > > if (!p) > > return -1; > > return *p; > > > > } > > > > Clang 3.4 removes the check for !p. ICC 14.0 and GCC 4.9 don't. > > quite bogus; i don't see why clang removes the check for !p. The only way f

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Thiago Macieira
Em seg 17 mar 2014, às 12:33:51, Linus Torvalds escreveu: > > struct D { int i; int j; }; > > int f(struct D *d) > > { > > > > int *p = &d->j; > > if (!p) > > return -1; > > return *p; > > > > } > > > > Clang 3.4 removes the check for !p. ICC 14.0 and GCC 4.

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 21:28, Thiago Macieira wrote: > Em seg 17 mar 2014, às 11:12:31, Linus Torvalds escreveu: >> The compiler is allowed to assume that the *result* of the arithmetic is >> not NULL, because pointer arithmetic is only well-defined if it stays >> within an object, and that explains the

Re: [PATCH] Don't calculate with NaN when on 100% o2

2014-03-17 Thread Linus Torvalds
On Mon, Mar 17, 2014 at 12:25 PM, Anton Lundin wrote: > Fixes: 465 Actually, probably only on x86. > double ratio = (double)fhe / (1000.0 - fo2); > + /* if we have 100% o2, ratio is nan */ > + if (isnan(ratio)) > + ratio = 0; The

[PATCH v2] Translate using tr() to be Qt5-compatible

2014-03-17 Thread Anton Lundin
There are no utf8 in those strings, and we can translate them as everything else with tr() instead. QApplication::UnicodeUTF8-part is deprecated and removed in Qt5. Signed-off-by: Anton Lundin --- qt-ui/maintab.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qt-ui

[PATCH] Translate using tr() to be Qt5-compatible

2014-03-17 Thread Anton Lundin
There are no utf8 in those strings, and we can translate them as everything else with tr() instead. QApplication::UnicodeUTF8-part is deprecated and removed in Qt5. Signed-off-by: Anton Lundin --- qt-ui/maintab.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qt-ui

[PATCH] Add forward declaration of QSettings

2014-03-17 Thread Anton Lundin
Its needed for Qt5 Signed-off-by: Anton Lundin --- qt-ui/mainwindow.h | 1 + 1 file changed, 1 insertion(+) diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 971bd17..e249398 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -28,6 +28,7 @@ class GlobeGPS; class MainTab; cla

[PATCH] Make dc_number defined when using it

2014-03-17 Thread Anton Lundin
Signed-off-by: Anton Lundin --- qt-ui/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 02c424f..686dc2e 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -23,6 +23,7 @@ #include "starwidget.h" #include "../dive.

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Linus Torvalds
On Mon, Mar 17, 2014 at 12:26 PM, Thiago Macieira wrote: > > I can't find anything either, in either C11 or C++1y drafts. So what is unquestionably undefined behavior is doing pointer arithmetic past the end of objects, and NULL obviously points to no object at all, so any pointer arithmetic on a

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Linus Torvalds
On Mon, Mar 17, 2014 at 12:28 PM, Thiago Macieira wrote: > Em seg 17 mar 2014, às 11:12:31, Linus Torvalds escreveu: >> The compiler is allowed to assume that the *result* of the arithmetic is >> not NULL, because pointer arithmetic is only well-defined if it stays >> within an object, and that ex

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Thiago Macieira
Em seg 17 mar 2014, às 11:12:31, Linus Torvalds escreveu: > The compiler is allowed to assume that the *result* of the arithmetic is > not NULL, because pointer arithmetic is only well-defined if it stays > within an object, and that explains the offsetof thing you point to (since > that very much

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Thiago Macieira
Em seg 17 mar 2014, às 12:07:59, Linus Torvalds escreveu: > On Mon, Mar 17, 2014 at 11:12 AM, Linus Torvalds > > wrote: > > Where in the standard does it say that you can't do arithmetic before > > testing a NULL pointer, and who can I shoot at for messing things up > > *again* if it actually doe

[PATCH] Don't calculate with NaN when on 100% o2

2014-03-17 Thread Anton Lundin
Fixes: 465 Signed-off-by: Anton Lundin --- profile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profile.c b/profile.c index 2102179..20f157c 100644 --- a/profile.c +++ b/profile.c @@ -1131,6 +1131,9 @@ static void calculate_gas_information_new(struct dive *dive, struct plot_info *p

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Anton Lundin
On 18 March, 2014 - Venkatesh Shukla IIT BHU wrote: > On Mon, Mar 17, 2014 at 9:35 PM, Anton Lundin wrote: > > > On 16 March, 2014 - Anton Lundin wrote: > > > > > I started to rebase those patches but i ran out of steam when trying to > > > whip libgit2 into the build chain. > > > > > > I pushed

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Linus Torvalds
On Mon, Mar 17, 2014 at 11:12 AM, Linus Torvalds wrote: > > Where in the standard does it say that you can't do arithmetic before > testing a NULL pointer, and who can I shoot at for messing things up *again* > if it actually does say that? I don't have access to the real standard, but I do have

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Venkatesh Shukla IIT BHU
On Mon, Mar 17, 2014 at 9:35 PM, Anton Lundin wrote: > On 16 March, 2014 - Anton Lundin wrote: > > > I started to rebase those patches but i ran out of steam when trying to > > whip libgit2 into the build chain. > > > > I pushed out what it looks like so far. > > Took some time today and reworked

Re: Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Farzana Raisa
Then I'll have to switch to Fedora. Thanks for your replay On Tue, Mar 18, 2014 at 12:19 AM, Alberto Corona wrote: > On Mon, Mar 17, 2014 at 1:11 PM, Farzana Raisa > wrote: > > Well, i guess i have came up with a solution for this > > http://trac.hohndel.org/ticket/436#comment:5 but now i am

Re: Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Tomaz Canabrava
On Mon, Mar 17, 2014 at 3:19 PM, Alberto Corona wrote: > On Mon, Mar 17, 2014 at 1:11 PM, Farzana Raisa > wrote: > > Well, i guess i have came up with a solution for this > > http://trac.hohndel.org/ticket/436#comment:5 but now i am stuck with > this > > problem > > I would suggest not using Ub

Re: Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Alberto Corona
On Mon, Mar 17, 2014 at 1:11 PM, Farzana Raisa wrote: > Well, i guess i have came up with a solution for this > http://trac.hohndel.org/ticket/436#comment:5 but now i am stuck with this > problem I would suggest not using Ubuntu for cross compiling. Mainly due to the fact that there aren't any r

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Linus Torvalds
On Mar 17, 2014 10:57 AM, "Thiago Macieira" wrote: > > Actually, the compiler is allowed in this case to assume that dive is never > null. I think you are confused. Or the standard has been corrupted by crazy C++ people. Because arithmetic on NULL pointers is both traditional and common, exactly

Re: Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Farzana Raisa
Well, i guess i have came up with a solution for this http://trac.hohndel.org/ticket/436#comment:5 but now i am stuck with this problem On Mon, Mar 17, 2014 at 11:43 PM, Dirk Hohndel wrote: > On Mon, 2014-03-17 at 19:11 +0200, Lubomir I. Ivanov wrote: > > On 17 March 2014 18:01, Farzana Raisa

Re: *** SPAM *** (was: Re: Error during compilation of Libdivecomputer for android)

2014-03-17 Thread Cristian Ionescu-Idbohrn
On Mon, 17 Mar 2014, Tomaz Canabrava wrote: > > Qt5's been on the 'Stable' mark for about a year now ( on > qt-project.org ). > debian is a *very* pricky distribution... True. Picky. But not only debian. Most derivatives too. Experimental is not for the faint of heart :]

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Thiago Macieira
Em seg 17 mar 2014, às 08:31:05, Linus Torvalds escreveu: > > +static inline int number_of_computers(struct dive *dive) > > +{ > > + int total_number = 0; > > + struct divecomputer *dc = &dive->dc; > > + > > + if (!dive) > > + return 1; > > > > (hint: think what hap

Fwd: [Bug 860502] IRDA_FAST_RR not set in kernel causing 4x slower data transfer from IR device

2014-03-17 Thread Sape Sikkema
Gentlemen, See the good news below. Thank you all for your help sorting out the problem. Sape Origineel bericht Onderwerp: [Bug 860502] IRDA_FAST_RR not set in kernel causing 4x slower data transfer from IR device Datum: Mon, 17 Mar 2014 09:20:32 + Van:bugzilla_

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Tomaz Canabrava
On Mon, Mar 17, 2014 at 2:22 PM, Cristian Ionescu-Idbohrn < cristian.ionescu-idbo...@axis.com> wrote: > On Mon, 17 Mar 2014, Lubomir I. Ivanov wrote: > > On 17 March 2014 18:54, Tomaz Canabrava wrote: > > > On Mon, Mar 17, 2014 at 1:05 PM, Anton Lundin > wrote: > > >> On 16 March, 2014 - Anton L

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Dirk Hohndel
On Mon, 2014-03-17 at 17:05 +0100, Anton Lundin wrote: > On 16 March, 2014 - Anton Lundin wrote: > > > I started to rebase those patches but i ran out of steam when trying to > > whip libgit2 into the build chain. > > > > I pushed out what it looks like so far. > > Took some time today and rewor

Re: [Patch] Open File Dialog File Location Text Misaligned

2014-03-17 Thread Tomaz Canabrava
it seems that the need to modify the dialog should occour only on mac, so a #ifdef seems necessary ( or a fix on qt itself ) ___ subsurface mailing list subsurface@hohndel.org http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Re: Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Dirk Hohndel
On Mon, 2014-03-17 at 19:11 +0200, Lubomir I. Ivanov wrote: > On 17 March 2014 18:01, Farzana Raisa wrote: > > in order to solving bug i need to compile subsurface in windows and i'm > > trying cross building on ubuntu for windows. I've installed both mingw32 and > > gcc-mingw32. But it is not rec

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Cristian Ionescu-Idbohrn
On Mon, 17 Mar 2014, Lubomir I. Ivanov wrote: > On 17 March 2014 18:54, Tomaz Canabrava wrote: > > On Mon, Mar 17, 2014 at 1:05 PM, Anton Lundin wrote: > >> On 16 March, 2014 - Anton Lundin wrote: > >> > >> I did some Qt5 fixes too, and ill probably send them out tonight. > >> > >> Dirk: What do

Re: [Patch] Open File Dialog File Location Text Misaligned

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 19:08, Lubomir I. Ivanov wrote: > BTW, the dialog changed quite a lot on Windows 7, a[1] seems more like a > GTK dialog and a bit out of place. > is there are[2] way to fix the alignment issue you describe without > changing how the dialog looks? eating words and making typos: [

Re: Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 18:01, Farzana Raisa wrote: > in order to solving bug i need to compile subsurface in windows and i'm > trying cross building on ubuntu for windows. I've installed both mingw32 and > gcc-mingw32. But it is not recognizing mingw32-configure, mingw32-make etc. > What to do now? > t

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Tomaz Canabrava
On Mon, Mar 17, 2014 at 1:58 PM, Lubomir I. Ivanov wrote: > On 17 March 2014 18:54, Tomaz Canabrava wrote: > > Anton > > > > > > On Mon, Mar 17, 2014 at 1:05 PM, Anton Lundin wrote: > >> > >> On 16 March, 2014 - Anton Lundin wrote: > >> > >> > I started to rebase those patches but i ran out of s

Re: [Patch] Clear pn2GasItem po2GasItem pheGasItem after log closed

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 19:02, Wu Long wrote: > Hi, Lubomir, > > So for this patch, do I need to reformatted and then resubmit again? > yes, please. lubomir -- ___ subsurface mailing list subsurface@hohndel.org http://lists.hohndel.org/cgi-bin/mailman/listinf

Re: [Patch] Clear pn2GasItem po2GasItem pheGasItem after log closed

2014-03-17 Thread Wu Long
Hi, Lubomir, So for this patch, do I need to reformatted and then resubmit again? Thank you! Hugle(Wu Long) On 18 March 2014 00:55, Lubomir I. Ivanov wrote: > On 17 March 2014 18:52, Lubomir I. Ivanov wrote: > > On 17 March 2014 17:27, Long Wu wrote: > >> > >> Description : After log file

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 18:54, Tomaz Canabrava wrote: > Anton > > > On Mon, Mar 17, 2014 at 1:05 PM, Anton Lundin wrote: >> >> On 16 March, 2014 - Anton Lundin wrote: >> >> > I started to rebase those patches but i ran out of steam when trying to >> > whip libgit2 into the build chain. >> > >> > I pushe

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Dirk Hohndel
On Mon, 2014-03-17 at 08:31 -0700, Linus Torvalds wrote: > On Mon, Mar 17, 2014 at 8:13 AM, Dirk Hohndel wrote: > > > > Look at this little gem. I think I'll reorder this a little bit: > > No need. > > > +static inline int number_of_computers(struct dive *dive) > > +{ > > + int total_numbe

Re: [Patch] Clear pn2GasItem po2GasItem pheGasItem after log closed

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 18:52, Lubomir I. Ivanov wrote: > On 17 March 2014 17:27, Long Wu wrote: >> >> Description : After log file closed, the pn2, po2 or phe2 gas line are not >> cleared >> >> This patch fixed this problem after set these three items to be invisible, >> please check the attached pat

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Tomaz Canabrava
Anton On Mon, Mar 17, 2014 at 1:05 PM, Anton Lundin wrote: > On 16 March, 2014 - Anton Lundin wrote: > > > I started to rebase those patches but i ran out of steam when trying to > > whip libgit2 into the build chain. > > > > I pushed out what it looks like so far. > > Took some time today and

Re: [Patch] Clear pn2GasItem po2GasItem pheGasItem after log closed

2014-03-17 Thread Lubomir I. Ivanov
On 17 March 2014 17:27, Long Wu wrote: > > Description : After log file closed, the pn2, po2 or phe2 gas line are not > cleared > > This patch fixed this problem after set these three items to be invisible, > please check the attached patch file. > the patch seems to do the right thing, but you

Re: Error during compilation of Libdivecomputer for android

2014-03-17 Thread Anton Lundin
On 16 March, 2014 - Anton Lundin wrote: > I started to rebase those patches but i ran out of steam when trying to > whip libgit2 into the build chain. > > I pushed out what it looks like so far. Took some time today and reworked some patches and fixed building with libgit2, so now stuff builds a

Cross-building Subsurface on Linux for Windows

2014-03-17 Thread Farzana Raisa
in order to solving bug i need to compile subsurface in windows and i'm trying cross building on ubuntu for windows. I've installed both mingw32 and gcc-mingw32. But it is not recognizing mingw32-configure, mingw32-make etc. What to do now? ___ subsurface

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Linus Torvalds
On Mon, Mar 17, 2014 at 8:31 AM, Linus Torvalds wrote: > > [ Same goes for "&*ptr" btw: the "&" operator literally "undoes" the > access that is implied by the '*', and the result is just "ptr", with > no implied access, so you can do it even on a NULL pointer ] Btw, for anybody wondering "Why?".

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Linus Torvalds
On Mon, Mar 17, 2014 at 8:13 AM, Dirk Hohndel wrote: > > Look at this little gem. I think I'll reorder this a little bit: No need. > +static inline int number_of_computers(struct dive *dive) > +{ > + int total_number = 0; > + struct divecomputer *dc = &dive->dc; > + > + if (!di

[PATCH] Be more careful about dive computer selection

2014-03-17 Thread Linus Torvalds
From: Linus Torvalds Date: Mon, 17 Mar 2014 08:19:09 -0700 Subject: [PATCH] Be more careful about dive computer selection The selection logic was a bit random: some places would return NULL if the dive computer index was out of range, others would return the primary dive computer, and actually mo

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Dirk Hohndel
On Sun, 2014-03-16 at 15:52 -0700, Linus Torvalds wrote: > On Sun, Mar 16, 2014 at 1:57 PM, Dirk Hohndel wrote: > > > > Oops. We used to have code that fixes that. Wonder where that got lost. > > I think the new profile lost it in the re-implementation. The old code > didn't blindly just update t

[PATCH] Added a Current Location Button in Mappicker

2014-03-17 Thread Venkatesh Shukla IIT BHU
Added a Current Location Button in Mappicker Changes made: 1. Added a current location button in the mappicker, which takes you to your current location on clicking. Signed-off-by: Venkatesh Shukla --- src/org/subsurface/PickLocationMap.java | 63 ++--- 1 file cha

Re: Some subsurface notes from a week of diving

2014-03-17 Thread Andrey Zhdanov
On 16 March 2014 22:45, Anton Lundin wrote: > Crashes when trying to add a Gas Change event after selecting another dc > with the left arrow. > > #0 0x0042c048 in add_event (dc=0x0, time=1124, type=25, flags=0, > value=25, name=0x52eda8 "gaschange") at dive.c:41 > #1 0x0043d5ff

[PATCH] Changes to sections 1 and 2 of the user manual. (with attachment)

2014-03-17 Thread Willem Ferguson
Changes to sections 1 and 2 of the user manual. The text for these two sections has been corrected and updated in order to be ready for the release of V4.1. The very first paragraph of the manual is expanded substantially. Kind regards, willemf >From a42b71aed541ba053d77949392fb10dd7dd2f02f Mon S

[PATCH] Changes to sections 1 and 2 of the user manual.

2014-03-17 Thread Willem Ferguson
Changes to sections 1 and 2 of the user manual. The text for these two sections has been corrected and updated in order to be ready for the release of V4.1. The very first paragraph of the manual is expanded substantially. Kind regards, willemf ___ subs