Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Feb 2009 01:50:09 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187973 - head/sys/geom
Message-ID:  <200902010150.n111o9aS039635@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Feb  1 01:50:09 2009
New Revision: 187973
URL: http://svn.freebsd.org/changeset/base/187973

Log:
  Constify val in g_handleattr() and str in g_handleattr_str().
  This allows passing string constants to g_handleattr_str().

Modified:
  head/sys/geom/geom.h
  head/sys/geom/geom_subr.c

Modified: head/sys/geom/geom.h
==============================================================================
--- head/sys/geom/geom.h	Sun Feb  1 01:07:15 2009	(r187972)
+++ head/sys/geom/geom.h	Sun Feb  1 01:50:09 2009	(r187973)
@@ -227,10 +227,11 @@ void g_error_provider(struct g_provider 
 struct g_provider *g_provider_by_name(char const *arg);
 int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len);
 #define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v))
-int g_handleattr(struct bio *bp, const char *attribute, void *val, int len);
+int g_handleattr(struct bio *bp, const char *attribute, const void *val,
+    int len);
 int g_handleattr_int(struct bio *bp, const char *attribute, int val);
 int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val);
-int g_handleattr_str(struct bio *bp, const char *attribute, char *str);
+int g_handleattr_str(struct bio *bp, const char *attribute, const char *str);
 struct g_consumer * g_new_consumer(struct g_geom *gp);
 struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...);
 struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...);

Modified: head/sys/geom/geom_subr.c
==============================================================================
--- head/sys/geom/geom_subr.c	Sun Feb  1 01:07:15 2009	(r187972)
+++ head/sys/geom/geom_subr.c	Sun Feb  1 01:50:09 2009	(r187973)
@@ -858,14 +858,14 @@ g_handleattr_off_t(struct bio *bp, const
 }
 
 int
-g_handleattr_str(struct bio *bp, const char *attribute, char *str)
+g_handleattr_str(struct bio *bp, const char *attribute, const char *str)
 {
 
 	return (g_handleattr(bp, attribute, str, 0));
 }
 
 int
-g_handleattr(struct bio *bp, const char *attribute, void *val, int len)
+g_handleattr(struct bio *bp, const char *attribute, const void *val, int len)
 {
 	int error = 0;
 



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