[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: Make libxl__xs_* more const-correct



# HG changeset patch
# User Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
# Date 1323712117 0
# Node ID f33548a58db30624ac2ff58f257af042f44c94f7
# Parent  efb9359f486d94f1db5d70cb22b2eff133eb5f4d
libxl: Make libxl__xs_* more const-correct

Paths and values which are not modified by these functions should be
declared as "const char *" not "char *".

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r efb9359f486d -r f33548a58db3 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Mon Dec 12 17:43:15 2011 +0000
+++ b/tools/libxl/libxl_internal.h      Mon Dec 12 17:48:37 2011 +0000
@@ -172,18 +172,19 @@
 _hidden char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array, 
int length);
 
 _hidden int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
-                    char *dir, char **kvs);
+                             const char *dir, char **kvs);
 _hidden int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
-                   char *path, const char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
+               const char *path, const char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
    /* Each fn returns 0 on success.
     * On error: returns -1, sets errno (no logging) */
 
 _hidden char *libxl__xs_get_dompath(libxl__gc *gc, uint32_t domid);
    /* On error: logs, returns NULL, sets errno. */
 
-_hidden char *libxl__xs_read(libxl__gc *gc, xs_transaction_t t, char *path);
+_hidden char *libxl__xs_read(libxl__gc *gc, xs_transaction_t t,
+                             const char *path);
 _hidden char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t,
-                                   char *path, unsigned int *nb);
+                                   const char *path, unsigned int *nb);
    /* On error: returns NULL, sets errno (no logging) */
 
 _hidden char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid);
diff -r efb9359f486d -r f33548a58db3 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c        Mon Dec 12 17:43:15 2011 +0000
+++ b/tools/libxl/libxl_xshelp.c        Mon Dec 12 17:48:37 2011 +0000
@@ -49,7 +49,7 @@
 }
 
 int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
-                    char *dir, char *kvs[])
+                     const char *dir, char *kvs[])
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *path;
@@ -69,7 +69,7 @@
 }
 
 int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
-                   char *path, const char *fmt, ...)
+                    const char *path, const char *fmt, ...)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *s;
@@ -87,7 +87,7 @@
     return 0;
 }
 
-char * libxl__xs_read(libxl__gc *gc, xs_transaction_t t, char *path)
+char * libxl__xs_read(libxl__gc *gc, xs_transaction_t t, const char *path)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *ptr;
@@ -113,7 +113,8 @@
     return s;
 }
 
-char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t, char *path, 
unsigned int *nb)
+char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t,
+                           const char *path, unsigned int *nb)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char **ret = NULL;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.