]> granicus.if.org Git - graphviz/commit
core plugin: suppress 'offset' double comparison warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Nov 2022 23:53:05 +0000 (15:53 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Nov 2022 21:00:02 +0000 (13:00 -0800)
commit449407245568ce8a96a142923c388d6bfdfe5d34
treef7115c4c94b3e818b46f98eb622c5afbe49d9014
parentbbbe41a43964a8f258d33aec741a80002f690f31
core plugin: suppress 'offset' double comparison warning

This code is trying to abbreviate printing `0.000` or `1.000`. We can more
accurately describe the situations under which this will happen, squashing:

  gvrender_core_svg.c: In function ‘svg_print_stop’:
  gvrender_core_svg.c:525:16: warning: comparing floating-point with ‘==’ or
    ‘!=’ is unsafe [-Wfloat-equal]
    525 |     if (offset == 0.0)
        |                ^~
  gvrender_core_svg.c:527:21: warning: comparing floating-point with ‘==’ or
    ‘!=’ is unsafe [-Wfloat-equal]
    527 |     else if (offset == 1.0)
        |                     ^~
plugin/core/gvrender_core_svg.c