svn commit: r286724 - head/sys/sys

Ian Lepore ian at FreeBSD.org
Thu Aug 13 14:43:27 UTC 2015


Author: ian
Date: Thu Aug 13 14:43:25 2015
New Revision: 286724
URL: https://svnweb.freebsd.org/changeset/base/286724

Log:
  Constify the pointers to eventtimer and timecounter name strings.
  
  The need for this appears as soon as you try to set the names to something
  that isn't a "quoted literal".  (I'm actually confused why quoted strings
  aren't a problem as well, we must have some warning disabled.)

Modified:
  head/sys/sys/timeet.h
  head/sys/sys/timetc.h

Modified: head/sys/sys/timeet.h
==============================================================================
--- head/sys/sys/timeet.h	Thu Aug 13 14:43:11 2015	(r286723)
+++ head/sys/sys/timeet.h	Thu Aug 13 14:43:25 2015	(r286724)
@@ -53,7 +53,7 @@ typedef int et_deregister_cb_t(struct ev
 struct eventtimer {
 	SLIST_ENTRY(eventtimer)	et_all;
 		/* Pointer to the next event timer. */
-	char			*et_name;
+	const char		*et_name;
 		/* Name of the event timer. */
 	int			et_flags;
 		/* Set of capabilities flags: */

Modified: head/sys/sys/timetc.h
==============================================================================
--- head/sys/sys/timetc.h	Thu Aug 13 14:43:11 2015	(r286723)
+++ head/sys/sys/timetc.h	Thu Aug 13 14:43:25 2015	(r286724)
@@ -49,7 +49,7 @@ struct timecounter {
 		/* This mask should mask off any unimplemented bits. */
 	uint64_t		tc_frequency;
 		/* Frequency of the counter in Hz. */
-	char			*tc_name;
+	const char		*tc_name;
 		/* Name of the timecounter. */
 	int			tc_quality;
 		/*


More information about the svn-src-head mailing list