ncurses 6.1 - patch 20190216
[ncurses.git] / ncurses / trace / trace_xnames.c
index 9b0b5920d81455d4d47de9f932275c3538acfbf6..8d0eefb9d4f00de956c35237060a739ec1f282f6 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1999-2010,2016 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  */
 
 #include <curses.priv.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $")
+MODULE_ID("$Id: trace_xnames.c,v 1.7 2016/05/28 23:30:01 tom Exp $")
 
 NCURSES_EXPORT(void)
-_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED)
+_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED)
 {
 #ifdef TRACE
 #if NCURSES_XNAMES
     int limit = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings;
-    int n, m;
+
     if (limit) {
+       int n;
        int begin_num = tp->ext_Booleans;
        int begin_str = tp->ext_Booleans + tp->ext_Numbers;
 
@@ -54,7 +54,10 @@ _nc_trace_xnames(TERMTYPE * tp GCC_UNUSED)
                limit,
                tp->ext_Booleans, tp->ext_Numbers, tp->ext_Strings,
                tp->num_Booleans, tp->num_Numbers, tp->num_Strings);
+
        for (n = 0; n < limit; n++) {
+           int m;
+
            if ((m = n - begin_str) >= 0) {
                _tracef("[%d] %s = %s", n,
                        tp->ext_Names[n],