mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Add some more miscellaneous asserts.
These clarify matters for static checkers (not to mention humans), and seem inexpensive enough not to worry about adding.
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
* gtkcols.c - implementation of the `Columns' GTK layout container.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "defs.h"
|
||||
#include "gtkcompat.h"
|
||||
@ -662,6 +663,7 @@ static gint columns_compute_width(Columns *cols, widget_dim_fn_t get_width)
|
||||
|
||||
childwidth = get_width(child);
|
||||
colspan = child->colspan ? child->colspan : ncols-child->colstart;
|
||||
assert(colspan > 0);
|
||||
|
||||
#ifdef COLUMNS_WIDTH_DIAGNOSTICS
|
||||
printf("compute_width(%p): ", cols);
|
||||
|
@ -1850,8 +1850,9 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
|
||||
GtkWidget *ret;
|
||||
int i;
|
||||
|
||||
if (!s->boxname && s->boxtitle) {
|
||||
if (!s->boxname) {
|
||||
/* This controlset is a panel title. */
|
||||
assert(s->boxtitle);
|
||||
return gtk_label_new(s->boxtitle);
|
||||
}
|
||||
|
||||
|
@ -1614,6 +1614,7 @@ static void pangofont_draw_internal(unifont_drawctx *ctx, unifont *font,
|
||||
draw_layout = pango_cairo_draw_layout;
|
||||
}
|
||||
#endif
|
||||
assert(draw_layout);
|
||||
|
||||
if (wide)
|
||||
cellwidth *= 2;
|
||||
|
Reference in New Issue
Block a user