From 37388ebb0ef9085c841d7f94e665a5a77cfe0e92 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 16 Jul 2013 13:28:28 +0200 Subject: configure: uniform the defines to #define HAVE_xxx (0|1) The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related --- video/out/vo_x11.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'video/out/vo_x11.c') diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index a2c8ecb2e8..be385ac621 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -40,7 +40,7 @@ #include "x11_common.h" -#ifdef HAVE_SHM +#if HAVE_SHM #include #include #include @@ -94,7 +94,7 @@ struct priv { int num_buffers; int Shmem_Flag; -#ifdef HAVE_SHM +#if HAVE_SHM int Shm_Warned_Slow; XShmSegmentInfo Shminfo[2]; @@ -157,7 +157,7 @@ static int find_depth_from_visuals(struct vo *vo, Visual ** visual_return) static void getMyXImage(struct priv *p, int foo) { struct vo *vo = p->vo; -#ifdef HAVE_SHM +#if HAVE_SHM if (vo->x11->display_is_local && XShmQueryExtension(vo->x11->display)) { p->Shmem_Flag = 1; vo->x11->ShmCompletionEvent = XShmGetEventBase(vo->x11->display) @@ -221,7 +221,7 @@ shmemerror: memset(p->myximage[foo]->data, 0, p->myximage[foo]->bytes_per_line * p->image_height); p->ImageData[foo] = p->myximage[foo]->data; -#ifdef HAVE_SHM +#if HAVE_SHM } #endif } @@ -229,7 +229,7 @@ shmemerror: static void freeMyXImage(struct priv *p, int foo) { struct vo *vo = p->vo; -#ifdef HAVE_SHM +#if HAVE_SHM if (p->Shmem_Flag) { XShmDetach(vo->x11->display, &p->Shminfo[foo]); XDestroyImage(p->myximage[foo]); @@ -397,7 +397,7 @@ static void Display_Image(struct priv *p, XImage *myximage) XImage *x_image = p->myximage[p->current_buf]; -#ifdef HAVE_SHM +#if HAVE_SHM if (p->Shmem_Flag) { XShmPutImage(vo->x11->display, vo->x11->window, vo->x11->vo_gc, x_image, 0, 0, p->dst.x0, p->dst.y0, p->dst_w, p->dst_h, @@ -443,7 +443,7 @@ static mp_image_t *get_screenshot(struct vo *vo) static void wait_for_completion(struct vo *vo, int max_outstanding) { -#ifdef HAVE_SHM +#if HAVE_SHM struct priv *ctx = vo->priv; struct vo_x11_state *x11 = vo->x11; if (ctx->Shmem_Flag) { -- cgit v1.2.3