summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-11-20 13:02:38 -0500
committerFrank Ch. Eigler <fche@elastic.org>2009-11-20 13:02:38 -0500
commite9b2a22da6a5a4cc49b410681bd5cf228f1e8fc3 (patch)
treed7a0c7f4b1265797d807bf3a2745bba45a79e0dd
parent34642a03789b139d9e33253ab42744852199af1f (diff)
downloadsystemtap-steved-e9b2a22da6a5a4cc49b410681bd5cf228f1e8fc3.tar.gz
systemtap-steved-e9b2a22da6a5a4cc49b410681bd5cf228f1e8fc3.tar.xz
systemtap-steved-e9b2a22da6a5a4cc49b410681bd5cf228f1e8fc3.zip
cleanup: explain -5 magic value used in map-sorting code
-rw-r--r--runtime/map.c2
-rw-r--r--translate.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/runtime/map.c b/runtime/map.c
index 74467f30..20d8a48c 100644
--- a/runtime/map.c
+++ b/runtime/map.c
@@ -412,7 +412,7 @@ static void _stp_pmap_del(PMAP pmap)
}
/* sort keynum values */
-#define SORT_COUNT -5
+#define SORT_COUNT -5 /* see also translate.cxx:visit_foreach_loop */
#define SORT_SUM -4
#define SORT_MIN -3
#define SORT_MAX -2
diff --git a/translate.cxx b/translate.cxx
index ca298113..03f7c86a 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -2611,7 +2611,7 @@ c_unparser::visit_foreach_loop (foreach_loop *s)
// @count instead for aggregates. '-5' tells the
// runtime to sort by count.
if (s->sort_column == 0)
- sort_column = -5;
+ sort_column = -5; /* runtime/map.c SORT_COUNT */
else
sort_column = s->sort_column;