Author: florian
Date: Fri Nov 14 19:25:08 2014
New Revision: 14723
Log:
Minor non-functional cleanups.
Modified:
trunk/coregrind/m_coredump/coredump-elf.c
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_libcfile.c
trunk/coregrind/m_machine.c
trunk/coregrind/m_syswrap/priv_syswrap-generic.h
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/pub_core_libcfile.h
Modified: trunk/coregrind/m_coredump/coredump-elf.c
==============================================================================
--- trunk/coregrind/m_coredump/coredump-elf.c (original)
+++ trunk/coregrind/m_coredump/coredump-elf.c Fri Nov 14 19:25:08 2014
@@ -195,7 +195,7 @@
static void fill_prpsinfo(const ThreadState *tst,
struct vki_elf_prpsinfo *prpsinfo)
{
- HChar *name;
+ const HChar *name;
VG_(memset)(prpsinfo, 0, sizeof(*prpsinfo));
@@ -223,7 +223,7 @@
prpsinfo->pr_gid = 0;
if (VG_(resolve_filename)(VG_(cl_exec_fd), &name)) {
- HChar *n = name+VG_(strlen)(name)-1;
+ const HChar *n = name + VG_(strlen)(name) - 1;
while (n > name && *n != '/')
n--;
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Fri Nov 14 19:25:08 2014
@@ -1227,7 +1227,7 @@
obj_mtime = stat_buf.mtime;
/* and get its name into exename. */
- HChar *exe;
+ const HChar *exe;
if (! VG_(resolve_filename)(fd_obj, &exe))
return; /* failed */
sz_exename = VG_(strlen)(exe);
Modified: trunk/coregrind/m_errormgr.c
==============================================================================
--- trunk/coregrind/m_errormgr.c (original)
+++ trunk/coregrind/m_errormgr.c Fri Nov 14 19:25:08 2014
@@ -1106,18 +1106,18 @@
static HChar buf[256];
static Int buf_size = 0;
static Int buf_used = 0;
- vg_assert(buf_size >= 0 && buf_size <= 256);
+ vg_assert(buf_size >= 0 && buf_size <= sizeof buf);
vg_assert(buf_used >= 0 && buf_used <= buf_size);
if (buf_used == buf_size) {
- r = VG_(read)(fd, buf, 256);
+ r = VG_(read)(fd, buf, sizeof buf);
if (r < 0) return r; /* read failed */
- vg_assert(r >= 0 && r <= 256);
+ vg_assert(r >= 0 && r <= sizeof buf);
buf_size = r;
buf_used = 0;
}
if (buf_size == 0)
return 0; /* eof */
- vg_assert(buf_size >= 0 && buf_size <= 256);
+ vg_assert(buf_size >= 0 && buf_size <= sizeof buf);
vg_assert(buf_used >= 0 && buf_used < buf_size);
*out_buf = buf[buf_used];
buf_used++;
Modified: trunk/coregrind/m_libcfile.c
==============================================================================
--- trunk/coregrind/m_libcfile.c (original)
+++ trunk/coregrind/m_libcfile.c Fri Nov 14 19:25:08 2014
@@ -76,7 +76,7 @@
filename will be overwritten with the next invocation so callers
need to copy the filename if needed. *result is NULL if the filename
cannot be deduced. */
-Bool VG_(resolve_filename) ( Int fd, HChar** result )
+Bool VG_(resolve_filename) ( Int fd, const HChar** result )
{
# if defined(VGO_linux)
static HChar *buf = NULL;
Modified: trunk/coregrind/m_machine.c
==============================================================================
--- trunk/coregrind/m_machine.c (original)
+++ trunk/coregrind/m_machine.c Fri Nov 14 19:25:08 2014
@@ -537,7 +537,7 @@
static UInt VG_(get_machine_model)(void)
{
static struct model_map {
- HChar name[5];
+ const HChar name[5];
UInt id;
} model_map[] = {
{ "2064", VEX_S390X_MODEL_Z900 },
@@ -1263,7 +1263,7 @@
".short 0x0057" : : : "r0", "r1", "cc", "memory");
}
- /* Check availability og STFLE. If available store facility bits
+ /* Check availability of STFLE. If available store facility bits
in hoststfle. */
ULong hoststfle[S390_NUM_FACILITY_DW];
Modified: trunk/coregrind/m_syswrap/priv_syswrap-generic.h
==============================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-generic.h (original)
+++ trunk/coregrind/m_syswrap/priv_syswrap-generic.h Fri Nov 14 19:25:08 2014
@@ -64,7 +64,7 @@
extern void ML_(record_fd_open_named) (ThreadId tid, Int fd);
extern void ML_(record_fd_open_nameless) (ThreadId tid, Int fd);
extern void ML_(record_fd_open_with_given_name)(ThreadId tid, Int fd,
- char *pathname);
+ const HChar *pathname);
// Used when killing threads -- we must not kill a thread if it's the thread
// that would do Valgrind's final cleanup and output.
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c Fri Nov 14 19:25:08 2014
@@ -585,7 +585,8 @@
some such thing) or that we don't know the filename. If the fd is
already open, then we're probably doing a dup2() to an existing fd,
so just overwrite the existing one. */
-void ML_(record_fd_open_with_given_name)(ThreadId tid, Int fd, char *pathname)
+void ML_(record_fd_open_with_given_name)(ThreadId tid, Int fd,
+ const HChar *pathname)
{
OpenFd *i;
@@ -621,8 +622,8 @@
// Record opening of an fd, and find its name.
void ML_(record_fd_open_named)(ThreadId tid, Int fd)
{
- HChar* buf;
- HChar* name;
+ const HChar* buf;
+ const HChar* name;
if (VG_(resolve_filename)(fd, &buf))
name = buf;
else
Modified: trunk/coregrind/pub_core_libcfile.h
==============================================================================
--- trunk/coregrind/pub_core_libcfile.h (original)
+++ trunk/coregrind/pub_core_libcfile.h Fri Nov 14 19:25:08 2014
@@ -44,7 +44,7 @@
extern Int VG_(fcntl) ( Int fd, Int cmd, Addr arg );
/* Convert an fd into a filename */
-extern Bool VG_(resolve_filename) ( Int fd, HChar** buf );
+extern Bool VG_(resolve_filename) ( Int fd, const HChar** buf );
/* Return the size of a file, or -1 in case of error */
extern Long VG_(fsize) ( Int fd );
|