add comments

This commit is contained in:
kuoi 2022-04-01 01:18:58 +01:00
parent 39036cc34e
commit a533f12f7c
2 changed files with 10 additions and 10 deletions

BIN
oblong Executable file

Binary file not shown.

View File

@ -301,8 +301,8 @@ void procargs ( int nargs , char ** arg ) // int nargs =2 for [oblong -f] **arg
if ( !numreplications ) numreplications = 1 ; if ( !numreplications ) numreplications = 1 ;
if ( maxram > 0 ) { if ( maxram > 0 ) {
fprintf ( stderr , "\nUsing %.2f MBytes of RAM for matrix buffers\n" , maxram ) ; fprintf ( stderr , "\nUsing %.2f MBytes of RAM for matrix buffers\n" , maxram ) ;
fflush ( stderr ) ; //清空缓存区 *** fflush ( stderr ) ; //清空缓存区
maxram *= 1024 * 1024 ; } // *** maxram *= 1024 * 1024 ; } // maxram = maxram * 1024 * 1024;
reportheader = '\r' ; reportheader = '\r' ;
if ( !isatty( fileno( stderr ) ) ) { if ( !isatty( fileno( stderr ) ) ) {
errout ( verbose , "Verbose allowed only when STDERR goes to screen" ) ; errout ( verbose , "Verbose allowed only when STDERR goes to screen" ) ;
@ -318,10 +318,10 @@ void procargs ( int nargs , char ** arg ) // int nargs =2 for [oblong -f] **arg
void init_bit_counters ( void ) void init_bit_counters ( void )
{ {
int a , b , c ; int a , b , c ; // bitct[65536]
for ( a = 0 ; a < 65536 ; ++ a ) { for ( a = 0 ; a < 65536 ; ++ a ) { // a 0 -> 65535
for ( b = 1 , c = 0 ; b <= a ; b <<= 1 ) for ( b = 1 , c = 0 ; b <= a ; b <<= 1 ) // <= 是 < 或 =;
if ( ( b & a ) ) ++ c ; if ( ( b & a ) ) ++ c ; // c++;
bitct [ a ] = c ; } bitct [ a ] = c ; }
} }
@ -848,10 +848,10 @@ void read_input ( void )
char c ; char c ;
double prop , secs , prevprop ; double prop , secs , prevprop ;
clock_t beg , end ; clock_t beg , end ;
strcpy ( nampt , " " ) ; strcpy ( nampt , " " ) ; // nampt = " "
if ( treeinp != NULL ) { if ( treeinp != NULL ) { // int is NULL (L34), but can specific the tree file (L273)
while ( strcmp ( nampt , "tread" ) && !feof ( treeinp ) ) while ( strcmp ( nampt , "tread" ) && !feof ( treeinp ) ) //feof 如果 EOF 返回非 0没有EOF 返回 0 strcmp 0 相同非0 则执行,即 非 tread 并且 没有 EOF 且执行
fscanf ( treeinp , " %7s" , nampt ) ; fscanf ( treeinp , " %7s" , nampt ) ; // 输入长度为 7 的 string
errout ( feof ( treeinp ) , "String \"tread\" not found in tree file" ) ; errout ( feof ( treeinp ) , "String \"tread\" not found in tree file" ) ;
fscanf ( treeinp , " %c" , &c ) ; fscanf ( treeinp , " %c" , &c ) ;
errout ( c != 39 , "Number of trees should be indicated in the title of tree-file" ) ; errout ( c != 39 , "Number of trees should be indicated in the title of tree-file" ) ;