From ccdb7860691ea43cbb516b037e3f61628ec54cd6 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 2 Jul 2018 17:32:22 +0200 Subject: [PATCH] Convert to Cxx --- libert/CMakeLists.txt | 4 +- libert/applications/ert_tui/CMakeLists.txt | 6 +- .../applications/ert_tui/{ERT.h => ERT.hpp} | 32 +- .../{enkf_tui_QC.h => enkf_tui_QC.hpp} | 30 +- ...f_tui_analysis.c => enkf_tui_analysis.cpp} | 28 +- ...f_tui_analysis.h => enkf_tui_analysis.hpp} | 28 +- ...{enkf_tui_export.c => enkf_tui_export.cpp} | 46 +-- ...{enkf_tui_export.h => enkf_tui_export.hpp} | 30 +- .../{enkf_tui_fs.c => enkf_tui_fs.cpp} | 27 +- .../{enkf_tui_fs.h => enkf_tui_fs.hpp} | 30 +- .../{enkf_tui_help.c => enkf_tui_help.cpp} | 26 +- .../{enkf_tui_help.h => enkf_tui_help.hpp} | 30 +- .../{enkf_tui_init.c => enkf_tui_init.cpp} | 32 +- .../{enkf_tui_init.h => enkf_tui_init.hpp} | 30 +- .../{enkf_tui_main.c => enkf_tui_main.cpp} | 28 +- .../{enkf_tui_main.h => enkf_tui_main.hpp} | 32 +- .../{enkf_tui_misc.c => enkf_tui_misc.cpp} | 18 +- .../{enkf_tui_misc.h => enkf_tui_misc.hpp} | 30 +- ...nkf_tui_ranking.c => enkf_tui_ranking.cpp} | 24 +- ...nkf_tui_ranking.h => enkf_tui_ranking.hpp} | 30 +- .../{enkf_tui_run.c => enkf_tui_run.cpp} | 40 +-- .../{enkf_tui_run.h => enkf_tui_run.hpp} | 30 +- ...{enkf_tui_simple.c => enkf_tui_simple.cpp} | 32 +- ...{enkf_tui_simple.h => enkf_tui_simple.hpp} | 30 +- .../{enkf_tui_table.c => enkf_tui_table.cpp} | 44 +-- .../{enkf_tui_table.h => enkf_tui_table.hpp} | 30 +- .../{enkf_tui_util.c => enkf_tui_util.cpp} | 27 +- .../{enkf_tui_util.h => enkf_tui_util.hpp} | 42 +-- ...f_tui_workflow.c => enkf_tui_workflow.cpp} | 36 +- ...f_tui_workflow.h => enkf_tui_workflow.hpp} | 30 +- .../{ert_tui_const.h => ert_tui_const.hpp} | 30 +- .../applications/ert_tui/{main.c => main.cpp} | 20 +- .../applications/ert_tui/{menu.c => menu.cpp} | 15 +- .../applications/ert_tui/{menu.h => menu.hpp} | 34 +- libert/applications/ert_tui/upgrade_fs104.c | 320 ------------------ libert/applications/ert_tui/upgrade_fs104.cpp | 39 +++ .../ert/{ert_version.h => ert_version.hpp} | 0 libert/src/{ert_version.c => ert_version.cpp} | 2 +- 38 files changed, 532 insertions(+), 810 deletions(-) rename libert/applications/ert_tui/{ERT.h => ERT.hpp} (72%) rename libert/applications/ert_tui/{enkf_tui_QC.h => enkf_tui_QC.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_analysis.c => enkf_tui_analysis.cpp} (88%) rename libert/applications/ert_tui/{enkf_tui_analysis.h => enkf_tui_analysis.hpp} (65%) rename libert/applications/ert_tui/{enkf_tui_export.c => enkf_tui_export.cpp} (92%) rename libert/applications/ert_tui/{enkf_tui_export.h => enkf_tui_export.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_fs.c => enkf_tui_fs.cpp} (94%) rename libert/applications/ert_tui/{enkf_tui_fs.h => enkf_tui_fs.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_help.c => enkf_tui_help.cpp} (96%) rename libert/applications/ert_tui/{enkf_tui_help.h => enkf_tui_help.hpp} (74%) rename libert/applications/ert_tui/{enkf_tui_init.c => enkf_tui_init.cpp} (86%) rename libert/applications/ert_tui/{enkf_tui_init.h => enkf_tui_init.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_main.c => enkf_tui_main.cpp} (84%) rename libert/applications/ert_tui/{enkf_tui_main.h => enkf_tui_main.hpp} (60%) rename libert/applications/ert_tui/{enkf_tui_misc.c => enkf_tui_misc.cpp} (88%) rename libert/applications/ert_tui/{enkf_tui_misc.h => enkf_tui_misc.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_ranking.c => enkf_tui_ranking.cpp} (93%) rename libert/applications/ert_tui/{enkf_tui_ranking.h => enkf_tui_ranking.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_run.c => enkf_tui_run.cpp} (90%) rename libert/applications/ert_tui/{enkf_tui_run.h => enkf_tui_run.hpp} (68%) rename libert/applications/ert_tui/{enkf_tui_simple.c => enkf_tui_simple.cpp} (81%) rename libert/applications/ert_tui/{enkf_tui_simple.h => enkf_tui_simple.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_table.c => enkf_tui_table.cpp} (86%) rename libert/applications/ert_tui/{enkf_tui_table.h => enkf_tui_table.hpp} (62%) rename libert/applications/ert_tui/{enkf_tui_util.c => enkf_tui_util.cpp} (96%) rename libert/applications/ert_tui/{enkf_tui_util.h => enkf_tui_util.hpp} (84%) rename libert/applications/ert_tui/{enkf_tui_workflow.c => enkf_tui_workflow.cpp} (86%) rename libert/applications/ert_tui/{enkf_tui_workflow.h => enkf_tui_workflow.hpp} (62%) rename libert/applications/ert_tui/{ert_tui_const.h => ert_tui_const.hpp} (63%) rename libert/applications/ert_tui/{main.c => main.cpp} (94%) rename libert/applications/ert_tui/{menu.c => menu.cpp} (98%) rename libert/applications/ert_tui/{menu.h => menu.hpp} (82%) delete mode 100644 libert/applications/ert_tui/upgrade_fs104.c create mode 100644 libert/applications/ert_tui/upgrade_fs104.cpp rename libert/include/ert/ert/{ert_version.h => ert_version.hpp} (100%) rename libert/src/{ert_version.c => ert_version.cpp} (96%) diff --git a/libert/CMakeLists.txt b/libert/CMakeLists.txt index 97984a66234..598561a710c 100644 --- a/libert/CMakeLists.txt +++ b/libert/CMakeLists.txt @@ -1,11 +1,11 @@ -project(ert-ert C) +project(ert-ert CXX) if (NOT BUILD_SHARED_LIBS) message(WARNING "Building python - forcing shared libs.") set(BUILD_SHARED_LIBS ON) endif () -add_library(ert src/ert_version.c) +add_library(ert src/ert_version.cpp) target_include_directories(ert PUBLIC $ diff --git a/libert/applications/ert_tui/CMakeLists.txt b/libert/applications/ert_tui/CMakeLists.txt index 5ce42e48209..61937cbc8b0 100644 --- a/libert/applications/ert_tui/CMakeLists.txt +++ b/libert/applications/ert_tui/CMakeLists.txt @@ -1,9 +1,9 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -set( src_list main.c enkf_tui_main.c enkf_tui_fs.c enkf_tui_ranking.c enkf_tui_misc.c enkf_tui_table.c menu.c - enkf_tui_run.c enkf_tui_util.c enkf_tui_init.c enkf_tui_export.c enkf_tui_analysis.c enkf_tui_help.c enkf_tui_simple.c enkf_tui_workflow.c) +set( src_list main.cpp enkf_tui_main.cpp enkf_tui_fs.cpp enkf_tui_ranking.cpp enkf_tui_misc.cpp enkf_tui_table.cpp menu.cpp + enkf_tui_run.cpp enkf_tui_util.cpp enkf_tui_init.cpp enkf_tui_export.cpp enkf_tui_analysis.cpp enkf_tui_help.cpp enkf_tui_simple.cpp enkf_tui_workflow.cpp) -set_source_files_properties( main.c PROPERTIES COMPILE_DEFINITIONS "COMPILE_TIME_STAMP=\"${ERT_BUILD_TIME}\";GIT_COMMIT=\"${GIT_COMMIT}\"") +set_source_files_properties( main.cpp PROPERTIES COMPILE_DEFINITIONS "COMPILE_TIME_STAMP=\"${ERT_BUILD_TIME}\";GIT_COMMIT=\"${GIT_COMMIT}\"") add_executable( ert_tui ${src_list} ) target_link_libraries( ert_tui res::res ert ) diff --git a/libert/applications/ert_tui/ERT.h b/libert/applications/ert_tui/ERT.hpp similarity index 72% rename from libert/applications/ert_tui/ERT.h rename to libert/applications/ert_tui/ERT.hpp index 5993a6b4a06..4d1a86a1297 100644 --- a/libert/applications/ert_tui/ERT.h +++ b/libert/applications/ert_tui/ERT.hpp @@ -1,25 +1,25 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ERT.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'ERT.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #define SPLASH_LENGTH 11 const char * splash_text[SPLASH_LENGTH] = { " _________________________________ ", - " / \\", + " / \\", " | ______ ______ _______ |", " | | ____| | __ \\ |__ __| |", " | | |__ | |__) | | | |", diff --git a/libert/applications/ert_tui/enkf_tui_QC.h b/libert/applications/ert_tui/enkf_tui_QC.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_QC.h rename to libert/applications/ert_tui/enkf_tui_QC.hpp index 137de3cb051..1a0b1b24a96 100644 --- a/libert/applications/ert_tui/enkf_tui_QC.h +++ b/libert/applications/ert_tui/enkf_tui_QC.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2012 Statoil ASA, Norway. + + The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_QC_H diff --git a/libert/applications/ert_tui/enkf_tui_analysis.c b/libert/applications/ert_tui/enkf_tui_analysis.cpp similarity index 88% rename from libert/applications/ert_tui/enkf_tui_analysis.c rename to libert/applications/ert_tui/enkf_tui_analysis.cpp index db25d37fd64..538e04f2b24 100644 --- a/libert/applications/ert_tui/enkf_tui_analysis.c +++ b/libert/applications/ert_tui/enkf_tui_analysis.cpp @@ -22,20 +22,20 @@ #include #include -#include -#include -#include +#include +#include +#include -#include +#include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include "menu.h" +#include +#include +#include +#include "menu.hpp" void enkf_tui_analysis_scale_observation_std__(void * arg) { @@ -66,10 +66,10 @@ static void enkf_tui_analysis_update_title( enkf_main_type * enkf_main , menu_ty void enkf_tui_analysis_select_module__(void * arg) { int prompt_len = 50; arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = arg_pack_iget_ptr( arg_pack , 0 ); - menu_type * menu = arg_pack_iget_ptr( arg_pack , 1 ); + enkf_main_type * enkf_main = (enkf_main_type *) arg_pack_iget_ptr( arg_pack , 0 ); + menu_type * menu = (menu_type *) arg_pack_iget_ptr( arg_pack , 1 ); - const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); + analysis_config_type * analysis_config = (analysis_config_type *) enkf_main_get_analysis_config(enkf_main); char module_name[256]; util_printf_prompt("Name module to select" , prompt_len , '=' , "=> "); scanf("%s", module_name); diff --git a/libert/applications/ert_tui/enkf_tui_analysis.h b/libert/applications/ert_tui/enkf_tui_analysis.hpp similarity index 65% rename from libert/applications/ert_tui/enkf_tui_analysis.h rename to libert/applications/ert_tui/enkf_tui_analysis.hpp index c38c7c93ca1..a23877d3684 100644 --- a/libert/applications/ert_tui/enkf_tui_analysis.h +++ b/libert/applications/ert_tui/enkf_tui_analysis.hpp @@ -1,20 +1,20 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - + Copyright (C) 2011 Statoil ASA, Norway. + The file 'enkf_tui_analysis.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_ANALYSIS_H diff --git a/libert/applications/ert_tui/enkf_tui_export.c b/libert/applications/ert_tui/enkf_tui_export.cpp similarity index 92% rename from libert/applications/ert_tui/enkf_tui_export.c rename to libert/applications/ert_tui/enkf_tui_export.cpp index 7d3a9b006bc..cb216d76fca 100644 --- a/libert/applications/ert_tui/enkf_tui_export.c +++ b/libert/applications/ert_tui/enkf_tui_export.cpp @@ -22,20 +22,20 @@ #include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "menu.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "menu.hpp" #define PROMPT_LEN 60 @@ -78,7 +78,7 @@ void enkf_tui_export_field(const enkf_main_type * enkf_main , field_file_format_ } { - const field_type * field = enkf_node_value_ptr(node); + const field_type * field = (const field_type *) enkf_node_value_ptr(node); field_export(field , filename , NULL , file_type , output_transform, NULL); } free(filename); @@ -91,23 +91,23 @@ void enkf_tui_export_field(const enkf_main_type * enkf_main , field_file_format_ void enkf_tui_export_grdecl(void * enkf_main) { - enkf_tui_export_field(enkf_main , ECL_GRDECL_FILE); + enkf_tui_export_field((enkf_main_type *) enkf_main , ECL_GRDECL_FILE); } void enkf_tui_export_roff(void * enkf_main) { - enkf_tui_export_field(enkf_main , RMS_ROFF_FILE); + enkf_tui_export_field((enkf_main_type *) enkf_main , RMS_ROFF_FILE); } void enkf_tui_export_restart_active(void * enkf_main) { - enkf_tui_export_field(enkf_main , ECL_KW_FILE_ACTIVE_CELLS); + enkf_tui_export_field((enkf_main_type *) enkf_main , ECL_KW_FILE_ACTIVE_CELLS); } void enkf_tui_export_restart_all(void * enkf_main) { - enkf_tui_export_field(enkf_main , ECL_KW_FILE_ALL_CELLS); + enkf_tui_export_field((enkf_main_type *) enkf_main , ECL_KW_FILE_ALL_CELLS); } @@ -137,7 +137,7 @@ void enkf_tui_export_gen_data(void * arg) { { enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); enkf_node_type * node = enkf_node_alloc(config_node); - gen_data_file_format_type export_type = gen_data_guess_export_type( enkf_node_value_ptr(node) ); + gen_data_file_format_type export_type = gen_data_guess_export_type( (const gen_data_type *) enkf_node_value_ptr(node) ); int iens; for (iens = iens1; iens <= iens2; iens++) { @@ -149,7 +149,7 @@ void enkf_tui_export_gen_data(void * arg) { if (path != NULL) util_make_path( path ); { - const gen_data_type * gen_data = enkf_node_value_ptr(node); + const gen_data_type * gen_data = (const gen_data_type *) enkf_node_value_ptr(node); gen_data_export(gen_data , full_path , export_type); } @@ -197,11 +197,11 @@ void enkf_tui_export_fieldP(void * arg) { enkf_node_clear( sum ); { /* OK going low level */ - field_type * sum_field = enkf_node_value_ptr( sum ); + field_type * sum_field = (field_type *) enkf_node_value_ptr( sum ); for (iens = iens1; iens < iens2; iens++) { if (ensemble[iens - iens1] != NULL) { - field_type * field = enkf_node_value_ptr( ensemble[iens - iens1] ); + field_type * field = (field_type *) enkf_node_value_ptr( ensemble[iens - iens1] ); field_update_sum( sum_field , field , lower_limit , upper_limit); active_ens_size++; } diff --git a/libert/applications/ert_tui/enkf_tui_export.h b/libert/applications/ert_tui/enkf_tui_export.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_export.h rename to libert/applications/ert_tui/enkf_tui_export.hpp index c7aa3021bdb..1261c2b710c 100644 --- a/libert/applications/ert_tui/enkf_tui_export.h +++ b/libert/applications/ert_tui/enkf_tui_export.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_export.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_export.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_EXPORT_H diff --git a/libert/applications/ert_tui/enkf_tui_fs.c b/libert/applications/ert_tui/enkf_tui_fs.cpp similarity index 94% rename from libert/applications/ert_tui/enkf_tui_fs.c rename to libert/applications/ert_tui/enkf_tui_fs.cpp index 79d5e9d95cc..e09de0d3354 100644 --- a/libert/applications/ert_tui/enkf_tui_fs.c +++ b/libert/applications/ert_tui/enkf_tui_fs.cpp @@ -19,18 +19,19 @@ #include #include -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include "menu.h" +#include +#include +#include + +#include "menu.hpp" void enkf_tui_fs_ls_case(void * arg) { enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); @@ -54,7 +55,7 @@ void enkf_tui_fs_create_case(void * arg) arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); enkf_main_type * enkf_main = enkf_main_safe_cast( arg_pack_iget_ptr(arg_pack, 0) ); - menu_type * menu = arg_pack_iget_ptr(arg_pack, 1); + menu_type * menu = (menu_type *) arg_pack_iget_ptr(arg_pack, 1); util_printf_prompt("Name of new case" , prompt_len , '=' , "=> "); if (fgets(new_case, prompt_len, stdin) != NULL){ @@ -113,7 +114,7 @@ void enkf_tui_fs_select_case(void * arg) arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); enkf_main_type * enkf_main = enkf_main_safe_cast( arg_pack_iget_ptr(arg_pack, 0) ); - menu_type * menu = arg_pack_iget_ptr(arg_pack, 1); + menu_type * menu = (menu_type *) arg_pack_iget_ptr(arg_pack, 1); new_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Name of case" , prompt_len); if (new_case != NULL) { enkf_main_select_fs( enkf_main , new_case ); @@ -156,7 +157,7 @@ static void enkf_tui_fs_copy_ensemble__( return; } } - identity_permutation_raw = util_calloc( ens_size , sizeof * identity_permutation_raw ); + identity_permutation_raw = (int *) util_calloc( ens_size , sizeof * identity_permutation_raw ); { int iens; for (iens =0; iens < ens_size; iens++) diff --git a/libert/applications/ert_tui/enkf_tui_fs.h b/libert/applications/ert_tui/enkf_tui_fs.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_fs.h rename to libert/applications/ert_tui/enkf_tui_fs.hpp index 49b8f1efc38..343c3490886 100644 --- a/libert/applications/ert_tui/enkf_tui_fs.h +++ b/libert/applications/ert_tui/enkf_tui_fs.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_fs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_fs.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_FS_H diff --git a/libert/applications/ert_tui/enkf_tui_help.c b/libert/applications/ert_tui/enkf_tui_help.cpp similarity index 96% rename from libert/applications/ert_tui/enkf_tui_help.c rename to libert/applications/ert_tui/enkf_tui_help.cpp index 8f7b64884d5..3802c904248 100644 --- a/libert/applications/ert_tui/enkf_tui_help.c +++ b/libert/applications/ert_tui/enkf_tui_help.cpp @@ -21,19 +21,19 @@ #include #include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "menu.h" +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "menu.hpp" void enkf_tui_help_manual_main( void * arg) { enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); diff --git a/libert/applications/ert_tui/enkf_tui_help.h b/libert/applications/ert_tui/enkf_tui_help.hpp similarity index 74% rename from libert/applications/ert_tui/enkf_tui_help.h rename to libert/applications/ert_tui/enkf_tui_help.hpp index b9f0a5ec0b1..299a26c9674 100644 --- a/libert/applications/ert_tui/enkf_tui_help.h +++ b/libert/applications/ert_tui/enkf_tui_help.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2012 Statoil ASA, Norway. + + The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_HELP_H diff --git a/libert/applications/ert_tui/enkf_tui_init.c b/libert/applications/ert_tui/enkf_tui_init.cpp similarity index 86% rename from libert/applications/ert_tui/enkf_tui_init.c rename to libert/applications/ert_tui/enkf_tui_init.cpp index b1fe4455833..f64a5941cf5 100644 --- a/libert/applications/ert_tui/enkf_tui_init.c +++ b/libert/applications/ert_tui/enkf_tui_init.cpp @@ -22,18 +22,18 @@ #include #include -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include -#include -#include "menu.h" +#include +#include +#include "menu.hpp" @@ -105,27 +105,27 @@ void enkf_tui_init(enkf_main_type * enkf_main, bool all_members , bool all_param static void enkf_tui_init1(void * enkf_main) { - enkf_tui_init(enkf_main, true , true , false); + enkf_tui_init((enkf_main_type *) enkf_main, true , true , false); } static void enkf_tui_init2(void * enkf_main) { - enkf_tui_init(enkf_main , true , false , false); + enkf_tui_init((enkf_main_type *) enkf_main , true , false , false); } static void enkf_tui_init3(void * enkf_main) { - enkf_tui_init(enkf_main , false , true , false); + enkf_tui_init((enkf_main_type *) enkf_main , false , true , false); } static void enkf_tui_init4(void * enkf_main) { - enkf_tui_init(enkf_main , false , false, false); + enkf_tui_init((enkf_main_type *) enkf_main , false , false, false); } static void enkf_tui_init5(void * enkf_main) { - enkf_tui_init(enkf_main , false , true, true); + enkf_tui_init((enkf_main_type *) enkf_main , false , true, true); } static void enkf_tui_init6(void * enkf_main) { - enkf_tui_init(enkf_main , false , false, true); + enkf_tui_init((enkf_main_type *) enkf_main , false , false, true); } void enkf_tui_init_menu(void * arg) { diff --git a/libert/applications/ert_tui/enkf_tui_init.h b/libert/applications/ert_tui/enkf_tui_init.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_init.h rename to libert/applications/ert_tui/enkf_tui_init.hpp index 73bc1f78c2d..a42b8fc7583 100644 --- a/libert/applications/ert_tui/enkf_tui_init.h +++ b/libert/applications/ert_tui/enkf_tui_init.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_init.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_init.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_INIT_H diff --git a/libert/applications/ert_tui/enkf_tui_main.c b/libert/applications/ert_tui/enkf_tui_main.cpp similarity index 84% rename from libert/applications/ert_tui/enkf_tui_main.c rename to libert/applications/ert_tui/enkf_tui_main.cpp index 5466c8cfc6a..04892ed2ad6 100644 --- a/libert/applications/ert_tui/enkf_tui_main.c +++ b/libert/applications/ert_tui/enkf_tui_main.cpp @@ -20,21 +20,21 @@ #include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "menu.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "menu.hpp" /** diff --git a/libert/applications/ert_tui/enkf_tui_main.h b/libert/applications/ert_tui/enkf_tui_main.hpp similarity index 60% rename from libert/applications/ert_tui/enkf_tui_main.h rename to libert/applications/ert_tui/enkf_tui_main.hpp index 0016bb50c40..07c8ae3a5c5 100644 --- a/libert/applications/ert_tui/enkf_tui_main.h +++ b/libert/applications/ert_tui/enkf_tui_main.hpp @@ -1,24 +1,24 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_main.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_main.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_INTER_MAIN_H #define ERT_ENKF_INTER_MAIN_H -#include +#include void enkf_tui_main_menu(void * arg); diff --git a/libert/applications/ert_tui/enkf_tui_misc.c b/libert/applications/ert_tui/enkf_tui_misc.cpp similarity index 88% rename from libert/applications/ert_tui/enkf_tui_misc.c rename to libert/applications/ert_tui/enkf_tui_misc.cpp index 7e013307f56..85ecb9b622d 100644 --- a/libert/applications/ert_tui/enkf_tui_misc.c +++ b/libert/applications/ert_tui/enkf_tui_misc.cpp @@ -15,18 +15,18 @@ See the GNU General Public License at for more details. */ -#include +#include -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include -#include -#include -#include "menu.h" +#include +#include +#include "menu.hpp" diff --git a/libert/applications/ert_tui/enkf_tui_misc.h b/libert/applications/ert_tui/enkf_tui_misc.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_misc.h rename to libert/applications/ert_tui/enkf_tui_misc.hpp index 0a260649abf..1a2ef3f1ff7 100644 --- a/libert/applications/ert_tui/enkf_tui_misc.h +++ b/libert/applications/ert_tui/enkf_tui_misc.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_misc.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_misc.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_MISC_H diff --git a/libert/applications/ert_tui/enkf_tui_ranking.c b/libert/applications/ert_tui/enkf_tui_ranking.cpp similarity index 93% rename from libert/applications/ert_tui/enkf_tui_ranking.c rename to libert/applications/ert_tui/enkf_tui_ranking.cpp index afce65495a6..7f8b2763953 100644 --- a/libert/applications/ert_tui/enkf_tui_ranking.c +++ b/libert/applications/ert_tui/enkf_tui_ranking.cpp @@ -19,23 +19,23 @@ #include #include -#include -#include +#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include -#include "menu.h" +#include +#include +#include "menu.hpp" static void enkf_tui_ranking_make_misfit_ensemble( void * arg) { arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = arg_pack_iget_ptr( arg_pack , 0 ); + enkf_main_type * enkf_main = (enkf_main_type *) arg_pack_iget_ptr( arg_pack , 0 ); enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); @@ -47,7 +47,7 @@ static void enkf_tui_ranking_make_misfit_ensemble( void * arg) { misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); misfit_ensemble_initialize( misfit_ensemble , ensemble_config , enkf_obs , fs , ens_size , history_length , false); { - menu_item_type * obs_item = arg_pack_iget_ptr( arg_pack , 1 ); + menu_item_type * obs_item = (menu_item_type *) arg_pack_iget_ptr( arg_pack , 1 ); menu_item_enable( obs_item ); } } diff --git a/libert/applications/ert_tui/enkf_tui_ranking.h b/libert/applications/ert_tui/enkf_tui_ranking.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_ranking.h rename to libert/applications/ert_tui/enkf_tui_ranking.hpp index 36fbed15059..9e65a7d51ae 100644 --- a/libert/applications/ert_tui/enkf_tui_ranking.h +++ b/libert/applications/ert_tui/enkf_tui_ranking.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_ranking.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_ranking.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_RANKING_H diff --git a/libert/applications/ert_tui/enkf_tui_run.c b/libert/applications/ert_tui/enkf_tui_run.cpp similarity index 90% rename from libert/applications/ert_tui/enkf_tui_run.c rename to libert/applications/ert_tui/enkf_tui_run.cpp index 539cf1b1d73..a9b4c100d25 100644 --- a/libert/applications/ert_tui/enkf_tui_run.c +++ b/libert/applications/ert_tui/enkf_tui_run.cpp @@ -22,25 +22,25 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include "menu.h" +#include +#include +#include +#include +#include +#include "menu.hpp" @@ -85,7 +85,7 @@ void enkf_tui_run_iterated_ES(void * arg) { */ void enkf_tui_run_exp(void * enkf_main) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); + const int ens_size = enkf_main_get_ensemble_size( (enkf_main_type *) enkf_main ); bool_vector_type * iactive = bool_vector_alloc(0,false); bool ok = false; // is active_list select_string within range (< ens_size) { @@ -100,7 +100,7 @@ void enkf_tui_run_exp(void * enkf_main) { free( prompt ); } if (ok && bool_vector_count_equal(iactive , true)) - enkf_main_run_tui_exp(enkf_main , iactive ); + enkf_main_run_tui_exp((enkf_main_type *) enkf_main , iactive ); bool_vector_free(iactive); } @@ -182,7 +182,7 @@ void enkf_tui_run_manual_load__( void * arg ) { if (bool_vector_count_equal( iactive , true )) { - stringlist_type ** realizations_msg_list = util_calloc( ens_size , sizeof * realizations_msg_list ); + stringlist_type ** realizations_msg_list = (stringlist_type **) util_calloc( ens_size , sizeof * realizations_msg_list ); int iens = 0; for (; iens < ens_size; ++iens) { realizations_msg_list[iens] = stringlist_alloc_new(); diff --git a/libert/applications/ert_tui/enkf_tui_run.h b/libert/applications/ert_tui/enkf_tui_run.hpp similarity index 68% rename from libert/applications/ert_tui/enkf_tui_run.h rename to libert/applications/ert_tui/enkf_tui_run.hpp index 331aefc9937..c69cd2aa855 100644 --- a/libert/applications/ert_tui/enkf_tui_run.h +++ b/libert/applications/ert_tui/enkf_tui_run.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_run.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_run.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_RUN_H diff --git a/libert/applications/ert_tui/enkf_tui_simple.c b/libert/applications/ert_tui/enkf_tui_simple.cpp similarity index 81% rename from libert/applications/ert_tui/enkf_tui_simple.c rename to libert/applications/ert_tui/enkf_tui_simple.cpp index f84b2af006f..fa719a2a2e4 100644 --- a/libert/applications/ert_tui/enkf_tui_simple.c +++ b/libert/applications/ert_tui/enkf_tui_simple.cpp @@ -22,22 +22,22 @@ #include #include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include "menu.h" +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "menu.hpp" void enkf_tui_simple_menu(void * arg) { enkf_main_type * enkf_main = enkf_main_safe_cast(arg); diff --git a/libert/applications/ert_tui/enkf_tui_simple.h b/libert/applications/ert_tui/enkf_tui_simple.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_simple.h rename to libert/applications/ert_tui/enkf_tui_simple.hpp index 36d612ade77..8d746619133 100644 --- a/libert/applications/ert_tui/enkf_tui_simple.h +++ b/libert/applications/ert_tui/enkf_tui_simple.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_main.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_main.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_SIMPLE_H diff --git a/libert/applications/ert_tui/enkf_tui_table.c b/libert/applications/ert_tui/enkf_tui_table.cpp similarity index 86% rename from libert/applications/ert_tui/enkf_tui_table.c rename to libert/applications/ert_tui/enkf_tui_table.cpp index 89602e13d0e..eaf95194e11 100644 --- a/libert/applications/ert_tui/enkf_tui_table.c +++ b/libert/applications/ert_tui/enkf_tui_table.cpp @@ -22,21 +22,21 @@ #include #include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include "menu.h" +#include +#include +#include +#include "menu.hpp" @@ -71,10 +71,10 @@ static void enkf_tui_table__(enkf_main_type * enkf_main , bool gen_kw_table , bo if (ensemble_config_has_key( ensemble_config , key )) { config_node = ensemble_config_get_node( ensemble_config , key ); if (enkf_config_node_get_impl_type( config_node ) == GEN_KW) { - gen_kw_config_type * gen_kw_config = enkf_config_node_get_ref( config_node ); + gen_kw_config_type * gen_kw_config = (gen_kw_config_type *) enkf_config_node_get_ref( config_node ); num_keys = gen_kw_config_get_data_size( gen_kw_config ); - user_keys = util_calloc( num_keys , sizeof * user_keys ); + user_keys = (char **) util_calloc( num_keys , sizeof * user_keys ); for (int i=0; i < num_keys; i++) user_keys[i] = gen_kw_config_alloc_user_key( gen_kw_config , i); @@ -106,10 +106,10 @@ static void enkf_tui_table__(enkf_main_type * enkf_main , bool gen_kw_table , bo free( filename ); } - active = util_calloc( num_keys , sizeof * active ); - nodes = util_calloc( num_keys , sizeof * nodes ); - config_nodes = util_calloc( num_keys , sizeof * config_nodes ); - index_keys = util_calloc( num_keys , sizeof * index_keys ); + active = (bool *) util_calloc( num_keys , sizeof * active ); + nodes = (enkf_node_type **) util_calloc( num_keys , sizeof * nodes ); + config_nodes = (enkf_config_node_type **) util_calloc( num_keys , sizeof * config_nodes ); + index_keys = (char **) util_calloc( num_keys , sizeof * index_keys ); for (ikey = 0; ikey < num_keys; ikey++) { config_nodes[ikey] = (enkf_config_node_type *) ensemble_config_user_get_node( ensemble_config , user_keys[ikey] , &index_keys[ikey]); if (config_nodes[ikey] != NULL) { @@ -135,12 +135,12 @@ static void enkf_tui_table__(enkf_main_type * enkf_main , bool gen_kw_table , bo step2 = last_report + 1; length = (step2 - step1); } - index = util_calloc( length , sizeof * index ); - data = util_calloc( num_keys , sizeof * data ); + index = (int *) util_calloc( length , sizeof * index ); + data = (double **) util_calloc( num_keys , sizeof * data ); { int i; for (i = 0; i < num_keys; i++) - data[i] = util_calloc( length , sizeof * data[i] ); + data[i] = (double *) util_calloc( length , sizeof * data[i] ); } { diff --git a/libert/applications/ert_tui/enkf_tui_table.h b/libert/applications/ert_tui/enkf_tui_table.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_table.h rename to libert/applications/ert_tui/enkf_tui_table.hpp index 304ee727abf..7d971f430f1 100644 --- a/libert/applications/ert_tui/enkf_tui_table.h +++ b/libert/applications/ert_tui/enkf_tui_table.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_table.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_table.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_TABLE diff --git a/libert/applications/ert_tui/enkf_tui_util.c b/libert/applications/ert_tui/enkf_tui_util.cpp similarity index 96% rename from libert/applications/ert_tui/enkf_tui_util.c rename to libert/applications/ert_tui/enkf_tui_util.cpp index 38f1277968b..a7d9b7daaaa 100644 --- a/libert/applications/ert_tui/enkf_tui_util.c +++ b/libert/applications/ert_tui/enkf_tui_util.cpp @@ -22,17 +22,16 @@ #include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include "menu.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include /** This file implements various small utility functions for the (text @@ -320,7 +319,7 @@ const enkf_config_node_type * enkf_tui_util_scanf_key(const ensemble_config_type bool * enkf_tui_util_scanf_alloc_iens_active(int ens_size, int prompt_len , int * _iens1 , int * _iens2) { - bool * iactive = util_calloc(ens_size , sizeof * iactive ); + bool * iactive = (bool *) util_calloc(ens_size , sizeof * iactive ); int iens1 = util_scanf_int_with_limits("First ensemble member" , prompt_len , 0 , ens_size - 1); int iens2 = util_scanf_int_with_limits("Last ensemble member" , prompt_len , iens1 , ens_size - 1); int iens; @@ -422,7 +421,7 @@ void enkf_tui_util_scanf_report_steps(int last_report , int prompt_len , int * _ */ bool * enkf_tui_util_scanf_alloc_report_active(int last_step, int prompt_len) { - bool * iactive = util_calloc((last_step + 1) , sizeof * iactive ); + bool * iactive = (bool *) util_calloc((last_step + 1) , sizeof * iactive ); int step1 = util_scanf_int_with_limits("First report step" , prompt_len , 0 , last_step); int step2 = util_scanf_int_with_limits("Last report step" , prompt_len , step1 , last_step); int step; @@ -488,7 +487,7 @@ void enkf_tui_util_get_time(enkf_fs_type * fs , const enkf_config_node_type * co for (report_step = step1; report_step <= step2; report_step++) { node_id_type node_id = {.report_step = report_step , .iens = iens }; if (enkf_node_try_load(node , fs , node_id)) { - const field_type * field = enkf_node_value_ptr( node ); + const field_type * field = (const field_type *) enkf_node_value_ptr( node ); y[index] = field_iget_double(field , get_index); } else { fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",key , iens , report_step); diff --git a/libert/applications/ert_tui/enkf_tui_util.h b/libert/applications/ert_tui/enkf_tui_util.hpp similarity index 84% rename from libert/applications/ert_tui/enkf_tui_util.h rename to libert/applications/ert_tui/enkf_tui_util.hpp index a39a3f6d15b..7655be02d72 100644 --- a/libert/applications/ert_tui/enkf_tui_util.h +++ b/libert/applications/ert_tui/enkf_tui_util.hpp @@ -1,31 +1,31 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'enkf_tui_util.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_UTIL_H #define ERT_ENKF_TUI_UTIL_H -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include void enkf_tui_util_scanf_report_steps(int , int , int * , int * ); const enkf_config_node_type * enkf_tui_util_scanf_key(const ensemble_config_type * , int , ert_impl_type , enkf_var_type); diff --git a/libert/applications/ert_tui/enkf_tui_workflow.c b/libert/applications/ert_tui/enkf_tui_workflow.cpp similarity index 86% rename from libert/applications/ert_tui/enkf_tui_workflow.c rename to libert/applications/ert_tui/enkf_tui_workflow.cpp index 57686c00697..c396b8897e6 100644 --- a/libert/applications/ert_tui/enkf_tui_workflow.c +++ b/libert/applications/ert_tui/enkf_tui_workflow.cpp @@ -22,24 +22,24 @@ #include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include "menu.h" +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "menu.hpp" void enkf_tui_workflow_run( void * arg ) { enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); diff --git a/libert/applications/ert_tui/enkf_tui_workflow.h b/libert/applications/ert_tui/enkf_tui_workflow.hpp similarity index 62% rename from libert/applications/ert_tui/enkf_tui_workflow.h rename to libert/applications/ert_tui/enkf_tui_workflow.hpp index fe6cc12720e..40925c423ce 100644 --- a/libert/applications/ert_tui/enkf_tui_workflow.h +++ b/libert/applications/ert_tui/enkf_tui_workflow.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_workflow.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2012 Statoil ASA, Norway. + + The file 'enkf_tui_workflow.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_ENKF_TUI_WORKFLOW_H diff --git a/libert/applications/ert_tui/ert_tui_const.h b/libert/applications/ert_tui/ert_tui_const.hpp similarity index 63% rename from libert/applications/ert_tui/ert_tui_const.h rename to libert/applications/ert_tui/ert_tui_const.hpp index 4f2981569ec..4c88c5a9048 100644 --- a/libert/applications/ert_tui/ert_tui_const.h +++ b/libert/applications/ert_tui/ert_tui_const.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ert_tui_const.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'ert_tui_const.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_TUI_CONST diff --git a/libert/applications/ert_tui/main.c b/libert/applications/ert_tui/main.cpp similarity index 94% rename from libert/applications/ert_tui/main.c rename to libert/applications/ert_tui/main.cpp index 5b9f34fcb01..83996c248ee 100644 --- a/libert/applications/ert_tui/main.c +++ b/libert/applications/ert_tui/main.cpp @@ -22,18 +22,18 @@ #include #include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include -#include +#include #define WORKFLOW_OPTION "-wf" @@ -41,7 +41,7 @@ void text_splash() { const int usleep_time = 1000; int i; { -#include "ERT.h" +#include "ERT.hpp" printf("\n\n"); for (i = 0; i < SPLASH_LENGTH; i++) { printf("%s\n", splash_text[i]); diff --git a/libert/applications/ert_tui/menu.c b/libert/applications/ert_tui/menu.cpp similarity index 98% rename from libert/applications/ert_tui/menu.c rename to libert/applications/ert_tui/menu.cpp index 327b1fcaa18..7ecb04aaefa 100644 --- a/libert/applications/ert_tui/menu.c +++ b/libert/applications/ert_tui/menu.cpp @@ -21,10 +21,10 @@ #include #include -#include -#include +#include +#include -#include "menu.h" +#include "menu.hpp" /** This file implements a simple character based menu system. The menu @@ -341,10 +341,11 @@ static void __print_sep(int l) { static void __print_helptext(char * label, int l){ - bool end_reached = false; + /* + bool end_reached = false; char * label_copy = util_alloc_string_copy( label ); - char * first_part = "Dummy3"; - char * second_part = "Dummy4"; + const char * first_part = "Dummy3"; + const char * second_part = "Dummy4"; while(!end_reached){ int i; if(strlen(label_copy) > l){ @@ -363,6 +364,8 @@ static void __print_helptext(char * label, int l){ end_reached = true; } } + */ + fputs(label, stdout); } diff --git a/libert/applications/ert_tui/menu.h b/libert/applications/ert_tui/menu.hpp similarity index 82% rename from libert/applications/ert_tui/menu.h rename to libert/applications/ert_tui/menu.hpp index 6306a4abde2..f87e69950f9 100644 --- a/libert/applications/ert_tui/menu.h +++ b/libert/applications/ert_tui/menu.hpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'menu.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'menu.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. */ #ifndef ERT_MENU_H @@ -21,7 +21,7 @@ #ifdef __cplusplus extern "C" { -#endif //__cplusplus +#endif typedef struct menu_struct menu_type; typedef struct menu_item_struct menu_item_type; @@ -46,6 +46,6 @@ void menu_add_helptext(menu_type * menu, const char * label ); #ifdef __cplusplus } -#endif //__cplusplus +#endif #endif diff --git a/libert/applications/ert_tui/upgrade_fs104.c b/libert/applications/ert_tui/upgrade_fs104.c deleted file mode 100644 index b5120e78f1c..00000000000 --- a/libert/applications/ert_tui/upgrade_fs104.c +++ /dev/null @@ -1,320 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'main.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ERT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License at - for more details. -*/ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define BLOCK_FS_DRIVER_INDEX_ID 3002 - - -config_type * create_config( ) { - config_type * config = config_alloc( ); - config_schema_item_type * item; - - item = config_add_schema_item(config , ENSPATH_KEY , true , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 0 , NULL); - - item = config_add_schema_item(config , NUM_REALIZATIONS_KEY , true , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 1, (const config_item_types [1]) {CONFIG_INT}); - - item = config_add_schema_item(config , REFCASE_KEY , true , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 1 , NULL ); - - return config; -} - - -void fskip_block_fs( FILE * stream ) { - util_fread_int( stream ); - util_fread_int( stream ); -} - - -void fskip_block_fs_index( FILE * stream ) { - return; -} - - -char * check_enspath( const char * ens_path , stringlist_type * case_list ) { - char * mount_file = util_alloc_filename( ens_path , "enkf_mount_info" , NULL); - FILE * stream = util_fopen( mount_file , "r"); - int version; - - util_fread_long( stream ); - version = util_fread_int( stream ); - - if (version != 104) - util_exit("This application is only for upgrading fs from version 104\n"); - - { - for (int driver_nr = 0; driver_nr < 5; driver_nr++) { - int driver_id; - util_fread_int( stream ); - - driver_id = util_fread_int( stream ); - if (driver_id == BLOCK_FS_DRIVER_ID) - fskip_block_fs(stream); - else if (driver_id == BLOCK_FS_DRIVER_INDEX_ID) - fskip_block_fs_index(stream); - else - util_abort("%s: sorry can only convert BLOCK_FS cases\n",__func__); - } - } - - { - int num_case = util_fread_int( stream ); - for (int icase = 0; icase < num_case; icase++) { - char * case_name = util_fread_alloc_string( stream ); - stringlist_append_owned_ref( case_list , case_name ); - } - } - - - fclose( stream ); - return mount_file; -} - - - - - -void upgrade_case( int ens_size , const ecl_sum_type * refcase , const char * enspath , const char * case_path , const char * file) { - int num_drivers = 32; - int length = ecl_sum_get_last_report_step( refcase ); - block_fs_type ** fs_list = util_calloc( num_drivers , sizeof * fs_list ); - buffer_type * buffer = buffer_alloc(100); - double_vector_type * vector = double_vector_alloc( 0,0 ); - int driver_nr; - - - for (driver_nr = 0; driver_nr < num_drivers; driver_nr++) { - char * mount_file = util_alloc_sprintf( "%s/%s/mod_%d/%s.mnt" , enspath , case_path , driver_nr , file); - fs_list[driver_nr] = block_fs_mount( mount_file , 32 , 0 , 1 , 1 , true , false ); - free( mount_file ); - } - - { - const ecl_smspec_type * smspec = ecl_sum_get_smspec( refcase ); - int num_params = ecl_smspec_get_params_size( smspec ); - msg_type * msg; - { - char * prefix = util_alloc_sprintf("Upgrading %s/mod_nnn/%s: " , case_path , file ); - msg = msg_alloc( prefix , false ); - free( prefix ); - } - msg_show( msg ); - - for (int i=0; i < num_params; i++) { - const smspec_node_type * smspec_node = ecl_smspec_iget_node( smspec , i ); - const char * gen_key = smspec_node_get_gen_key1( smspec_node ); - { - char * progress = util_alloc_sprintf("%4.1f %s" , i * 100.0 / num_params , "%"); - msg_update( msg , progress ); - free( progress ); - } - if (gen_key != NULL) { - for (int iens = 0; iens < ens_size; iens++) { - block_fs_type * fs = fs_list[ iens % num_drivers ]; - double_vector_reset( vector ); - for (int tstep = 0; tstep <= length; tstep++) { - char * node_key = util_alloc_sprintf("%s.%d.%d" , gen_key , tstep , iens ); - - if (block_fs_has_file( fs , node_key )) { - block_fs_fread_realloc_buffer( fs , node_key , buffer ); - buffer_fskip( buffer , 12 ); - double_vector_iset( vector , tstep , buffer_fread_double( buffer )); - block_fs_unlink_file( fs , node_key ); - } - free( node_key ); - } - - if (double_vector_size( vector ) > 0) { - char * vector_key = util_alloc_sprintf("%s.%d" , gen_key , iens ); - buffer_rewind( buffer ); - buffer_fwrite_time_t( buffer , time(NULL)); - buffer_fwrite_int( buffer , SUMMARY ); - double_vector_buffer_fwrite( vector , buffer ); - - block_fs_fwrite_buffer( fs , vector_key , buffer ); - free( vector_key ); - } - } - } - } - msg_free( msg , false); - } - - double_vector_free( vector ); - buffer_free( buffer ); - for (driver_nr = 0; driver_nr < num_drivers; driver_nr++) { - block_fs_close( fs_list[driver_nr] , true ); - } - free( fs_list ); -} - - -void update_index( int ens_size, int length, const char * ens_path , const char * case_path ) { - char * index_path = util_alloc_sprintf("%s/%s/Index" , ens_path , case_path ); - char * old_path = util_alloc_sprintf("%s/%s" , ens_path , case_path ); - - util_make_path( index_path ); - util_move_file4( "INDEX.data_0" , NULL , old_path , index_path ); - util_move_file4( "INDEX.mnt" , NULL , old_path , index_path ); - - free( old_path ); - - { - char * mount_file = util_alloc_sprintf("%s/INDEX.mnt" , index_path); - block_fs_type * index = block_fs_mount( mount_file , 32 , 0 , 1 , 1 , true , false ); - buffer_type * buffer = buffer_alloc( 512 ); - for (int iens = 0; iens < ens_size; iens++) - for (int tstep = 0; tstep < length; tstep++) { - char * old_key = util_alloc_sprintf("kw_list_%d.%d" , tstep , iens); - char * new_key = util_alloc_sprintf("kw_list.%d.%d" , tstep , iens); - - if (block_fs_has_file( index , old_key )) { - block_fs_fread_realloc_buffer( index , old_key , buffer ); - block_fs_fwrite_buffer( index , new_key , buffer ); - block_fs_unlink_file( index , old_key ); - } - - free( old_key ); - free( new_key ); - } - - free( mount_file ); - block_fs_close( index , true ); - } -} - - -void create_fstab( const char * ens_path , const char * case_path ) { - int num_drivers = 32; - char * mount_point = util_alloc_sprintf("%s/%s" , ens_path , case_path ); - FILE * stream = fs_driver_open_fstab( mount_point , true ); - fs_driver_init_fstab( stream, BLOCK_FS_DRIVER_ID); - - block_fs_driver_create_fs( stream , mount_point , DRIVER_PARAMETER , num_drivers , "mod_%d" , "PARAMETER"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_STATIC , num_drivers , "mod_%d" , "STATIC"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_DYNAMIC_FORECAST , num_drivers , "mod_%d" , "FORECAST"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_DYNAMIC_ANALYZED , num_drivers , "mod_%d" , "ANALYZED"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_INDEX , 1 , "Index" , "INDEX"); - - fclose( stream ); - free( mount_point ); -} - - - - - -int main (int argc , char ** argv) { - enkf_main_install_SIGNALS(); /* Signals common to both tui and gui. */ - signal(SIGINT , util_abort_signal); /* Control C - tui only. */ - enkf_main_init_debug( NULL ); - if (argc != 2) { - printf("Usage: upgrade_fs104 config_file\n"); - exit(1); - } else { - const char * model_config_file = argv[1]; - char * enspath; - int ens_size; - ecl_sum_type * refcase; - { - config_type * config = create_config(); - if (!config_parse( config , model_config_file , "--" , "INCLUDE" , "DEFINE" , CONFIG_UNRECOGNIZED_IGNORE , true )) { - config_fprintf_erors( config , stderr ); - exit(1); - } - - { - char * path; - util_alloc_file_components(model_config_file , &path , NULL , NULL); - if (path != NULL) { - printf("Changing to directory:%s\n" , path); - chdir(path); - } - free( path ); - } - - ens_size = config_get_value_as_int( config , NUM_REALIZATIONS_KEY ); - enspath = util_alloc_string_copy( config_get_value( config , ENSPATH_KEY )); - refcase = ecl_sum_fread_alloc_case( config_get_value( config , REFCASE_KEY ) , ":"); - config_free( config ); - } - - { - stringlist_type * case_list = stringlist_alloc_new(); - int ic; - char * mount_file = check_enspath( enspath , case_list ); - - for (ic = 0; ic < stringlist_get_size( case_list ); ic++) { - const char * case_path = stringlist_iget( case_list , ic); - - upgrade_case( ens_size, refcase , enspath , case_path , "FORECAST"); - upgrade_case( ens_size, refcase , enspath , case_path , "ANALYZED"); - - update_index( ens_size, ecl_sum_get_last_report_step( refcase ), enspath , case_path ); - create_fstab( enspath , case_path ); - } - { - FILE * stream = util_fopen( mount_file , "w"); - util_fwrite_long(FS_MAGIC_ID , stream); - util_fwrite_int( 105 , stream); - fclose( stream ); - } - stringlist_free( case_list ); - free( mount_file ); - - } - free( enspath ); - ecl_sum_free( refcase ); - util_abort_free_version_info(); /* No fucking leaks ... */ - } -} diff --git a/libert/applications/ert_tui/upgrade_fs104.cpp b/libert/applications/ert_tui/upgrade_fs104.cpp new file mode 100644 index 00000000000..473163c37cb --- /dev/null +++ b/libert/applications/ert_tui/upgrade_fs104.cpp @@ -0,0 +1,39 @@ +/* + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'main.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + diff --git a/libert/include/ert/ert/ert_version.h b/libert/include/ert/ert/ert_version.hpp similarity index 100% rename from libert/include/ert/ert/ert_version.h rename to libert/include/ert/ert/ert_version.hpp diff --git a/libert/src/ert_version.c b/libert/src/ert_version.cpp similarity index 96% rename from libert/src/ert_version.c rename to libert/src/ert_version.cpp index adbbc07d5ef..d2c7c87e847 100644 --- a/libert/src/ert_version.c +++ b/libert/src/ert_version.cpp @@ -1,5 +1,5 @@ #include -#include +#include #define xstr(s) #s #define str(s) xstr(s)