Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jul 2013 15:54:44 GMT
From:      Jonathan Anderson <jonathan@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 231418 for review
Message-ID:  <201307241554.r6OFsinD078484@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@231418?ac=10

Change 231418 by jonathan@jonathan-on-joe on 2013/07/24 15:54:41

	Sync commit cf3aca from GitHub: allow programmer-specified assertion names.
	
	I wouldn't use this feature very much yet (requires testing), but here are the header changes that will allow it to work.

Affected files ...

.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/include/tesla-macros.h#10 edit
.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/include/tesla.h#9 edit

Differences ...

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/include/tesla-macros.h#10 (text+ko) ====

@@ -54,7 +54,7 @@
 /** An inline assertion. */
 #define	TESLA_ASSERT(locality, start, end, expression)			\
 	__tesla_inline_assertion(					\
-		__FILE__, __LINE__, __COUNTER__,			\
+		"", __FILE__, __LINE__, __COUNTER__,			\
 		locality, start, end, expression			\
 	)
 

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/include/tesla.h#9 (text+ko) ====

@@ -57,13 +57,15 @@
  * Magic "function" representing a TESLA assertion.
  *
  * Its arguments are:
+ *  * an explicit programmer-supplied name (optional: can be set to "")
  *  * name of the file the assertion is located in (__FILE__)
  *  * the line the assertion is defined at (__LINE__)
  *  * a counter to ensure uniqueness (__COUNTER__)
  *  * the TESLA context (per-thread or global)
  */
 void
-__tesla_inline_assertion(const char *filename, int line, int count,
+__tesla_inline_assertion(const char *name,
+	const char *filename, int line, int count,
 	__tesla_locality *loc, ...);
 
 #define	__TESLA_INFINITE_REPETITIONS	INT_MAX
@@ -165,8 +167,8 @@
 struct __tesla_automaton_description*	__tesla_automaton_done();
 
 inline struct __tesla_automaton_usage*
-__tesla_struct_uses_automaton(const char *automaton,
-	__tesla_locality *loc, ...)
+__tesla_struct_uses_automaton(__unused const char *automaton,
+	__unused __tesla_locality *loc, ...)
 {
 	return 0;
 }
@@ -183,7 +185,7 @@
  */
 #define	__tesla_struct_usage(subject, automaton, loc, start, end) \
 	struct __tesla_automaton_usage*					\
-	__tesla_struct_automaton_usage_##struct_name##_##automaton(subject) { \
+	__tesla_struct_automaton_usage_##struct_name##_##automaton(__unused subject) { \
 		return __tesla_struct_uses_automaton(			\
 			#automaton, loc, start, end);	\
 	}



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