log_callback_t -> struct log_callback
authorZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 11:00:51 +0000 (03:00 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 19:58:04 +0000 (11:58 -0800)
Removes useless and confusing typedef for log callback structure.
Types with _t should be suitable for passing by-value as arguments.

src/helper/log.c
src/helper/log.h

index ccc0c01bdb655d4808cd30b274d388cd7853dc7b..1724beccbb61de7b40acbba74e7a01fa17d4028c 100644 (file)
@@ -45,7 +45,7 @@
 int debug_level = -1;
 
 static FILE* log_output;
 int debug_level = -1;
 
 static FILE* log_output;
-static log_callback_t *log_callbacks = NULL;
+static struct log_callback *log_callbacks = NULL;
 
 static long long last_time;
 static long long current_time;
 
 static long long last_time;
 static long long current_time;
@@ -82,7 +82,7 @@ static void log_forward(const char *file, int line, const char *function, const
 {
        if (log_forward_count==0)
        {
 {
        if (log_forward_count==0)
        {
-               log_callback_t *cb, *next;
+               struct log_callback *cb, *next;
                cb = log_callbacks;
                /* DANGER!!!! the log callback can remove itself!!!! */
                while (cb)
                cb = log_callbacks;
                /* DANGER!!!! the log callback can remove itself!!!! */
                while (cb)
@@ -353,7 +353,7 @@ int set_log_output(struct command_context_s *cmd_ctx, FILE *output)
 /* add/remove log callback handler */
 int log_add_callback(log_callback_fn fn, void *priv)
 {
 /* add/remove log callback handler */
 int log_add_callback(log_callback_fn fn, void *priv)
 {
-       log_callback_t *cb;
+       struct log_callback *cb;
 
        /* prevent the same callback to be registered more than once, just for sure */
        for (cb = log_callbacks; cb; cb = cb->next)
 
        /* prevent the same callback to be registered more than once, just for sure */
        for (cb = log_callbacks; cb; cb = cb->next)
@@ -363,7 +363,7 @@ int log_add_callback(log_callback_fn fn, void *priv)
        }
 
        /* alloc memory, it is safe just to return in case of an error, no need for the caller to check this */
        }
 
        /* alloc memory, it is safe just to return in case of an error, no need for the caller to check this */
-       if ((cb = malloc(sizeof(log_callback_t))) == NULL)
+       if ((cb = malloc(sizeof(struct log_callback))) == NULL)
                return ERROR_BUF_TOO_SMALL;
 
        /* add item to the beginning of the linked list */
                return ERROR_BUF_TOO_SMALL;
 
        /* add item to the beginning of the linked list */
@@ -377,7 +377,7 @@ int log_add_callback(log_callback_fn fn, void *priv)
 
 int log_remove_callback(log_callback_fn fn, void *priv)
 {
 
 int log_remove_callback(log_callback_fn fn, void *priv)
 {
-       log_callback_t *cb, **p;
+       struct log_callback *cb, **p;
 
        for (p = &log_callbacks; (cb = *p); p = &(*p)->next)
        {
 
        for (p = &log_callbacks; (cb = *p); p = &(*p)->next)
        {
index aabd1be250c2a40efa29819ec2e317f814c6b406..5742897d8c958a70c9dcc067239d16482ed69bb9 100644 (file)
@@ -88,12 +88,11 @@ void log_rethrow(void);
 typedef void (*log_callback_fn)(void *priv, const char *file, unsigned line,
                const char *function, const char *string);
 
 typedef void (*log_callback_fn)(void *priv, const char *file, unsigned line,
                const char *function, const char *string);
 
-typedef struct log_callback_s
-{
+struct log_callback {
        log_callback_fn fn;
        void *priv;
        log_callback_fn fn;
        void *priv;
-       struct log_callback_s *next;
-} log_callback_t;
+       struct log_callback *next;
+};
 
 int log_add_callback(log_callback_fn fn, void *priv);
 int log_remove_callback(log_callback_fn fn, void *priv);
 
 int log_add_callback(log_callback_fn fn, void *priv);
 int log_remove_callback(log_callback_fn fn, void *priv);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)