]> granicus.if.org Git - graphviz/commitdiff
lib/mingle: [nfc] pre-emptively squash -fpermissive warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 6 Jan 2022 04:48:07 +0000 (20:48 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 8 Jan 2022 16:15:32 +0000 (08:15 -0800)
When moving this code to C++ in an upcoming commit, this would otherwise
trigger:

  lib/mingle/ink.cpp:46:22: error: uninitialized const 'Origin' [-fpermissive]
   static const point_t Origin;
                        ^
  In file included from lib/mingle/ink.cpp:17:0:
  lib/mingle/ink.h:19:16: note: 'const struct point_t' has no user-provided
    default constructor
   typedef struct {
                  ^
  lib/mingle/ink.h:20:10: note: and the implicitly-defined constructor does not
    initialize 'double point_t::x'
     double x, y;
          ^

This noisy initialization can probably be undone after mingle and libmingle are
moved to entirely C++.

Gitlab: #2154

lib/mingle/ink.c

index 78a27d71434ff7f390d1c10f81e02ab18667b558..2c7caa43d7c6648ba869640754d77afa12c99817 100644 (file)
@@ -43,7 +43,7 @@ static double dotPoint(point_t a, point_t b){
   return a.x*b.x + a.y*b.y;
 }
 
-static const point_t Origin;
+static const point_t Origin = {0, 0};
 
 /* sumLengths:
  */