summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-02-06 07:27:25 +0000
committerglebius <glebius@FreeBSD.org>2013-02-06 07:27:25 +0000
commit40a2400cbed1f40f70252328eeb5d4001f0a6fbb (patch)
tree964f59d983221e87836863529953524b190d0e11
parent73c1717b7e07dec67ad73cdee5c43064533a7e8b (diff)
downloadFreeBSD-src-40a2400cbed1f40f70252328eeb5d4001f0a6fbb.zip
FreeBSD-src-40a2400cbed1f40f70252328eeb5d4001f0a6fbb.tar.gz
Fixes to QUEUE_MACRO_DEBUG support:
- Add const quilifiers to fields that store value of __FILE__. - Use long type for fields that store value of __LINE__. - Sort and style(9) debugging fields. - Add initializer for debugging fields into TAILQ_INITIALIZER macro. PR: 175759 Submitted by: Andrey Simonenko <simon comsys.ntu-kpi.kiev.ua> Reviewed by: bde
-rw-r--r--sys/sys/queue.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index e65b1ce..368d69e 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -105,13 +105,14 @@
#ifdef QUEUE_MACRO_DEBUG
/* Store the last 2 places the queue element or head was altered */
struct qm_trace {
- char * lastfile;
- int lastline;
- char * prevfile;
- int prevline;
+ unsigned long lastline;
+ unsigned long prevline;
+ const char *lastfile;
+ const char *prevfile;
};
#define TRACEBUF struct qm_trace trace;
+#define TRACEBUF_INITIALIZER { __FILE__, __LINE__, NULL, 0 } ,
#define TRASHIT(x) do {(x) = (void *)-1;} while (0)
#define QMD_SAVELINK(name, link) void **name = (void *)&(link)
@@ -134,6 +135,7 @@ struct qm_trace {
#define QMD_TRACE_HEAD(head)
#define QMD_SAVELINK(name, link)
#define TRACEBUF
+#define TRACEBUF_INITIALIZER
#define TRASHIT(x)
#endif /* QUEUE_MACRO_DEBUG */
@@ -461,7 +463,7 @@ struct name { \
}
#define TAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).tqh_first }
+ { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }
#define TAILQ_ENTRY(type) \
struct { \
OpenPOWER on IntegriCloud