Print this page
cleanup

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/gprof/common/printgprof.c
          +++ new/usr/src/cmd/sgs/gprof/common/printgprof.c
↓ open down ↓ 520 lines elided ↑ open up ↑
 521  521                          (void) printf(" (%d)", selfp->index);
 522  522          }
 523  523  
 524  524          if (c != selfp->name)
 525  525                  free((void *)c);
 526  526  }
 527  527  
 528  528  void
 529  529  print_demangled_name(int n, nltype *selfp)
 530  530  {
 531      -        char *c = demangled_name(selfp);
      531 +        char *c = (char *)demangled_name(selfp);
 532  532          int i;
 533  533  
 534  534          if (c == selfp->name)
 535  535                  return;
 536  536  
 537  537          (void) printf("\n");
 538  538          for (i = 1; i < n; i++)
 539  539                  (void) printf(" ");
 540  540          (void) printf("[%s]", selfp->name);
 541  541  
 542      -        free((void *)c);
      542 +        free(c);
 543  543  }
 544  544  
 545  545  void
 546  546  sortchildren(nltype *parentp)
 547  547  {
 548  548          arctype *arcp;
 549  549          arctype *detachedp;
 550  550          arctype sorted;
 551  551          arctype *prevp;
 552  552  
↓ open down ↓ 480 lines elided ↑ open up ↑
1033 1033                                  (void) sprintf(peterbuffer, "[%d]", nlp->index);
1034 1034                          else
1035 1035                                  (void) sprintf(peterbuffer, "(%d)", nlp->index);
1036 1036  
1037 1037                          if (i < nnames) {
1038 1038                                  const char *d = demangled_name(nlp);
1039 1039  
1040 1040                                  if (does_clash(namesortnlp, i, nnames)) {
1041 1041                                          (void) printf("%6.6s %d:%s\n",
1042 1042                                              peterbuffer, nlp->module->id, d);
1043      -                                } else
     1043 +                                } else {
1044 1044                                          (void) printf("%6.6s %s\n", peterbuffer,
1045 1045                                              d);
     1046 +                                }
1046 1047  
1047      -                                if (d != nlp->name)
     1048 +                                if (d != nlp->name) {
1048 1049                                          (void) printf("%6.6s   [%s]", "",
1049 1050                                              nlp->name);
     1051 +                                        free((void *)d);
     1052 +                                }
1050 1053                          } else {
1051 1054                                  (void) printf("%6.6s ", peterbuffer);
1052 1055                                  (void) sprintf(peterbuffer, "<cycle %d>",
1053 1056                                      nlp->cycleno);
1054 1057                                  (void) printf("%-33.33s", peterbuffer);
1055 1058                          }
1056 1059                  }
1057 1060                  (void) printf("\n");
1058 1061          }
1059 1062          free(namesortnlp);
1060 1063  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX