]> granicus.if.org Git - graphviz/commitdiff
smyrna EmbedText: squash some compiler warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Jan 2023 21:27:37 +0000 (13:27 -0800)
This switch is exhaustive. This change squashes the following warnings:

  draw.c:341:9: warning: switch missing default case [-Wswitch-default]
    341 |         switch (o->op.u.text.align)
        |         ^~~~~~
  draw.c:374:9: warning: ‘x’ may be used uninitialized in this function
    [-Wmaybe-uninitialized]
    374 |         glCompDrawText3D(o->font,x,y,view->Topview->global_z…
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~…

cmd/smyrna/draw.c

index 26463e9efcdf7d5b8424c4d7b66056ed456927f7..267a1aa591d818889b66e1fc1fffe5892d6c6143 100644 (file)
@@ -14,6 +14,7 @@ XDOT DRAWING FUNCTIONS, maybe need to move them somewhere else
                for now keep them at the bottom
 */
 #include "draw.h"
+#include <cgraph/unreachable.h>
 #include <common/colorprocs.h>
 #include <common/types.h>
 #include <common/utils.h>
@@ -349,7 +350,8 @@ static void EmbedText(sdot_op* o, int param)
                case xd_right:
                        x=o->op.u.text.x - o->op.u.text.width;
                        break;
-
+               default:
+                       UNREACHABLE();
        }
        y=o->op.u.text.y;
        if (!o->font)