summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/core/utils.h5
-rw-r--r--src/bitvec.c3
-rw-r--r--src/gsm/gsm0808_utils.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index cd22dfb0..dd4461cc 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -4,6 +4,7 @@
#include <osmocom/core/backtrace.h>
#include <osmocom/core/talloc.h>
+#include <osmocom/core/panic.h>
/*! \defgroup utils General-purpose utility functions
* @{
@@ -77,9 +78,7 @@ do { \
*/
#define OSMO_ASSERT(exp) \
if (!(exp)) { \
- fprintf(stderr, "Assert failed %s %s:%d\n", #exp, __BASE_FILE__, __LINE__); \
- osmo_generate_backtrace(); \
- abort(); \
+ osmo_panic("Assert failed %s %s:%d\n", #exp, __BASE_FILE__, __LINE__); \
}
/*! duplicate a string using talloc and release its prior content (if any)
diff --git a/src/bitvec.c b/src/bitvec.c
index 884eb025..0f56e3e9 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -44,6 +44,7 @@
#include <osmocom/core/bits.h>
#include <osmocom/core/bitvec.h>
+#include <osmocom/core/panic.h>
#define BITNUM_FROM_COMP(byte, bit) ((byte*8)+bit)
@@ -530,7 +531,7 @@ char bit_value_to_char(enum bit_value v)
case ONE: return '1';
case L: return 'L';
case H: return 'H';
- default: abort();
+ default: osmo_panic("unexpected input in bit_value_to_char"); return 'X';
}
}
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 080fc95b..73f02341 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -155,7 +155,7 @@ static uint8_t enc_speech_codec(struct msgb *msg,
/* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */
uint8_t header = 0;
uint8_t *old_tail;
- bool type_extended;
+ bool type_extended = false;
/* Note: Extended codec types are codec types that require 8 instead
* of 4 bit to fully specify the selected codec. In the following,