svn commit: r187973 - head/sys/geom
Marcel Moolenaar
marcel at FreeBSD.org
Sat Jan 31 17:50:10 PST 2009
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;
More information about the svn-src-head
mailing list