[Spice-commits] 2 commits - common/log.h common/quic.c common/quic_family_tmpl.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Thu Jun 22 10:35:22 UTC 2017
common/log.h | 5 -----
common/quic.c | 8 ++++----
common/quic_family_tmpl.c | 2 +-
3 files changed, 5 insertions(+), 10 deletions(-)
New commits:
commit dde1fe35338f2df47d5e20cd41b15d6872acdc4e
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Jun 12 10:19:25 2017 +0100
log: remove spice_static_assert macro
The macro was misused and not doing static check.
Spice have other working static check macros to use.
The macro is used only by spice-common so removing it
does not cause issues to other depending projects.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau at redhat.com>
diff --git a/common/log.h b/common/log.h
index 1ea2313..a4d296d 100644
--- a/common/log.h
+++ b/common/log.h
@@ -94,11 +94,6 @@ void spice_log(const char *log_domain,
} \
} G_STMT_END
-/* FIXME: improve that some day.. */
-#define spice_static_assert(x) SPICE_STMT_START { \
- spice_assert(x); \
-} SPICE_STMT_END
-
SPICE_END_DECLS
#endif /* H_SPICE_LOG */
diff --git a/common/quic.c b/common/quic.c
index 980ddbd..d22a9b7 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -878,7 +878,7 @@ static void find_model_params(Encoder *encoder,
/* The only valid values are 1, 3 and 5.
0, 2 and 4 are obsolete and the rest of the
values are considered out of the range. */
- spice_static_assert (evol == 1 || evol == 3 || evol == 5);
+ SPICE_VERIFY(evol == 1 || evol == 3 || evol == 5);
spice_assert(bpc <= 8 && bpc > 0);
*ncounters = 8;
diff --git a/common/quic_family_tmpl.c b/common/quic_family_tmpl.c
index 9a434e0..9450f44 100644
--- a/common/quic_family_tmpl.c
+++ b/common/quic_family_tmpl.c
@@ -71,7 +71,7 @@ static unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned
static void FNAME(update_model)(CommonState *state, s_bucket * const bucket,
const BYTE curval)
{
- spice_static_assert(BPC >= 1);
+ SPICE_VERIFY(BPC >= 1);
spice_return_if_fail (bucket != NULL);
const unsigned int bpp = BPC;
commit 2ff5c77fff7fc3e066104acdbeabbe3b75f80c07
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Jun 12 10:17:05 2017 +0100
quic: constantify some variable
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
diff --git a/common/quic.c b/common/quic.c
index 98ac319..980ddbd 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -173,13 +173,13 @@ struct Encoder {
};
/* target wait mask index */
-static int wmimax = DEFwmimax;
+static const int wmimax = DEFwmimax;
/* number of symbols to encode before increasing wait mask index */
-static int wminext = DEFwminext;
+static const int wminext = DEFwminext;
/* model evolution mode */
-static int evol = DEFevol;
+static const int evol = DEFevol;
/* bppmask[i] contains i ones as lsb-s */
static const unsigned long int bppmask[33] = {
More information about the Spice-commits
mailing list