+++ /dev/null
-#ifndef __LABWC_BUG_ON_H
-#define __LABWC_BUG_ON_H
-
-/**
- * BUG_ON - assert() without abort()
- * @condition - expression to be evaluated
- */
-#define BUG_ON(condition) \
- do { \
- if ((condition) != 0) { \
- fprintf(stderr, "Badness in %s() at %s:%d\n", \
- __func__, __FILE__, __LINE__); \
- } \
- } while (0)
-
-#endif /* __LABWC_BUG_ON_H */
#include <wlr/xwayland.h>
#include <xkbcommon/xkbcommon.h>
-#include "common/bug-on.h"
#include "common/log.h"
#include "config/keybind.h"
#include "config/rcxml.h"
#define _POSIX_C_SOURCE 200809L
+#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
#include <libxml/parser.h>
#include <unistd.h>
#include <wayland-server-core.h>
-#include "common/bug-on.h"
#include "common/dir.h"
#include "common/font.h"
#include "common/log.h"
current_keybind = keybind_create(content);
}
/* We expect <keybind key=""> to come first */
- BUG_ON(!current_keybind);
+ assert(current_keybind);
if (!strcmp(nodename, "name.action")) {
current_keybind->action = strdup(content);
} else if (!strcmp(nodename, "command.action")) {
* Copyright Johan Malm 2020
*/
+#include <assert.h>
#include "config/rcxml.h"
#include "labwc.h"
#include "theme/theme.h"
deco_box(struct view *view, enum deco_part deco_part)
{
struct wlr_box box = { .x = 0, .y = 0, .width = 0, .height = 0 };
- BUG_ON(!view);
+ assert(view);
switch (deco_part) {
case LAB_DECO_BUTTON_CLOSE:
box.width = rc.title_height;
+#include <assert.h>
#include "labwc.h"
static void
struct view *
desktop_next_mapped_view(struct view *current)
{
- BUG_ON(!current);
+ assert(current);
struct server *server = current->server;
if (!has_mapped_view(&server->views)) {
return NULL;
void
desktop_focus_next_mapped_view(struct view *current)
{
- BUG_ON(!current);
+ assert(current);
struct view *view = desktop_next_mapped_view(current);
desktop_focus_view(view);
}
*/
#define _POSIX_C_SOURCE 200809L
+#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "common/bug-on.h"
#include "xbm/parse.h"
static uint32_t color;
{
struct pixmap pixmap = { 0 };
- BUG_ON(size > LABWC_BUILTIN_ICON_MAX_SIZE);
+ assert(size <= LABWC_BUILTIN_ICON_MAX_SIZE);
pixmap.width = size;
pixmap.height = size;
+#include <assert.h>
#include "labwc.h"
struct xdg_deco {
handle_commit(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, commit);
- BUG_ON(!view->surface);
+ assert(view->surface);
view->w = view->surface->current.width;
view->h = view->surface->current.height;
}
+#include <assert.h>
#include "labwc.h"
static void
handle_commit(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, commit);
- BUG_ON(!view->surface);
+ assert(view->surface);
/* Must receive commit signal before accessing surface->current* */
view->w = view->surface->current.width;