From 7eb82a0fe52562b61c5ae17967a6d30be3d0ed42 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Wed, 18 Jun 2014 15:54:50 -0400 Subject: [PATCH] bump version to 0.4.1 --- configure.ac | 2 +- src/toxic.c | 6 +++--- src/toxic.h | 14 ++++++-------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 3fc3a3a..3b1f181 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([toxic], [0.4.0], [https://tox.im/]) +AC_INIT([toxic], [0.4.1], [https://tox.im/]) AC_CONFIG_AUX_DIR(configure_aux) AC_CONFIG_SRCDIR([src/toxic.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/src/toxic.c b/src/toxic.c index 6eb4254..c7e0465 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -111,14 +111,14 @@ void exit_toxic_success(Tox *m) exit(EXIT_SUCCESS); } -void exit_toxic_err(const char *errmsg, int retcode) +void exit_toxic_err(const char *errmsg, int errcode) { if (errmsg == NULL) errmsg = "No error message"; endwin(); - fprintf(stderr, "Toxic session aborted with return code %d (%s)\n", retcode, errmsg); - exit(retcode); + fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg); + exit(EXIT_FAILURE); } static void init_term(void) diff --git a/src/toxic.h b/src/toxic.h index a6000d9..97503c7 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -41,8 +41,6 @@ #define KEY_IDENT_DIGITS 2 /* number of hex digits to display for the pub-key based identifier */ #define TIME_STR_SIZE 16 -#define EXIT_SUCCESS 0 - /* ASCII key codes */ #define T_KEY_KILL 0x0B /* ctrl-k */ #define T_KEY_DISCARD 0x15 /* ctrl-u */ @@ -60,15 +58,15 @@ enum { } KEY_DIRS; typedef enum _FATAL_ERRS { - FATALERR_MEMORY = -1, - FATALERR_FREAD = -2, + FATALERR_MEMORY = -1, /* malloc() or calloc() failed */ + FATALERR_FREAD = -2, /* fread() failed on critical read */ FATALERR_THREAD_CREATE = -3, FATALERR_MUTEX_INIT = -4, FATALERR_LOCALE_SET = -5, FATALERR_STORE_DATA = -6, - FATALERR_NETWORKINIT = -7, - FATALERR_INFLOOP = -8, - FATALERR_WININIT = -9, + FATALERR_NETWORKINIT = -7, /* Tox network failed to init */ + FATALERR_INFLOOP = -8, /* infinite loop detected */ + FATALERR_WININIT = -9, /* window init failed */ } FATAL_ERRS; /* Fixes text color problem on some terminals. @@ -76,7 +74,7 @@ typedef enum _FATAL_ERRS { /* #define URXVT_FIX */ void exit_toxic_success(Tox *m); -void exit_toxic_err(const char *errmsg, int retcode); +void exit_toxic_err(const char *errmsg, int errcode); void on_request(Tox *m, const uint8_t *public_key, const uint8_t *data, uint16_t length, void *userdata); void on_connectionchange(Tox *m, int32_t friendnumber, uint8_t status, void *userdata);