[Spice-commits] 3 commits - common/backtrace.c common/canvas_utils.c common/log.c common/lz.c common/Makefile.am common/mem.c common/meson.build common/pixman_utils.c common/quic.c common/ring.h common/rop3.c common/spice_common.h tests/test-logging.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 6 05:47:01 UTC 2018


 common/Makefile.am    |    1 -
 common/backtrace.c    |    4 ++--
 common/canvas_utils.c |    1 -
 common/log.c          |    4 ----
 common/lz.c           |    1 -
 common/mem.c          |    1 -
 common/meson.build    |    1 -
 common/pixman_utils.c |    5 ++---
 common/quic.c         |    2 +-
 common/ring.h         |    2 +-
 common/rop3.c         |    1 -
 common/spice_common.h |   37 -------------------------------------
 tests/test-logging.c  |   14 ++------------
 13 files changed, 8 insertions(+), 66 deletions(-)

New commits:
commit b4e07c31cfbf7a4aacd63870b9ef3b10535e4e6b
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Jul 3 12:42:35 2018 +0200

    build: Remove spice_common.h
    
    Most users of spice_common.h don't need it, or only need log.h. It only
    has a few users outside of spice-common. It's not very well defined
    which headers it should contain. This commit removes spice_common.h in
    favour of direct inclusion of the needed headers.
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/common/Makefile.am b/common/Makefile.am
index 5ca6538..4b1ff68 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -51,7 +51,6 @@ libspice_common_la_SOURCES =		\
 	rop3.h				\
 	snd_codec.c			\
 	snd_codec.h			\
-	spice_common.h			\
 	verify.h			\
 	$(NULL)
 
diff --git a/common/backtrace.c b/common/backtrace.c
index 6e0d61b..c4edde1 100644
--- a/common/backtrace.c
+++ b/common/backtrace.c
@@ -24,10 +24,10 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "spice_common.h"
 
-#include <unistd.h>
 #include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
 #ifndef __MINGW32__
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index a95501f..e5f4efb 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -18,7 +18,6 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "spice_common.h"
 
 #include "canvas_utils.h"
 #include "mem.h"
diff --git a/common/lz.c b/common/lz.c
index b7e7d48..87c13db 100644
--- a/common/lz.c
+++ b/common/lz.c
@@ -47,7 +47,6 @@
 #include <config.h>
 #endif
 
-#include "spice_common.h"
 #include "lz.h"
 
 #define HASH_LOG 13
diff --git a/common/mem.c b/common/mem.c
index 8b96548..8779282 100644
--- a/common/mem.c
+++ b/common/mem.c
@@ -19,7 +19,6 @@
 #include <config.h>
 #endif
 
-#include "spice_common.h"
 #include "mem.h"
 
 #include <string.h>
diff --git a/common/meson.build b/common/meson.build
index 22dcbb8..9044aa9 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -34,7 +34,6 @@ spice_common_sources = [
   'rop3.h',
   'snd_codec.c',
   'snd_codec.h',
-  'spice_common.h',
   'verify.h'
 ]
 
diff --git a/common/pixman_utils.c b/common/pixman_utils.c
index 5d1c15c..b7cf25c 100644
--- a/common/pixman_utils.c
+++ b/common/pixman_utils.c
@@ -18,7 +18,6 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "spice_common.h"
 
 #include "pixman_utils.h"
 
diff --git a/common/quic.c b/common/quic.c
index 04f3999..6ed316c 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -26,7 +26,7 @@
 #include <glib.h>
 
 #include "quic.h"
-#include "spice_common.h"
+#include "log.h"
 
 /* ASCII "QUIC" */
 #define QUIC_MAGIC 0x43495551
diff --git a/common/ring.h b/common/ring.h
index 1ed3576..4fd35ef 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -19,7 +19,7 @@
 #ifndef _H_RING2
 #define _H_RING2
 
-#include "spice_common.h"
+#include "log.h"
 
 SPICE_BEGIN_DECLS
 
diff --git a/common/rop3.c b/common/rop3.c
index 2a0a167..75fec12 100644
--- a/common/rop3.c
+++ b/common/rop3.c
@@ -20,7 +20,6 @@
 #endif
 
 #include "rop3.h"
