aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-03-08Avoid calling free on uninitialized dive variableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-08Uemis GPS location tracking seems backwardsGravatar Dirk Hohndel
I can't figure out how this ever worked... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-08Another case of 'dereference before NULL check'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-08Don't use dive before checking it against NULLGravatar Dirk Hohndel
Dive gets dereferenced in get_surface_pressure_in_mbar(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-08Fix totally broken put_vformat() implementationGravatar Linus Torvalds
I'm ashamed. put_vbuffer() worked perfectly fine for the normal case when everything fit in our simple buffer on-stack, but the fallback case was broken in so many ways that I'm just going to go sit in a corner and cry myself to sleep. And dammit, I _knew_ how to do it right. I knew you had to do a "va_copy()" and couldn't just keep re-using 'args'. I've done this before. But I half-arsed it, and nobody ever noticed, because you wouldn't do C style format strings for big strings. "128 bytes is enough for everybody". And as penance for this idiocy, I just spent too much time trying to figure out what was wrong in my git loading code when my debug printouts caused SIGSEGV's. Sigh. Anyway, now it should hopefully be correct, and the code is smarter about things too, not having that extra buffer since we already *have* a buffer in the "struct membuffer" we are working with. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-08Add initial parser for git treesGravatar Linus Torvalds
It doesn't actually parse the files themselves, but it does walk the object tree and print out the dives and trips it finds. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-08Use symbolic names for the git file typesGravatar Linus Torvalds
Instead of hardcoding the regular file mode (0100644 is the traditional Unix S_IFREG file mode with -rw-r--r-- protections), use GIT_FILEMODE_BLOB (and GIT_FILEMODE_TREE for 040000 - S_IFDIR). The numbers were historically indeed the regular S_IFREG/S_IFDIR values, but since those aren't portable, git ended up defining their own. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Fix colors on the new profile.Gravatar Tomaz Canabrava
This patch fixes the colors on the new profile, the init of the colors map was not being done. This fixes it. A few problems were spotted on the new profile dealing with the ruler graph and a newly added dive, when using the dive add dialog. I'll be on it later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Remove unused parameter to tree_insert()Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Don't have the put_something() functions return successGravatar Dirk Hohndel
We didn't use the return value anywhere. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Flesh out git save formatGravatar Linus Torvalds
This fixes up the writing of the git format to the point that it might be getting close to complete. In particular: - Add subsurface version information into commit message as requested by Dirk - Fix missed string quoting ('\' needs to be quoted as '\\') - rename "git_save_error()" as "report_error()", since we'll want to use this for the loading code too. - Improve on dive and trip name generation - create a date-based directory hierarchy - save dive computer data as individual files - actually save the trip information There might be further changes as I start to actually *read* the git files, of course. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Add C string helper to membuffer interfaceGravatar Linus Torvalds
I don't know why I didn't do this from the beginning. We often build up a membuffer and then want to use it as a C string. You could do it by hand by adding the zero byte at the end, but that's just annoying. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Update cross building for Windows on LinuxGravatar Dirk Hohndel
This updates the instructions and the plumbing to be able to link against a locally built libgit2 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Fix compile problemGravatar Dirk Hohndel
QPointer was undefined (oddly I didn't run into this when test building earlier). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Add libgit2 dependency to INSTALL file (MacPorts stanza)Gravatar Giuseppe 'ferdy' Miceli
Signed-off-by: Giuseppe 'ferdy' Miceli <ferdy@ferdy.it> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Add a workaround for using post 0.20 git versions of libgit2Gravatar Dirk Hohndel
Add the following to your qmake command line and things should compile again: qmake ... CONFIG+=libgit21-api Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Remove a Lot of Dead Code.Gravatar Tomaz Canabrava
This is just removal of dead code from the old profile, probably there's still a bit more to remove, but this is a very good cleanup already. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Remove the code for the old Profile.Gravatar Tomaz Canabrava
This is simply a code removal, nothing was touched besides the profilegraphics.h/cpp files. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Remove the old profile from the main screen of SubsurfaceGravatar Tomaz Canabrava
This patch partially removes the code for the old profile from Subsurface. It removes the use of the old profile on the mainwindow, but keeping the code in the tree for now. A bit of code-cleanup also entered this commit because I had to change every instance of the code that used the old profile. Now to the real code-cleanup Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Fix a crash on changing dives when the ruler is used.Gravatar Tomaz Canabrava
The ruler is a weird beast - it has two child objects that access the parent to call another function, that call the child functions. When I updated the plot_info I didn't take that into consideration, what happened is that when I set the parent's plot_info, the children's plot_info are still invalid, but the update method is called anyhow. This patch updates all plot_info's before calling anything else. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Fix compilation with libgit2 0.20Gravatar Tomaz Canabrava
Linus was wrong - the change to the API happened after 0.20 was released. So libgit2 0.20 still needs the fix. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Fix theoretical uninitialized readGravatar Dirk Hohndel
We should never read cur_pr[cyl] if cyl isn't used during a dive - but for cylinders that are used cur_pr[cyl] is initialized. But just to catch errors elsewhere, let's not leave cur_pr[cyl] uninitialized. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Fix memory leak when parsing a dive failsGravatar Dirk Hohndel
We had all these repetitive calls to dc_parser_destroy but didn't free the already allocated dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Prevent another file descriptor leakGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Initial implementation of git save formatGravatar Linus Torvalds
This saves the dive data into a git object repository instead of a single XML file. We create a git object tree with each dive as a separate file, hierarchically by trip and date. NOTE 1: This largely duplicates the XML saving code, because trying to share it seemed just too painful: the logic is very similar, but the details of the actual strings end up differing sufficiently that there are tons of trivial differences. The git save format is line-based with minimal quoting, while XML quotes everything with either "<..\>" or using single quotes around attributes. NOTE 2: You currently need a dummy "file" to save to, which points to the real save location: the git repository and branch to be used. We should make this a config thing, but for testing, do something like this: echo git /home/torvalds/scuba:linus > git-test to create that git information file, and when you use "Save To" and specify "git-test" as the file to save to, subsurface will use the new git save logic to save to the branch "linus" in the repository found at "/home/torvalds/scuba". NOTE 3: The git save format uses just the git object directory, it does *not* check out the result in any git working tree or index. So after you do a save, you can do git log -p linus to see what actually happened in that branch, but it will not affect any actual checked-out state in the repository. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Fix real memory leakGravatar Dirk Hohndel
We can't keep the cache around (even though it's tempting) as the next iteration might change the start time of the planned dive or other parameters which would make the cached data invalid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Deal with theoretical memory leaksGravatar Dirk Hohndel
This is rather academic, but it will make Coverity happy. If we start running out of memory we should make sure we don't leak any more memory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Don't leak file descriptor in the error caseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06Make it executable and remove magic whitespace on shebang line.Gravatar Cristian Ionescu-Idbohrn
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-05Mark ignored error return as intentionalGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-05Null terminate buffer at the correct spotGravatar Dirk Hohndel
fread tells us how many bytes it read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-05Uemis downloader: don't ignore return values from fs operationsGravatar Dirk Hohndel
In most cases the existing code might have done the right thing, but some of the hard to reproduce errors might actually stem from the fact that we have intermittend fs errors. Maybe this addresses things? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-05Another small tweak to whitespace toolGravatar Dirk Hohndel
clang-format doesn't appear to reindent multi line #define statements correctly - so this hopefully will clean those up. The included whitespace corrections to the code should stay in place when using the updated tool. This includes cleaning up some multi-line comments that were messed up the last time around as well as a few other minor changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-05Add new terms which can be a useful referenceGravatar Gopichand Paturi
Terms added are Trimix, Nitrox, Heliox and TC. Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-04Add alternate instructions for building on MacOSX using MacPortsGravatar Giuseppe 'ferdy' Miceli
This modifies the INSTALL file to offer MacPorts based instructions. Signed-off-by: Giuseppe 'ferdy' Miceli <ferdy@ferdy.it> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-04Changes to icons in profile panelGravatar Willem Ferguson
- Replace dustbin icon. - Replace NDL/TTS tool tip with "Show NDL / TTS" - Create tool tip for scale icon: "Rescale depth axis" Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-04Reorganise buttons in profile panelGravatar Willem Ferguson
- Move the buttons of the profile window around to have more sane positions. - All the buttons affecting the ceiling(s) are now grouped together. - All the buttons affecting the Information Box are now grouped together. - The previous icon for "Show calculated ceiling" has been reassigned to "Show all tissues" - A new stand-in button hav been included for "Show calculated ceiling" Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Fix possibly uninitialized valueGravatar Dirk Hohndel
I'm not sure about this one. It's possible that there's something happening behind the scenes that I don't understand. But let's just initialize this to 0 and be sure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Don't use error after freeGravatar Dirk Hohndel
We need to reset the error pointer to NULL for this to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Don't use negative gas indexGravatar Dirk Hohndel
This shouldn't happen, but in case we run out of gases we shouldn't use the negative gas index (which is the error return of get_gas_idx()) for the array. Let's fall back to the (incorrect) first gas. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Remove pointless assignmentsGravatar Dirk Hohndel
tissue_tolerance wasn't used after it was assigned. type was overwritten after it was assigned. serial was overwritten after the last /= 100. event is assigned in the for loop. clear isn't used after the assignment Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Update the README file part about commit messagesGravatar Thiago Macieira
Link to the official home of the developer certificate of origin and clarify some details about commit messages, as discussed on the mailing list. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Depth widget minor UX improvementGravatar Andrey Zhdanov
Decrease depth by tapping left part of widget. Icon is showing "up" (i.e. closer to surface). Increase depth by tapping right part of widget. Icon is showing "down" (i.e. deeper). Fixes #354 Signed-off-by: Andrey Zhdanov <andrjufka@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Whitespace cleanupGravatar Dirk Hohndel
Minor change to the perl postprocessing script and resulting changes to the affected source files. This deals with two issues: - "foreach"-like structures were not always treated correctly - some longer calculations that ended on "+ constant" were reformatted in a rather unatractive manner In one source file (divelist.c) I ended up adding braces to the sources... trying to cascade the indentation further down without having the block there seemed a lot more trouble than it's worth. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Fix gps parsingGravatar g1g19
The argument index used to pull in the translated hemisphere letters was incorrect. Fixes #418 Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Correct another typoGravatar Giuseppe 'ferdy' Miceli
Non-stop Dive Limit (or No Deco Limit) abbreviation is not NTL but NDL Signed-off-by: Giuseppe 'ferdy' Miceli <ferdy@ferdy.it> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Correct typo in partial pressure abbreviationsGravatar Giuseppe 'ferdy' Miceli
Partial pressures abbreviations should have capitalized chemical element symbols e.g. pn2 -> pN2 Signed-off-by: Giuseppe 'ferdy' Miceli <ferdy@ferdy.it> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Add .DS_Store files to .gitignoreGravatar Giuseppe 'ferdy' Miceli
Signed-off-by: Giuseppe 'ferdy' Miceli <ferdy@ferdy.it> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Equivalent Air Density Depth was mislabeledGravatar Dirk Hohndel
In commit c84ef319a2d8 ("Create a toolbox on the left side of the new profile") Tomaz invented a new TLA: EED. No one noticed. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-03Created latest source strings for translationsGravatar Dirk Hohndel
And pushed them to transifex Signed-off-by: Dirk Hohndel <dirk@hohndel.org>