Skip to content

Commit

Permalink
destroy functions actually never return non-0
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Sep 27, 2023
1 parent 1d2a3aa commit c5eeccb
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 196 deletions.
17 changes: 9 additions & 8 deletions src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@
typedef struct core_t core;

struct client_config {
uint32_t center_freq;
uint32_t sampling_rate;
uint32_t band_freq;
uint8_t destination;
int client_socket;
uint32_t id;
atomic_bool is_running;
core *core;
uint32_t center_freq;
uint32_t sampling_rate;
uint32_t band_freq;
uint8_t destination;
int client_socket;
uint32_t id;
atomic_bool is_running;
core *core;
};

int create_core(struct server_config *server_config, core **result);

// client_config contains core to modify
int add_client(struct client_config *config);

void remove_client(struct client_config *config);

void destroy_core(core *core);
Expand Down
8 changes: 4 additions & 4 deletions src/rotator.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ void rotator_increment_batch(rotator *rotator, float complex *input, float compl
volk_32fc_s32fc_x2_rotator_32fc(output, input, rotator->phase_incr, &rotator->phase, batch_size);
}

int destroy_rotator(rotator *rotator) {
if (rotator != NULL) {
free(rotator);
void destroy_rotator(rotator *rotator) {
if (rotator == NULL) {
return;
}
return 0;
free(rotator);
}

2 changes: 1 addition & 1 deletion src/rotator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ int create_rotator(float complex phase, float complex phase_incr, rotator **rota

void rotator_increment_batch(rotator *rotator, float complex *input, float complex *output, int batch_size);

int destroy_rotator(rotator *rotator);
void destroy_rotator(rotator *rotator);

#endif /* SRC_ROTATOR_H_ */
Loading

0 comments on commit c5eeccb

Please sign in to comment.