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 *'.
This commit is contained in:
Martin Baulig
1998-08-25 08:41:02 +00:00
committed by Martin Baulig
parent db3d7adbaa
commit 0ea8e591f4
6 changed files with 16 additions and 10 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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);";

View File

@@ -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);
}