src/disk_probs.cpp
// Will return the smallest type available
Will return the smallest type available
Will return the smallest type available
static CFRValueType ValueType(int st, const char *dir, int it) {
  char buf[500];
  for (int t = 0; t < 4; ++t) {
    CFRValueType value_type;
    char suffix;
    if (t == 0) {
      suffix = 'c';
      value_type = CFRValueType::CFR_CHAR;
    } else if (t == 1) {
      suffix = 's';
      value_type = CFRValueType::CFR_SHORT;
    } else if (t == 2) {
      suffix = 'i';
      value_type = CFRValueType::CFR_INT;
    } else if (t == 3) {
      suffix = 'd';
      value_type = CFRValueType::CFR_DOUBLE;
    }
    sprintf(buf, "%s/sumprobs.x.0.0.%i.%i.p0.%c", dir, st, it, suffix);
    if (FileExists(buf)) {
      return value_type;
    }
  }
  fprintf(stderr, "No sumprobs files for street %i\n", st);
  exit(-1);
}
static CFRValueType ValueType ( int st , const char * dir , int it ) { char buf [ 500 ] ; for ( int t = 0 ; t < 4 ; ++ t ) { CFRValueType value_type ; char suffix ; if ( t == 0 ) { suffix = ' ' ; value_type = CFRValueType :: CFR_CHAR ; } else if ( t == 1 ) { suffix = ' ' ; value_type = CFRValueType :: CFR_SHORT ; } else if ( t == 2 ) { suffix = ' ' ; value_type = CFRValueType :: CFR_INT ; } else if ( t == 3 ) { suffix = ' ' ; value_type = CFRValueType :: CFR_DOUBLE ; } sprintf ( buf , " " , dir , st , it , suffix ) ; if ( FileExists ( buf ) ) { return value_type ; } } fprintf ( stderr , " \n " , st ) ; exit ( -1 ) ; }
Will return the smallest type available
Will return the smallest type available