Skip to content

Commit

Permalink
Initialize struct members
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 21, 2023
1 parent e1aad2d commit c2e72d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
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 @@ -5,7 +5,7 @@
#include <ert/job_queue/job_node.hpp>

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

Expand Down
6 changes: 3 additions & 3 deletions src/clib/lib/job_queue/job_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <ert/job_queue/job_queue.hpp>

struct job_queue_struct {
job_list_type *job_list;
job_queue_status_type *status;
job_list_type *job_list = nullptr;
job_queue_status_type *status = nullptr;
/** A pointer to a driver instance (LSF|LOCAL) which actually 'does it'. */
queue_driver_type *driver;
queue_driver_type *driver = nullptr;
};

/**
Expand Down
4 changes: 1 addition & 3 deletions src/clib/lib/job_queue/job_queue_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include <ert/job_queue/queue_driver.hpp>

job_queue_status_type *job_queue_status_alloc() {
auto status = new job_queue_status_struct;
pthread_rwlock_init(&status->rw_lock, nullptr);
return status;
return new job_queue_status_struct;
}

void job_queue_status_free(job_queue_status_type *status) { delete status; }
Expand Down

0 comments on commit c2e72d4

Please sign in to comment.