bug-cflow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cflow] [bug report] A part of the tree branch is lacked with the --


From: Shigio YAMAGUCHI
Subject: [bug-cflow] [bug report] A part of the tree branch is lacked with the --tree option.
Date: Wed, 17 Aug 2011 17:16:35 +0900

Hello,
Though I might be misunderstanding about it, I might have found a bug.

Version: cflow-1.3
Environment: FreeBSD-6.1 RELEASE

1. Situation of the trouble
===========================

A '|' is lacked in the 3 line of the output.

% cat -n test.c
     1  int main()
     2  {
     3          hello(NULL);
     4          printf("Hello\n");
     5  }
     6  hello(const char *data)
     7  {
     8          printf("Hello\n");
     9  }
% cflow --tree --number test.c
    1 +-main() <int main () at test.c:1>
    2   +-hello() <hello (const char *data) at test.c:6>
    3     \-printf()      <=========================== A '|' is lacked
    4   \-printf()

2. Correction of the trouble
============================

o Fixed version

% cflow --tree --number test.c
    1 +-main() <int main () at test.c:1>
    2   +-hello() <hello (const char *data) at test.c:6>
    3   | \-printf()
    4   \-printf()
% _

This is the test program.
-------------------------------------------------
int main()
{
        hello(NULL);
        printf("Hello\n");
}
hello(const char *data)
{
        printf("Hello\n");
}
-------------------------------------------------

Here is the patch.
Thank you for your great tool.

Best Regards,
Shigio Yamaguchi


*** output.c.orig       Sun Jun 28 21:53:58 2009
--- output.c    Wed Aug 17 16:44:03 2011
***************
*** 327,333 ****
          return;
       set_active(sym);
       for (p = linked_list_head(sym->callee); p; p = p->next) {
!         set_level_mark(lev+1, is_printable(p->next));
          direct_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
--- 327,333 ----
          return;
       set_active(sym);
       for (p = linked_list_head(sym->callee); p; p = p->next) {
!         set_level_mark(lev+1, !is_last(p));
          direct_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
***************
*** 351,357 ****
          return;
       set_active(sym);
       for (p = linked_list_head(sym->caller); p; p = p->next) {
!         set_level_mark(lev+1, is_printable(p->next));
          inverted_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
--- 351,357 ----
          return;
       set_active(sym);
       for (p = linked_list_head(sym->caller); p; p = p->next) {
!         set_level_mark(lev+1, !is_last(p));
          inverted_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]