svn commit: r209193 - head/sys/dev/sound/pcm

Andriy Gapon avg at FreeBSD.org
Tue Jun 15 07:06:55 UTC 2010


Author: avg
Date: Tue Jun 15 07:06:54 2010
New Revision: 209193
URL: http://svn.freebsd.org/changeset/base/209193

Log:
  sound/pcm: use non-const string as a value with SYSCTL_STRING
  
  Although the sysctls are marked with CTLFLAG_RD and the values will stay
  immutable, current sysctl implementation stores value pointer in
  void* type, which means that const qualifier is discarded anyway
  and some newer compilers complaint about that.
  We can't use de-const trick in sysctl implementation, because in that
  case we could miss an opposite situation where a const value is used
  with CTLFLAG_RW sysctl.
  
  Complaint from:	gcc 4.4, clang
  MFC after:	2 weeks

Modified:
  head/sys/dev/sound/pcm/feeder_eq.c
  head/sys/dev/sound/pcm/feeder_rate.c
  head/sys/dev/sound/pcm/sound.c

Modified: head/sys/dev/sound/pcm/feeder_eq.c
==============================================================================
--- head/sys/dev/sound/pcm/feeder_eq.c	Tue Jun 15 04:47:16 2010	(r209192)
+++ head/sys/dev/sound/pcm/feeder_eq.c	Tue Jun 15 07:06:54 2010	(r209193)
@@ -93,7 +93,7 @@ SND_DECLARE_FILE("$FreeBSD$");
 static int feeder_eq_exact_rate = 0;
 
 #ifdef _KERNEL
-static const char feeder_eq_presets[] = FEEDER_EQ_PRESETS;
+static char feeder_eq_presets[] = FEEDER_EQ_PRESETS;
 SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_eq_presets, CTLFLAG_RD,
     &feeder_eq_presets, 0, "compile-time eq presets");
 

Modified: head/sys/dev/sound/pcm/feeder_rate.c
==============================================================================
--- head/sys/dev/sound/pcm/feeder_rate.c	Tue Jun 15 04:47:16 2010	(r209192)
+++ head/sys/dev/sound/pcm/feeder_rate.c	Tue Jun 15 07:06:54 2010	(r209193)
@@ -159,7 +159,7 @@ int feeder_rate_quality = Z_QUALITY_DEFA
 static int feeder_rate_polyphase_max = Z_POLYPHASE_MAX;
 
 #ifdef _KERNEL
-static const char feeder_rate_presets[] = FEEDER_RATE_PRESETS;
+static char feeder_rate_presets[] = FEEDER_RATE_PRESETS;
 SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_rate_presets, CTLFLAG_RD,
     &feeder_rate_presets, 0, "compile-time rate presets");
 

Modified: head/sys/dev/sound/pcm/sound.c
==============================================================================
--- head/sys/dev/sound/pcm/sound.c	Tue Jun 15 04:47:16 2010	(r209192)
+++ head/sys/dev/sound/pcm/sound.c	Tue Jun 15 07:06:54 2010	(r209193)
@@ -68,7 +68,7 @@ SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_
  * XXX I've had enough with people not telling proper version/arch
  *     while reporting problems, not after 387397913213th questions/requests.
  */
-static const char snd_driver_version[] =
+static char snd_driver_version[] =
     __XSTRING(SND_DRV_VERSION)"/"MACHINE_ARCH;
 SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version,
     0, "driver version/arch");


More information about the svn-src-head mailing list