From 7e86eef4a1d49b6f0e3c18633698ed7a601e9a73 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 28 Feb 2014 20:11:21 +0100 Subject: msgb: Optionally declare some msgb struct fields as const Writing directly to following struct fields may cause inconsistencies that are hard to debug: data_len, len, head, tail, data In general, the available macros and functions should be used to modify them instead. This patch declares these fields as const if MSGB_DISABLE_DIRECT_WRITE is defined. Doing so may lead to warnings and errors, therefore this macro is only defined for libosmocore yet, where at least the errors are also fixed by this patch. The main purpose is to maintain consistency, so only modifing the fields themselves is restricted. It's still possible to modify the data the pointers refer to. Sponsored-by: On-Waves ehf --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index a77bd8f3..d6a19923 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +export AM_CPPFLAGS = -DMSGB_DISABLE_DIRECT_WRITE + SUBDIRS = include src src/vty src/codec src/gsm src/gb tests utils pkgconfigdir = $(libdir)/pkgconfig -- cgit v1.2.3