[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11547: fix typecasting for shm
From: |
Markus Gothe |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11547: fix typecasting for shm |
Date: |
Sat, 03 Oct 2009 23:48:49 +0200 |
User-agent: |
Bazaar (1.16.1) |
------------------------------------------------------------
revno: 11547
committer: Markus Gothe <address@hidden>
branch nick: trunk
timestamp: Sat 2009-10-03 23:48:49 +0200
message:
fix typecasting for shm
modified:
libbase/shm.cpp
utilities/dumpshm.cpp
=== modified file 'libbase/shm.cpp'
--- a/libbase/shm.cpp 2009-02-25 22:33:03 +0000
+++ b/libbase/shm.cpp 2009-10-03 21:48:49 +0000
@@ -113,7 +113,7 @@
// Get the shared memory id for this segment
_shmfd = shmget(_shmkey, _size, 0);
}
- _addr = (char *)shmat(_shmfd, 0, 0);
+ _addr = static_cast<char *>(shmat(_shmfd, 0, 0));
if (_addr <= 0) {
log_debug("WARNING: shmat() failed: %s\n", strerror(errno));
return false;
@@ -126,8 +126,8 @@
log_debug("WARNING: CreateFileMapping failed: %ld\n", GetLastError());
return false;
}
- _addr = (char *) MapViewOfFile(_shmhandle, FILE_MAP_ALL_ACCESS,
- 0, 0, _size);
+ _addr = static_cast<char *>(MapViewOfFile(_shmhandle, FILE_MAP_ALL_ACCESS,
+ 0, 0, _size));
if (_addr == NULL) {
log_debug("WARNING: MapViewOfFile() failed: %ld\n", GetLastError());
return false;
@@ -314,21 +314,21 @@
}
#else // else of HAVE_SHM_OPEN
# ifdef HAVE_SHMAT
- _addr = (char *)shmat(_shmfd, 0, 0);
+ _addr = static_cast<char *>(shmat(_shmfd, 0, 0));
if (_addr <= 0) {
log_error("shmat() failed: %s\n", strerror(errno));
return false;
}
# else
# ifdef __riscos__
- _addr = (char *)malloc(_size);
+ _addr = static_cast<char *>(malloc(_size));
if (_addr == 0) {
log_error("malloc() failed\n");
return false;
}
# else
- _addr = (char *)MapViewOfFile (_shmhandle, FILE_MAP_ALL_ACCESS,
- 0, 0, _size);
+ _addr = static_cast<char *>(MapViewOfFile(_shmhandle,
FILE_MAP_ALL_ACCESS,
+ 0, 0, _size));
# endif
#endif
#endif
@@ -363,7 +363,7 @@
_shmfd, static_cast<off_t>(0)));
#else
// off = (off_t)((long)addr - (long)_addr);
- _addr = static_cast<char *>(mmap((char *)addr,
+ _addr = static_cast<char *>(mmap(reinterpret_cast<char *>(addr),
_size, PROT_READ|PROT_WRITE,
MAP_FIXED|MAP_SHARED, _shmfd, 0));
#endif
@@ -375,14 +375,14 @@
#else // HAVE_SHM_OPEN
# ifdef HAVE_SHMAT
shmdt(_addr);
- _addr = (char *)shmat(_shmfd, (void *)addr, 0);
+ _addr = static_cast<char *>(shmat(_shmfd, reinterpret_cast<void
*>(addr), 0));
# else
# ifdef __riscos__
_addr = _addr;
# else
CloseHandle(_shmhandle);
- _addr = (char *)MapViewOfFile (_shmhandle, FILE_MAP_ALL_ACCESS,
- 0, 0, _size);
+ _addr = static_cast<char *>(MapViewOfFile(_shmhandle,
FILE_MAP_ALL_ACCESS,
+ 0, 0, _size));
# endif
# endif // end of HAVE_SHMAT
}
=== modified file 'utilities/dumpshm.cpp'
--- a/utilities/dumpshm.cpp 2009-10-02 12:38:13 +0000
+++ b/utilities/dumpshm.cpp 2009-10-03 21:48:49 +0000
@@ -341,7 +341,7 @@
{
cerr << _("This program dumps the internal data of a shared memory
segment")
<< endl;
- cerr << _("Usage: dumpmem [hdsanlif] filename") << endl;
+ cerr << _("Usage: dumpshm [hdsanlif] filename") << endl;
cerr << _("-h\tHelp") << endl;
cerr << _("-i\tList segments") << endl;
cerr << _("-r\tDump SYSV segments") << endl;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11547: fix typecasting for shm,
Markus Gothe <=