コード例 #1
0
ファイル: ShadingModel.cpp プロジェクト: 4og/guacamole
void ShadingModel::reload() {
  ++current_revision;

  if (file_name_ != "") {
    TextFile file(file_name_);

    if (file.is_valid()) {
      construct_from_file(file);
    } else {
      Logger::LOG_WARNING << "Failed to load shading model \"" << file_name_ << "\": "
              "File does not exist!" << std::endl;
    }
  }
}
コード例 #2
0
ファイル: short.c プロジェクト: mhspradlin/c
int main (int argc, char **argv) {
    // If bad input, bail
    if (argc != 4)
        return 1;

    int num_verts = num_nodes (argv[1]);
    int **weights = malloc (num_verts * sizeof (int *));
    int i;
    // Don't need to zero, as construct_f_f will write over every entry
    for (i = 0; i < num_verts; i++)
        weights[i] = malloc (num_verts * sizeof (int));
    struct node **graph = init_cache (num_verts);
    construct_from_file (weights, graph, argv[1]);

    struct path *shortest = find_shortest (weights, graph, num_verts, atoi(argv[2]), atoi(argv[3]));
    print_path (shortest);
    return 0;
}