Show
Ignore:
Timestamp:
03/27/08 12:40:50 (8 months ago)
Author:
peter
Message:

source/service.cpp
source/punch_fits.cpp
source/init_coreload.cpp
source/grains_mie.cpp
source/assert_results.cpp
source/parse_punch.cpp
source/optimize_phymir.cpp
source/version.h
source/parse_commands.cpp
source/prt_final.cpp
source/grid_do.cpp
source/parse_print.cpp
source/cddrive.cpp
source/prt_comment.cpp
tsuite/programs/mpi/mpi.cpp

  • Bug-fix for PR59 - cdVersion, cdDate could cause segfault.
  • Start preparing for the change of the release numbering scheme for the next release.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/version.h

    • Property svn:keywords set to URL
    r1732 r1891  
    66 
    77/** version.h */ 
     8#include "date.h" 
    89 
    9 #define CITATION        "Ferland, G. J., Korista, K. T., Verner, D. A., Ferguson, J. W., Kingdon, J. B., & Verner, E. M. 1998, PASP, 110, 761"  
    10 #define CITATION_LATEX  "\\bibitem[Ferland et al.(1998)]{1998PASP..110..761F} Ferland, G.~J., Korista, K.~T., Verner, D.~A., Ferguson, J.~W., Kingdon, J.~B., \\& Verner, E.~M.\\ 1998, \\pasp, 110, 761"  
    11 #define CITATION_SHORT  "Ferland et al. (1998)"  
     10#if 0 
     11static const int CLD_MAJOR = 8; 
     12static const int CLD_MINOR = 0; 
    1213 
    13 EXTERN struct t_version { 
     14#ifdef SVN_REVISION 
     15static const char* svn_revision = SVN_REVISION; 
     16#else 
     17static const char* svn_revision = "unknown"; 
     18#endif 
    1419 
     20static const string Url = "$HeadURL$"; 
     21#endif 
     22 
     23static const char* CITATION = "Ferland, G. J., Korista, K. T., Verner, D. A., Ferguson, J. W., Kingdon, J. B., & Verner, E. M. 1998, PASP, 110, 761"; 
     24static const char* CITATION_LATEX = "\\bibitem[Ferland et al.(1998)]{1998PASP..110..761F} Ferland, G.~J., Korista, K.~T., Verner, D.~A., Ferguson, J.~W., Kingdon, J.~B., \\& Verner, E.~M.\\ 1998, \\pasp, 110, 761"; 
     25static const char* CITATION_SHORT = "Ferland et al. (1998)";             
     26 
     27class version : public Singleton<version>  
     28{ 
     29        friend class Singleton<version>; 
     30protected: 
     31        version() 
     32        { 
     33                /* set date and version - this code will need to be modified in the year 2100 */ 
     34                if( YEAR >= 200 ) 
     35                { 
     36                        fprintf(ioQQQ,"must update formation of chDate in cdInit \n"); 
     37                        TotalInsanity(); 
     38                } 
     39                 
     40                static const char chMonth[12][4] = 
     41                        { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 
     42                 
     43                /* is this a beta version?  0 for no */ 
     44                nBetaVer = 0; 
     45                 
     46                /* is this a release version? */ 
     47                lgRelease = false; 
     48                 
     49                sprintf( chDate, "%2.2i%3.3s%2.2i",  
     50                         YEAR-100, 
     51                         chMonth[MONTH], 
     52                         DAY ); 
     53 
     54                sprintf( chVersion, "%2.2i.%2.2i.%2.2i",  
     55                         YEAR-100, 
     56                         MONTH+1, 
     57                         DAY ); 
     58                 
     59                char mode[6]; 
     60                if( sizeof(long) == 4 ) 
     61                        strncpy( mode, "ILP32", 6 ); 
     62                else if( sizeof(long) == 8 ) 
     63                        strncpy( mode, "LP64", 6 ); 
     64                else 
     65                        strncpy( mode, "?????", 6 ); 
     66                 
     67                /* now generate info on how we were compiled, including compiler version */ 
     68                sprintf(chInfo ,  
     69                        "cdInit compiled on %s in OS %s using the %s %i compiler in %s mode." , 
     70                        __DATE__  ,__OS , __COMP , __COMP_VER, mode); 
     71 
     72                chCitation = CITATION; 
     73                chCitationLatex = CITATION_LATEX; 
     74                chCitationShort = CITATION_SHORT; 
     75        } 
     76public: 
    1577        /** date of this version of the code as a string, set in cdinit.c, 
    1678         * where space is allocated */ 
    17         char *chDate; 
     79        char chDate[INPUT_LINE_LENGTH]; 
    1880 
    1981        /** version number of this version of the code, as a string, set in cdinit.c  
    2082         * where space is allocated */ 
    21         char *chVersion; 
     83        char chVersion[INPUT_LINE_LENGTH]; 
    2284 
    2385        /** normally zero, non-zero if this is a beta test version */ 
     
    39101        /** string to print latex bibitem with print citation command */ 
    40102        const char *chCitationLatex; 
    41  
    42 }       version; 
     103}; 
    43104 
    44105