Can you show the heartrate in Subsurface?

Oscar Isoz jan.oscar.isoz at gmail.com
Sat Jan 18 06:52:42 UTC 2014


Hello Linus

It seems as your latest patch generates some warnings when I run make

profile.c: In function ‘plot_string’:
profile.c:1396:3: warning: format not a string literal and no format
arguments [-Wformat-security]
   put_format(b, translate("gettextFromC","In deco\n"));
   ^
profile.c:1410:3: warning: format not a string literal and no format
arguments [-Wformat-security]
   put_format(b, translate("gettextFromC","In deco (calc)\n"));
   ^

Is this expected?
/Oscar



On Fri, Jan 17, 2014 at 11:24 PM, Linus Torvalds <
torvalds at linux-foundation.org> wrote:

> On Fri, Jan 17, 2014 at 1:50 PM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
> >
> > Ok. So here's a slightly updated patch that replaces the previous
> > patch, fixing an extraneous space in the XML output, and also adding
> > the heartbeat and bearing information to the profile "info" box, so
> > now you can actually see it in subsurface too.
>
> On top of that patch, here's a second patch that makes the dive info
> text generation use the new "struct membuffer", which has the ability
> to sanely append a formatted string to an existing string. The old
> code used a nasty pattern of
>
>     memcpy(buf2, buf, bufsize);
>     snprintf(buf, bufsize, "%s\nnew-format-string", buf2, ...);
>
> which is just disgusting. The new model just does
>
>     put_format(b, "new-format-string\n", ...);
>
> instead, which does that nice "append formatted string" thing in a
> imho much more readable manner.
>
>      Linus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140118/477a0cf0/attachment.html>


More information about the subsurface mailing list