Constify val in g_handleattr() and str in g_handleattr_str().

This allows passing string constants to g_handleattr_str().
This commit is contained in:
marcel 2009-02-01 01:50:09 +00:00
parent c304504261
commit 41ccd088c6
2 changed files with 5 additions and 4 deletions

View File

@ -227,10 +227,11 @@ void g_error_provider(struct g_provider *pp, int error);
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, ...);

View File

@ -858,14 +858,14 @@ 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)
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;