-#include "spice_common.h"
 
 typedef void (*rop3_with_pattern_handler_t)(pixman_image_t *d, pixman_image_t *s,
                                             SpicePoint *src_pos, pixman_image_t *p,
diff --git a/common/spice_common.h b/common/spice_common.h
deleted file mode 100644
index c7b6e8e..0000000
--- a/common/spice_common.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef H_SPICE_COMMON
-#define H_SPICE_COMMON
-
-#include <stdio.h>
-#include <stdint.h>
-#include <time.h>
-#include <stdlib.h>
-#include <stddef.h>
-
-#include <spice/macros.h>
-#include "backtrace.h"
-#include "log.h"
-
-#endif
commit 8069bf498de70f6806c67014c3b22f2e9c71112f
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Jul 3 12:42:34 2018 +0200

    common: Remove spice_abort()
    
    There are only 2 users in spice-common, and none in spice-gtk/spice
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/common/pixman_utils.c b/common/pixman_utils.c
index 81806c9..5d1c15c 100644
--- a/common/pixman_utils.c
+++ b/common/pixman_utils.c
@@ -937,7 +937,7 @@ pixman_format_code_t spice_surface_format_to_pixman(uint32_t surface_format)
         return PIXMAN_a8r8g8b8;
     default:
         printf("Unknown surface format %d\n", surface_format);
-        spice_abort();
+        g_abort();
         break;
     }
         return (pixman_format_code_t)0; /* Not reached */
@@ -976,7 +976,7 @@ pixman_format_code_t spice_bitmap_format_to_pixman(int bitmap_format,
     case SPICE_BITMAP_FMT_INVALID:
     default:
         printf("Unknown bitmap format %d\n", bitmap_format);
-        spice_abort();
+        g_abort();
         return PIXMAN_a8r8g8b8;
     }
 }
diff --git a/common/spice_common.h b/common/spice_common.h
index f9a7b3b..c7b6e8e 100644
--- a/common/spice_common.h
+++ b/common/spice_common.h
@@ -28,6 +28,4 @@
 #include "backtrace.h"
 #include "log.h"
 
-#define spice_abort() abort()
-
 #endif
commit 31d462268754ecfe0d61b70c7ca8e6d1bacfd3f9
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Jul 3 12:42:33 2018 +0200

    log: Remove SPICE_DISABLE_ABORT
    
    spice-gtk was the last user, and stopped using it on Jun 14th 2017
    in 040090ccba34 "build-sys: remove -DSPICE_DISABLE_ABORT"
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/common/log.c b/common/log.c
index 7e460f0..b59c8a8 100644
--- a/common/log.c
+++ b/common/log.c
@@ -34,12 +34,8 @@ static int glib_debug_level = INT_MAX;
 static int abort_mask = 0;
 
 #ifndef SPICE_ABORT_MASK_DEFAULT
-#ifdef SPICE_DISABLE_ABORT
-#define SPICE_ABORT_MASK_DEFAULT 0
-#else
 #define SPICE_ABORT_MASK_DEFAULT (G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR)
 #endif
-#endif
 
 #define G_LOG_DOMAIN "Spice"
 
diff --git a/common/spice_common.h b/common/spice_common.h
index 5572326..f9a7b3b 100644
--- a/common/spice_common.h
+++ b/common/spice_common.h
@@ -28,10 +28,6 @@
 #include "backtrace.h"
 #include "log.h"
 
-#ifdef SPICE_DISABLE_ABORT
-#define spice_abort() do { } while(0)
-#else
 #define spice_abort() abort()
-#endif
 
 #endif
diff --git a/tests/test-logging.c b/tests/test-logging.c
index 437e0a1..559d656 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -89,8 +89,7 @@ static void test_spice_fatal_warning(void)
     g_unsetenv("G_DEBUG");
 }
 
-/* Checks that spice_critical() aborts by default if SPICE_DISABLE_ABORT is not
- * defined at compile-time */
+/* Checks that spice_critical() aborts by default */
 static void test_spice_fatal_critical(void)
 {
     if (g_test_subprocess()) {
@@ -98,11 +97,7 @@ static void test_spice_fatal_critical(void)
         return;
     }
     g_test_trap_subprocess(NULL, 0, 0);
-#ifdef SPICE_DISABLE_ABORT
-    g_test_trap_assert_passed();
-#else
     g_test_trap_assert_failed();
-#endif
     g_test_trap_assert_stderr("*spice_critical*");
 }
 
@@ -132,8 +127,7 @@ static void test_spice_fatal_g_critical(void)
     g_unsetenv("G_DEBUG");
 }
 
-/* Checks that spice_return_if_fail() aborts by default unless
- * SPICE_DISABLE_ABORT was defined at compile time*/
+/* Checks that spice_return_if_fail() aborts by default */
 static void test_spice_fatal_return_if_fail(void)
 {
     if (g_test_subprocess()) {
@@ -141,11 +135,7 @@ static void test_spice_fatal_return_if_fail(void)
         return;
     }
     g_test_trap_subprocess(NULL, 0, 0);
-#ifdef SPICE_DISABLE_ABORT
-    g_test_trap_assert_passed();
-#else
     g_test_trap_assert_failed();
-#endif
     g_test_trap_assert_stderr("*test_spice_fatal_return_if_fail*");
 }
 


More information about the Spice-commits mailing list