target_event_callback_t -> struct target_event_callback
Remove misleading typedef and redundant suffix from struct target_event_callback.
This commit is contained in:
parent
46fc1d57ac
commit
2d5767201b
|
@ -86,7 +86,7 @@ target_type_t *target_types[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
target_t *all_targets = NULL;
|
target_t *all_targets = NULL;
|
||||||
target_event_callback_t *target_event_callbacks = NULL;
|
struct target_event_callback *target_event_callbacks = NULL;
|
||||||
target_timer_callback_t *target_timer_callbacks = NULL;
|
target_timer_callback_t *target_timer_callbacks = NULL;
|
||||||
|
|
||||||
const Jim_Nvp nvp_assert[] = {
|
const Jim_Nvp nvp_assert[] = {
|
||||||
|
@ -872,7 +872,7 @@ int target_init(struct command_context_s *cmd_ctx)
|
||||||
|
|
||||||
int target_register_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv)
|
int target_register_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv)
|
||||||
{
|
{
|
||||||
target_event_callback_t **callbacks_p = &target_event_callbacks;
|
struct target_event_callback **callbacks_p = &target_event_callbacks;
|
||||||
|
|
||||||
if (callback == NULL)
|
if (callback == NULL)
|
||||||
{
|
{
|
||||||
|
@ -886,7 +886,7 @@ int target_register_event_callback(int (*callback)(struct target_s *target, enum
|
||||||
callbacks_p = &((*callbacks_p)->next);
|
callbacks_p = &((*callbacks_p)->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
(*callbacks_p) = malloc(sizeof(target_event_callback_t));
|
(*callbacks_p) = malloc(sizeof(struct target_event_callback));
|
||||||
(*callbacks_p)->callback = callback;
|
(*callbacks_p)->callback = callback;
|
||||||
(*callbacks_p)->priv = priv;
|
(*callbacks_p)->priv = priv;
|
||||||
(*callbacks_p)->next = NULL;
|
(*callbacks_p)->next = NULL;
|
||||||
|
@ -934,8 +934,8 @@ int target_register_timer_callback(int (*callback)(void *priv), int time_ms, int
|
||||||
|
|
||||||
int target_unregister_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv)
|
int target_unregister_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv)
|
||||||
{
|
{
|
||||||
target_event_callback_t **p = &target_event_callbacks;
|
struct target_event_callback **p = &target_event_callbacks;
|
||||||
target_event_callback_t *c = target_event_callbacks;
|
struct target_event_callback *c = target_event_callbacks;
|
||||||
|
|
||||||
if (callback == NULL)
|
if (callback == NULL)
|
||||||
{
|
{
|
||||||
|
@ -944,7 +944,7 @@ int target_unregister_event_callback(int (*callback)(struct target_s *target, en
|
||||||
|
|
||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
target_event_callback_t *next = c->next;
|
struct target_event_callback *next = c->next;
|
||||||
if ((c->callback == callback) && (c->priv == priv))
|
if ((c->callback == callback) && (c->priv == priv))
|
||||||
{
|
{
|
||||||
*p = next;
|
*p = next;
|
||||||
|
@ -988,8 +988,8 @@ int target_unregister_timer_callback(int (*callback)(void *priv), void *priv)
|
||||||
|
|
||||||
int target_call_event_callbacks(target_t *target, enum target_event event)
|
int target_call_event_callbacks(target_t *target, enum target_event event)
|
||||||
{
|
{
|
||||||
target_event_callback_t *callback = target_event_callbacks;
|
struct target_event_callback *callback = target_event_callbacks;
|
||||||
target_event_callback_t *next_callback;
|
struct target_event_callback *next_callback;
|
||||||
|
|
||||||
if (event == TARGET_EVENT_HALTED)
|
if (event == TARGET_EVENT_HALTED)
|
||||||
{
|
{
|
||||||
|
|
|
@ -232,12 +232,12 @@ struct target_event_action_s {
|
||||||
target_event_action_t *next;
|
target_event_action_t *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct target_event_callback_s
|
struct target_event_callback
|
||||||
{
|
{
|
||||||
int (*callback)(struct target_s *target, enum target_event event, void *priv);
|
int (*callback)(struct target_s *target, enum target_event event, void *priv);
|
||||||
void *priv;
|
void *priv;
|
||||||
struct target_event_callback_s *next;
|
struct target_event_callback *next;
|
||||||
} target_event_callback_t;
|
};
|
||||||
|
|
||||||
typedef struct target_timer_callback_s
|
typedef struct target_timer_callback_s
|
||||||
{
|
{
|
||||||
|
@ -450,7 +450,7 @@ void target_free_all_working_areas_restore(struct target_s *target, int restore)
|
||||||
|
|
||||||
extern target_t *all_targets;
|
extern target_t *all_targets;
|
||||||
|
|
||||||
extern target_event_callback_t *target_event_callbacks;
|
extern struct target_event_callback *target_event_callbacks;
|
||||||
extern target_timer_callback_t *target_timer_callbacks;
|
extern target_timer_callback_t *target_timer_callbacks;
|
||||||
|
|
||||||
uint32_t target_buffer_get_u32(target_t *target, const uint8_t *buffer);
|
uint32_t target_buffer_get_u32(target_t *target, const uint8_t *buffer);
|
||||||
|
|
Loading…
Reference in New Issue