Diff for /parser3/src/main/pa_common.C between versions 1.9 and 1.11

version 1.9, 2001/03/12 17:00:48 version 1.11, 2001/03/13 16:38:24
Line 49  char *file_read(Pool& pool, const char * Line 49  char *file_read(Pool& pool, const char *
                 /*if(exclusive)                  /*if(exclusive)
                         flock(f, LOCK_EX);*/                          flock(f, LOCK_EX);*/
   
                 char *result=static_cast<char *>(pool.malloc(finfo.st_size+1));                  char *result=(char *)pool.malloc(finfo.st_size+1);
                 int read_size=read(f,result,finfo.st_size);                  int read_size=read(f,result,finfo.st_size);
                 if(read_size>=0 && read_size<=finfo.st_size)                   if(read_size>=0 && read_size<=finfo.st_size) 
                         result[read_size]='\0';                          result[read_size]='\0';
Line 59  char *file_read(Pool& pool, const char * Line 59  char *file_read(Pool& pool, const char *
                 return result;//prepare_config(result, remove_empty_lines);                  return result;//prepare_config(result, remove_empty_lines);
     }      }
         if(fail_on_read_problem)          if(fail_on_read_problem)
                 POOL_THROW(0,0,                  PTHROW(0,0,
                         0,                          0,
                         "use: can not read '%s' file", fname);                          "use: can not read '%s' file", fname);
     return 0;      return 0;
Line 105  char *rsplit(char *string, char delim) { Line 105  char *rsplit(char *string, char delim) {
     }      }
     return NULL;              return NULL;        
 }  }
   
   char *format(Pool& pool, double value, char *fmt) {
           char *result=(char *)pool.malloc(MAX_NUMBER);
           if(fmt)
                   if(strpbrk(fmt, "diouxX"))
                           if(strpbrk(fmt, "ouxX"))
                                   snprintf(result, MAX_NUMBER, fmt, (uint)value );
                           else
                                   snprintf(result, MAX_NUMBER, fmt, (int)value );
                   else
                           snprintf(result, MAX_NUMBER, fmt, value);
           else
                   snprintf(result, MAX_NUMBER, "%d", (int)value);
           
           return result;
   }

Removed from v.1.9  
changed lines
  Added in v.1.11


E-mail: