The latter is more robust and clearer in intent.
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
#include <cgraph/agxbuf.h>
+#include <cgraph/unreachable.h>
#include <common/utils.h>
#include <common/color.h>
color->u.index = i;
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
color->type = COLOR_INDEX;
#include <stdlib.h>
+#include <cgraph/unreachable.h>
#include <common/types.h>
#include <common/utils.h>
#include <gvc/gvplugin_render.h>
gvputs(job, "\n");
break;
default:
- assert(0);
- break;
+ UNREACHABLE();
}
} else if (job->render.id == FORMAT_ISMAP && url && url[0]) {
break;
}
default:
- assert(0);
- break;
+ UNREACHABLE();
}
} else if (job->render.id == FORMAT_CMAP || job->render.id == FORMAT_CMAPX) {
gvputs(job, "<area shape=\"poly\"");
break;
default:
- assert(0);
- break;
+ UNREACHABLE();
}
if (id && id[0]) {
gvputs(job, " id=\"");
#include <io.h>
#endif
+#include <cgraph/unreachable.h>
#include <common/macros.h>
#include <common/const.h>
color->u.index = 0;
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
color->type = COLOR_INDEX;
#include <gvc/gvplugin_render.h>
#include <cgraph/agxbuf.h>
+#include <cgraph/unreachable.h>
#include <common/utils.h>
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
color.u.rgba[0], color.u.rgba[1], color.u.rgba[2]);
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
}
color.u.rgba[0], color.u.rgba[1], color.u.rgba[2]);
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
}
gvprintf(job, " fill-opacity=\"%f\"", ((float) obj->pencolor.u.rgba[3] / 255.0));
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
gvputc(job, '>');
if (obj->labeledgealigned) {
#include <stdlib.h>
#include <string.h>
+#include <cgraph/unreachable.h>
#include <common/macros.h>
#include <common/const.h>
color.u.rgba[0], color.u.rgba[1], color.u.rgba[2]);
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
}
ObjId = AGID(obj->u.sg);
break;
default:
- assert (0);
- break;
+ UNREACHABLE();
}
gvprintf(job, " -tags {%d%s0x%" PRIx64 "}", ObjFlag, ObjType, ObjId);
}
#include <gvc/gvio.h>
#include <common/memory.h>
#include <cgraph/strcasecmp.h>
+#include <cgraph/unreachable.h>
typedef enum { FORMAT_VML, FORMAT_VMLZ, } format_type;
color.u.rgba[0], color.u.rgba[1], color.u.rgba[2]);
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
}
obj->pencolor.u.rgba[0], obj->pencolor.u.rgba[1], obj->pencolor.u.rgba[2]);
break;
default:
- assert(0); /* internal error */
+ UNREACHABLE(); // internal error
}
gvputs(job, "\"><center>");
html_puts(job, span->str);