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/init_coreload.cpp

    r1842 r1891  
    1111#include "hcmap.h" 
    1212#include "h2.h" 
    13 #include "date.h" 
    1413#include "version.h" 
    1514#include "hextra.h" 
     
    159158        hcmap.lgMapBeingDone = false; 
    160159 
    161         /* set the date saved in date.h into version.chDate  
    162          * this is the decade part of the year counted after 2000 */ 
    163         int nDecade = (YEAR-100)/10; 
    164         char chDecade[2]; 
    165  
    166         /* create space for these strings */ 
    167         version.chDate = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH ); 
    168         version.chVersion = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH ); 
    169  
    170         static char chMonth[12][4] ={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" }; 
    171         static char chMonthInt[12][3] ={"01","02","03","04","05","06","07","08","09","10","11","12" }; 
    172  
    173         sprintf(chDecade,"%i", nDecade ); 
    174         /* set date and version - this code will need to be modified in the year 2110 */ 
    175         if( nDecade > 9 ) 
    176         { 
    177                 fprintf(ioQQQ,"must update formation of chDate in cdInit \n"); 
    178                 TotalInsanity(); 
    179         } 
    180         if( DAY < 10 ) 
    181         { 
    182                 sprintf( version.chDate , "%s%1i%s0%1i",  
    183                         chDecade, 
    184                         YEAR-100-nDecade*10, 
    185                         chMonth[MONTH], 
    186                         DAY ); 
    187                 sprintf( version.chVersion , "%s%1i.%s.0%1i",  
    188                         chDecade, 
    189                         YEAR-100-nDecade*10, 
    190                         chMonthInt[MONTH], 
    191                         DAY ); 
    192         } 
    193         else 
    194         { 
    195                 sprintf( version.chDate , "%s%1i%s%2i",  
    196                         chDecade, 
    197                         YEAR-100-nDecade*10, 
    198                         chMonth[MONTH], 
    199                         DAY ); 
    200                 sprintf( version.chVersion , "%s%1i.%s.%2i",  
    201                         chDecade, 
    202                         YEAR-100-nDecade*10, 
    203                         chMonthInt[MONTH], 
    204                         DAY ); 
    205         } 
    206  
    207         version.chCitation = CITATION; 
    208         version.chCitationLatex = CITATION_LATEX; 
    209         version.chCitationShort = CITATION_SHORT; 
    210  
    211         /* is this a release version? */ 
    212         version.lgRelease = false; 
    213  
    214         /* is this a beta version?  0 for no */ 
    215         version.nBetaVer = 0; 
    216  
    217         /* optional letter could come here for updates to branched version */ 
    218         /*strcat( version.chVersion , "a" );*/ 
    219         /* change following from * to letter when letters are used */ 
    220         strcat( version.chDate , "*" ); 
    221  
    222         char mode[6]; 
    223         if( sizeof(long) == 4 ) 
    224                 strncpy( mode, "ILP32", 6 ); 
    225         else if( sizeof(long) == 8 ) 
    226                 strncpy( mode, "LP64", 6 ); 
    227         else 
    228                 strncpy( mode, "?????", 6 ); 
    229  
    230         /* now generate info on how we were compiled, including compiler version */ 
    231         sprintf(version.chInfo ,  
    232                 "cdInit compiled on %s in OS %s using the %s %i compiler in %s mode." , 
    233                 __DATE__  ,__OS , __COMP , __COMP_VER, mode); 
    234  
    235160        /* name of output file from optimization run */ 
    236161        strncpy( chOptimFileName , "optimal.in" , sizeof( chOptimFileName ) );