]> granicus.if.org Git - graphviz/commitdiff
strip_dir: replace ad hoc boolean with C99 bool
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Jul 2021 23:10:20 +0000 (16:10 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Jul 2021 00:14:02 +0000 (17:14 -0700)
lib/sparse/general.c

index d3acbb3d75364cc68ed548a749a9a85b4703e631..048cd3a8c056a785b516c2d55b6996d858397c04 100644 (file)
@@ -8,6 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include <stdbool.h>
 #include <stddef.h>
 #include <sparse/general.h>
 #include <errno.h>
@@ -174,12 +175,12 @@ real point_distance(real *p1, real *p2, int dim){
 }
 
 char *strip_dir(char *s){
-  int first = TRUE;
+  bool first = true;
   if (!s) return s;
   for (size_t i = strlen(s); ; i--) {
     if (first && s[i] == '.') {/* get rid of .mtx */
       s[i] = '\0';
-      first = FALSE;
+      first = false;
     }
     if (s[i] == '/') return &s[i+1];
     if (i == 0) {