diff --git a/ivette/src/frama-c/eva/Values.tsx b/ivette/src/frama-c/eva/Values.tsx index ee3bb0c523fe8e6239ec99ad4a3033dba25d95f7..6bdf15345c8728ade58b0881b2e451cca04f9264 100644 --- a/ivette/src/frama-c/eva/Values.tsx +++ b/ivette/src/frama-c/eva/Values.tsx @@ -26,7 +26,8 @@ import * as Ast from 'frama-c/api/kernel/ast'; // Locals import { SizedArea, HSIZER, WSIZER } from './sized'; import { Diff } from './diffed'; -import { sizeof, valueAt, diffAfter, diffThen, diffElse, EvaAlarm } from './cells'; +import { sizeof, valueAt, diffAfter, diffThen, diffElse, EvaAlarm } + from './cells'; import { Row } from './layout'; import { Probe } from './probes'; import { Callsite } from './stacks'; @@ -162,11 +163,11 @@ function AlarmsInfo() { model.values.getValues(probe.marker, probe.stmt, callstack); const alarms = domain?.alarms ?? []; if (alarms.length > 0) { - console.log('ALARMS', alarms); + // console.log('ALARMS', alarms); const renderAlarm = ([status, alarm]: EvaAlarm) => { const className = `eva-alarm-info eva-alarm-${status}`; return ( - <Code className={className} icon='WARNING'>{alarm}</Code> + <Code className={className} icon="WARNING">{alarm}</Code> ); }; return ( @@ -273,7 +274,7 @@ function TableCell(props: TableCellProps) { contents = ( <> {alarms.length > 0 && ( - <Icon className="eva-cell-alarms" size={10} id='WARNING' /> + <Icon className="eva-cell-alarms" size={10} id="WARNING" /> )} <SizedArea cols={cols} rows={rows}> <span className={`eva-state-${s}`}> diff --git a/ivette/src/frama-c/eva/diffed.tsx b/ivette/src/frama-c/eva/diffed.tsx index 9fa71d9e20ce92d88dbd53fe9f6bc92a416e2974..9edf57ee95f6edd03c49de4f3935ad4dbb70156a 100644 --- a/ivette/src/frama-c/eva/diffed.tsx +++ b/ivette/src/frama-c/eva/diffed.tsx @@ -50,24 +50,22 @@ export class DiffBuffer { if (value) { this.scratch += '\0'.repeat(value.length); this.contents.push( - <span className={MODIFIED} title='Modified'> {value}</span > + <span className={MODIFIED} title="Modified"> {value}</span>, ); } } else if (removed) { if (value) { this.contents.push( - <span className={REMOVED} title='Removed'>{value}</span> + <span className={REMOVED} title="Removed">{value}</span>, ); } } else if (added) { this.contents.push( - <span className={ADDED}><span className={SHADOW} /></span> + <span className={ADDED}><span className={SHADOW} /></span>, ); - } else { - if (value) { - this.scratch += value; - this.contents.push(value); - } + } else if (value) { + this.scratch += value; + this.contents.push(value); } this.value = ''; this.added = false; @@ -95,17 +93,17 @@ export interface Diff2Props { diff: string; } -export function Diff2(props: Diff2Props) { +export function Diff2(props: Diff2Props): JSX.Element { const { text, diff } = props; const contents = React.useMemo(() => { if (text === diff) return text; const buffer = new DiffBuffer(); const chunks = diffChars(text, diff); - console.log('DIFF', text, diff, chunks); + // console.log('DIFF', text, diff, chunks); chunks.forEach(buffer.push); return buffer.getContents(); }, [text, diff]); - return contents; + return contents as JSX.Element; } /* --------------------------------------------------------------------------*/ @@ -118,7 +116,7 @@ export interface Diff3Props { diffB: string; } -export function Diff3(props: Diff3Props) { +export function Diff3(props: Diff3Props): JSX.Element { const { text, diffA, diffB } = props; const contents = React.useMemo(() => { if (text === diffA && text === diffB) return text; @@ -129,7 +127,7 @@ export function Diff3(props: Diff3Props) { diffChars(text, scratch).forEach(buffer.push); return buffer.getContents(); }, [text, diffA, diffB]); - return contents; + return contents as JSX.Element; } /* --------------------------------------------------------------------------*/ diff --git a/ivette/src/frama-c/eva/layout.ts b/ivette/src/frama-c/eva/layout.ts index 61dc7f4d11e2b7d58d641fe8d9fe49707b677d96..c416fa7c8945753a5ac0ff2490a9618ac73bc430 100644 --- a/ivette/src/frama-c/eva/layout.ts +++ b/ivette/src/frama-c/eva/layout.ts @@ -65,8 +65,8 @@ export class LayoutEngine { private rows: Row[] = []; crop(zoomed: boolean, s: Size): Size { - const s_cols = s.cols + INSET; - const cols = zoomed ? s_cols : Math.min(s_cols, this.hcrop); + const sCols = s.cols + INSET; + const cols = zoomed ? sCols : Math.min(sCols, this.hcrop); const rows = zoomed ? s.rows : Math.min(s.rows, this.vcrop); return { cols: Math.max(HCROP, cols),