Skip to content

Commit

Permalink
Initialize struct contents brace style
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 18, 2023
1 parent 3ff5848 commit 6d4dbd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/clib/lib/include/ert/job_queue/job_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@
*/
struct job_queue_node_struct {
/** How many cpu's will this job need - the driver is free to ignore if not relevant. */
int num_cpu;
int num_cpu = 0;
/** The path to the actual executable. */
char *run_cmd;
char *run_cmd = nullptr;
/** The queue will look for the occurrence of this file to detect a failure. */
char *exit_file = nullptr;
/** The queue will look for this file to verify that the job is running or
* has run. */
char *status_file = nullptr;
/** The name of the job. */
char *job_name;
char *job_name = nullptr;
/** Where the job is run - absolute path. */
char *run_path;
char *run_path = nullptr;
/** The number of commandline arguments to pass when starting the job. */
int argc;
int argc = 0;
/** The commandline arguments. */
char **argv;
int queue_index = 0;

std::optional<std::string> fail_message;
std::optional<std::string> fail_message{};

/** Which attempt is this ... */
int submit_attempt = 0;
/** The current status of the job. */
job_status_type job_status = JOB_QUEUE_NOT_ACTIVE;
/** Protecting the access to the job_data pointer. */
pthread_mutex_t data_mutex;
pthread_mutex_t data_mutex{};
/** Driver specific data about this job - fully handled by the driver. */
void *job_data = nullptr;
/** When did the job change status -> RUNNING - the LAST TIME. */
Expand Down
2 changes: 1 addition & 1 deletion src/clib/lib/job_queue/job_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

struct job_list_struct {
std::vector<job_queue_node_type *> vec_jobs;
pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;
pthread_rwlock_t lock{};
};

job_list_type *job_list_alloc() { return new job_list_type; }
Expand Down
1 change: 0 additions & 1 deletion src/clib/lib/job_queue/job_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ job_queue_node_type *job_queue_node_alloc(const char *job_name,
node->exit_file =
util_alloc_filename(node->run_path, exit_file, nullptr);

pthread_mutex_init(&node->data_mutex, nullptr);
free(argv);
return node;
}
Expand Down

0 comments on commit 6d4dbd5

Please sign in to comment.