Skip to content

Commit

Permalink
Improve consistency of definition metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dspinellis committed Jul 21, 2024
1 parent 02c7f05 commit 6864c28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/fcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ FCall::set_current_fun(const Type &t)
Pdtoken::macros_size());
nesting.push(cfun);
if (nesting.size() == 1)
Filedetails::get_pre_cpp_metrics(Fchar::get_fileid()).add_function(t.is_static());
Filedetails::get_post_cpp_metrics(Fchar::get_fileid()).add_function(t.is_static());
}

10 changes: 5 additions & 5 deletions src/filemetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ MetricDetails FileMetrics::metric_details[] = {
// BEGIN AUTOSCHEMA FileMetrics
// pre-cpp, post-cpp, file
{ em_ncopies, 1, 0, 1, "NCOPIES", "Number of copies of the file"},
{ em_npfunction, 1, 1, 1, "NPFUNCTION", "Number of defined project-scope functions"},
{ em_nffunction, 1, 1, 1, "NFFUNCTION", "Number of defined file-scope (static) functions"},
{ em_npvar, 1, 1, 1, "NPVAR", "Number of defined project-scope variables"},
{ em_nfvar, 1, 1, 1, "NFVAR", "Number of defined file-scope (static) variables"},
{ em_nincfile, 1, 0, 1, "NINCFILE", "Number of directly included files"},
{ em_npfunction, 0, 1, 1, "NPFUNCTION", "Number of defined project-scope functions"},
{ em_nffunction, 0, 1, 1, "NFFUNCTION", "Number of defined file-scope (static) functions"},
{ em_npvar, 0, 1, 1, "NPVAR", "Number of defined project-scope variables"},
{ em_nfvar, 0, 1, 1, "NFVAR", "Number of defined file-scope (static) variables"},
{ em_naggregate, 0, 1, 1, "NAGGREGATE", "Number of complete aggregate (struct/union) declarations"},
{ em_namember, 0, 1, 1, "NAMEMBER", "Number of declared aggregate (struct/union) members"},
{ em_nenum, 0, 1, 1, "NENUM", "Number of complete enumeration declarations"},
{ em_nemember, 0, 1, 1, "NEMEMBER", "Number of declared enumeration elements"},
{ em_nincfile, 1, 0, 1, "NINCFILE", "Number of directly included files"},
// END AUTOSCHEMA FileMetrics
};

Expand Down
4 changes: 2 additions & 2 deletions src/filemetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class FileMetrics : public Metrics {
// During post-processing
em_ncopies = // Number of copies of the file
Metrics::metric_max,
// During pre-processing or parsing (once based on processed)
em_nincfile, // Number of directly included files
// During parsing (once based on processed)
em_npfunction, // Defined project-scope functions
em_nffunction, // Defined file-scope (static) functions
em_npvar, // Defined project-scope variables
Expand All @@ -59,7 +60,6 @@ class FileMetrics : public Metrics {
em_namember, // Number of declared aggregate members
em_nenum, // Number of complete enumeration declarations
em_nemember, // Number of declared enumeration elements
em_nincfile, // Number of directly included files
metric_max
};

Expand Down

0 comments on commit 6864c28

Please sign in to comment.