[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11779: Changes to help build with s
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11779: Changes to help build with strictly standard-compliant headers. |
Date: |
Wed, 20 Jan 2010 18:12:19 +0100 |
User-agent: |
Bazaar (2.0.2) |
------------------------------------------------------------
revno: 11779
author: Albert Lee <address@hidden>
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2010-01-20 18:12:19 +0100
message:
Changes to help build with strictly standard-compliant headers.
Improvements and fixes to various bits of code.
Original patch modified for line breaks and spaces.
modified:
libcore/MovieLoader.cpp
libcore/asobj/LoadableObject.cpp
macros/libltdl.m4
utilities/dumpshm.cpp
=== modified file 'libcore/MovieLoader.cpp'
--- a/libcore/MovieLoader.cpp 2010-01-18 06:32:07 +0000
+++ b/libcore/MovieLoader.cpp 2010-01-20 17:12:19 +0000
@@ -444,11 +444,10 @@
/// If the method is MovieClip::METHOD_NONE, we send no data.
if (method == MovieClip::METHOD_GET)
{
- std::string varsToSend(urlstr);
/// GET: append data to query string.
- std::string qs = url.querystring();
- if ( qs.empty() ) varsToSend.insert(0, 1, '?');
- else varsToSend.insert(0, 1, '&');
+ const std::string& qs = url.querystring();
+ std::string varsToSend(qs.empty() ? "?" : "&");
+ varsToSend.append(urlstr);
url.set_querystring(qs + varsToSend);
}
=== modified file 'libcore/asobj/LoadableObject.cpp'
--- a/libcore/asobj/LoadableObject.cpp 2010-01-11 06:41:38 +0000
+++ b/libcore/asobj/LoadableObject.cpp 2010-01-20 17:12:19 +0000
@@ -51,7 +51,7 @@
}
void
-attachLoadableInterface(as_object& o, const int flags)
+attachLoadableInterface(as_object& o, int flags)
{
Global_as& gl = getGlobal(o);
=== modified file 'macros/libltdl.m4'
--- a/macros/libltdl.m4 2010-01-01 17:48:26 +0000
+++ b/macros/libltdl.m4 2010-01-20 17:12:19 +0000
@@ -3894,10 +3894,22 @@
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+ fi
;;
esac
;;
=== modified file 'utilities/dumpshm.cpp'
--- a/utilities/dumpshm.cpp 2010-01-11 06:41:38 +0000
+++ b/utilities/dumpshm.cpp 2010-01-20 17:12:19 +0000
@@ -115,8 +115,8 @@
{
int c;
bool listfiles = false;
- bool sysv = false;
- bool convert = false;
+ bool sysv = false;
+ bool convert = false;
int size = 0;
string filespec, realname, tmpname;
vector<const char *> dirlist;
@@ -130,45 +130,45 @@
// scan for the two main standard GNU options
for (c = 0; c < argc; c++) {
if (strcmp("--help", argv[c]) == 0) {
- usage();
- exit(EXIT_SUCCESS);
+ usage();
+ exit(EXIT_SUCCESS);
}
if (strcmp("--version", argv[c]) == 0) {
- printf (_("Gnash dumpshm version: %s, Gnash version: %s\n"),
- DUMPSHM_VERSION, VERSION);
- exit(EXIT_SUCCESS);
+ printf (_("Gnash dumpshm version: %s, Gnash version: %s\n"),
+ DUMPSHM_VERSION, VERSION);
+ exit(EXIT_SUCCESS);
}
}
while ((c = getopt (argc, argv, "hircv")) != -1) {
switch (c) {
case 'h':
- usage ();
- break;
-
+ usage ();
+ break;
+
case 'r':
- sysv = true;
- convert = false;
- break;
-
+ sysv = true;
+ convert = false;
+ break;
+
case 'c':
- sysv = true;
- convert = true;
- break;
-
+ sysv = true;
+ convert = true;
+ break;
+
case 'i':
- sysv = true;
- listfiles = true;
- break;
-
+ sysv = true;
+ listfiles = true;
+ break;
+
case 'v':
- // turn on verbosity for the libraries
- dbglogfile.setVerbosity();
- break;
-
+ // turn on verbosity for the libraries
+ dbglogfile.setVerbosity();
+ break;
+
default:
- usage ();
- break;
+ usage ();
+ break;
}
}
@@ -183,25 +183,25 @@
#if defined(USE_SYSV_SHM) && defined(HAVE_IPC_INFO)
// Just list the shared memory segments
if (listfiles && sysv) {
- list_lcs();
+ list_lcs();
exit(EXIT_SUCCESS);
}
#endif
if (optind <= argc - 1) {
- if (*argv[optind] == '-') {
- filespec = '-';
- }
+ if (*argv[optind] == '-') {
+ filespec = '-';
+ }
}
if (sysv) {
- if (filespec == "-") {
- dump_shm(convert, true);
- } else {
- dump_shm(convert, false);
- }
-
- exit(EXIT_SUCCESS);
+ if (filespec == "-") {
+ dump_shm(convert, true);
+ } else {
+ dump_shm(convert, false);
+ }
+
+ exit(EXIT_SUCCESS);
}
if (size == 0) {
@@ -211,9 +211,9 @@
// get the file name from the command line
if (optind < argc) {
filespec = argv[optind];
- if (!convert) {
- log_debug(_("Will use \"%s\" for memory segment file"), filespec);
- }
+ if (!convert) {
+ log_debug(_("Will use \"%s\" for memory segment file"), filespec);
+ }
}
}
@@ -228,20 +228,21 @@
key_t key = rcfile.getLCShmKey();
if (key == 0) {
- log_debug(_("No LcShmKey set in ~/.gnashrc, trying to find it
ourselves"));
+ log_debug(_("No LcShmKey set in ~/.gnashrc, trying to find it ourselves"));
#if defined(USE_SYSV_SHM) && defined(HAVE_IPC_INFO)
- key = list_lcs();
+ key = list_lcs();
#endif
}
- int size = 64528; // 1007 bytes less than unsigned
+ int size = 64528; // 1007 bytes less than unsigned
if (key == 0) {
- log_debug(_("No shared memory segments found!"));
- return;
+ log_debug(_("No shared memory segments found!"));
+ return;
}
if (dbglogfile.getVerbosity()) {
- log_debug(_("Existing SHM Key is: 0x %s %s, Size is: %s %s"), hex, key,
dec, size);
+ log_debug(_("Existing SHM Key is: %s, Size is: %s"),
+ boost::io::group(hex, showbase, key), size);
}
amf::LcShm lc;
@@ -251,20 +252,20 @@
// If the -c convert options was specified, dump the memory segment to
disk.
// This makes it easy to store them as well as to examine them in great
detail.
if (convert) {
- int fd = open("segment.raw",O_WRONLY|O_CREAT, S_IRWXU);
- if (fd == -1) {
- perror("open");
- }
- log_debug(_("Writing memory segment to disk: \"segment.raw\""));
- shmaddr = lc.getAddr();
- write(fd, shmaddr, size);
- if (out) {
+ int fd = open("segment.raw",O_WRONLY|O_CREAT, S_IRWXU);
+ if (fd == -1) {
+ perror("open");
+ }
+ log_debug(_("Writing memory segment to disk: \"segment.raw\""));
+ shmaddr = lc.getAddr();
+ write(fd, shmaddr, size);
+ if (out) {
#if 0
- log_debug(_("The data is: 0x%s"), hexify((uint8_t *)shmaddr, size,
false));
+ log_debug(_("The data is: 0x%s"), hexify((uint8_t *)shmaddr, size,
false));
#endif
- }
-
- close(fd);
+ }
+
+ close(fd);
}
exit (EXIT_SUCCESS);
@@ -279,15 +280,15 @@
// #ifdef USE_POSIX_SHM
// if (library_dir != NULL) {
-// for (i=0; entry>0; i++) {
-// entry = readdir(library_dir);
-// if (entry != NULL) {
+// for (i=0; entry>0; i++) {
+// entry = readdir(library_dir);
+// if (entry != NULL) {
// cout << "Found segment: " << entry->d_name << endl;
// }
// }
// } else {
-// cout << _("Sorry, we can only list the files on systems with"
-// " disk based shared memory") << endl;
+// cout << _("Sorry, we can only list the files on systems with"
+// " disk based shared memory") << endl;
// }
// #eendif
@@ -300,37 +301,39 @@
struct shmid_ds shm_info;
maxid = shmctl(0, SHM_INFO, &shm_info);
if (maxid < 0) {
- log_debug(_("kernel not configured for shared memory"));
- return 0;
+ log_debug(_("kernel not configured for shared memory"));
+ return 0;
}
// struct shminfo shminfo;
if ((shmctl(0, IPC_INFO, &shm_info)) < 0) {
- return 0;
+ return 0;
}
for (id = 0; id <= maxid; id++) {
- shmid = shmctl(id, SHM_STAT, &shmseg);
- if (shmid < 0) {
- continue;
- }
+ shmid = shmctl(id, SHM_STAT, &shmseg);
+ if (shmid < 0) {
+ continue;
+ }
#ifdef IPC_PERM_KEY
- if (shmseg.shm_segsz == 64528) {
- log_debug(_("Found it! \"set LCShmKey 0x %s %s \" in your
~/.gnashrc", hex, shmseg.shm_perm.IPC_PERM_KEY));
- log_debug(_("Last changed on: %s", ctime(&shmseg.shm_ctime)));
- log_debug(_("Last attached on: %s", ctime(&shmseg.shm_atime)));
- log_debug(_("Last detached on: %s", ctime(&shmseg.shm_dtime)));
- return shmseg.shm_perm.IPC_PERM_KEY;
- }
-#endif // end of IPC_PERM_KEY
+ if (shmseg.shm_segsz == 64528) {
+ log_debug(_("Found it! \"set LCShmKey %s\" in your ~/.gnashrc",
+ boost::io::group(hex, showbase,
+ shmseg.shm_perm.IPC_PERM_KEY)));
+ log_debug(_("Last changed on: %s", ctime(&shmseg.shm_ctime)));
+ log_debug(_("Last attached on: %s", ctime(&shmseg.shm_atime)));
+ log_debug(_("Last detached on: %s", ctime(&shmseg.shm_dtime)));
+ return shmseg.shm_perm.IPC_PERM_KEY;
+ }
+#endif // end of IPC_PERM_KEY
}
// #else
// # error "No supported shared memory type for this platform"
-//#endif // end of USE_POSIX_SHM
+//#endif // end of USE_POSIX_SHM
// Didn't find any segments of the right size
return static_cast<key_t>(0);
}
-#endif // end of USE_SYSV_SHM & HAVE_IPC_INFO
+#endif // end of USE_SYSV_SHM & HAVE_IPC_INFO
/// \brief Display the command line arguments
static void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11779: Changes to help build with strictly standard-compliant headers.,
Benjamin Wolsey <=