Skip to content
This repository has been archived by the owner on Jul 4, 2021. It is now read-only.

Commit

Permalink
Constified some things.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 7, 2008
1 parent 893bcc0 commit b7e2c11
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dataplugin_tests/hello/viewhello.cpp
@@ -1,7 +1,7 @@
#include "gdb-dataplugins.h"
#include "hello.h"

static void view_hello(void *ptr, const GDB_dataplugin_funcs *funcs)
static void view_hello(const void *ptr, const GDB_dataplugin_funcs *funcs)
{
Hello hello;

Expand Down
2 changes: 1 addition & 1 deletion dataplugin_tests/sdl/viewsdl.c
Expand Up @@ -2,7 +2,7 @@
#include "gdb-dataplugins.h"
#include "SDL.h"

static void view_SDL_Surface(void *ptr, const GDB_dataplugin_funcs *funcs)
static void view_SDL_Surface(const void *ptr, const GDB_dataplugin_funcs *funcs)
{
SDL_Surface surface;
SDL_Palette palette;
Expand Down
2 changes: 1 addition & 1 deletion dataplugin_tests/wchar_t/viewwchar.c
Expand Up @@ -6,7 +6,7 @@

/* app was built with -fshort-wchar */
#define VIEW_WCHAR_T_IMPL(bits) \
static void view_wchar_t_##bits(void *ptr, const GDB_dataplugin_funcs *funcs) \
static void view_wchar_t_##bits(const void *ptr, const GDB_dataplugin_funcs *funcs) \
{ \
wchar_t *wcptr = 0; \
uint##bits##_t *str = 0; \
Expand Down
6 changes: 3 additions & 3 deletions src/gdb/gdb-dataplugins.h
Expand Up @@ -38,11 +38,11 @@ extern "C" {
typedef void (*GDB_dataplugin_printfn)(const char *fmt, ...);

/* callback for reading memory from debuggee address space to debugger. */
typedef int (*GDB_dataplugin_readmemfn)(void *src, void *dst, int len);
typedef int (*GDB_dataplugin_readmemfn)(const void *src, void *dst, int len);

/* callback for reading a null-terminated string from debuggee address space to debugger. */
/* readstrfn(ptr, sizeof (wchar_t)), for example. */
typedef void *(*GDB_dataplugin_readstrfn)(void *src, int charsize);
typedef void *(*GDB_dataplugin_readstrfn)(const void *src, int charsize);

/* callback for allocating memory. */
typedef void *(*GDB_dataplugin_mallocfn)(int len);
Expand All @@ -68,7 +68,7 @@ typedef struct
} GDB_dataplugin_funcs;

/* function pointer where data plugins do their work. */
typedef void (*GDB_dataplugin_viewfn)(void *, const GDB_dataplugin_funcs *);
typedef void (*GDB_dataplugin_viewfn)(const void *, const GDB_dataplugin_funcs *);

/* callback for registering a viewer for a specific data type. */
typedef void (*GDB_dataplugin_register)(const char *, GDB_dataplugin_viewfn);
Expand Down
4 changes: 2 additions & 2 deletions src/gdb/printcmd.c
Expand Up @@ -179,7 +179,7 @@ static void do_one_display (struct display *);
static htab_t dataplugin_htab = 0;

static int
dataplugin_read_memory(void *src, void *dst, int len)
dataplugin_read_memory(const void *src, void *dst, int len)
{
const int rc = target_read_memory ((CORE_ADDR) src, (gdb_byte *)dst, len);
if (rc != 0)
Expand All @@ -188,7 +188,7 @@ dataplugin_read_memory(void *src, void *dst, int len)
}

static void *
dataplugin_read_string(void *src, int charlen)
dataplugin_read_string(const void *src, int charlen)
{
char *retval = NULL;
int err = 0;
Expand Down

0 comments on commit b7e2c11

Please sign in to comment.