Skip to content
Browse files

fixed basename definition to suit gcc4

  • Loading branch information...
1 parent fec2ad5 commit 9b3f7fc89d531b849aa85375067ec20f31f459a2 rtv committed Oct 20, 2009
Showing with 8 additions and 12 deletions.
  1. +1 −5 libstage/stage.hh
  2. +1 −1 libstage/worldfile.cc
  3. +2 −4 replace/basename.c
  4. +1 −1 replace/replace.h
  5. +2 −0 todo.txt
  6. +1 −1 worlds/fasr.world
View
6 libstage/stage.hh
@@ -976,13 +976,9 @@ namespace Stg
stg_usec_t time; // time that event occurs
Model* mod; // model to update
- /** Update the model appropriately, based on the event type. */
- //void Execute();
- //static const char* TypeStr( type_t type );
bool operator<( const Event& other ) const;
- // bool operator==( const Event& other ) const;
};
-
+
std::vector<std::priority_queue<Event> > event_queues;
void Enqueue( unsigned int queue_num, stg_usec_t delay, Model* mod );
View
2 libstage/worldfile.cc
@@ -96,7 +96,7 @@ FILE *Worldfile::FileOpen(const char *filename, const char* method)
char *token = strtok(stagepath, ":");
char* fullpath = new char[PATH_MAX];
char *tmp = strdup(filename);
- char *base = basename(tmp);
+ const char *base = basename(tmp);
while (token != NULL) {
// for each part of the path, try it:
memset( fullpath, 0, PATH_MAX);
View
6 replace/basename.c
@@ -32,14 +32,12 @@
# define basename gnu_basename
#endif
-
-char *
-basename (filename)
- const char *filename;
+const char * basename( const char *filename )
{
char *p = strrchr (filename, '/');
return p ? p + 1 : (char *) filename;
}
+
#ifdef _LIBC
libc_hidden_def (basename)
#endif
View
2 replace/replace.h
@@ -91,7 +91,7 @@ int poll (struct pollfd *fds, unsigned long int nfds, int timeout);
#endif // !HAVE_DIRNAME
#if !HAVE_BASENAME
- char * basename (const char* filename);
+ const char * basename (const char* filename);
#else
#include <libgen.h> // for basename(3)
#endif // !HAVE_BASENAME
View
2 todo.txt
@@ -8,12 +8,14 @@ simple.world
linux 8.89
OS X 7.75
11.05 (rev 8210)
+ 10.15 (rev 8295)
fasr.world
----------
linux 16.36
OS X 16.20 (rev 7949)
19.94 (rev 8210 - new event queue is slower but more powerful and elegant)
+ 14.5 (rev 8295) threads: 6: 13.7 3: 13.4
MBA 17.3
MBA 23.2
View
2 worlds/fasr.world
@@ -15,7 +15,7 @@ quit_time 3600 # 1 hour of simulated time
resolution 0.02
-threads 0
+threads 3
# configure the GUI window
window

0 comments on commit 9b3f7fc

Please sign in to comment.
Something went wrong with that request. Please try again.