Mercurial > ~dholland > hg > ag > index.cgi
view anagram/guisupport/errordc.cpp @ 8:ec2b657edf13
Add explicit lint-comment-style fallthrough annotations.
GCC now assumes that if you don't have these you're making a mistake,
which is annoying.
XXX: This changeset updates the AG output files only (by hand) and is
XXX: abusive - rebuilding them will erase the change. However, I need
XXX: to get things to build before I can try to get AG to issue the
XXX: annotations itself, so this seems like a reasonable expedient.
author | David A. Holland |
---|---|
date | Mon, 30 May 2022 23:51:43 -0400 |
parents | 13d2b8934445 |
children |
line wrap: on
line source
/* * AnaGram, A System for Syntax Directed Programming * Copyright 1993-2002 Parsifal Software. All Rights Reserved. * See the file COPYING for license and usage terms. * * errordc.cpp */ #include "brt.h" #include "dc.h" #include "error.h" #include "errordc.h" #include "stacks.h" #include "wm1.h" //#define INCLUDE_LOGGING #include "log.h" void error_display_dc::synchCursor(unsigned ln) const { set_text_line(errorList[ln].line, errorList[ln].column, 0); } //dc *error_display_cursor(dc *d, int k); error_display_dc::error_display_dc(void) : dc("Warnings") { LOGSECTION("error_display_dc::error_display_dc"); LOGV((int) this); cint size; unsigned i, dw, n; //extern cint cursor_bar_size; int nerrors = errorList.size(); LOGV(nerrors); for (i = dw = 0; i < nerrors; i++) { getLine(i); n = rcs(); if (n > dw) { dw = n; } } size.x = dw; size.y = nerrors; des->d_size = size; } void error_display_dc::getLine(unsigned ln) const { LOGSECTION("error_display_dc::getLine"); Error &e=errorList[ln]; if (e.file.exists()) { ssprintf("%s: Line %d, Col %d: %s", e.file.pointer(), e.line, e.column, e.message.pointer()); } else { ssprintf("Line %d, Col %d: %s", e.line, e.column, e.message.pointer()); } } AgString error_display_dc::findHelpTopic() { dc_ref window; char *q; //update_screen(this); getLine(des->c_loc_doc.y); q = string_base; if (strncmp(q, "Line ", 5) == 0) { q = strchr(q, ':'); if (q) { q += 2; } } AgString topic = q; rcs(); return topic; }