diff options
author | Martin Baulig <martin@home-of-linux.org> | 1998-08-25 08:41:02 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 1998-08-25 08:41:02 +0000 |
commit | 0ea8e591f48bb9ac097e56d8afe4f9cf10db5897 (patch) | |
tree | 64e9ebf04bddb0c736f585c32b118ed1fd4d2429 | |
parent | db3d7adbaa4bb986a200cede75ff343be76a1c87 (diff) | |
download | libgtop-0ea8e591f48bb9ac097e56d8afe4f9cf10db5897.tar.gz |
Third argument is now `const void *'.
1998-08-25 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/command.h (glibtop_call): Third argument is
now `const void *'.
* include/glibtop/xmalloc.h (glibtop_free): Now taking a
`const void *'.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | include/glibtop/command.h | 4 | ||||
-rw-r--r-- | include/glibtop/xmalloc.h | 2 | ||||
-rw-r--r-- | lib/command.c | 2 | ||||
-rw-r--r-- | lib/lib.awk | 8 | ||||
-rw-r--r-- | sysdeps/common/xmalloc.c | 4 |
6 files changed, 16 insertions, 10 deletions
@@ -1,5 +1,11 @@ 1998-08-25 Martin Baulig <martin@home-of-linux.org> + * include/glibtop/command.h (glibtop_call): Third argument is + now `const void *'. + + * include/glibtop/xmalloc.h (glibtop_free): Now taking a + `const void *'. + * src/daemon/ChangeLog: New file. * sysdeps/sun4/ChangeLog: New file. diff --git a/include/glibtop/command.h b/include/glibtop/command.h index 5aaccf8e..a2ec780a 100644 --- a/include/glibtop/command.h +++ b/include/glibtop/command.h @@ -84,8 +84,8 @@ struct _glibtop_response #define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4) -extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, void *, size_t, void *)); -extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, void *, size_t, void *)); +extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, const void *, size_t, void *)); +extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, const void *, size_t, void *)); __END_DECLS diff --git a/include/glibtop/xmalloc.h b/include/glibtop/xmalloc.h index ce9dac18..adc38812 100644 --- a/include/glibtop/xmalloc.h +++ b/include/glibtop/xmalloc.h @@ -37,7 +37,7 @@ extern void *glibtop_malloc_r __P((glibtop *, size_t)); extern void *glibtop_calloc_r __P((glibtop *, size_t, size_t)); extern void *glibtop_realloc_r __P((glibtop *, void *, size_t)); extern char *glibtop_strdup_r __P((glibtop *, const char *)); -extern void glibtop_free_r __P((glibtop *, void *)); +extern void glibtop_free_r __P((glibtop *, const void *)); __END_DECLS diff --git a/lib/command.c b/lib/command.c index 17cda905..a3c1133c 100644 --- a/lib/command.c +++ b/lib/command.c @@ -28,7 +28,7 @@ void * glibtop_call_l (glibtop *server, unsigned command, size_t send_size, - void *send_buf, size_t recv_size, void *recv_buf) + const void *send_buf, size_t recv_size, void *recv_buf) { glibtop_command cmnd; glibtop_response response; diff --git a/lib/lib.awk b/lib/lib.awk index 851c280c..bb375f78 100644 --- a/lib/lib.awk +++ b/lib/lib.awk @@ -68,7 +68,7 @@ function output(line) { if (param_def == "string") { call_param = ", "line_fields[5]; param_decl = ",\n "space" const char *"line_fields[5]; - send_ptr = "\n\tvoid *send_ptr = "line_fields[5]";"; + send_ptr = "\n\tconst void *send_ptr = "line_fields[5]";"; send_size = "\n\tconst size_t send_size =\n\t\tstrlen ("line_fields[5]") + 1;"; } else { call_param = ""; @@ -90,7 +90,7 @@ function output(line) { param_decl = param_decl""convert[type]" "fields[field]; call_param = call_param", "fields[field]; if (send_ptr == "") - send_ptr = "\n\tvoid *send_ptr = &"fields[field]";"; + send_ptr = "\n\tconst void *send_ptr = &"fields[field]";"; if (send_size == "") send_size = "\n\tconst size_t send_size =\n\t\t"; else @@ -103,14 +103,14 @@ function output(line) { else send_size = "\n\tconst size_t send_size = 0;"; if (send_ptr == "") - send_ptr = "\n\tvoid *send_ptr = NULL;"; + send_ptr = "\n\tconst void *send_ptr = NULL;"; } print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf"param_decl")"; print "{"send_ptr""send_size; if (retval !~ /^void$/) - print "\t"retval" retval;"; + print "\t"retval" retval = ("retval") 0;"; print ""; print "\tglibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_"toupper(feature)"), 0);"; diff --git a/sysdeps/common/xmalloc.c b/sysdeps/common/xmalloc.c index 9963ae7f..fcf5c96d 100644 --- a/sysdeps/common/xmalloc.c +++ b/sysdeps/common/xmalloc.c @@ -64,7 +64,7 @@ glibtop_strdup_r (glibtop *server, const char *string) } void -glibtop_free_r (glibtop *server, void *ptr) +glibtop_free_r (glibtop *server, const void *ptr) { - if (ptr) free (ptr); + if (ptr) free ((void *) ptr); } |