From 52727b75c69d4108362b292622d4513b0cf20d4f Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 21 Apr 1998 17:01:43 +0000 Subject: [PATCH] Fixed a problems where a pointer to a function was being passed around. In one place this functions arguments were defined as ( void ) while in another place they were defined as ( int ). The correct answer was ( int ). Prepairing for C++ integration. --- Time/event.h | 21 +++++++++++++++++++-- Time/fg_time.h | 21 +++++++++++++++++++-- Time/fg_timer.c | 15 +++++++++++---- Time/fg_timer.h | 23 ++++++++++++++++++++--- Time/sunpos.h | 10 ++++++++++ 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/Time/event.h b/Time/event.h index 6532878c0..1d650ff12 100644 --- a/Time/event.h +++ b/Time/event.h @@ -28,6 +28,11 @@ #define _EVENT_H +#ifdef __cplusplus +extern "C" { +#endif + + #define FG_EVENT_SUSP 0 #define FG_EVENT_READY 1 #define FG_EVENT_QUEUED 2 @@ -61,13 +66,25 @@ void fgEventPrintStats( void ); void fgEventProcess( void ); +#ifdef __cplusplus +} +#endif + + #endif /* _EVENT_H */ /* $Log$ -/* Revision 1.3 1998/01/22 02:59:43 curt -/* Changed #ifdef FILE_H to #ifdef _FILE_H +/* Revision 1.4 1998/04/21 17:01:43 curt +/* Fixed a problems where a pointer to a function was being passed around. In +/* one place this functions arguments were defined as ( void ) while in another +/* place they were defined as ( int ). The correct answer was ( int ). +/* +/* Prepairing for C++ integration. /* + * Revision 1.3 1998/01/22 02:59:43 curt + * Changed #ifdef FILE_H to #ifdef _FILE_H + * * Revision 1.2 1998/01/19 18:40:39 curt * Tons of little changes to clean up the code and to remove fatal errors * when building with the c++ compiler. diff --git a/Time/fg_time.h b/Time/fg_time.h index c520166d5..4cc905142 100644 --- a/Time/fg_time.h +++ b/Time/fg_time.h @@ -28,6 +28,11 @@ #define _FG_TIME_H +#ifdef __cplusplus +extern "C" { +#endif + + #include #ifdef HAVE_WINDOWS_H @@ -111,13 +116,25 @@ void fgTimeInit(struct fgTIME *t); void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t); +#ifdef __cplusplus +} +#endif + + #endif /* _FG_TIME_H */ /* $Log$ -/* Revision 1.18 1998/04/08 23:35:40 curt -/* Tweaks to Gnu automake/autoconf system. +/* Revision 1.19 1998/04/21 17:01:44 curt +/* Fixed a problems where a pointer to a function was being passed around. In +/* one place this functions arguments were defined as ( void ) while in another +/* place they were defined as ( int ). The correct answer was ( int ). +/* +/* Prepairing for C++ integration. /* + * Revision 1.18 1998/04/08 23:35:40 curt + * Tweaks to Gnu automake/autoconf system. + * * Revision 1.17 1998/04/03 22:12:56 curt * Converting to Gnu autoconf system. * Centralized time handling differences. diff --git a/Time/fg_timer.c b/Time/fg_timer.c index e5536bcba..94548696e 100644 --- a/Time/fg_timer.c +++ b/Time/fg_timer.c @@ -61,7 +61,7 @@ void fgTimerCatch( void ) { /* this routine initializes the interval timer to generate a SIGALRM after * the specified interval (dt) */ -void fgTimerInit(float dt, void (*f)()) { +void fgTimerInit(float dt, void (*f)( int )) { int terr; int isec; float usec; @@ -110,10 +110,17 @@ int fgGetTimeInterval( void ) { /* $Log$ -/* Revision 1.11 1998/04/03 22:12:56 curt -/* Converting to Gnu autoconf system. -/* Centralized time handling differences. +/* Revision 1.12 1998/04/21 17:01:44 curt +/* Fixed a problems where a pointer to a function was being passed around. In +/* one place this functions arguments were defined as ( void ) while in another +/* place they were defined as ( int ). The correct answer was ( int ). /* +/* Prepairing for C++ integration. +/* + * Revision 1.11 1998/04/03 22:12:56 curt + * Converting to Gnu autoconf system. + * Centralized time handling differences. + * * Revision 1.10 1998/01/31 00:43:45 curt * Added MetroWorks patches from Carmen Volpe. * diff --git a/Time/fg_timer.h b/Time/fg_timer.h index 7d1e4ef20..7f425f6d3 100644 --- a/Time/fg_timer.h +++ b/Time/fg_timer.h @@ -28,25 +28,42 @@ #define _FG_TIMER_H +#ifdef __cplusplus +extern "C" { +#endif + + extern unsigned long int fgSimTime; /* this routine initializes the interval timer to generate a SIGALRM * after the specified interval (dt) the function f() will be called * at each signal */ -void fgTimerInit( float dt, void (*f)( void ) ); +void fgTimerInit( float dt, void (*f)( int ) ); /* This function returns the number of milleseconds since the last time it was called. */ int fgGetTimeInterval( void ); +#ifdef __cplusplus +} +#endif + + #endif /* _FG_TIMER_H */ /* $Log$ -/* Revision 1.4 1998/01/22 02:59:43 curt -/* Changed #ifdef FILE_H to #ifdef _FILE_H +/* Revision 1.5 1998/04/21 17:01:45 curt +/* Fixed a problems where a pointer to a function was being passed around. In +/* one place this functions arguments were defined as ( void ) while in another +/* place they were defined as ( int ). The correct answer was ( int ). +/* +/* Prepairing for C++ integration. /* + * Revision 1.4 1998/01/22 02:59:43 curt + * Changed #ifdef FILE_H to #ifdef _FILE_H + * * Revision 1.3 1998/01/19 18:40:40 curt * Tons of little changes to clean up the code and to remove fatal errors * when building with the c++ compiler. diff --git a/Time/sunpos.h b/Time/sunpos.h index ff9a0bb48..a55d80d58 100644 --- a/Time/sunpos.h +++ b/Time/sunpos.h @@ -40,6 +40,11 @@ #define _SUNPOS_H +#ifdef __cplusplus +extern "C" { +#endif + + #include #include @@ -50,4 +55,9 @@ void fgUpdateSunPos( void ); void fgSunPosition(time_t ssue, double *lon, double *lat); +#ifdef __cplusplus +} +#endif + + #endif /* _SUNPOS_H */ -- 2.39.2