From 6a2e83c01719cada03eb3bd13dc51d21d8bc964f Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Mon, 9 Nov 2009 06:12:02 -0800 Subject: [PATCH] log: improve log_callback_fn signature Use unsigned type for line number in log_callback_fn signature. --- src/helper/command.c | 4 ++-- src/helper/log.h | 2 +- src/server/gdb_server.c | 4 ++-- src/server/telnet_server.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/helper/command.c b/src/helper/command.c index 5d69ffb3..5f3c88dc 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -49,10 +49,10 @@ Jim_Interp *interp = NULL; int run_command(command_context_t *context, command_t *c, char *words[], int num_words); -static void tcl_output(void *privData, const char *file, int line, const char *function, const char *string) +static void tcl_output(void *privData, const char *file, unsigned line, + const char *function, const char *string) { Jim_Obj *tclOutput = (Jim_Obj *)privData; - Jim_AppendString(interp, tclOutput, string, strlen(string)); } diff --git a/src/helper/log.h b/src/helper/log.h index 15bd3c86..aabd1be2 100644 --- a/src/helper/log.h +++ b/src/helper/log.h @@ -85,7 +85,7 @@ void log_catch(void); void log_rethrow(void); -typedef void (*log_callback_fn)(void *priv, const char *file, int line, +typedef void (*log_callback_fn)(void *priv, const char *file, unsigned line, const char *function, const char *string); typedef struct log_callback_s diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 284def3c..21b58d0e 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -49,7 +49,7 @@ extern int gdb_error(connection_t *connection, int retval); static unsigned short gdb_port = 3333; static const char *DIGITS = "0123456789abcdef"; -static void gdb_log_callback(void *priv, const char *file, int line, +static void gdb_log_callback(void *priv, const char *file, unsigned line, const char *function, const char *string); /* number of gdb connections, mainly to supress gdb related debugging spam @@ -1956,7 +1956,7 @@ int gdb_detach(connection_t *connection, target_t *target) return gdb_put_packet(connection, "OK", 2); } -static void gdb_log_callback(void *priv, const char *file, int line, +static void gdb_log_callback(void *priv, const char *file, unsigned line, const char *function, const char *string) { connection_t *connection = priv; diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 84959e3a..b77deff1 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -101,7 +101,7 @@ int telnet_output(struct command_context_s *cmd_ctx, const char* line) return telnet_outputline(connection, line); } -void telnet_log_callback(void *priv, const char *file, int line, +void telnet_log_callback(void *priv, const char *file, unsigned line, const char *function, const char *string) { connection_t *connection = priv; -- 2.39.5