Make VG_(n_errs_found) local;  replace globally with a 'get' function.  Renamed
vg_n_errs_suppressed too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2546 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_errcontext.c b/coregrind/vg_errcontext.c
index 646cebc..a01ea89 100644
--- a/coregrind/vg_errcontext.c
+++ b/coregrind/vg_errcontext.c
@@ -43,10 +43,10 @@
 static Supp* vg_suppressions = NULL;
 
 /* Running count of unsuppressed errors detected. */
-UInt VG_(n_errs_found) = 0;
+static UInt n_errs_found = 0;
 
 /* Running count of suppressed errors detected. */
-static UInt vg_n_errs_suppressed = 0;
+static UInt n_errs_suppressed = 0;
 
 /* forwards ... */
 static Supp* is_suppressible_error ( Error* err );
@@ -113,6 +113,11 @@
    return err->extra;
 }
 
+UInt VG_(get_n_errs_found)( void )
+{
+   return n_errs_found;
+}
+
 /*------------------------------------------------------------*/
 /*--- Suppression type                                     ---*/
 /*------------------------------------------------------------*/
@@ -423,7 +428,7 @@
       pointless to continue the Valgrind run after this point. */
    if (VG_(clo_error_limit) 
        && (vg_n_errs_shown >= M_VG_COLLECT_NO_ERRORS_AFTER_SHOWN
-           || VG_(n_errs_found) >= M_VG_COLLECT_NO_ERRORS_AFTER_FOUND)) {
+           || n_errs_found >= M_VG_COLLECT_NO_ERRORS_AFTER_FOUND)) {
       if (!stopping_message) {
          VG_(message)(Vg_UserMsg, "");
 
@@ -482,9 +487,9 @@
 	 if (p->supp != NULL) {
             /* Deal correctly with suppressed errors. */
             p->supp->count++;
-            vg_n_errs_suppressed++;	 
+            n_errs_suppressed++;	 
          } else {
-            VG_(n_errs_found)++;
+            n_errs_found++;
          }
 
          /* Move p to the front of the list so that future searches
@@ -539,7 +544,7 @@
    p->supp = is_suppressible_error(&err);
    vg_errors = p;
    if (p->supp == NULL) {
-      VG_(n_errs_found)++;
+      n_errs_found++;
       if (!is_first_shown_context)
          VG_(message)(Vg_UserMsg, "");
       pp_Error(p, False);
@@ -547,7 +552,7 @@
       vg_n_errs_shown++;
       do_actions_on_error(p, /*allow_db_attach*/True);
    } else {
-      vg_n_errs_suppressed++;
+      n_errs_suppressed++;
       p->supp->count++;
    }
 }
@@ -557,7 +562,7 @@
    guaranteed to only happen once.  This avoids all the recording and
    comparing stuff.  But they can be suppressed;  returns True if it is
    suppressed.  Bool `print_error' dictates whether to print the error. 
-   Bool `count_error' dictates whether to count the error in VG_(n_errs_found)
+   Bool `count_error' dictates whether to count the error in n_errs_found.
 */
 Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s,
                          void* extra, ExeContext* where, Bool print_error,
@@ -578,7 +583,7 @@
 
    if (NULL == is_suppressible_error(&err)) {
       if (count_error)
-         VG_(n_errs_found)++;
+         n_errs_found++;
 
       if (print_error) {
          if (!is_first_shown_context)
@@ -591,7 +596,7 @@
       return False;
 
    } else {
-      vg_n_errs_suppressed++;
+      n_errs_suppressed++;
       return True;
    }
 }
@@ -609,8 +614,6 @@
    VG_(maybe_record_error)( tid, PThreadErr, /*addr*/0, msg, /*extra*/NULL );
 }
 
-/*------------------------------*/
-
 void VG_(show_all_errors) ( void )
 {
    Int    i, n_min;
@@ -636,8 +639,8 @@
    VG_(message)(Vg_UserMsg,
                 "ERROR SUMMARY: "
                 "%d errors from %d contexts (suppressed: %d from %d)",
-                VG_(n_errs_found), n_err_contexts, 
-                vg_n_errs_suppressed, n_supp_contexts );
+                n_errs_found, n_err_contexts, 
+                n_errs_suppressed, n_supp_contexts );
 
    if (VG_(clo_verbosity) <= 1)
       return;
@@ -685,8 +688,7 @@
       VG_(message)(Vg_UserMsg,
                    "IN SUMMARY: "
                    "%d errors from %d contexts (suppressed: %d from %d)",
-                   VG_(n_errs_found), n_err_contexts, 
-                   vg_n_errs_suppressed,
+                   n_errs_found, n_err_contexts, n_errs_suppressed,
                    n_supp_contexts );
       VG_(message)(Vg_UserMsg, "");
    }