summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c2
-rw-r--r--gfx/pdftoc.c4
-rw-r--r--gfx/record.c3
-rw-r--r--gfx/text.c5
4 files changed, 8 insertions, 6 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 91e0ed4..1e229d5 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -220,7 +220,7 @@ static void cr_text(void *ctx, int x, int y, const char *s, unsigned size,
cairo_rel_move_to(cc->cr, -ext.width, 0);
break;
default:
- abort();
+ BUG("invalid alignment %d", align);
}
cairo_show_text(cc->cr, s);
diff --git a/gfx/pdftoc.c b/gfx/pdftoc.c
index dd30ded..39d59bd 100644
--- a/gfx/pdftoc.c
+++ b/gfx/pdftoc.c
@@ -173,7 +173,7 @@ static void line(struct pdftoc *ctx, const char *s)
}
break;
case xref:
- abort();
+ BUG("cannot be in xref");
case trailer:
if (sscanf(s, " /Root %d 0 R", &ctx->root) == 1)
break;
@@ -181,7 +181,7 @@ static void line(struct pdftoc *ctx, const char *s)
break;
break;
default:
- abort();
+ BUG("invalid state %d", ctx->state);
}
}
diff --git a/gfx/record.c b/gfx/record.c
index f224a48..0add67f 100644
--- a/gfx/record.c
+++ b/gfx/record.c
@@ -16,6 +16,7 @@
#include <math.h>
#include "misc/util.h"
+#include "misc/diag.h"
#include "gfx/style.h"
#include "gfx/gfx.h"
#include "gfx/text.h"
@@ -289,7 +290,7 @@ void record_replay(const struct record *rec)
obj->color, layer->layer);
break;
default:
- abort();
+ BUG("invalid object type %d", obj->type);
}
}
diff --git a/gfx/text.c b/gfx/text.c
index 46147c5..1d6d38a 100644
--- a/gfx/text.c
+++ b/gfx/text.c
@@ -17,6 +17,7 @@
#include <string.h>
#include "misc/util.h"
+#include "misc/diag.h"
#include "gfx/misc.h"
#include "gfx/style.h"
#include "gfx/gfx.h"
@@ -64,7 +65,7 @@ enum text_align text_flip(enum text_align align)
case text_max:
return text_min;
default:
- abort();
+ BUG("invalid alignment %d", align);
}
}
@@ -87,7 +88,7 @@ static int align(int dim, enum text_align align)
case text_max:
return dim;
default:
- abort();
+ BUG("invalid alignment %d", align);
}
}