Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2013 07:27:26 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246387 - head/sys/sys
Message-ID:  <201302060727.r167RQqS023872@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Feb  6 07:27:25 2013
New Revision: 246387
URL: http://svnweb.freebsd.org/changeset/base/246387

Log:
  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

Modified:
  head/sys/sys/queue.h

Modified: head/sys/sys/queue.h
==============================================================================
--- head/sys/sys/queue.h	Wed Feb  6 07:20:09 2013	(r246386)
+++ head/sys/sys/queue.h	Wed Feb  6 07:27:25 2013	(r246387)
@@ -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 {								\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302060727.r167RQqS023872>