diff options
Diffstat (limited to '2022-10-30-113850-3702-1@9f60058d4b7d_master')
12 files changed, 15337 insertions, 0 deletions
diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/index.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/index.html new file mode 100644 index 0000000..39c2743 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/index.html @@ -0,0 +1,124 @@ +<html> +<head> +<title>rootdir - scan-build results</title> +<link type="text/css" rel="stylesheet" href="scanview.css"/> +<script src="sorttable.js"></script> +<script language='javascript' type="text/javascript"> +function SetDisplay(RowClass, DisplayVal) +{ + var Rows = document.getElementsByTagName("tr"); + for ( var i = 0 ; i < Rows.length; ++i ) { + if (Rows[i].className == RowClass) { + Rows[i].style.display = DisplayVal; + } + } +} + +function CopyCheckedStateToCheckButtons(SummaryCheckButton) { + var Inputs = document.getElementsByTagName("input"); + for ( var i = 0 ; i < Inputs.length; ++i ) { + if (Inputs[i].type == "checkbox") { + if(Inputs[i] != SummaryCheckButton) { + Inputs[i].checked = SummaryCheckButton.checked; + Inputs[i].onclick(); + } + } + } +} + +function returnObjById( id ) { + if (document.getElementById) + var returnVar = document.getElementById(id); + else if (document.all) + var returnVar = document.all[id]; + else if (document.layers) + var returnVar = document.layers[id]; + return returnVar; +} + +var NumUnchecked = 0; + +function ToggleDisplay(CheckButton, ClassName) { + if (CheckButton.checked) { + SetDisplay(ClassName, ""); + if (--NumUnchecked == 0) { + returnObjById("AllBugsCheck").checked = true; + } + } + else { + SetDisplay(ClassName, "none"); + NumUnchecked++; + returnObjById("AllBugsCheck").checked = false; + } +} +</script> +<!-- SUMMARYENDHEAD --> +</head> +<body> +<h1>rootdir - scan-build results</h1> + +<table> +<tr><th>User:</th><td>root@c824a250765f</td></tr> +<tr><th>Working Directory:</th><td>/rootdir</td></tr> +<tr><th>Command Line:</th><td>make -j 2</td></tr> +<tr><th>Clang Version:</th><td>clang version 14.0.5 (Fedora 14.0.5-1.fc36) +</td></tr> +<tr><th>Date:</th><td>Sun Oct 30 11:38:50 2022</td></tr> +</table> +<h2>Bug Summary</h2><table> +<thead><tr><td>Bug Type</td><td>Quantity</td><td class="sorttable_nosort">Display?</td></tr></thead> +<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">9</td><td><center><input type="checkbox" id="AllBugsCheck" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr> +<tr><th>Logic error</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Dereference of null pointer</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_dereference_of_null_pointer');" checked/></center></td></tr> +<tr><th>Security</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Potential insecure memory buffer bounds restriction in call 'strcat'</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcat_');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_');" checked/></center></td></tr> +<tr><th>Unused code</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Dead assignment</td><td class="Q">3</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_unused_code_dead_assignment');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Dead nested assignment</td><td class="Q">3</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_unused_code_dead_nested_assignment');" checked/></center></td></tr> +</table> +<h2>Reports</h2> + +<table class="sortable" style="table-layout:automatic"> +<thead><tr> + <td>Bug Group</td> + <td class="sorttable_sorted">Bug Type<span id="sorttable_sortfwdind"> ▾</span></td> + <td>File</td> + <td>Function/Method</td> + <td class="Q">Line</td> + <td class="Q">Path Length</td> + <td class="sorttable_nosort"></td> + <!-- REPORTBUGCOL --> +</tr></thead> +<tbody> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>math-buttons.c</td><td class="DESC">base_changed_cb</td><td class="Q">472</td><td class="Q">1</td><td><a href="report-458ccc.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-458ccc.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>math-equation.c</td><td class="DESC">math_equation_get_equation</td><td class="Q">802</td><td class="Q">1</td><td><a href="report-90c61f.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-90c61f.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>math-preferences.c</td><td class="DESC">set_combo_box_from_int</td><td class="Q">150</td><td class="Q">1</td><td><a href="report-c8cbaf.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-c8cbaf.html" --> +</tr> +<tr class="bt_unused_code_dead_nested_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead nested assignment</td><td>lexer.c</td><td class="DESC">l_insert_next_token</td><td class="Q">204</td><td class="Q">1</td><td><a href="report-1d4839.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-1d4839.html" --> +</tr> +<tr class="bt_unused_code_dead_nested_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead nested assignment</td><td>lexer.c</td><td class="DESC">l_insert_next_token</td><td class="Q">241</td><td class="Q">1</td><td><a href="report-720c65.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-720c65.html" --> +</tr> +<tr class="bt_unused_code_dead_nested_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead nested assignment</td><td>lexer.c</td><td class="DESC">l_insert_next_token</td><td class="Q">125</td><td class="Q">1</td><td><a href="report-b1189a.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-b1189a.html" --> +</tr> +<tr class="bt_logic_error_dereference_of_null_pointer"><td class="DESC">Logic error</td><td class="DESC">Dereference of null pointer</td><td>mp.c</td><td class="DESC">mp_factorize</td><td class="Q">956</td><td class="Q">32</td><td><a href="report-397825.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-397825.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcat_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcat'</td><td>parserfunc.c</td><td class="DESC">pf_apply_func_with_npower</td><td class="Q">366</td><td class="Q">1</td><td><a href="report-c223fe.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-c223fe.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>parserfunc.c</td><td class="DESC">pf_apply_func_with_npower</td><td class="Q">365</td><td class="Q">1</td><td><a href="report-0e4c8f.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-0e4c8f.html" --> +</tr> +</tbody> +</table> + +</body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-0e4c8f.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-0e4c8f.html new file mode 100644 index 0000000..c700285 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-0e4c8f.html @@ -0,0 +1,1651 @@ +<!doctype html> +<html> +<head> +<title>parserfunc.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/src/parserfunc.c --> + +<!-- FILENAME parserfunc.c --> + +<!-- FUNCTIONNAME pf_apply_func_with_npower --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 0e4c8f4c4146d2f7a6092a405ec66fb3 --> + +<!-- BUGLINE 365 --> + +<!-- BUGCOLUMN 5 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>parserfunc.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 365, column 5</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name parserfunc.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c parserfunc.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"365": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"><span class='directive'>#include "parser.h"</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"><span class='directive'>#include "parserfunc.h"</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"><span class='comment'>/* Register error variables in ParserState structure. */</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line">set_error(ParserState* state, gint errorno, <span class='keyword'>const</span> gchar *token)</td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> state->error = errorno;</td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='keyword'>if</span>(token)</td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> state->error_token = strdup(token);</td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"><span class='comment'>/* Unused function pointer. This won't be called anytime. */</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line">pf_none(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='comment'>/* Set variable. */</span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line">pf_set_var(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> val = (MPNumber *) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> <span class='keyword'>if</span>(!val || !(self->state->set_variable))</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> (*(self->state->set_variable))(self->state, self->left->token->string, val);</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> <span class='keyword'>return</span> val;</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='comment'>/* Converts Number from one unit to other. */</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">pf_convert_number(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> gchar* from;</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> gchar* to;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> gint free_from = 0;</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> gint free_to = 0;</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='keyword'>if</span>(self->left->value)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> from = (gchar*) self->left->value;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> free_from = 1;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> from = self->left->token->string;</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='keyword'>if</span>(self->right->value)</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> to = (gchar*) self->right->value;</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> free_to = 1;</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> to = self->right->token->string;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(self->left->left->token->string, self->state->options->base, &tmp) != 0)</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> <span class='keyword'>goto</span> END_PF_CONVERT_NUMBER;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='keyword'>if</span>(!(self->state->convert))</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>goto</span> END_PF_CONVERT_NUMBER;</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->convert))(self->state, &tmp, from, to, ans))</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_CONVERSION, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line">END_PF_CONVERT_NUMBER:</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> <span class='keyword'>if</span>(free_from)</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> g_free(self->left->value);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> self->left->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>if</span>(free_to)</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_free(self->right->value);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> self->right->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='comment'>/* Conversion rate. */</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">pf_convert_1(ParseNode* self )</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> gchar* from;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> gchar* to;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> gint free_from = 0;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> gint free_to = 0;</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span>(self->left->value)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> from = (gchar*) self->left->value;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> free_from = 1;</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> from = self->left->token->string;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='keyword'>if</span>(self->right->value)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> to = (gchar*) self->right->value;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> free_to = 1;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> to = self->right->token->string;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> mp_set_from_integer(1, &tmp);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span>(!(self->state->convert))</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->convert))(self->state, &tmp, from, to, ans))</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_CONVERSION, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>if</span>(free_from)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_free(self->left->value);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> self->left->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>if</span>(free_to)</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> g_free(self->right->value);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> self->right->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"><span class='comment'>/* Join source unit and power. */</span></td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line">pf_make_unit(gchar* source, gchar* power)</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>return</span> g_strjoin(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, source, power, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>static</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line">utf8_next_char(<span class='keyword'>const</span> gchar *c)</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> c++;</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>while</span>((*c & 0xC0) == 0x80)</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> c++;</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='keyword'>return</span>(gchar *) c;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"><span class='comment'>/* Get value of variable. */</span></td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">pf_get_variable(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> gint result = 0;</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>const</span> gchar *c, *next;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> gchar *buffer;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> MPNumber value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> MPNumber t = mp_new();</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_variable))</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>/* If defined, then get the variable */</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span>((*(self->state->get_variable))(self->state, self->token->string, ans))</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>/* If has more than one character then assume a multiplication of variables */</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>if</span>(utf8_next_char(self->token->string)[0] != '\0')</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> result = 1;</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> buffer = (gchar*) malloc(<span class='keyword'>sizeof</span>(gchar) * strlen(self->token->string));</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> mp_set_from_integer(1, &value);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='keyword'>for</span>(c = self->token->string; *c != '\0'; c = next)</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> next = utf8_next_char(c);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> snprintf(buffer, next - c + 1, <span class='string_literal'>"%s"</span>, c);</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_variable))(self->state, buffer, &t))</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> result = 0;</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> mp_multiply(&value, &t, &value);</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> free(buffer);</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>if</span>(result)</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> mp_set_from_mp(&value, ans);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>if</span>(!result)</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> free (ans);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_VARIABLE, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"><span class='comment'>/* Get value of variable with power. */</span></td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line">pf_get_variable_with_power(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> gint result = 0;</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>const</span> gchar *c, *next;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> gchar *buffer;</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> MPNumber value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> MPNumber t = mp_new();</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> pow = super_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='comment'>/* No need to free the memory. It is allocated and freed somewhere else. */</span></td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_variable))</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> <span class='comment'>/* If defined, then get the variable */</span></td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='keyword'>if</span>((*(self->state->get_variable))(self->state, self->token->string, ans))</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> mp_xpowy_integer(ans, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='comment'>/* If has more than one character then assume a multiplication of variables */</span></td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span>(utf8_next_char(self->token->string)[0] != '\0')</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> result = 1;</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> buffer = (gchar*) malloc(<span class='keyword'>sizeof</span>(gchar) * strlen(self->token->string));</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> mp_set_from_integer(1, &value);</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>for</span>(c = self->token->string; *c != '\0'; c = next)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> next = utf8_next_char(c);</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> snprintf(buffer, next - c + 1, <span class='string_literal'>"%s"</span>, c);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_variable))(self->state, buffer, &t))</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> result = 0;</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='comment'>/* If last term do power */</span></td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>if</span>(*next == '\0')</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> mp_xpowy_integer(&t, pow, &t);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> mp_multiply(&value, &t, &value);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> free(buffer);</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>if</span>(result)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> mp_set_from_mp(&value, ans);</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='keyword'>if</span>(!result)</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_VARIABLE, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"><span class='comment'>/* Apply function on child. */</span></td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">pf_apply_func(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_function))</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_function))(self->state, self->token->string, val, ans))</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_FUNCTION, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"><span class='comment'>/* Apply function with +ve power. */</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line">pf_apply_func_with_power(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> MPNumber* tmp = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_function))</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_function))(self->state, self->token->string, val, tmp))</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_FUNCTION, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> pow = super_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> mp_xpowy_integer(tmp, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"><span class='comment'>/* Apply function with -ve power. */</span></td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line">pf_apply_func_with_npower(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> MPNumber* tmp = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar* inv_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> inv_name = (gchar*) malloc(<span class='keyword'>sizeof</span>(gchar) * strlen(self->token->string) + strlen(<span class='string_literal'>"⁻¹"</span>) + 1);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> <span class="mrange">strcpy</span>(inv_name, self->token->string);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:5ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> strcat(inv_name, <span class='string_literal'>"⁻¹"</span>);</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_function))</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_function))(self->state, inv_name, val, tmp))</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_FUNCTION, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> pow = super_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> mp_xpowy_integer(tmp, -pow, ans);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='comment'>/* Find nth root of child. */</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line">pf_do_nth_root(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> pow = sub_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> mp_root(val, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"><span class='comment'>/* Find sqrt of child. */</span></td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">pf_do_sqrt(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> mp_sqrt(val, ans);</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"><span class='comment'>/* Find 3rd root of child. */</span></td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line">pf_do_root_3(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> mp_root(val, 3, ans);</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"><span class='comment'>/* Find 4th root of child. */</span></td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line">pf_do_root_4(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> mp_root(val, 4, ans);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"><span class='comment'>/* Apply floor function. */</span></td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line">pf_do_floor(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> mp_floor(val, ans);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='comment'>/* Apply ceiling function. */</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"><span class='keyword'>void</span>* pf_do_ceiling (ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> mp_ceiling(val, ans);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"><span class='comment'>/* Round off. */</span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line">pf_do_round(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> mp_round(val, ans);</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"><span class='comment'>/* Fraction. */</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line">pf_do_fraction(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> mp_fractional_part(val, ans);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"><span class='comment'>/* Absolute value. */</span></td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line">pf_do_abs(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> mp_abs(val, ans);</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"><span class='comment'>/* Find x^y for x and y being MPNumber. */</span></td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line">pf_do_x_pow_y(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> MPNumber* pow;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> pow = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> <span class='keyword'>if</span>(!val || !pow)</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> <span class='keyword'>if</span>(pow)</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> mp_free(pow);</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> mp_xpowy(val, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> mp_free(pow);</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"><span class='comment'>/* Find x^y for MPNumber x and integer y. */</span></td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line">pf_do_x_pow_y_int(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> <span class='keyword'>long</span> pow;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> val = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> mp_set_from_integer(super_atoi(self->left->token->string), val);</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> <span class='keyword'>if</span> (self->right->token != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> pow = super_atoi(self->right->token->string);</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> MPNumber* aux = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> pow = mp_to_integer(aux);</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> mp_free(aux);</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> mp_xpowy_integer(val, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"><span class='comment'>/* Find factorial. */</span></td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line">pf_do_factorial(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> mp_factorial(val, ans);</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"><span class='comment'>/* Apply unary minus. */</span></td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line">pf_unary_minus(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> mp_invert_sign(val, ans);</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"><span class='comment'>/* Divide. */</span></td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line">pf_do_divide(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> mp_divide(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"><span class='comment'>/* Modulus. */</span></td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line">pf_do_mod(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> <span class='keyword'>if</span> (self->left->evaluate == pf_do_x_pow_y)</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> MPNumber* base_value = (MPNumber*) (*(self->left->left->evaluate))(self->left->left);</td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> MPNumber* exponent = (MPNumber*) (*(self->left->right->evaluate))(self->left->right);</td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='keyword'>if</span>(!base_value || !exponent)</td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> <span class='keyword'>if</span>(base_value)</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> mp_free(base_value);</td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='keyword'>if</span>(exponent)</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> mp_free(exponent);</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> mp_modular_exponentiation(base_value, exponent, right, ans);</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> mp_free(base_value);</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> mp_free(exponent);</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> mp_modulus_divide(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"><span class='comment'>/* Multiply two numbers. */</span></td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line">pf_do_multiply(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> mp_multiply(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"><span class='comment'>/* Subtract two numbers. */</span></td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line">pf_do_subtract(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> mp_subtract(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"><span class='comment'>/* Add two numbers. */</span></td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line">pf_do_add(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> mp_add(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"><span class='comment'>/* Add (x) Percentage to value. */</span></td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">pf_do_add_percent(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> MPNumber* per;</td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line"> per = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line"> <span class='keyword'>if</span>(!val || !per)</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> <span class='keyword'>if</span>(per)</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> mp_add_integer(per, 100, per);</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> mp_divide_integer(per, 100, per);</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> mp_multiply(val, per, ans);</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"><span class='comment'>/* Subtract (x) Percentage to value. */</span></td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line">pf_do_subtract_percent(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> MPNumber* per;</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> per = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> <span class='keyword'>if</span>(!val || !per)</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> <span class='keyword'>if</span>(per)</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> mp_add_integer(per, -100, per);</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"> mp_divide_integer(per, -100, per);</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> mp_multiply(val, per, ans);</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"><span class='comment'>/* Converts a constant into percentage. */</span></td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line">pf_do_percent(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> mp_divide_integer(val, 100, ans);</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"><span class='comment'>/* NOT. */</span></td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line">pf_do_not(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"> <span class='keyword'>if</span>(!mp_is_overflow(val, self->state->options->wordlen))</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> set_error(self->state, PARSER_ERR_OVERFLOW, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> mp_not(val, self->state->options->wordlen, ans);</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"><span class='comment'>/* AND. */</span></td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line">pf_do_and(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> mp_and(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"><span class='comment'>/* OR. */</span></td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line">pf_do_or(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> mp_or(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"><span class='comment'>/* XOR. */</span></td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line">pf_do_xor(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> mp_xor(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"><span class='comment'>/* Constant value. Convert into MPNumber and return. */</span></td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line">pf_constant(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(self->token->string, self->state->options->base, ans) != 0)</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> <span class='comment'>/* This should never happen, as l_check_if_number() has already passed the string once. */</span></td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> <span class='comment'>/* If the code reaches this point, something is really wrong. X( */</span></td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> set_error(self->state, PARSER_ERR_INVALID, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> </td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-1d4839.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-1d4839.html new file mode 100644 index 0000000..a256dfe --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-1d4839.html @@ -0,0 +1,1270 @@ +<!doctype html> +<html> +<head> +<title>lexer.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type' --> + +<!-- BUGTYPE Dead nested assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/src/lexer.c --> + +<!-- FILENAME lexer.c --> + +<!-- FUNCTIONNAME l_insert_next_token --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 1d483979e7aa90682616758b282e3cf2 --> + +<!-- BUGLINE 204 --> + +<!-- BUGCOLUMN 29 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>lexer.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 204, column 29</a><br />Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name lexer.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c lexer.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"204": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"><span class='directive'>#include <assert.h></span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"><span class='directive'>#include "lexer.h"</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"><span class='directive'>#include "parserfunc.h"</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"><span class='directive'>#include "mp-equation.h"</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line">l_check_if_function(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> gchar* name = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='keyword'>if</span>(!state->parent->function_is_defined)</td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='keyword'>if</span> ((*(state->parent->function_is_defined))(state->parent, name))</td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line">l_check_if_number(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> <span class='keyword'>int</span> count = 0;</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> gchar* text = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(text, state->parent->options->base, &tmp) == 0)</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='comment'>/* Try to rollback several characters to see, if that yeilds any number. */</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='keyword'>while</span>(strlen (text) > 0)</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(text, state->parent->options->base, &tmp) == 0)</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> count++;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> pl_roll_back(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> text = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>/* Undo all rollbacks. */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='keyword'>while</span>(count--)</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> pl_get_next_token (state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"><span class='comment'>/* Insert generated token to the LexerState structure. */</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='keyword'>static</span> LexerToken*</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line">l_insert_token(LexerState* state, <span class='keyword'>const</span> LexerTokenType type)</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> state->tokens = (LexerToken *) realloc(state->tokens, (state->token_count + 1) * <span class='keyword'>sizeof</span>(LexerToken));</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='macro'>assert(state->tokens != NULL)<span class='macro_popup'>((void) sizeof ((state->tokens != ((void*)0)) ? 1 : 0), __extension__<br> ({ if (state->tokens != ((void*)0)) ; else __assert_fail (<br>"state->tokens != NULL", "lexer.c", 72, __extension__ __PRETTY_FUNCTION__<br>); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> state->tokens[state->token_count].string = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> state->tokens[state->token_count].start_index = state->prelexer->mark_index;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> state->tokens[state->token_count].end_index = state->prelexer->next_index;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> state->tokens[state->token_count].token_type = type;</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> state->token_count++;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->token_count - 1];</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='comment'>/* Generates next token from pre-lexer stream and call l_insert_token() to insert it at the end. */</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='keyword'>static</span> LexerToken*</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">l_insert_next_token(LexerState* lstate)</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> PreLexerState* state = lstate->prelexer;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> LexerTokenType type;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gchar* tmp;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> pl_set_marker(state);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> <span class='comment'>/* Ignore all blank spaces. :) */</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_SKIP)</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='comment'>/* Set marker. Beginning of new token. */</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> pl_set_marker(state);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span>(type == T_AND</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> ||type == T_OR</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> ||type == T_XOR</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> ||type == T_NOT</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> ||type == T_ADD</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> ||type == T_SUBTRACT</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> ||type == T_MULTIPLY</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> ||type == T_DIV</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> ||type == T_L_FLOOR</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> ||type == T_R_FLOOR</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> ||type == T_L_CEILING</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> ||type == T_R_CEILING</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> ||type == T_ROOT</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> ||type == T_ROOT_3</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> ||type == T_ROOT_4</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> ||type == T_ASSIGN</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> ||type == T_L_R_BRACKET</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> ||type == T_R_R_BRACKET</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> ||type == T_L_S_BRACKET</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> ||type == T_R_S_BRACKET</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> ||type == T_L_C_BRACKET</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> ||type == T_R_C_BRACKET</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> ||type == T_ABS</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> ||type == T_POWER</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> ||type == T_FACTORIAL</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> ||type == T_PERCENTAGE)</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, type);</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='comment'>/* [PL_SUPER_MINUS][PL_SUPER_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUPER_MINUS)</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>if</span>((type = pl_get_next_token(state)) != PL_SUPER_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SUP_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring (state));</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='comment'>/* Get all PL_SUPER_DIGITs. */</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='keyword'>while</span> (pl_get_next_token(state) == PL_SUPER_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NSUP_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='comment'>/* [PL_SUPER_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUPER_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUPER_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_SUP_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='comment'>/* [PL_SUB_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_SUB_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> <span class='comment'>/* [PL_FRACTION] */</span></td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='keyword'>if</span>(type == PL_FRACTION)</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='keyword'>if</span>(type == PL_FRACTION)</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DEGREE)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>goto</span> ANGLE_NUM_DM_STATE;</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_MINUTE)</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='keyword'>goto</span> ANGLE_NUM_DMS_STATE;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SECOND)</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SECOND */</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring (state));</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">ANGLE_NUM_DMS_STATE:</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>if</span>((type = <span class="mrange">pl_get_next_token (state)</span>) != PL_DIGIT)</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:29ex">Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'</div></td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>if</span>(type == PL_SECOND)</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SECOND */</span></td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='comment'>/* ERROR: expected PL_MINUTE | PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line">ANGLE_NUM_DM_STATE:</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>if</span>((type = pl_get_next_token(state)) != PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='keyword'>if</span>(type == PL_MINUTE)</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='comment'>/* ERROR: expected PL_MINUTE */</span></td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_STATE;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='keyword'>goto</span> HEX_DEC_STATE;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">DECIMAL_STATE:</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='keyword'>if</span>(type == PL_DEGREE)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_HEX);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line">HEX_DEC_STATE:</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DECIMAL | PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">DECIMAL_HEX_STATE:</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>if</span>(!(type == PL_DIGIT || type == PL_HEX))</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='comment'>/* NUMBER */</span></td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='comment'>/* VARIABLE */</span></td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_LETTER)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>goto</span> LETTER_STATE;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> <span class='comment'>/* NUMBER */</span></td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> <span class='comment'>/* VARIABLE */</span></td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>if</span>(type == PL_LETTER)</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line">LETTER_STATE:</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class='keyword'>if</span>(type == PL_LETTER || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> tmp = g_ascii_strdown(pl_get_marked_substring(state), -1);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"mod"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_MOD);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"and"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_AND);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"or"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_OR);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"xor"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_XOR);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"not"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NOT);</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"in"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_IN);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> tmp = g_ascii_strdown(pl_get_marked_substring(state), -1);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"mod"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_MOD);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"and"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_AND);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"or"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_OR);</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"xor"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_XOR);</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"not"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NOT);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"in"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_IN);</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>if</span>(type == PL_EOS)</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, PL_EOS);</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='comment'>/* ERROR: Unexpected token.. X( */</span></td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> set_error(lstate->parent, PARSER_ERR_INVALID, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"><span class='comment'>/* Call l_insert_next_token() as many times as needed to completely tokenize the string. */</span></td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">l_insert_all_tokens(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> LexerToken* token;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> token = l_insert_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> <span class='macro'>assert(token != NULL)<span class='macro_popup'>((void) sizeof ((token != ((void*)0)) ? 1 : 0), __extension__<br> ({ if (token != ((void*)0)) ; else __assert_fail ("token != NULL"<br>, "lexer.c", 537, __extension__ __PRETTY_FUNCTION__); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>if</span>(token->token_type == PL_EOS)</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"><span class='comment'>/* Create a lexer state from given input string. This will take care of pre-lexer state. */</span></td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line">LexerState*</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line">l_create_lexer(<span class='keyword'>const</span> gchar* input, <span class='keyword'>struct</span> parser_state* parent)</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> LexerState* ret;</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> ret = (LexerState *) malloc(<span class='keyword'>sizeof</span>(LexerState));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='macro'>assert(ret != NULL)<span class='macro_popup'>((void) sizeof ((ret != ((void*)0)) ? 1 : 0), __extension__ (<br>{ if (ret != ((void*)0)) ; else __assert_fail ("ret != NULL",<br> "lexer.c", 551, __extension__ __PRETTY_FUNCTION__); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> ret->prelexer = pl_create_scanner(input);</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> ret->tokens = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> ret->token_count = 0;</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> ret->next_token = 0;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> ret->parent = parent;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"><span class='comment'>/* Destroy lexer state and free memory. */</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line">l_destroy_lexer(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>int</span> l;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> pl_destroy_scanner(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>for</span>(l = 0; l < state->token_count; l++)</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> free(state->tokens[l].string);</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> free(state->tokens);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> free(state);</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"><span class='comment'>/* Get next token interface. Will be called by parser to get pointer to next token in token stream. */</span></td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">LexerToken*</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line">l_get_next_token(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='comment'>/* Return PL_EOS token after token stream reaches to its end. */</span></td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span>(state->next_token >= state->token_count)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->token_count - 1];</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->next_token++];</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"><span class='comment'>/* Roll back one lexer token. */</span></td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line">l_roll_back(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span>(state->next_token > 0)</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> state->next_token--;</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-397825.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-397825.html new file mode 100644 index 0000000..e2dc089 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-397825.html @@ -0,0 +1,1783 @@ +<!doctype html> +<html> +<head> +<title>mp.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Access to field 'data' results in a dereference of a null pointer (loaded from variable 'list') --> + +<!-- BUGTYPE Dereference of null pointer --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/src/mp.c --> + +<!-- FILENAME mp.c --> + +<!-- FUNCTIONNAME mp_factorize --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 39782558caa7182257e33af79c74933b --> + +<!-- BUGLINE 956 --> + +<!-- BUGCOLUMN 24 --> + +<!-- BUGPATHLENGTH 32 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mp.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 956, column 24</a><br />Access to field 'data' results in a dereference of a null pointer (loaded from variable 'list')</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mp.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c mp.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"53": 1, "54": 1, "55": 1, "56": 1, "57": 1, "58": 1, "61": 1, "62": 1, "63": 1, "64": 1, "65": 1, "66": 1, "67": 1, "78": 1, "79": 1, "80": 1, "81": 1, "82": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "162": 1, "163": 1, "164": 1, "165": 1, "224": 1, "225": 1, "226": 1, "227": 1, "230": 1, "231": 1, "232": 1, "233": 1, "240": 1, "243": 1, "244": 1, "245": 1, "246": 1, "248": 1, "249": 1, "250": 1, "253": 1, "254": 1, "255": 1, "256": 1, "257": 1, "280": 1, "281": 1, "282": 1, "283": 1, "286": 1, "287": 1, "288": 1, "289": 1, "290": 1, "299": 1, "300": 1, "301": 1, "302": 1, "303": 1, "306": 1, "307": 1, "308": 1, "309": 1, "318": 1, "319": 1, "320": 1, "321": 1, "324": 1, "325": 1, "326": 1, "327": 1, "413": 1, "414": 1, "415": 1, "416": 1, "418": 1, "427": 1, "429": 1, "430": 1, "438": 1, "445": 1, "446": 1, "447": 1, "448": 1, "449": 1, "450": 1, "454": 1, "455": 1, "456": 1, "457": 1, "499": 1, "500": 1, "501": 1, "502": 1, "504": 1, "505": 1, "506": 1, "657": 1, "658": 1, "659": 1, "660": 1, "661": 1, "662": 1, "663": 1, "666": 1, "667": 1, "668": 1, "669": 1, "670": 1, "672": 1, "673": 1, "674": 1, "675": 1, "678": 1, "679": 1, "680": 1, "682": 1, "709": 1, "710": 1, "711": 1, "712": 1, "713": 1, "714": 1, "715": 1, "717": 1, "842": 1, "843": 1, "844": 1, "845": 1, "846": 1, "847": 1, "849": 1, "850": 1, "852": 1, "860": 1, "861": 1, "862": 1, "872": 1, "873": 1, "874": 1, "875": 1, "876": 1, "877": 1, "888": 1, "889": 1, "891": 1, "892": 1, "901": 1, "904": 1, "906": 1, "907": 1, "908": 1, "909": 1, "910": 1, "928": 1, "943": 1, "944": 1, "951": 1, "952": 1, "955": 1, "956": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + <path class="arrow" id="arrow0"/> + <path class="arrow" id="arrow1"/> + <path class="arrow" id="arrow2"/> + <path class="arrow" id="arrow3"/> + <path class="arrow" id="arrow4"/> + <path class="arrow" id="arrow5"/> + <path class="arrow" id="arrow6"/> + <path class="arrow" id="arrow7"/> + <path class="arrow" id="arrow8"/> + <path class="arrow" id="arrow9"/> + <path class="arrow" id="arrow10"/> + <path class="arrow" id="arrow11"/> + <path class="arrow" id="arrow12"/> + <path class="arrow" id="arrow13"/> + <path class="arrow" id="arrow14"/> + <path class="arrow" id="arrow15"/> + <path class="arrow" id="arrow16"/> + <path class="arrow" id="arrow17"/> + <path class="arrow" id="arrow18"/> + <path class="arrow" id="arrow19"/> + <path class="arrow" id="arrow20"/> + <path class="arrow" id="arrow21"/> + <path class="arrow" id="arrow22"/> + <path class="arrow" id="arrow23"/> + <path class="arrow" id="arrow24"/> + <path class="arrow" id="arrow25"/> + <path class="arrow" id="arrow26"/> + <path class="arrow" id="arrow27"/> + <path class="arrow" id="arrow28"/> + <path class="arrow" id="arrow29"/> + <path class="arrow" id="arrow30"/> + <path class="arrow" id="arrow31"/> + <path class="arrow" id="arrow32"/> + <path class="arrow" id="arrow33"/> + <path class="arrow" id="arrow34"/> + <path class="arrow" id="arrow35"/> + <path class="arrow" id="arrow36"/> + <path class="arrow" id="arrow37"/> + <path class="arrow" id="arrow38"/> + <path class="arrow" id="arrow39"/> + <path class="arrow" id="arrow40"/> + <path class="arrow" id="arrow41"/> + <path class="arrow" id="arrow42"/> + <path class="arrow" id="arrow43"/> + <path class="arrow" id="arrow44"/> + <path class="arrow" id="arrow45"/> + <path class="arrow" id="arrow46"/> + <path class="arrow" id="arrow47"/> + <path class="arrow" id="arrow48"/> + <path class="arrow" id="arrow49"/> + <path class="arrow" id="arrow50"/> + <path class="arrow" id="arrow51"/> + <path class="arrow" id="arrow52"/> + <path class="arrow" id="arrow53"/> + <path class="arrow" id="arrow54"/> + <path class="arrow" id="arrow55"/> + <path class="arrow" id="arrow56"/> + <path class="arrow" id="arrow57"/> + <path class="arrow" id="arrow58"/> + <path class="arrow" id="arrow59"/> + <path class="arrow" id="arrow60"/> + <path class="arrow" id="arrow61"/> + <path class="arrow" id="arrow62"/> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 63,63,61,56,52,52,52,50,47,42,38,38,38,37,35,34,34,34,32,29,26,21,17,14,11,10,7,4,3,2,2,0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2008-2011 Robert Ancell</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify it under</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* the terms of the GNU General Public License as published by the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* Foundation, either version 2 of the License, or (at your option) any later</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* version. See http://www.gnu.org/copyleft/gpl.html the full text of the</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* license.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"><span class='directive'>#include <stdint.h></span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"><span class='directive'>#include <math.h></span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"><span class='directive'>#include "mp.h"</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"><span class='keyword'>char</span> *mp_error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>/* THIS ROUTINE IS CALLED WHEN AN ERROR CONDITION IS ENCOUNTERED, AND</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* AFTER A MESSAGE HAS BEEN WRITTEN TO STDERR.</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line">mperr(<span class='keyword'>const</span> <span class='keyword'>char</span> *format, ...)</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> <span class='keyword'>char</span> text[1024];</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> va_list args;</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> <span class='macro'>va_start(args, format)<span class='macro_popup'>__builtin_va_start(args, format)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> vsnprintf(text, 1024, format, args);</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> <span class='macro'>va_end(args)<span class='macro_popup'>__builtin_va_end(args)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> <span class='keyword'>if</span> (mp_error)</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> free(mp_error);</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> mp_error = strdup(text);</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line">mp_get_error()</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> <span class='keyword'>return</span> mp_error;</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='keyword'>void</span> mp_clear_error()</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> <span class='keyword'>if</span> (mp_error)</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> free(mp_error);</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> mp_error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line">MPNumber</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line">mp_new(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> MPNumber z;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> mpc_init2(z.num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='keyword'>return</span> z;</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">MPNumber</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">mp_new_from_unsigned_integer(ulong x)</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> MPNumber z;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> mpc_init2(z.num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> mpc_set_ui(z.num, x, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> <span class='keyword'>return</span> z;</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line">MPNumber *</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">mp_new_ptr(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> MPNumber *z = malloc(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> mpc_init2(z->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> <span class='keyword'>return</span> z;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">mp_clear(MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (z != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> mpc_clear(z->num);</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">mp_free(MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> <span class='keyword'>if</span> (z != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> mpc_clear(z->num);</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> free(z);</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line">mp_get_eulers(MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> <span class='comment'>/* e^1, since mpfr doesn't have a function to return e */</span></td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> <span class='macro'>mpfr_set_ui(mpc_realref(z->num), 1, MPFR_RNDN)<span class='macro_popup'>(__builtin_constant_p (1) && (mpfr_ulong) (1) == 0 ? __extension__<br> ({ mpfr_ptr _p = (((z->num)->re)); _p->_mpfr_sign =<br> 1; _p->_mpfr_exp = (0 - ((mpfr_exp_t) (((mpfr_uexp_t) -1)<br> >> 1))); (mpfr_void) (MPFR_RNDN); 0; }) : mpfr_set_ui_2exp<br> ((((z->num)->re)), (1), 0, (MPFR_RNDN)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> mpfr_exp(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, <span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">mp_get_i(MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> mpc_set_si_si(z->num, 0, 1, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line">mp_abs(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> mpc_abs(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line">mp_arg(<span class='keyword'>const</span> MPNumber *x, MPAngleUnit unit, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(x))</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='comment'>/* Translators: Error display when attempting to take argument of zero */</span></td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"Argument not defined for zero"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Argument not defined for zero", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> mpc_arg(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> convert_from_radians(z, unit, z);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> <span class='comment'>// MPC returns -π for the argument of negative real numbers if</span></td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='comment'>// their imaginary part is -0, we want +π for all real negative</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='comment'>// numbers</span></td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> <span class='keyword'>if</span> (!mp_is_complex (x) && mp_is_negative (x))</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='macro'>mpfr_abs(mpc_realref(z->num), mpc_realref(z->num), MPFR_RNDN)<span class='macro_popup'>mpfr_set4(((z->num)->re),((z->num)->re),MPFR_RNDN<br>,1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line">mp_conjugate(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> mpc_conj(z->num, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">mp_real_component(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> mpc_set_fr(z->num, <span class='macro'>mpc_realref(x->num)<span class='macro_popup'>((x->num)->re)</span></span>, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line">mp_imaginary_component(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> mpc_set_fr(z->num, <span class='macro'>mpc_imagref(x->num)<span class='macro_popup'>((x->num)->im)</span></span>, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line">mp_add(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> mpc_add(z->num, x->num, y->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line">mp_add_integer(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>long</span> y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> mpc_add_si(z->num, x->num, y, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line">mp_subtract(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> mpc_sub(z->num, x->num, y->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line">mp_sgn(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> mpc_set_si(z->num, <span class='macro'>mpfr_sgn(mpc_realref(x->num))<span class='macro_popup'>((((x->num)->re))->_mpfr_exp < (2 - ((mpfr_exp_t)<br> (((mpfr_uexp_t) -1) >> 1))) ? ((((mpfr_srcptr) (0 ? ((<br>(x->num)->re)) : (mpfr_srcptr) (((x->num)->re))))<br>->_mpfr_exp == (1 - ((mpfr_exp_t) (((mpfr_uexp_t) -1) >><br> 1)))) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : ((((x-><br>num)->re))->_mpfr_sign))</span></span>, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">mp_integer_component(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='macro'>mpfr_trunc(mpc_realref(z->num), mpc_realref(x->num))<span class='macro_popup'>mpfr_rint((((z->num)->re)), (((x->num)->re)), MPFR_RNDZ<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line">mp_fractional_component(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> mpfr_frac(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, <span class='macro'>mpc_realref(x->num)<span class='macro_popup'>((x->num)->re)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">mp_fractional_part(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> MPNumber f = mp_new();</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> mp_floor(x, &f);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> mp_subtract(x, &f, z);</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> mp_clear(&f);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">mp_floor(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='macro'>mpfr_floor(mpc_realref(z->num), mpc_realref(x->num))<span class='macro_popup'>mpfr_rint((((z->num)->re)), (((x->num)->re)), MPFR_RNDD<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line">mp_ceiling(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='macro'>mpfr_ceil(mpc_realref(z->num), mpc_realref(x->num))<span class='macro_popup'>mpfr_rint((((z->num)->re)), (((x->num)->re)), MPFR_RNDU<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line">mp_round(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='macro'>mpfr_round(mpc_realref(z->num), mpc_realref(x->num))<span class='macro_popup'>mpfr_rint((((z->num)->re)), (((x->num)->re)), MPFR_RNDNA<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"><span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line">mp_compare(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>mpfr_cmp(mpc_realref(x->num), mpc_realref(y->num))<span class='macro_popup'>mpfr_cmp3(((x->num)->re), ((y->num)->re), 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line">mp_divide(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(y))</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='comment'>/* Translators: Error displayed attempted to divide by zero */</span></td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"Division by zero is undefined"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Division by zero is undefined", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> mpc_div(z->num, x->num, y->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line">mp_divide_integer(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>long</span> y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> MPNumber t1 = mp_new();</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> mp_set_from_integer(y, &t1);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> mp_divide(x, &t1, z);</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> mp_clear(&t1);</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line">mp_is_integer(<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> <span class='keyword'>if</span> (mp_is_complex(x))</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>false<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>return</span> mpfr_integer_p(<span class='macro'>mpc_realref(x->num)<span class='macro_popup'>((x->num)->re)</span></span>) != 0;</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line">mp_is_positive_integer(<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> <span class='keyword'>if</span> (mp_is_complex(x))</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>false<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>mpfr_sgn(mpc_realref(x->num))<span class='macro_popup'>((((x->num)->re))->_mpfr_exp < (2 - ((mpfr_exp_t)<br> (((mpfr_uexp_t) -1) >> 1))) ? ((((mpfr_srcptr) (0 ? ((<br>(x->num)->re)) : (mpfr_srcptr) (((x->num)->re))))<br>->_mpfr_exp == (1 - ((mpfr_exp_t) (((mpfr_uexp_t) -1) >><br> 1)))) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : ((((x-><br>num)->re))->_mpfr_sign))</span></span> >= 0 && mp_is_integer(x);</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line">mp_is_natural(<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> <span class='keyword'>if</span> (mp_is_complex(x))</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>false<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>mpfr_sgn(mpc_realref(x->num))<span class='macro_popup'>((((x->num)->re))->_mpfr_exp < (2 - ((mpfr_exp_t)<br> (((mpfr_uexp_t) -1) >> 1))) ? ((((mpfr_srcptr) (0 ? ((<br>(x->num)->re)) : (mpfr_srcptr) (((x->num)->re))))<br>->_mpfr_exp == (1 - ((mpfr_exp_t) (((mpfr_uexp_t) -1) >><br> 1)))) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : ((((x-><br>num)->re))->_mpfr_sign))</span></span> > 0 && mp_is_integer(x);</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line">mp_is_complex(<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>return</span> !<span class='macro'>mpfr_zero_p(mpc_imagref(x->num))<span class='macro_popup'>(((mpfr_srcptr) (0 ? (((x->num)->im)) : (mpfr_srcptr) (<br>((x->num)->im))))->_mpfr_exp == (0 - ((mpfr_exp_t) (<br>((mpfr_uexp_t) -1) >> 1))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"><span id="start46"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr></span> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">mp_is_equal(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span id="start45"><span id="end46"><span class='keyword'>int</span></span></span> res = mpc_cmp(x->num, y->num);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> <span class="mrange"><span id="start39"><span id="end40"><span id="end41"><span id="start44"><span id="end45"><span class='keyword'>return</span></span></span></span></span></span> <span id="start38"><span id="end38"><span id="end39"><span id="start40"><span id="start41"><span class="mrange"><span id="start42"><span id="end42"><span id="start43"><span id="end43"><span id="end44"><span class='macro'>MPC_INEX_RE</span></span></span></span></span></span></span></span></span></span></span>(res)<span class='macro_popup'>((((res) & 3) == 2) ? -1 : (((res) & 3) == 0) ? 0 : 1<br>)</span></span> == 0 && <span class='macro'>MPC_INEX_IM(res)<span class='macro_popup'>((((res) >> 2) == 2) ? -1 : (((res) >> 2) == 0) ?<br> 0 : 1)</span></span> == 0</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path9" class="msg msgEvent" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">9</div></td><td><div class="PathNav"><a href="#Path8" title="Previous event (8)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path10" title="Next event (10)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path10" class="msg msgControl" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">10</div></td><td><div class="PathNav"><a href="#Path9" title="Previous event (9)">←</a></div></td><td>'?' condition is true</td><td><div class="PathNav"><a href="#Path11" title="Next event (11)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path11" class="msg msgEvent" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">11</div></td><td><div class="PathNav"><a href="#Path10" title="Previous event (10)">←</a></div></td><td>Returning zero, which participates in a condition later</td><td><div class="PathNav"><a href="#Path12" title="Next event (12)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line">mp_epowy(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> mpc_exp(z->num, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"><span id="start60"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr></span> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line">mp_is_zero (<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> <span id="start59"><span id="end60"><span class='keyword'>int</span></span></span> res = mpc_cmp_si_si(x->num, 0, 0);</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class="mrange"><span id="start53"><span id="end54"><span id="end55"><span id="start58"><span id="end59"><span class='keyword'>return</span></span></span></span></span></span> <span id="start52"><span id="end52"><span id="end53"><span id="start54"><span id="start55"><span class="mrange"><span id="start56"><span id="end56"><span id="start57"><span id="end57"><span id="end58"><span class='macro'>MPC_INEX_RE</span></span></span></span></span></span></span></span></span></span></span>(res)<span class='macro_popup'>((((res) & 3) == 2) ? -1 : (((res) & 3) == 0) ? 0 : 1<br>)</span></span> == 0 && <span class='macro'>MPC_INEX_IM(res)<span class='macro_popup'>((((res) >> 2) == 2) ? -1 : (((res) >> 2) == 0) ?<br> 0 : 1)</span></span> == 0</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgEvent" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgControl" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">←</a></div></td><td>'?' condition is true</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgEvent" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">←</a></div></td><td>Returning zero, which participates in a condition later</td><td><div class="PathNav"><a href="#Path6" title="Next event (6)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"><span id="start9"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr></span> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line">mp_is_negative(<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class="mrange"><span id="end2"><span id="start4"><span id="end5"><span id="start8"><span id="end9"><span class='keyword'>return</span></span></span></span></span></span> <span id="start2"><span class="mrange"><span id="start3"><span id="end3"><span id="end4"><span id="start5"><span id="start6"><span id="end6"><span class="mrange"><span id="start7"><span id="end7"><span id="end8"><span class='macro'>mpfr_sgn</span></span></span></span></span></span></span></span></span></span></span>(mpc_realref(x->num))<span class='macro_popup'>((((x->num)->re))->_mpfr_exp < (2 - ((mpfr_exp_t)<br> (((mpfr_uexp_t) -1) >> 1))) ? ((((mpfr_srcptr) (0 ? ((<br>(x->num)->re)) : (mpfr_srcptr) (((x->num)->re))))<br>->_mpfr_exp == (1 - ((mpfr_exp_t) (((mpfr_uexp_t) -1) >><br> 1)))) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : ((((x-><br>num)->re))->_mpfr_sign))</span></span> < 0</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path26" class="msg msgEvent" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">26</div></td><td><div class="PathNav"><a href="#Path25" title="Previous event (25)">←</a></div></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path27" title="Next event (27)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path27" class="msg msgControl" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">27</div></td><td><div class="PathNav"><a href="#Path26" title="Previous event (26)">←</a></div></td><td>'?' condition is false</td><td><div class="PathNav"><a href="#Path28" title="Next event (28)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path28" class="msg msgEvent" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">28</div></td><td><div class="PathNav"><a href="#Path27" title="Previous event (27)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path29" title="Next event (29)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path29" class="msg msgEvent" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">29</div></td><td><div class="PathNav"><a href="#Path28" title="Previous event (28)">←</a></div></td><td>Returning the value 1, which participates in a condition later</td><td><div class="PathNav"><a href="#Path30" title="Next event (30)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line">mp_is_greater_equal(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y)</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>return</span> mp_compare(x, y) >= 0;</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line">mp_is_greater_than(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>return</span> mp_compare(x, y) > 0;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"><span id="start34"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr></span> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line">mp_is_less_equal(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y)</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class="mrange"><span id="end34"><span class='keyword'>return</span></span> <span class="mrange">mp_compare(x, y) <= 0</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path15" class="msg msgEvent" style="margin-left:12ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">15</div></td><td><div class="PathNav"><a href="#Path14" title="Previous event (14)">←</a></div></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path16" title="Next event (16)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path16" class="msg msgEvent" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">16</div></td><td><div class="PathNav"><a href="#Path15" title="Previous event (15)">←</a></div></td><td>Returning zero, which participates in a condition later</td><td><div class="PathNav"><a href="#Path17" title="Next event (17)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"><span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line">mp_is_less_than(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y)</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='keyword'>return</span> mp_compare(x, y) < 0;</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line">mp_ln(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>/* ln(0) undefined */</span></td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(x))</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>/* Translators: Error displayed when attempting to take logarithm of zero */</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"Logarithm of zero is undefined"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Logarithm of zero is undefined", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> <span class='comment'>/* ln(-x) complex */</span></td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> <span class='comment'>/* FIXME: Make complex numbers optional */</span></td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> <span class='comment'>/*if (mp_is_negative(x)) {</span></td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='comment'>// Translators: Error displayed attempted to take logarithm of negative value</span></td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='comment'>mperr(_("Logarithm of negative values is undefined"));</span></td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='comment'>mp_set_from_integer(0, z);</span></td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='comment'>return;</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='comment'>}*/</span></td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> mpc_log(z->num, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='comment'>// MPC returns -π for the imaginary part of the log of</span></td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='comment'>// negative real numbers if their imaginary part is -0, we want +π</span></td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>if</span> (!mp_is_complex (x) && mp_is_negative (x))</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='macro'>mpfr_abs(mpc_imagref(z->num), mpc_imagref(z->num), MPFR_RNDN)<span class='macro_popup'>mpfr_set4(((z->num)->im),((z->num)->im),MPFR_RNDN<br>,1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line">mp_logarithm(<span class='keyword'>long</span> n, <span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='comment'>/* log(0) undefined */</span></td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(x))</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='comment'>/* Translators: Error displayed when attempting to take logarithm of zero */</span></td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"Logarithm of zero is undefined"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Logarithm of zero is undefined", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='comment'>/* logn(x) = ln(x) / ln(n) */</span></td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> MPNumber t1 = mp_new();</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> mp_set_from_integer(n, &t1);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> mp_ln(&t1, &t1);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> mp_ln(x, z);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> mp_divide(z, &t1, z);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> mp_clear(&t1);</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line">mp_multiply(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> mpc_mul(z->num, x->num, y->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line">mp_multiply_integer(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>long</span> y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> mpc_mul_si(z->num, x->num, y, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line">mp_invert_sign(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> mpc_neg(z->num, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">mp_reciprocal(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> mpc_t temp;</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> mpc_init2(temp, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> mpc_set_ui(temp, 1, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> mpc_fr_div(z->num, <span class='macro'>mpc_realref(temp)<span class='macro_popup'>((temp)->re)</span></span>, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> mpc_clear(temp);</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line">mp_root(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>long</span> n, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> ulong p;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> <span class='keyword'>if</span> (n < 0)</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> mpc_ui_div(z->num, 1, x->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> <span class='keyword'>if</span> (n == <span class='macro'>LONG_MIN<span class='macro_popup'>(-9223372036854775807L -1L)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> p = (ulong) <span class='macro'>LONG_MAX<span class='macro_popup'>9223372036854775807L</span></span> + 1;</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> p = (ulong) -n;</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (n > 0)</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> mp_set_from_mp(x, z);</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> p = n;</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when attempting to take zeroth root */</span></td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"The zeroth root of a number is undefined"</span>)<span class='macro_popup'>dcgettext (((void*)0), "The zeroth root of a number is undefined"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class='keyword'>if</span> (!mp_is_complex(x) && (!mp_is_negative(x) || (p & 1) == 1))</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> mpfr_rootn_ui(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, <span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, p, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> mpfr_t tmp;</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> mpfr_init2(tmp, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='macro'>mpfr_set_ui(tmp, p, MPFR_RNDN)<span class='macro_popup'>(__builtin_constant_p (p) && (mpfr_ulong) (p) == 0 ? __extension__<br> ({ mpfr_ptr _p = (tmp); _p->_mpfr_sign = 1; _p->_mpfr_exp<br> = (0 - ((mpfr_exp_t) (((mpfr_uexp_t) -1) >> 1))); (mpfr_void<br>) (MPFR_RNDN); 0; }) : mpfr_set_ui_2exp ((tmp), (p), 0, (MPFR_RNDN<br>)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> mpfr_ui_div(tmp, 1, tmp, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> mpc_pow_fr(z->num, z->num, tmp, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> mpfr_clear(tmp);</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line">mp_sqrt(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> mp_root(x, 2, z);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line">mp_factorial(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='comment'>/* 0! == 1 */</span></td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(x))</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> mpc_set_si(z->num, 1, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>if</span> (!mp_is_natural(x))</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='comment'>/* Factorial Not defined for Complex or for negative numbers */</span></td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='keyword'>if</span> (mp_is_negative(x) || mp_is_complex(x))</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when attempted take the factorial of a negative or complex number */</span></td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"Factorial is only defined for non-negative real numbers"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Factorial is only defined for non-negative real numbers"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> mpfr_t tmp2;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> mpfr_init2(tmp2, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> mp_set_from_integer(1, &tmp);</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> mp_add(&tmp, x, &tmp);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='comment'>/* Factorial(x) = Gamma(x+1) - This is the formula used to calculate Factorial of positive real numbers.*/</span></td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> mpfr_gamma(tmp2, <span class='macro'>mpc_realref(tmp.num)<span class='macro_popup'>((tmp.num)->re)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> mpc_set_fr(z->num, tmp2, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> mpfr_clear(tmp2);</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='comment'>/* Convert to integer - if couldn't be converted then the factorial would be too big anyway */</span></td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> ulong value = mp_to_unsigned_integer(x);</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> mpfr_fac_ui(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, value, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line">mp_modulus_divide(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>if</span> (!mp_is_integer(x) || !mp_is_integer(y))</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when attemping to do a modulus division on non-integer numbers */</span></td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"Modulus division is only defined for integers"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Modulus division is only defined for integers"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> MPNumber t1 = mp_new();</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> MPNumber t2 = mp_new();</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> mp_divide(x, y, &t1);</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> mp_floor(&t1, &t1);</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> mp_multiply(&t1, y, &t2);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> mp_subtract(x, &t2, z);</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> mp_set_from_integer(0, &t1);</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='keyword'>if</span> ((mp_compare(y, &t1) < 0 && mp_compare(z, &t1) > 0) ||</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> (mp_compare(y, &t1) > 0 && mp_compare(z, &t1) < 0))</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> mp_add(z, y, z);</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> mp_clear(&t1);</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> mp_clear(&t2);</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">mp_modular_exponentiation(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, <span class='keyword'>const</span> MPNumber *p, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> MPNumber base_value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> MPNumber exp_value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> MPNumber ans = mp_new();</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> MPNumber two = mp_new();</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> mp_set_from_integer(1, &ans);</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> mp_set_from_integer(2, &two);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> mp_abs(y, &exp_value);</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> <span class='keyword'>if</span> (mp_is_negative(y))</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> mp_reciprocal(x, &base_value);</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> mp_set_from_mp(x, &base_value);</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>while</span> (!mp_is_zero(&exp_value))</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> mp_modulus_divide(&exp_value, &two, &tmp);</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='macro'>bool<span class='macro_popup'>_Bool</span></span> is_even = mp_is_zero(&tmp);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> <span class='keyword'>if</span> (!is_even)</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> mp_multiply(&ans, &base_value, &ans);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> mp_modulus_divide(&ans, p, &ans);</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> mp_multiply(&base_value, &base_value, &base_value);</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> mp_modulus_divide(&base_value, p, &base_value);</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> mp_divide_integer(&exp_value, 2, &exp_value);</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> mp_floor(&exp_value, &exp_value);</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> mp_modulus_divide(&ans, p, z);</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> mp_clear(&base_value);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> mp_clear(&exp_value);</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> mp_clear(&ans);</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> mp_clear(&two);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line">mp_xpowy(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> MPNumber *y, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> <span class='comment'>/* 0^-n invalid */</span></td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(x) && mp_is_negative(y))</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when attempted to raise 0 to a negative exponent */</span></td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"The power of zero is undefined for a negative exponent"</span>)<span class='macro_popup'>dcgettext (((void*)0), "The power of zero is undefined for a negative exponent"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='keyword'>if</span> (!mp_is_complex(x) && !mp_is_complex(y) && !mp_is_integer(y))</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> MPNumber reciprocal = mp_new();</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> mp_reciprocal(y, &reciprocal);</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> <span class='keyword'>if</span> (mp_is_integer(&reciprocal))</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> mp_root(x, mp_to_integer(&reciprocal), z);</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mp_clear(&reciprocal);</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mp_clear(&reciprocal);</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mpc_pow(z->num, x->num, y->num, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line">mp_xpowy_integer(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>long</span> n, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> <span class='comment'>/* 0^-n invalid */</span></td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='keyword'>if</span> (mp_is_zero(x) && n < 0)</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when attempted to raise 0 to a negative re_exponent */</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"The power of zero is undefined for a negative exponent"</span>)<span class='macro_popup'>dcgettext (((void*)0), "The power of zero is undefined for a negative exponent"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> mpc_pow_si(z->num, x->num, n, <span class='macro'>MPC_RNDNN<span class='macro_popup'>(((int)(MPFR_RNDN)) + ((int)(MPFR_RNDN) << 4))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line">mp_erf(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> <span class='keyword'>if</span> (mp_is_complex(x))</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when error function (erf) value is undefined */</span></td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"The error function is only defined for real numbers"</span>)<span class='macro_popup'>dcgettext (((void*)0), "The error function is only defined for real numbers"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> mpfr_erf(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, <span class='macro'>mpc_realref(x->num)<span class='macro_popup'>((x->num)->re)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line">mp_zeta(<span class='keyword'>const</span> MPNumber *x, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> MPNumber one = mp_new();</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> mp_set_from_integer(1, &one);</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='keyword'>if</span> (mp_is_complex(x) || mp_compare(x, &one) == 0)</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> { <span class='comment'>/* Translators: Error displayed when zeta function value is undefined */</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> mperr(<span class='macro'>_(<span class='string_literal'>"The Riemann zeta function is only defined for real numbers ≠1"</span>)<span class='macro_popup'>dcgettext (((void*)0), "The Riemann zeta function is only defined for real numbers ≠1"<br>, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> mp_set_from_integer(0, z);</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> mp_clear(&one);</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> mpfr_set_zero(<span class='macro'>mpc_imagref(z->num)<span class='macro_popup'>((z->num)->im)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> mpfr_zeta(<span class='macro'>mpc_realref(z->num)<span class='macro_popup'>((z->num)->re)</span></span>, <span class='macro'>mpc_realref(x->num)<span class='macro_popup'>((x->num)->re)</span></span>, MPFR_RNDN);</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> mp_clear(&one);</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"><span class='comment'>/***********************************************************************/</span></td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"><span class='comment'>/** FACTORIZATION **/</span></td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"><span class='comment'>/***********************************************************************/</span></td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> <span class='comment'>* mp_is_pprime uses the Miller-Rabin primality test to decide</span></td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> <span class='comment'>* whether or not a number is probable prime.</span></td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> <span class='comment'>* For special values of @n and @rounds it can be deterministic,</span></td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> <span class='comment'>* but in general the probability of declaring @n as prime if it</span></td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='comment'>* is not is at most 4^(-@rounds).</span></td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> <span class='comment'>* @n has to be odd.</span></td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='comment'>* Returns TRUE if @n is probable prime and FALSE otherwise.</span></td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"><span class='keyword'>static</span> <span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line">mp_is_pprime(MPNumber *n, ulong rounds)</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> MPNumber two = mp_new_from_unsigned_integer(2);</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> ulong l = 0;</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> <span class='macro'>bool<span class='macro_popup'>_Bool</span></span> is_pprime = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> <span class='comment'>/* Write t := n-1 = 2^l * q with q odd */</span></td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> MPNumber q = mp_new();</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> MPNumber t = mp_new();</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> mp_add_integer(n, -1, &t);</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> mp_set_from_mp(&t, &q);</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> <span class='keyword'>do</span></td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> mp_divide_integer(&q, 2, &q);</td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> mp_modulus_divide(&q, &two, &tmp);</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> l++;</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> } <span class='keyword'>while</span> (mp_is_zero(&tmp));</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> <span class='comment'>/* @rounds Miller-Rabin tests to bases a = 2,3,...,@rounds+1 */</span></td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> MPNumber one = mp_new_from_unsigned_integer(1);</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> MPNumber a = mp_new_from_unsigned_integer(1);</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> MPNumber b = mp_new();</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> <span class='keyword'>for</span> (ulong i = 1; (i < mp_to_integer(&t)) && (i <= rounds+1); i++)</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> mp_add_integer(&a, 1, &a);</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> mp_modular_exponentiation(&a, &q, n, &b);</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> <span class='keyword'>if</span> (mp_compare(&one, &b) == 0 || mp_compare(&t, &b) == 0)</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> <span class='macro'>bool<span class='macro_popup'>_Bool</span></span> is_witness = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> <span class='keyword'>for</span> (<span class='keyword'>long</span> j = 1; j < l; j++)</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> mp_modular_exponentiation(&b, &two, n, &b);</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> <span class='keyword'>if</span> (mp_compare(&b, &t) == 0)</td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> is_witness = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='keyword'>if</span> (!is_witness)</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> is_pprime = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> mp_clear(&t);</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> mp_clear(&q);</td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> mp_clear(&a);</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> mp_clear(&b);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> mp_clear(&one);</td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> mp_clear(&two);</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> <span class='keyword'>return</span> is_pprime;</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> <span class='comment'>* Sets z = gcd(a,b) where gcd(a,b) is the greatest common divisor of @a and @b.</span></td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line">mp_gcd (<span class='keyword'>const</span> MPNumber *a, <span class='keyword'>const</span> MPNumber *b, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> MPNumber null = mp_new_from_unsigned_integer(0);</td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> MPNumber t1 = mp_new();</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> MPNumber t2 = mp_new();</td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> mp_set_from_mp(a, z);</td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> mp_set_from_mp(b, &t2);</td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> <span class='keyword'>while</span> (mp_compare(&t2, &null) != 0)</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> mp_set_from_mp(&t2, &t1);</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> mp_modulus_divide(z, &t2, &t2);</td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> mp_set_from_mp(&t1, z);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> mp_clear(&null);</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> mp_clear(&t1);</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> mp_clear(&t2);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> <span class='comment'>* mp_pollard_rho searches a divisor of @n using Pollard's rho algorithm.</span></td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> <span class='comment'>* @i is the start value of the pseudorandom sequence which is generated</span></td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> <span class='comment'>* by the polynomial x^2+1 mod n.</span></td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> <span class='comment'>* Returns TRUE if a divisor was found and stores the divisor in z.</span></td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> <span class='comment'>* Returns FALSE otherwise.</span></td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"><span class='keyword'>static</span> <span class='macro'>bool<span class='macro_popup'>_Bool</span></span></td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line">mp_pollard_rho (<span class='keyword'>const</span> MPNumber *n, ulong i, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> MPNumber one = mp_new_from_unsigned_integer(1);</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> MPNumber two = mp_new_from_unsigned_integer(2);</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> MPNumber x = mp_new_from_unsigned_integer(i);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> MPNumber y = mp_new_from_unsigned_integer(2);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> MPNumber d = mp_new_from_unsigned_integer(1);</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> <span class='keyword'>while</span> (mp_compare(&d, &one) == 0)</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> mp_modular_exponentiation(&x, &two, n, &x);</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> mp_add(&x, &one, &x);</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> mp_modular_exponentiation(&y, &two, n, &y);</td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> mp_add(&y, &one, &y);</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> mp_modular_exponentiation(&y, &two, n, &y);</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> mp_add(&y, &one, &y);</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> mp_subtract(&x, &y,z);</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> mp_abs(z, z);</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> mp_gcd(z, n, &d);</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> <span class='keyword'>if</span> (mp_compare(&d, n) == 0)</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> mp_clear(&one);</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> mp_clear(&two);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> mp_clear(&y);</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> mp_clear(&d);</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> mp_set_from_mp(&d, z);</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> mp_clear(&one);</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line"> mp_clear(&two);</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> mp_clear(&y);</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line"> mp_clear(&d);</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> <span class='comment'>* find_big_prime_factor acts as driver function for mp_pollard_rho which</span></td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> <span class='comment'>* is run as long as a prime factor is found.</span></td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> <span class='comment'>* On success sets @z to a prime factor of @n.</span></td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line">find_big_prime_factor (<span class='keyword'>const</span> MPNumber *n, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> ulong i = 2;</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> <span class='keyword'>while</span> (<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> <span class='keyword'>while</span> (mp_pollard_rho (n, i, &tmp) == <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> i++;</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> <span class='keyword'>if</span> (!mp_is_pprime(&tmp, 50))</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> mp_divide(n, &tmp, &tmp);</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> mp_set_from_mp(&tmp, z);</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> <span class='comment'>* mp_factorize tries to factorize the value of @x.</span></td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> <span class='comment'>* If @x < 2^64 it calls mp_factorize_unit64 which deals in integers</span></td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> <span class='comment'>* and should be fast enough for most values.</span></td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"> <span class='comment'>* If @x > 2^64 the approach to find factors of @x is as follows:</span></td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> <span class='comment'>* - Try to divide @x by prime numbers 2,3,5,7,.. up to min(2^13, sqrt(x))</span></td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"> <span class='comment'>* - Use Pollard rho to find prime factors > 2^13.</span></td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> <span class='comment'>* Returns a pointer to a GList with all prime factors of @x which needs to</span></td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> <span class='comment'>* be freed.</span></td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line">GList*</td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line">mp_factorize(<span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> <span id="start62"><span class="mrange">GList</span> *list</span> = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgEvent" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">1</div></td><td>'list' initialized to a null pointer value</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line"> MPNumber *factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> MPNumber value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> mp_abs(x, &value);</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> <span id="start61"><span id="end62"><span class='keyword'>if</span></span></span> (<span id="start51"><span class="mrange"><span class="mrange"><span id="end61">mp_is_zero</span></span>(&value)</span></span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">←</a></div></td><td>Calling 'mp_is_zero'</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path6" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">←</a></div></td><td>Returning from 'mp_is_zero'</td><td><div class="PathNav"><a href="#Path7" title="Next event (7)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path7" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">7</div></td><td><div class="PathNav"><a href="#Path6" title="Previous event (6)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path8" title="Next event (8)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> mp_set_from_mp(&value, factor);</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> mp_clear(&value);</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='keyword'>return</span> list;</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> <span id="start48"><span id="end49"><span id="start50"><span id="end51">MPNumber</span></span></span></span> tmp = <span id="start49"><span id="end50">mp_new</span></span>();</td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> mp_set_from_integer(1, &tmp);</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> <span id="start47"><span id="end48"><span class='keyword'>if</span></span></span> (<span id="start37"><span class="mrange"><span class="mrange"><span id="end47">mp_is_equal</span></span>(&value, &tmp)</span></span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path8" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">8</div></td><td><div class="PathNav"><a href="#Path7" title="Previous event (7)">←</a></div></td><td>Calling 'mp_is_equal'</td><td><div class="PathNav"><a href="#Path9" title="Next event (9)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path12" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">12</div></td><td><div class="PathNav"><a href="#Path11" title="Previous event (11)">←</a></div></td><td>Returning from 'mp_is_equal'</td><td><div class="PathNav"><a href="#Path13" title="Next event (13)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path13" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">13</div></td><td><div class="PathNav"><a href="#Path12" title="Previous event (12)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path14" title="Next event (14)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> mp_set_from_mp(x, factor);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> mp_clear(&value);</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> <span class='keyword'>return</span> list;</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> <span class='comment'>/* If value < 2^64-1, call for factorize_uint64 function which deals in integers */</span></td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"> <span id="start36"><span id="end37">uint64_t</span></span> num = 1;</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> num = num << 63;</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> num += (num - 1);</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> MPNumber int_max = mp_new();</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> mp_set_from_unsigned_integer(num, &int_max);</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> <span id="start35"><span id="end36"><span class='keyword'>if</span></span></span> (<span id="start33"><span class="mrange"><span class="mrange"><span id="end35">mp_is_less_equal</span></span>(x, &int_max)</span></span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path14" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">14</div></td><td><div class="PathNav"><a href="#Path13" title="Previous event (13)">←</a></div></td><td>Calling 'mp_is_less_equal'</td><td><div class="PathNav"><a href="#Path15" title="Next event (15)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path17" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">17</div></td><td><div class="PathNav"><a href="#Path16" title="Previous event (16)">←</a></div></td><td>Returning from 'mp_is_less_equal'</td><td><div class="PathNav"><a href="#Path18" title="Next event (18)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path18" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">18</div></td><td><div class="PathNav"><a href="#Path17" title="Previous event (17)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path19" title="Next event (19)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> list = mp_factorize_unit64(mp_to_unsigned_integer(&value));</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> <span class='keyword'>if</span> (mp_is_negative(x))</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> mp_invert_sign(list->data, list->data);</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line"> mp_clear(&value);</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> mp_clear(&int_max);</td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> <span class='keyword'>return</span> list;</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> <span id="start30"><span id="end31"><span id="start32"><span id="end33">MPNumber</span></span></span></span> divisor = mp_new_from_unsigned_integer(<span id="start31"><span id="end32">2</span></span>);</td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> <span class='keyword'>while</span> (<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path19" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">19</div></td><td><div class="PathNav"><a href="#Path18" title="Previous event (18)">←</a></div></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path20" title="Next event (20)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> <span id="start27"><span id="end28"><span id="start29"><span id="end30">mp_divide</span></span></span></span>(&<span id="start28"><span id="end29">value</span></span>, &divisor, &tmp);</td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> <span id="start26"><span id="end27"><span class='keyword'>if</span></span></span> (mp_is_integer(&tmp))</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path20" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">20</div></td><td><div class="PathNav"><a href="#Path19" title="Previous event (19)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path21" title="Next event (21)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> mp_set_from_mp(&tmp, &value);</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> mp_set_from_mp(&divisor, factor);</td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> <span id="start25"><span id="end26"><span class='keyword'>break</span></span></span>;</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> <span id="start23"><span id="end24"><span id="end25">mp_set_from_integer</span></span></span>(3, &<span id="start24">divisor</span>);</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> MPNumber root = mp_new();</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> mp_sqrt(&value, &root);</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> uint64_t max_trial_division = (uint64_t) (1 << 10);</td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"> uint64_t iter = 0;</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> <span class='keyword'>while</span> (mp_is_less_equal(&divisor, &root) && (iter++ < max_trial_division))</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> mp_divide(&value, &divisor, &tmp);</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> <span class='keyword'>if</span> (mp_is_integer(&tmp))</td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> mp_set_from_mp(&tmp, &value);</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> mp_sqrt(&value, &root);</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> mp_set_from_mp(&divisor, factor);</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> mp_add_integer(&divisor, 2, &divisor);</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span id="start22"><span id="end23"><span class='keyword'>while</span></span></span> (!mp_is_pprime(&value, 50))</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path21" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">21</div></td><td><div class="PathNav"><a href="#Path20" title="Previous event (20)">←</a></div></td><td>Loop condition is false. Execution continues on line 943</td><td><div class="PathNav"><a href="#Path22" title="Next event (22)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> find_big_prime_factor (&value, &divisor);</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> mp_divide(&value, &divisor, &tmp);</td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> <span class='keyword'>if</span> (mp_is_integer(&tmp))</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"> mp_set_from_mp(&tmp, &value);</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> mp_set_from_mp(&divisor, factor);</td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> <span id="start19"><span id="end20"><span id="start21"><span id="end22">mp_set_from_integer</span></span></span></span>(1, &<span id="start20"><span id="end21">tmp</span></span>);</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> <span id="start18"><span id="end19"><span class='keyword'>if</span></span></span> (mp_is_greater_than(&value, &tmp))</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path22" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">22</div></td><td><div class="PathNav"><a href="#Path21" title="Previous event (21)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path23" title="Next event (23)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> mp_set_from_mp(&value, factor);</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> <span id="start15"><span id="end16"><span id="start17"><span id="end18">mpc_clear</span></span></span></span>(<span id="start16"><span id="end17">factor</span></span>->num);</td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> <span id="start12"><span id="start13"><span id="end13"><span id="start14"><span id="end14"><span id="end15"><span class='macro'>g_slice_free</span></span></span></span></span></span>(MPNumber, factor)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MPNumber), (factor)); else<br> (void) ((MPNumber*) 0 == (factor)); } while (0)</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path23" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">23</div></td><td><div class="PathNav"><a href="#Path22" title="Previous event (22)">←</a></div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path24" title="Next event (24)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path24" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">24</div></td><td><div class="PathNav"><a href="#Path23" title="Previous event (23)">←</a></div></td><td>Loop condition is false. Exiting loop</td><td><div class="PathNav"><a href="#Path25" title="Next event (25)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> <span id="start11"><span id="end12"><span class='keyword'>if</span></span></span> (<span id="start1"><span class="mrange"><span class="mrange"><span id="end10">mp_is_negative</span></span>(<span id="start10"><span id="end11">x</span></span>)</span></span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path25" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">25</div></td><td><div class="PathNav"><a href="#Path24" title="Previous event (24)">←</a></div></td><td>Calling 'mp_is_negative'</td><td><div class="PathNav"><a href="#Path26" title="Next event (26)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path30" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">30</div></td><td><div class="PathNav"><a href="#Path29" title="Previous event (29)">←</a></div></td><td>Returning from 'mp_is_negative'</td><td><div class="PathNav"><a href="#Path31" title="Next event (31)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path31" class="msg msgControl" style="margin-left:5ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">31</div></td><td><div class="PathNav"><a href="#Path30" title="Previous event (30)">←</a></div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#EndPath" title="Next event (32)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"> <span id="start0"><span id="end1">mp_invert_sign</span></span>(<span class="mrange"><span id="end0">list</span></span>->data, list->data);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:24ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">32</div></td><td><div class="PathNav"><a href="#Path31" title="Previous event (31)">←</a></div></td><td>Access to field 'data' results in a dereference of a null pointer (loaded from variable 'list')</td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"> mp_clear(&value);</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> mp_clear(&divisor);</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> mp_clear(&root);</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> <span class='keyword'>return</span> list;</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line">GList*</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line">mp_factorize_unit64(uint64_t n)</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> GList *list = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> MPNumber *factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line"> mp_set_from_unsigned_integer(2, &tmp);</td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> <span class='keyword'>while</span> (n % 2 == 0)</td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> n /= 2;</td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> mp_set_from_mp(&tmp, factor);</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> <span class='keyword'>for</span> (uint64_t divisor = 3; divisor <= n / divisor; divisor +=2)</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> <span class='keyword'>while</span> (n % divisor == 0)</td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> n /= divisor;</td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line"> mp_set_from_unsigned_integer(divisor, factor);</td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"> factor = g_slice_alloc0(<span class='keyword'>sizeof</span>(MPNumber));</td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line"> mpc_init2(factor->num, <span class='macro'>PRECISION<span class='macro_popup'>1000</span></span>);</td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"> <span class='keyword'>if</span> (n > 1)</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line"> mp_set_from_unsigned_integer(n, factor);</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line"> list = g_list_append(list, factor);</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line"> mpc_clear(factor->num);</td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> <span class='macro'>g_slice_free(MPNumber, factor)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MPNumber), (factor)); else<br> (void) ((MPNumber*) 0 == (factor)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line"> <span class='keyword'>return</span> list;</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-458ccc.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-458ccc.html new file mode 100644 index 0000000..124af39 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-458ccc.html @@ -0,0 +1,2072 @@ +<!doctype html> +<html> +<head> +<title>math-buttons.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'valid' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/src/math-buttons.c --> + +<!-- FILENAME math-buttons.c --> + +<!-- FUNCTIONNAME base_changed_cb --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 458ccc7c2d0afd3db33adb6986f54cde --> + +<!-- BUGLINE 472 --> + +<!-- BUGCOLUMN 9 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>math-buttons.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 472, column 9</a><br />Value stored to 'valid' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name math-buttons.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c math-buttons.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"472": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2008-2011 Robert Ancell</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify it under</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* the terms of the GNU General Public License as published by the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Foundation, either version 2 of the License, or (at your option) any later</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* version. See http://www.gnu.org/copyleft/gpl.html the full text of the</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* license.</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"><span class='directive'>#include "math-buttons.h"</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"><span class='directive'>#include "math-converter.h"</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"><span class='directive'>#include "math-variable-popup.h"</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"><span class='directive'>#include "financial.h"</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"><span class='directive'>#include "mp-serializer.h"</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"><span class='directive'>#include "utility.h"</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> PROP_EQUATION,</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> PROP_MODE,</td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> PROP_PROGRAMMING_BASE</td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>static</span> GType button_mode_type;</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#define <span class='macro'>MAXBITS<span class='macro_popup'>64</span></span> 64 /* Bit panel: number of bit fields. */</span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='keyword'>struct</span> MathButtonsPrivate</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> MathEquation *equation;</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> ButtonMode mode;</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> gint programming_base;</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> MathConverter *converter;</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> GtkBuilder *basic_ui, *advanced_ui, *financial_ui, *programming_ui;</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> GtkWidget *bas_panel, *adv_panel, *fin_panel, *prog_panel;</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GtkWidget *active_panel;</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GtkWidget *shift_left_menu, *shift_right_menu;</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> GtkWidget *function_menu;</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> GtkWidget *const_menu;</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> GList *superscript_toggles;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> GList *subscript_toggles;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> GtkWidget *base_combo;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> GtkWidget *base_label;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> GtkWidget *bit_panel;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> GtkWidget *bit_labels[<span class='macro'>MAXBITS<span class='macro_popup'>64</span></span>];</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> GtkWidget *character_code_dialog;</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> GtkWidget *character_code_entry;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (MathButtons, math_buttons, GTK_TYPE_BOX)<span class='macro_popup'>static void math_buttons_init (MathButtons *self); static void<br> math_buttons_class_init (MathButtonsClass *klass); static GType<br> math_buttons_get_type_once (void); static gpointer math_buttons_parent_class<br> = ((void*)0); static gint MathButtons_private_offset; static<br> void math_buttons_class_intern_init (gpointer klass) { math_buttons_parent_class<br> = g_type_class_peek_parent (klass); if (MathButtons_private_offset<br> != 0) g_type_class_adjust_private_offset (klass, &MathButtons_private_offset<br>); math_buttons_class_init ((MathButtonsClass*) klass); } __attribute__<br> ((__unused__)) static inline gpointer math_buttons_get_instance_private<br> (MathButtons *self) { return (((gpointer) ((guint8*) (self) +<br> (glong) (MathButtons_private_offset)))); } GType math_buttons_get_type<br> (void) { static gsize static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0));<br> (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id<br>)); }))) { GType g_define_type_id = math_buttons_get_type_once<br> (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); 0 ?<br> (void) (*(&static_g_define_type_id) = (g_define_type_id)<br>) : (void) 0; g_once_init_leave ((&static_g_define_type_id<br>), (gsize) (g_define_type_id)); })); } return static_g_define_type_id<br>; } __attribute__ ((__noinline__)) static GType math_buttons_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> ((gtk_box_get_type ()), g_intern_static_string ("MathButtons"<br>), sizeof (MathButtonsClass), (GClassInitFunc)(void (*)(void)<br>) math_buttons_class_intern_init, sizeof (MathButtons), (GInstanceInitFunc<br>)(void (*)(void)) math_buttons_init, (GTypeFlags) 0); { {{ MathButtons_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (MathButtonsPrivate<br>)); };} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='directive'>#define <span class='macro'>UI_BASIC_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-basic.ui"</span></span> "/org/mate/calculator/ui/buttons-basic.ui"</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"><span class='directive'>#define <span class='macro'>UI_ADVANCED_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-advanced.ui"</span></span> "/org/mate/calculator/ui/buttons-advanced.ui"</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='directive'>#define <span class='macro'>UI_FINANCIAL_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-financial.ui"</span></span> "/org/mate/calculator/ui/buttons-financial.ui"</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"><span class='directive'>#define <span class='macro'>UI_PROGRAMMING_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-programming.ui"</span></span> "/org/mate/calculator/ui/buttons-programming.ui"</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='directive'>#define <span class='macro'>GET_WIDGET(ui, name)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((ui), (name)))), ((gtk_widget_get_type<br> ()))))))</span></span> \</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> <span class='directive'><span class='macro'>GTK_WIDGET(gtk_builder_get_object((ui), (name)))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((ui), (name)))), ((gtk_widget_get_type<br> ()))))))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> NUMBER,</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> NUMBER_BOLD,</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> MEMORY,</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> GROUP,</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> ACTION</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line">} ButtonClass;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *widget_name;</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *data;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> ButtonClass class;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *tooltip;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line">} ButtonData;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"><span class='keyword'>static</span> ButtonData button_data[] = {</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {<span class='string_literal'>"pi"</span>, <span class='string_literal'>"π"</span>, NUMBER,</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> <span class='comment'>/* Tooltip for the Pi button */</span></td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Pi [Ctrl+P]"</span>)<span class='macro_popup'>("Pi [Ctrl+P]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> {<span class='string_literal'>"eulers_number"</span>, <span class='string_literal'>"e"</span>, NUMBER,</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='comment'>/* Tooltip for the Euler's Number button */</span></td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Euler’s Number"</span>)<span class='macro_popup'>("Euler’s Number")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> {<span class='string_literal'>"imaginary"</span>, <span class='string_literal'>"i"</span>, NUMBER,</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> <span class='comment'>/* Tooltip for the imaginary number button */</span></td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Imaginary unit"</span>)<span class='macro_popup'>("Imaginary unit")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> {<span class='string_literal'>"numeric_point"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, NUMBER,</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> <span class='comment'>/* Tooltip for the numeric point button */</span></td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Decimal point"</span>)<span class='macro_popup'>("Decimal point")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> {<span class='string_literal'>"subscript"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, NUMBER_BOLD,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='comment'>/* Tooltip for the subscript button */</span></td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Subscript mode [Alt]"</span>)<span class='macro_popup'>("Subscript mode [Alt]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> {<span class='string_literal'>"superscript"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, NUMBER_BOLD,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='comment'>/* Tooltip for the superscript button */</span></td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Superscript mode [Ctrl]"</span>)<span class='macro_popup'>("Superscript mode [Ctrl]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> {<span class='string_literal'>"exponential"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, NUMBER_BOLD,</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> <span class='comment'>/* Tooltip for the scientific exponent button */</span></td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Scientific exponent [Ctrl+E]"</span>)<span class='macro_popup'>("Scientific exponent [Ctrl+E]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> {<span class='string_literal'>"add"</span>, <span class='string_literal'>"+"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> <span class='comment'>/* Tooltip for the add button */</span></td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Add [+]"</span>)<span class='macro_popup'>("Add [+]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> {<span class='string_literal'>"subtract"</span>, <span class='string_literal'>"−"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='comment'>/* Tooltip for the subtract button */</span></td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Subtract [-]"</span>)<span class='macro_popup'>("Subtract [-]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> {<span class='string_literal'>"multiply"</span>, <span class='string_literal'>"×"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='comment'>/* Tooltip for the multiply button */</span></td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Multiply [*]"</span>)<span class='macro_popup'>("Multiply [*]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> {<span class='string_literal'>"divide"</span>, <span class='string_literal'>"÷"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='comment'>/* Tooltip for the divide button */</span></td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Divide [/]"</span>)<span class='macro_popup'>("Divide [/]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> {<span class='string_literal'>"modulus_divide"</span>, <span class='string_literal'>" mod "</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='comment'>/* Tooltip for the modulus divide button */</span></td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Modulus divide"</span>)<span class='macro_popup'>("Modulus divide")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> {<span class='string_literal'>"function"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='comment'>/* Tooltip for the additional functions button */</span></td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Additional Functions"</span>)<span class='macro_popup'>("Additional Functions")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> {<span class='string_literal'>"const"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> <span class='comment'>/* Tooltip for the additional constant button */</span></td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Additional constants"</span>)<span class='macro_popup'>("Additional constants")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> {<span class='string_literal'>"x_pow_y"</span>, <span class='string_literal'>"^"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> <span class='comment'>/* Tooltip for the exponent button */</span></td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Exponent [^ or **]"</span>)<span class='macro_popup'>("Exponent [^ or **]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {<span class='string_literal'>"x_squared"</span>, <span class='string_literal'>"²"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='comment'>/* Tooltip for the square button */</span></td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Square [Ctrl+2]"</span>)<span class='macro_popup'>("Square [Ctrl+2]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> {<span class='string_literal'>"percentage"</span>, <span class='string_literal'>"%"</span>, NUMBER,</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='comment'>/* Tooltip for the percentage button */</span></td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Percentage [%]"</span>)<span class='macro_popup'>("Percentage [%]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> {<span class='string_literal'>"factorial"</span>, <span class='string_literal'>"!"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='comment'>/* Tooltip for the factorial button */</span></td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Factorial [!]"</span>)<span class='macro_popup'>("Factorial [!]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> {<span class='string_literal'>"abs"</span>, <span class='string_literal'>"|"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='comment'>/* Tooltip for the absolute value button */</span></td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Absolute value [|]"</span>)<span class='macro_popup'>("Absolute value [|]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> {<span class='string_literal'>"arg"</span>, <span class='string_literal'>"Arg "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='comment'>/* Tooltip for the complex argument component button */</span></td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Complex argument"</span>)<span class='macro_popup'>("Complex argument")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> {<span class='string_literal'>"conjugate"</span>, <span class='string_literal'>"conj "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='comment'>/* Tooltip for the complex conjugate button */</span></td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Complex conjugate"</span>)<span class='macro_popup'>("Complex conjugate")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> {<span class='string_literal'>"root"</span>, <span class='string_literal'>"√"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='comment'>/* Tooltip for the root button */</span></td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Root [Ctrl+R]"</span>)<span class='macro_popup'>("Root [Ctrl+R]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {<span class='string_literal'>"square_root"</span>, <span class='string_literal'>"√"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='comment'>/* Tooltip for the square root button */</span></td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Square root [Ctrl+R]"</span>)<span class='macro_popup'>("Square root [Ctrl+R]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> {<span class='string_literal'>"logarithm"</span>, <span class='string_literal'>"log "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='comment'>/* Tooltip for the logarithm button */</span></td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Logarithm"</span>)<span class='macro_popup'>("Logarithm")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> {<span class='string_literal'>"natural_logarithm"</span>, <span class='string_literal'>"ln "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='comment'>/* Tooltip for the natural logarithm button */</span></td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Natural Logarithm"</span>)<span class='macro_popup'>("Natural Logarithm")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> {<span class='string_literal'>"sine"</span>, <span class='string_literal'>"sin "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='comment'>/* Tooltip for the sine button */</span></td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Sine"</span>)<span class='macro_popup'>("Sine")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> {<span class='string_literal'>"cosine"</span>, <span class='string_literal'>"cos "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> <span class='comment'>/* Tooltip for the cosine button */</span></td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Cosine"</span>)<span class='macro_popup'>("Cosine")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> {<span class='string_literal'>"tangent"</span>, <span class='string_literal'>"tan "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> <span class='comment'>/* Tooltip for the tangent button */</span></td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Tangent"</span>)<span class='macro_popup'>("Tangent")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> {<span class='string_literal'>"hyperbolic_sine"</span>, <span class='string_literal'>"sinh "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> <span class='comment'>/* Tooltip for the hyperbolic sine button */</span></td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Hyperbolic Sine"</span>)<span class='macro_popup'>("Hyperbolic Sine")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> {<span class='string_literal'>"hyperbolic_cosine"</span>, <span class='string_literal'>"cosh "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>/* Tooltip for the hyperbolic cosine button */</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Hyperbolic Cosine"</span>)<span class='macro_popup'>("Hyperbolic Cosine")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> {<span class='string_literal'>"hyperbolic_tangent"</span>, <span class='string_literal'>"tanh "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>/* Tooltip for the hyperbolic tangent button */</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Hyperbolic Tangent"</span>)<span class='macro_popup'>("Hyperbolic Tangent")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> {<span class='string_literal'>"inverse_sine"</span>, <span class='string_literal'>"asin "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>/* Tooltip for the inverse sine button */</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Inverse Sine"</span>)<span class='macro_popup'>("Inverse Sine")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> {<span class='string_literal'>"inverse_cosine"</span>, <span class='string_literal'>"acos "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>/* Tooltip for the inverse cosine button */</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Inverse Cosine"</span>)<span class='macro_popup'>("Inverse Cosine")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> {<span class='string_literal'>"inverse_tangent"</span>, <span class='string_literal'>"atan "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>/* Tooltip for the inverse tangent button */</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Inverse Tangent"</span>)<span class='macro_popup'>("Inverse Tangent")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> {<span class='string_literal'>"inverse"</span>, <span class='string_literal'>"⁻¹"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>/* Tooltip for the inverse button */</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Inverse [Ctrl+I]"</span>)<span class='macro_popup'>("Inverse [Ctrl+I]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> {<span class='string_literal'>"and"</span>, <span class='string_literal'>"∧"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>/* Tooltip for the boolean AND button */</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Boolean AND"</span>)<span class='macro_popup'>("Boolean AND")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {<span class='string_literal'>"or"</span>, <span class='string_literal'>"∨"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>/* Tooltip for the boolean OR button */</span></td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Boolean OR"</span>)<span class='macro_popup'>("Boolean OR")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> {<span class='string_literal'>"xor"</span>, <span class='string_literal'>"⊻"</span>, OPERATOR,</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='comment'>/* Tooltip for the exclusive OR button */</span></td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Boolean Exclusive OR"</span>)<span class='macro_popup'>("Boolean Exclusive OR")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> {<span class='string_literal'>"not"</span>, <span class='string_literal'>"¬"</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='comment'>/* Tooltip for the boolean NOT button */</span></td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Boolean NOT"</span>)<span class='macro_popup'>("Boolean NOT")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> {<span class='string_literal'>"integer_portion"</span>, <span class='string_literal'>"int "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Tooltip for the integer component button */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Integer Component"</span>)<span class='macro_popup'>("Integer Component")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> {<span class='string_literal'>"fractional_portion"</span>, <span class='string_literal'>"frac "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='comment'>/* Tooltip for the fractional component button */</span></td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Fractional Component"</span>)<span class='macro_popup'>("Fractional Component")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> {<span class='string_literal'>"real_portion"</span>, <span class='string_literal'>"Re "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='comment'>/* Tooltip for the real component button */</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Real Component"</span>)<span class='macro_popup'>("Real Component")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> {<span class='string_literal'>"imaginary_portion"</span>, <span class='string_literal'>"Im "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='comment'>/* Tooltip for the imaginary component button */</span></td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Imaginary Component"</span>)<span class='macro_popup'>("Imaginary Component")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> {<span class='string_literal'>"ones_complement"</span>, <span class='string_literal'>"ones "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='comment'>/* Tooltip for the ones' complement button */</span></td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Ones' Complement"</span>)<span class='macro_popup'>("Ones' Complement")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> {<span class='string_literal'>"twos_complement"</span>, <span class='string_literal'>"twos "</span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='comment'>/* Tooltip for the two's complement button */</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Two's Complement"</span>)<span class='macro_popup'>("Two's Complement")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {<span class='string_literal'>"start_group"</span>, <span class='string_literal'>"("</span>, GROUP,</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='comment'>/* Tooltip for the start group button */</span></td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Start Group [(]"</span>)<span class='macro_popup'>("Start Group [(]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> {<span class='string_literal'>"end_group"</span>, <span class='string_literal'>")"</span>, GROUP,</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='comment'>/* Tooltip for the end group button */</span></td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"End Group [)]"</span>)<span class='macro_popup'>("End Group [)]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> {<span class='string_literal'>"memory"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, MEMORY,</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='comment'>/* Tooltip for the memory button */</span></td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Memory"</span>)<span class='macro_popup'>("Memory")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> {<span class='string_literal'>"character"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, MEMORY,</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> <span class='comment'>/* Tooltip for the insert character code button */</span></td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Insert Character Code"</span>)<span class='macro_popup'>("Insert Character Code")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {<span class='string_literal'>"result"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, ACTION,</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> <span class='comment'>/* Tooltip for the solve button */</span></td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Calculate Result"</span>)<span class='macro_popup'>("Calculate Result")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> {<span class='string_literal'>"factor"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, ACTION,</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='comment'>/* Tooltip for the factor button */</span></td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Factorize [Ctrl+F]"</span>)<span class='macro_popup'>("Factorize [Ctrl+F]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> {<span class='string_literal'>"clear"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, GROUP,</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='comment'>/* Tooltip for the clear button */</span></td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Clear Display [Escape]"</span>)<span class='macro_popup'>("Clear Display [Escape]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> {<span class='string_literal'>"undo"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, GROUP,</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='comment'>/* Tooltip for the undo button */</span></td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Undo [Ctrl+Z]"</span>)<span class='macro_popup'>("Undo [Ctrl+Z]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {<span class='string_literal'>"shift_left"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, ACTION,</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='comment'>/* Tooltip for the shift left button */</span></td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Shift Left [<<]"</span>)<span class='macro_popup'>("Shift Left [<<]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {<span class='string_literal'>"shift_right"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, ACTION,</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> <span class='comment'>/* Tooltip for the shift right button */</span></td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Shift Right [>>]"</span>)<span class='macro_popup'>("Shift Right [>>]")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> {<span class='string_literal'>"finc_compounding_term"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='comment'>/* Tooltip for the compounding term button */</span></td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Compounding Term"</span>)<span class='macro_popup'>("Compounding Term")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> {<span class='string_literal'>"finc_double_declining_depreciation"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='comment'>/* Tooltip for the double declining depreciation button */</span></td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Double Declining Depreciation"</span>)<span class='macro_popup'>("Double Declining Depreciation")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> {<span class='string_literal'>"finc_future_value"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='comment'>/* Tooltip for the future value button */</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Future Value"</span>)<span class='macro_popup'>("Future Value")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> {<span class='string_literal'>"finc_term"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> <span class='comment'>/* Tooltip for the financial term button */</span></td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Financial Term"</span>)<span class='macro_popup'>("Financial Term")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> {<span class='string_literal'>"finc_sum_of_the_years_digits_depreciation"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='comment'>/* Tooltip for the sum of the years digits depreciation button */</span></td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Sum of the Years Digits Depreciation"</span>)<span class='macro_popup'>("Sum of the Years Digits Depreciation")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> {<span class='string_literal'>"finc_straight_line_depreciation"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='comment'>/* Tooltip for the straight line depreciation button */</span></td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Straight Line Depreciation"</span>)<span class='macro_popup'>("Straight Line Depreciation")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {<span class='string_literal'>"finc_periodic_interest_rate"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='comment'>/* Tooltip for the periodic interest rate button */</span></td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Periodic Interest Rate"</span>)<span class='macro_popup'>("Periodic Interest Rate")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> {<span class='string_literal'>"finc_present_value"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> <span class='comment'>/* Tooltip for the present value button */</span></td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Present Value"</span>)<span class='macro_popup'>("Present Value")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> {<span class='string_literal'>"finc_periodic_payment"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='comment'>/* Tooltip for the periodic payment button */</span></td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Periodic Payment"</span>)<span class='macro_popup'>("Periodic Payment")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> {<span class='string_literal'>"finc_gross_profit_margin"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, FUNCTION,</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='comment'>/* Tooltip for the gross profit margin button */</span></td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Gross Profit Margin"</span>)<span class='macro_popup'>("Gross Profit Margin")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"><span class='comment'>/* The names of each field in the dialogs for the financial functions */</span></td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *finc_dialog_fields[][5] = {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> {<span class='string_literal'>"ctrm_pint"</span>, <span class='string_literal'>"ctrm_fv"</span>, <span class='string_literal'>"ctrm_pv"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> {<span class='string_literal'>"ddb_cost"</span>, <span class='string_literal'>"ddb_life"</span>, <span class='string_literal'>"ddb_period"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> {<span class='string_literal'>"fv_pmt"</span>, <span class='string_literal'>"fv_pint"</span>, <span class='string_literal'>"fv_n"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> {<span class='string_literal'>"gpm_cost"</span>, <span class='string_literal'>"gpm_margin"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> {<span class='string_literal'>"pmt_prin"</span>, <span class='string_literal'>"pmt_pint"</span>, <span class='string_literal'>"pmt_n"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {<span class='string_literal'>"pv_pmt"</span>, <span class='string_literal'>"pv_pint"</span>, <span class='string_literal'>"pv_n"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> {<span class='string_literal'>"rate_fv"</span>, <span class='string_literal'>"rate_pv"</span>, <span class='string_literal'>"rate_n"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> {<span class='string_literal'>"sln_cost"</span>, <span class='string_literal'>"sln_salvage"</span>, <span class='string_literal'>"sln_life"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> {<span class='string_literal'>"syd_cost"</span>, <span class='string_literal'>"syd_salvage"</span>, <span class='string_literal'>"syd_life"</span>, <span class='string_literal'>"syd_period"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> {<span class='string_literal'>"term_pmt"</span>, <span class='string_literal'>"term_fv"</span>, <span class='string_literal'>"term_pint"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line">MathButtons *</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line">math_buttons_new(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>return</span> g_object_new(math_buttons_get_type(), <span class='string_literal'>"equation"</span>, equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line">set_data(GtkBuilder *ui, <span class='keyword'>const</span> gchar *object_name, <span class='keyword'>const</span> gchar *name, <span class='keyword'>const</span> <span class='keyword'>char</span> *value)</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> GObject *object;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> object = gtk_builder_get_object(ui, object_name);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>if</span> (object)</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> g_object_set_data(object, name, <span class='macro'>GINT_TO_POINTER(value)<span class='macro_popup'>((gpointer) (glong) (value))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line">set_int_data(GtkBuilder *ui, <span class='keyword'>const</span> gchar *object_name, <span class='keyword'>const</span> gchar *name, gint value)</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> GObject *object;</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> object = gtk_builder_get_object(ui, object_name);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='keyword'>if</span> (object)</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> g_object_set_data(object, name, <span class='macro'>GINT_TO_POINTER(value)<span class='macro_popup'>((gpointer) (glong) (value))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line">load_finc_dialogs(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>int</span> i, j;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"ctrm_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_CTRM_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"ddb_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_DDB_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"fv_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_FV_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"gpm_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_GPM_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"pmt_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_PMT_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"pv_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_PV_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"rate_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_RATE_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"sln_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_SLN_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"syd_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_SYD_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> set_int_data(buttons->priv->financial_ui, <span class='string_literal'>"term_dialog"</span>, <span class='string_literal'>"finc_dialog"</span>, FINC_TERM_DIALOG);</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='keyword'>for</span> (i = 0; finc_dialog_fields[i][0] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>for</span> (j = 0; finc_dialog_fields[i][j]; j++) {</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> GObject *o;</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> o = gtk_builder_get_object (buttons->priv->financial_ui, finc_dialog_fields[i][j]);</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> g_object_set_data(o, <span class='string_literal'>"finc_field"</span>, <span class='macro'>GINT_TO_POINTER(j)<span class='macro_popup'>((gpointer) (glong) (j))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> g_object_set_data(o, <span class='string_literal'>"finc_dialog"</span>, <span class='macro'>GINT_TO_POINTER(i)<span class='macro_popup'>((gpointer) (glong) (i))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">update_bit_panel(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> MPNumber x;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> gboolean enabled;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> guint64 bits;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> GString *label;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> gint base;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>if</span> (!buttons->priv->bit_panel)</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> x = mp_new();</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> enabled = math_equation_get_number(buttons->priv->equation, &x);</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='keyword'>if</span> (enabled) {</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> MPNumber max = mp_new();</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> MPNumber fraction = mp_new();</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> mp_set_from_unsigned_integer(<span class='macro'>G_MAXUINT64<span class='macro_popup'>(0xffffffffffffffffUL)</span></span>, &max);</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> mp_fractional_part(&x, &fraction);</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='keyword'>if</span> (mp_is_negative(&x) || mp_is_greater_than(&x, &max) || !mp_is_zero(&fraction))</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> enabled = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> bits = mp_to_unsigned_integer(&x);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> mp_clear(&max);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> mp_clear(&fraction);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> gtk_widget_set_sensitive(buttons->priv->bit_panel, enabled);</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> gtk_widget_set_sensitive(buttons->priv->base_label, enabled);</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (!enabled)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < <span class='macro'>MAXBITS<span class='macro_popup'>64</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='keyword'>const</span> gchar *bin_label;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>if</span> (bits & (1LLU << (<span class='macro'>MAXBITS<span class='macro_popup'>64</span></span>-i-1)))</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> bin_label = <span class='string_literal'>" 1"</span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> bin_label = <span class='string_literal'>" 0"</span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> gtk_label_set_text(<span class='macro'>GTK_LABEL(buttons->priv->bit_labels[i])<span class='macro_popup'>((((GtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->bit_labels[i])), ((gtk_label_get_type<br> ()))))))</span></span>, bin_label);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> base = math_equation_get_base(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> label = g_string_new(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>if</span> (base != 8) {</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (label->len != 0)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> g_string_append(label, <span class='string_literal'>" = "</span>);</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> g_string_append_printf(label, <span class='string_literal'>"%"</span> <span class='macro'>G_GINT64_MODIFIER<span class='macro_popup'>"l"</span></span> <span class='string_literal'>"o"</span>, bits);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> g_string_append(label, <span class='string_literal'>"₈"</span>);</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (base != 10) {</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='keyword'>if</span> (label->len != 0)</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> g_string_append(label, <span class='string_literal'>" = "</span>);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> g_string_append_printf(label, <span class='string_literal'>"%"</span> <span class='macro'>G_GINT64_MODIFIER<span class='macro_popup'>"l"</span></span> <span class='string_literal'>"u"</span>, bits);</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> g_string_append(label, <span class='string_literal'>"₁₀"</span>);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> <span class='keyword'>if</span> (base != 16) {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> <span class='keyword'>if</span> (label->len != 0)</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> g_string_append(label, <span class='string_literal'>" = "</span>);</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> g_string_append_printf(label, <span class='string_literal'>"%"</span> <span class='macro'>G_GINT64_MODIFIER<span class='macro_popup'>"l"</span></span> <span class='string_literal'>"X"</span>, bits);</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> g_string_append(label, <span class='string_literal'>"₁₆"</span>);</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> gtk_label_set_text(<span class='macro'>GTK_LABEL(buttons->priv->base_label)<span class='macro_popup'>((((GtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->base_label)), ((gtk_label_get_type (<br>)))))))</span></span>, label->str);</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> g_string_free(label, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line">display_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> update_bit_panel(buttons);</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line">base_combobox_changed_cb(GtkWidget *combo, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> gint value;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> gtk_combo_box_get_active_iter(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> gtk_tree_model_get(model, &iter, 1, &value, -1);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> math_buttons_set_programming_base(buttons, value);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line">base_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> gboolean valid;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> <span class='keyword'>if</span> (buttons->priv->mode != PROGRAMMING)</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(buttons->priv->base_combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->base_combo)), ((gtk_combo_box_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> valid = gtk_tree_model_get_iter_first(model, &iter);</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> buttons->priv->programming_base = math_equation_get_base(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>while</span> (valid) {</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> gint v;</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> gtk_tree_model_get(model, &iter, 1, &v, -1);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (v == buttons->priv->programming_base)</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> valid = gtk_tree_model_iter_next(model, &iter);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>if</span> (!valid)</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> valid = <span class="mrange">gtk_tree_model_get_iter_first(model, &iter)</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex">Value stored to 'valid' is never read</div></td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> gtk_combo_box_set_active_iter(<span class='macro'>GTK_COMBO_BOX(buttons->priv->base_combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->base_combo)), ((gtk_combo_box_get_type<br> ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"><span class='keyword'>static</span> GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line">load_mode(MathButtons *buttons, ButtonMode mode)</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> GtkBuilder *builder, **builder_ptr;</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> gchar *name;</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>const</span> gchar *path;</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>static</span> gchar *objects[] = { <span class='string_literal'>"button_panel"</span>, <span class='string_literal'>"character_code_dialog"</span>, <span class='string_literal'>"currency_dialog"</span>,</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='string_literal'>"ctrm_dialog"</span>, <span class='string_literal'>"ddb_dialog"</span>, <span class='string_literal'>"fv_dialog"</span>, <span class='string_literal'>"gpm_dialog"</span>,</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='string_literal'>"pmt_dialog"</span>, <span class='string_literal'>"pv_dialog"</span>, <span class='string_literal'>"rate_dialog"</span>, <span class='string_literal'>"sln_dialog"</span>,</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> <span class='string_literal'>"syd_dialog"</span>, <span class='string_literal'>"term_dialog"</span>, <span class='string_literal'>"adjustment1"</span>, <span class='string_literal'>"adjustment2"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> };</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> GtkWidget *widget, **panel;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='keyword'>switch</span> (mode) {</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> <span class='keyword'>case</span> BASIC:</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> builder_ptr = &buttons->priv->basic_ui;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> path = <span class='macro'>UI_BASIC_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-basic.ui"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> panel = &buttons->priv->bas_panel;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>case</span> ADVANCED:</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> builder_ptr = &buttons->priv->advanced_ui;</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> path = <span class='macro'>UI_ADVANCED_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-advanced.ui"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> panel = &buttons->priv->adv_panel;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='keyword'>case</span> FINANCIAL:</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> builder_ptr = &buttons->priv->financial_ui;</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> path = <span class='macro'>UI_FINANCIAL_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-financial.ui"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> panel = &buttons->priv->fin_panel;</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='keyword'>case</span> PROGRAMMING:</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> builder_ptr = &buttons->priv->programming_ui;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> path = <span class='macro'>UI_PROGRAMMING_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/buttons-programming.ui"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> panel = &buttons->priv->prog_panel;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> <span class='keyword'>if</span> (*panel)</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> builder = *builder_ptr = gtk_builder_new();</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='comment'>// FIXME: Show dialog if failed to load</span></td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> gtk_builder_add_objects_from_resource(builder, path, objects, &error);</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> g_warning(<span class='string_literal'>"Error loading button UI: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> g_clear_error(&error);</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> *panel = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"button_panel"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("button_panel")))), (<br>(gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> gtk_box_pack_end(<span class='macro'>GTK_BOX(buttons)<span class='macro_popup'>((((GtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons)), ((gtk_box_get_type ()))))))</span></span>, *panel, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>/* Configure buttons */</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> <span class='keyword'>for</span> (i = 0; button_data[i].widget_name != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> GObject *object;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> GtkWidget *button;</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> name = g_strdup_printf(<span class='string_literal'>"calc_%s_button"</span>, button_data[i].widget_name);</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> object = gtk_builder_get_object(*builder_ptr, name);</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> g_free(name);</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> <span class='keyword'>if</span> (!object)</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> button = <span class='macro'>GTK_WIDGET(object)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>if</span> (button_data[i].data)</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> g_object_set_data(object, <span class='string_literal'>"calc_text"</span>, (gpointer) button_data[i].data);</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> <span class='keyword'>if</span> (button_data[i].tooltip)</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> gtk_widget_set_tooltip_text(button, <span class='macro'>_(button_data[i].tooltip)<span class='macro_popup'>dcgettext (((void*)0), button_data[i].tooltip, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* Set special button data */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < 16; i++) {</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> GtkWidget *button;</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> name = g_strdup_printf(<span class='string_literal'>"calc_%d_button"</span>, i);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> button = <span class='macro'>GET_WIDGET(builder, name)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), (name)))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>if</span> (button) {</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> gchar buffer[7];</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> g_object_set_data(<span class='macro'>G_OBJECT(button)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((button)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"calc_digit"</span>, <span class='macro'>GINT_TO_POINTER(i)<span class='macro_popup'>((gpointer) (glong) (i))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> len = g_unichar_to_utf8(math_equation_get_digit_text(buttons->priv->equation, i), buffer);</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> buffer[len] = '\0';</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> gtk_button_set_label(<span class='macro'>GTK_BUTTON(button)<span class='macro_popup'>((((GtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((button)), ((gtk_button_get_type ()))))))</span></span>, buffer);</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> g_free(name);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> widget = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"calc_numeric_point_button"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("calc_numeric_point_button"<br>)))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>if</span> (widget) {</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> MpSerializer *serializer = math_equation_get_serializer(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> gchar buffer[7];</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> len = g_unichar_to_utf8(mp_serializer_get_radix(serializer), buffer);</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> buffer[len] = '\0';</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> gtk_button_set_label(<span class='macro'>GTK_BUTTON(widget)<span class='macro_popup'>((((GtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_button_get_type ()))))))</span></span>, buffer);</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> widget = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"calc_superscript_button"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("calc_superscript_button"<br>)))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> <span class='keyword'>if</span> (widget) {</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> buttons->priv->superscript_toggles = g_list_append(buttons->priv->superscript_toggles, widget);</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> <span class='keyword'>if</span> (math_equation_get_number_mode(buttons->priv->equation) == SUPERSCRIPT)</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> gtk_toggle_button_set_active(<span class='macro'>GTK_TOGGLE_BUTTON(widget)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_toggle_button_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> widget = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"calc_subscript_button"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("calc_subscript_button"<br>)))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (widget) {</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> buttons->priv->subscript_toggles = g_list_append(buttons->priv->subscript_toggles, widget);</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>if</span> (math_equation_get_number_mode(buttons->priv->equation) == SUBSCRIPT)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> gtk_toggle_button_set_active(<span class='macro'>GTK_TOGGLE_BUTTON(widget)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_toggle_button_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> <span class='comment'>/* put the icon name "process-stop" in the buttons</span></td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='comment'>button1, button3, button5, button7, button9,</span></td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> <span class='comment'>button11, button13, button15, button17, button19</span></td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> <span class='comment'>taken from buttons-financial.ui */</span></td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>for</span> (i = 1; i < 20; i++) {</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> <span class='keyword'>if</span> (i % 2) {</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> widget = <span class='macro'>GET_WIDGET (builder, g_strdup_printf (<span class='string_literal'>"button%d"</span>,i))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), (g_strdup_printf ("button%d"<br>,i))))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GTK_IS_BUTTON(widget)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(widget)); GType __t = ((gtk_button_get_type ())); gboolean __r<br>; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> gtk_button_set_image (<span class='macro'>GTK_BUTTON (widget)<span class='macro_popup'>((((GtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_button_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> gtk_image_new_from_icon_name (<span class='string_literal'>"process-stop"</span>, GTK_ICON_SIZE_BUTTON));</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='keyword'>if</span> (mode == PROGRAMMING) {</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> GtkListStore *model;</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> GtkCellRenderer *renderer;</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> buttons->priv->base_label = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"base_label"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("base_label")))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> buttons->priv->character_code_dialog = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"character_code_dialog"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("character_code_dialog"<br>)))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> buttons->priv->character_code_entry = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"character_code_entry"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("character_code_entry"<br>)))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> buttons->priv->bit_panel = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"bit_table"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("bit_table")))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < <span class='macro'>MAXBITS<span class='macro_popup'>64</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> name = g_strdup_printf(<span class='string_literal'>"bit_label_%d"</span>, i);</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> buttons->priv->bit_labels[i] = <span class='macro'>GET_WIDGET(builder, name)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), (name)))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> g_free(name);</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> name = g_strdup_printf(<span class='string_literal'>"bit_eventbox_%d"</span>, i);</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> set_int_data(builder, name, <span class='string_literal'>"bit_index"</span>, i);</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> buttons->priv->base_combo = <span class='macro'>GET_WIDGET(builder, <span class='string_literal'>"base_combo"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((builder), ("base_combo")))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> model = gtk_list_store_new(2, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, <span class='macro'>G_TYPE_INT<span class='macro_popup'>((GType) ((6) << (2)))</span></span>, <span class='macro'>G_TYPE_INT<span class='macro_popup'>((GType) ((6) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> gtk_combo_box_set_model(<span class='macro'>GTK_COMBO_BOX(buttons->priv->base_combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->base_combo)), ((gtk_combo_box_get_type<br> ()))))))</span></span>, <span class='macro'>GTK_TREE_MODEL(model)<span class='macro_popup'>((((GtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_tree_model_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> <span class='comment'>/* Number display mode combo: Binary, e.g. 10011010010₂ */</span></td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Binary"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Binary", 5)</span></span>, 1, 2, -1);</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> <span class='comment'>/* Number display mode combo: Octal, e.g. 2322₈ */</span></td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Octal"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Octal", 5)</span></span>, 1, 8, -1);</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>/* Number display mode combo: Decimal, e.g. 1234 */</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Decimal"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Decimal", 5)</span></span>, 1, 10, -1);</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='comment'>/* Number display mode combo: Hexadecimal, e.g. 4D2₁₆ */</span></td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Hexadecimal"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Hexadecimal", 5)</span></span>, 1, 16, -1);</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> renderer = gtk_cell_renderer_text_new();</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> gtk_cell_layout_pack_start(<span class='macro'>GTK_CELL_LAYOUT(buttons->priv->base_combo)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->base_combo)), ((gtk_cell_layout_get_type<br> ()))))))</span></span>, renderer, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> gtk_cell_layout_add_attribute(<span class='macro'>GTK_CELL_LAYOUT(buttons->priv->base_combo)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->base_combo)), ((gtk_cell_layout_get_type<br> ()))))))</span></span>, renderer, <span class='string_literal'>"text"</span>, 0);</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='macro'>g_signal_connect(buttons->priv->base_combo, <span class='string_literal'>"changed"</span>, G_CALLBACK(base_combobox_changed_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((buttons->priv->base_combo), ("changed"<br>), (((GCallback) (base_combobox_changed_cb))), (buttons), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='macro'>g_signal_connect(buttons->priv->equation, <span class='string_literal'>"notify::base"</span>, G_CALLBACK(base_changed_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((buttons->priv->equation), ("notify::base"<br>), (((GCallback) (base_changed_cb))), (buttons), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> base_changed_cb(buttons->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, buttons);</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> <span class='comment'>/* Setup financial functions */</span></td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> <span class='keyword'>if</span> (mode == FINANCIAL) {</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> load_finc_dialogs(buttons);</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_compounding_term_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"ctrm_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_double_declining_depreciation_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"ddb_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_future_value_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"fv_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_gross_profit_margin_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"gpm_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_periodic_payment_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"pmt_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_present_value_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"pv_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_periodic_interest_rate_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"rate_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_straight_line_depreciation_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"sln_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_sum_of_the_years_digits_depreciation_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"syd_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> set_data(builder, <span class='string_literal'>"calc_finc_term_button"</span>, <span class='string_literal'>"finc_dialog"</span>, <span class='string_literal'>"term_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> gtk_builder_connect_signals(builder, buttons);</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> display_changed_cb(buttons->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, buttons);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> <span class='keyword'>return</span> *panel;</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line">converter_changed_cb(MathConverter *converter, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> Unit *from_unit, *to_unit;</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> math_converter_get_conversion(converter, &from_unit, &to_unit);</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> <span class='keyword'>if</span> (buttons->priv->mode == FINANCIAL) {</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> math_equation_set_source_currency(buttons->priv->equation, unit_get_name(from_unit));</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> math_equation_set_target_currency(buttons->priv->equation, unit_get_name(to_unit));</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> math_equation_set_source_units(buttons->priv->equation, unit_get_name(from_unit));</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> math_equation_set_target_units(buttons->priv->equation, unit_get_name(to_unit));</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> g_object_unref(from_unit);</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> g_object_unref(to_unit);</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line">load_buttons(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> GtkWidget *panel;</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> <span class='keyword'>if</span> (!gtk_widget_get_visible(<span class='macro'>GTK_WIDGET(buttons)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons)), ((gtk_widget_get_type ()))))))</span></span>))</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='keyword'>if</span> (!buttons->priv->converter) {</td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> buttons->priv->converter = math_converter_new(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> <span class='macro'>g_signal_connect(buttons->priv->converter, <span class='string_literal'>"changed"</span>, G_CALLBACK(converter_changed_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((buttons->priv->converter), ("changed"<br>), (((GCallback) (converter_changed_cb))), (buttons), ((void*<br>)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> gtk_box_pack_start(<span class='macro'>GTK_BOX(buttons)<span class='macro_popup'>((((GtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons)), ((gtk_box_get_type ()))))))</span></span>, <span class='macro'>GTK_WIDGET(buttons->priv->converter)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->converter)), ((gtk_widget_get_type (<br>)))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> panel = load_mode(buttons, buttons->priv->mode);</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='keyword'>if</span> (buttons->priv->active_panel == panel)</td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> <span class='comment'>/* Hide old buttons */</span></td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='keyword'>if</span> (buttons->priv->active_panel)</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> gtk_widget_hide(buttons->priv->active_panel);</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='comment'>/* Load and display new buttons */</span></td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> buttons->priv->active_panel = panel;</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> <span class='keyword'>if</span> (panel)</td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> gtk_widget_show(panel);</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line">math_buttons_set_mode(MathButtons *buttons, ButtonMode mode)</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> <span class='macro'>g_return_if_fail(buttons != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (buttons != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "buttons != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> <span class='keyword'>if</span> (buttons->priv->mode == mode)</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> buttons->priv->mode = mode;</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> <span class='keyword'>if</span> (mode == PROGRAMMING)</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> math_equation_set_base(buttons->priv->equation, buttons->priv->programming_base);</td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> math_equation_set_base(buttons->priv->equation, 10);</td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> load_buttons(buttons);</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> gtk_widget_set_visible(<span class='macro'>GTK_WIDGET(buttons->priv->converter)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->converter)), ((gtk_widget_get_type (<br>)))))))</span></span>, mode == ADVANCED || mode == FINANCIAL);</td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='keyword'>if</span> (mode == ADVANCED) {</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> math_converter_set_category(buttons->priv->converter, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> math_converter_set_conversion(buttons->priv->converter,</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> math_equation_get_source_units(buttons->priv->equation),</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> math_equation_get_target_units(buttons->priv->equation));</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (mode == FINANCIAL) {</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> math_converter_set_category(buttons->priv->converter, <span class='string_literal'>"currency"</span>);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> math_converter_set_conversion(buttons->priv->converter,</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> math_equation_get_source_currency(buttons->priv->equation),</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> math_equation_get_target_currency(buttons->priv->equation));</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(buttons)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"mode"</span>);</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line">ButtonMode</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line">math_buttons_get_mode(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='keyword'>return</span> buttons->priv->mode;</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line">math_buttons_set_programming_base(MathButtons *buttons, gint base)</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> <span class='macro'>g_return_if_fail(buttons != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (buttons != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "buttons != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> <span class='keyword'>if</span> (base == buttons->priv->programming_base)</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> buttons->priv->programming_base = base;</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> g_settings_set_int(g_settings_var, <span class='string_literal'>"base"</span>, math_buttons_get_programming_base(buttons));</td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> <span class='keyword'>if</span> (buttons->priv->mode == PROGRAMMING)</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> math_equation_set_base(buttons->priv->equation, base);</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line">gint</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line">math_buttons_get_programming_base(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> <span class='macro'>g_return_val_if_fail(buttons != NULL, 10)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (buttons != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "buttons != NULL"<br>); return (10); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> <span class='keyword'>return</span> buttons->priv->programming_base;</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"><span class='keyword'>void</span> exponent_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line">exponent_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> math_equation_insert_exponent(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"><span class='keyword'>void</span> subtract_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line">subtract_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line"> math_equation_insert_subtract(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line"><span class='keyword'>void</span> button_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line">button_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> math_equation_insert(buttons->priv->equation, g_object_get_data(<span class='macro'>G_OBJECT(widget)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"calc_text"</span>));</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"><span class='keyword'>void</span> solve_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line">solve_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> math_equation_solve(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"><span class='keyword'>void</span> clear_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line">clear_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> math_equation_clear(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"><span class='keyword'>void</span> delete_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line">delete_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> math_equation_delete(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"><span class='keyword'>void</span> undo_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line">undo_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> math_equation_undo(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line">shift_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> math_equation_shift(buttons->priv->equation, <span class='macro'>GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), <span class='string_literal'>"shiftcount"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data(((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((widget)), (((GType) ((20) << (2)))<br>))))), "shiftcount")))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line">popup_button_menu(GtkWidget *widget, GtkMenu *menu)</td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> gtk_menu_popup_at_widget (menu,</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line"> widget,</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> GDK_GRAVITY_SOUTH_WEST,</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> GDK_GRAVITY_NORTH_WEST,</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"><span class='keyword'>void</span> memory_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line">memory_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> MathVariablePopup *popup;</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> GtkAllocation allocation;</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> gint x, y;</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> popup = math_variable_popup_new(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> gtk_window_set_transient_for(<span class='macro'>GTK_WINDOW(popup)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((popup)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>GTK_WINDOW(gtk_widget_get_toplevel(widget))<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_widget_get_toplevel(widget))), ((gtk_window_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> gtk_widget_get_allocation(widget, &allocation);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> gdk_window_get_root_coords(gtk_widget_get_window(widget), allocation.x, allocation.y, &x, &y);</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> gtk_window_move(<span class='macro'>GTK_WINDOW(popup)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((popup)), ((gtk_window_get_type ()))))))</span></span>, x, y);</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> gtk_widget_show(<span class='macro'>GTK_WIDGET(popup)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((popup)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"><span class='keyword'>void</span> shift_left_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line">shift_left_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> <span class='keyword'>if</span> (!buttons->priv->shift_left_menu) {</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> GtkWidget *menu;</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> menu = buttons->priv->shift_left_menu = gtk_menu_new();</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> gtk_menu_set_reserve_toggle_size(<span class='macro'>GTK_MENU(menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_get_type ()))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line"> <span class='keyword'>for</span> (i = 1; i < 16; i++) {</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> GtkWidget *item, *label;</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> <span class='keyword'>if</span> (i < 10) {</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> <span class='comment'>/* Left Shift Popup: Menu item to shift left by n places (n < 10) */</span></td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> text = g_strdup_printf(<span class='macro'>ngettext(<span class='string_literal'>"_%d place"</span>, <span class='string_literal'>"_%d places"</span>, i)<span class='macro_popup'>dcngettext (((void*)0), "_%d place", "_%d places", i, 5)</span></span>, i);</td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> <span class='comment'>/* Left Shift Popup: Menu item to shift left by n places (n >= 10) */</span></td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> text = g_strdup_printf(<span class='macro'>ngettext(<span class='string_literal'>"%d place"</span>, <span class='string_literal'>"%d places"</span>, i)<span class='macro_popup'>dcngettext (((void*)0), "%d place", "%d places", i, 5)</span></span>, i);</td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> label = gtk_label_new_with_mnemonic(text);</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> item = gtk_menu_item_new();</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> g_object_set_data(<span class='macro'>G_OBJECT(item)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((item)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"shiftcount"</span>, <span class='macro'>GINT_TO_POINTER(i)<span class='macro_popup'>((gpointer) (glong) (i))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> gtk_container_add(<span class='macro'>GTK_CONTAINER(item)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((item)), ((gtk_container_get_type ()))))))</span></span>, label);</td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> gtk_menu_shell_append(<span class='macro'>GTK_MENU_SHELL(menu)<span class='macro_popup'>((((GtkMenuShell*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_shell_get_type ()))))))</span></span>, item);</td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='macro'>g_signal_connect(item, <span class='string_literal'>"activate"</span>, G_CALLBACK(shift_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((item), ("activate"), (((GCallback) (shift_cb<br>))), (buttons), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> gtk_widget_show(label);</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> gtk_widget_show(item);</td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> popup_button_menu(widget, <span class='macro'>GTK_MENU(buttons->priv->shift_left_menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->shift_left_menu)), ((gtk_menu_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"><span class='keyword'>void</span> shift_right_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line">shift_right_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> <span class='keyword'>if</span> (!buttons->priv->shift_right_menu) {</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> GtkWidget *menu;</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> menu = buttons->priv->shift_right_menu = gtk_menu_new();</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> gtk_menu_set_reserve_toggle_size(<span class='macro'>GTK_MENU(menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_get_type ()))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> <span class='keyword'>for</span> (i = 1; i < 16; i++) {</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> GtkWidget *item, *label;</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> <span class='keyword'>if</span> (i < 10) {</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span class='comment'>/* Right Shift Popup: Menu item to shift right by n places (n < 10) */</span></td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> text = g_strdup_printf(<span class='macro'>ngettext(<span class='string_literal'>"_%d place"</span>, <span class='string_literal'>"_%d places"</span>, i)<span class='macro_popup'>dcngettext (((void*)0), "_%d place", "_%d places", i, 5)</span></span>, i);</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> <span class='comment'>/* Right Shift Popup: Menu item to shift right by n places (n >= 10) */</span></td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> text = g_strdup_printf(<span class='macro'>ngettext(<span class='string_literal'>"%d place"</span>, <span class='string_literal'>"%d places"</span>, i)<span class='macro_popup'>dcngettext (((void*)0), "%d place", "%d places", i, 5)</span></span>, i);</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"> label = gtk_label_new_with_mnemonic(text);</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> item = gtk_menu_item_new();</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> g_object_set_data(<span class='macro'>G_OBJECT(item)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((item)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"shiftcount"</span>, <span class='macro'>GINT_TO_POINTER(-i)<span class='macro_popup'>((gpointer) (glong) (-i))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> gtk_container_add(<span class='macro'>GTK_CONTAINER(item)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((item)), ((gtk_container_get_type ()))))))</span></span>, label);</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> gtk_menu_shell_append(<span class='macro'>GTK_MENU_SHELL(menu)<span class='macro_popup'>((((GtkMenuShell*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_shell_get_type ()))))))</span></span>, item);</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> <span class='macro'>g_signal_connect(item, <span class='string_literal'>"activate"</span>, G_CALLBACK(shift_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((item), ("activate"), (((GCallback) (shift_cb<br>))), (buttons), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> gtk_widget_show(label);</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> gtk_widget_show(item);</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> popup_button_menu(widget, <span class='macro'>GTK_MENU(buttons->priv->shift_right_menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->shift_right_menu)), ((gtk_menu_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line">insert_function_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> math_equation_insert(buttons->priv->equation, g_object_get_data(<span class='macro'>G_OBJECT(widget)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"function"</span>));</td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"><span class='keyword'>void</span> function_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line">function_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> <span class='keyword'>if</span> (!buttons->priv->function_menu) {</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> GtkWidget *menu;</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> gchar *name, *function;</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> } functions[] =</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> { <span class='comment'>/* Tooltip for the integer component button */</span></td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Integer Component"</span>)<span class='macro_popup'>("Integer Component")</span></span>, <span class='string_literal'>"int "</span> },</td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> { <span class='comment'>/* Tooltip for the fractional component button */</span></td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Fractional Component"</span>)<span class='macro_popup'>("Fractional Component")</span></span>, <span class='string_literal'>"frac "</span> },</td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> { <span class='comment'>/* Tooltip for the round button */</span></td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Round"</span>)<span class='macro_popup'>("Round")</span></span>, <span class='string_literal'>"round "</span> },</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> { <span class='comment'>/* Tooltip for the floor button */</span></td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Floor"</span>)<span class='macro_popup'>("Floor")</span></span>, <span class='string_literal'>"floor "</span> },</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line"> { <span class='comment'>/* Tooltip for the ceiling button */</span></td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Ceiling"</span>)<span class='macro_popup'>("Ceiling")</span></span>, <span class='string_literal'>"ceil "</span> },</td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"> { <span class='comment'>/* Tooltip for the ceiling button */</span></td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Sign"</span>)<span class='macro_popup'>("Sign")</span></span>, <span class='string_literal'>"sgn "</span> },</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> { <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> }</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> menu = buttons->priv->function_menu = gtk_menu_new();</td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> gtk_menu_set_reserve_toggle_size(<span class='macro'>GTK_MENU(menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_get_type ()))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line"> <span class='keyword'>for</span> (i = 0; functions[i].name != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> GtkWidget *item;</td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line"> item = gtk_menu_item_new_with_label(<span class='macro'>_(functions[i].name)<span class='macro_popup'>dcgettext (((void*)0), functions[i].name, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> g_object_set_data(<span class='macro'>G_OBJECT(item)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((item)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"function"</span>, g_strdup(functions[i].function));</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line"> gtk_menu_shell_append(<span class='macro'>GTK_MENU_SHELL(menu)<span class='macro_popup'>((((GtkMenuShell*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_shell_get_type ()))))))</span></span>, item);</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> <span class='macro'>g_signal_connect(item, <span class='string_literal'>"activate"</span>, G_CALLBACK(insert_function_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((item), ("activate"), (((GCallback) (insert_function_cb<br>))), (buttons), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"> gtk_widget_show(item);</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> popup_button_menu(widget, <span class='macro'>GTK_MENU(buttons->priv->function_menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->function_menu)), ((gtk_menu_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line">insert_const_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line"> math_equation_insert(buttons->priv->equation, g_object_get_data(<span class='macro'>G_OBJECT(widget)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"const"</span>));</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"><span class='keyword'>void</span> const_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line">const_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> <span class='keyword'>if</span> (!buttons->priv->const_menu) {</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> GtkWidget *menu;</td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line"> gchar *name, *constant, *tooltip;</td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"> } constants[] =</td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line"> { <span class='comment'>/* Tooltip for the c₀ component button */</span></td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Velocity of Light"</span>)<span class='macro_popup'>("Velocity of Light")</span></span>, <span class='string_literal'>"c₀"</span>, <span class='macro'>N_(<span class='string_literal'>"299,792,458 m/s"</span>)<span class='macro_popup'>("299,792,458 m/s")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> { <span class='comment'>/* Tooltip for the μ₀ component button */</span></td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Magnetic constant"</span>)<span class='macro_popup'>("Magnetic constant")</span></span>, <span class='string_literal'>"μ₀"</span>, <span class='macro'>N_(<span class='string_literal'>"1.2566370614×10⁻⁶ N/A²"</span>)<span class='macro_popup'>("1.2566370614×10⁻⁶ N/A²")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> { <span class='comment'>/* Tooltip for the ε₀ button */</span></td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Electric constant"</span>)<span class='macro_popup'>("Electric constant")</span></span>, <span class='string_literal'>"ε₀"</span>, <span class='macro'>N_(<span class='string_literal'>"8.85418782×10⁻¹² s⁴A²/m³kg"</span>)<span class='macro_popup'>("8.85418782×10⁻¹² s⁴A²/m³kg")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> { <span class='comment'>/* Tooltip for the G button */</span></td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Newtonian constant of gravitation"</span>)<span class='macro_popup'>("Newtonian constant of gravitation")</span></span>, <span class='string_literal'>"G"</span>, <span class='macro'>N_(<span class='string_literal'>"6.67408×10⁻¹¹ m³/(s²kg)"</span>)<span class='macro_popup'>("6.67408×10⁻¹¹ m³/(s²kg)")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> { <span class='comment'>/* Tooltip for the h button */</span></td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Planck constant"</span>)<span class='macro_popup'>("Planck constant")</span></span>, <span class='string_literal'>"h"</span>, <span class='macro'>N_(<span class='string_literal'>"6.62607004×10⁻³⁴ m²kg/s"</span>)<span class='macro_popup'>("6.62607004×10⁻³⁴ m²kg/s")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> { <span class='comment'>/* Tooltip for the e button */</span></td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Elementary charge"</span>)<span class='macro_popup'>("Elementary charge")</span></span>, <span class='string_literal'>"e"</span>, <span class='macro'>N_(<span class='string_literal'>"1.6021766208(98)×10⁻¹⁹ C"</span>)<span class='macro_popup'>("1.6021766208(98)×10⁻¹⁹ C")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line"> { <span class='comment'>/* Tooltip for the mₑ button */</span></td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Electron mass"</span>)<span class='macro_popup'>("Electron mass")</span></span>, <span class='string_literal'>"mₑ"</span>, <span class='macro'>N_(<span class='string_literal'>"9.10938356×10⁻³¹ kg"</span>)<span class='macro_popup'>("9.10938356×10⁻³¹ kg")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line"> { <span class='comment'>/* Tooltip for the mₚ button */</span></td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Proton mass"</span>)<span class='macro_popup'>("Proton mass")</span></span>, <span class='string_literal'>"mₚ"</span>, <span class='macro'>N_(<span class='string_literal'>"1.672621898(21)×10⁻²⁷ kg"</span>)<span class='macro_popup'>("1.672621898(21)×10⁻²⁷ kg")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"> { <span class='comment'>/* Tooltip for the Nₐ button */</span></td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line"> <span class='macro'>N_(<span class='string_literal'>"Avogadro constant"</span>)<span class='macro_popup'>("Avogadro constant")</span></span>, <span class='string_literal'>"Nₐ"</span>, <span class='macro'>N_(<span class='string_literal'>"6.02214086×10²³ mol⁻¹"</span>)<span class='macro_popup'>("6.02214086×10²³ mol⁻¹")</span></span> },</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> { <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> }</td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> menu = buttons->priv->const_menu = gtk_menu_new();</td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line"> gtk_menu_set_reserve_toggle_size(<span class='macro'>GTK_MENU(menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_get_type ()))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"> <span class='keyword'>for</span> (i = 0; constants[i].name != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line"> GtkWidget *item;</td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> item = gtk_menu_item_new_with_label(<span class='macro'>_(constants[i].name)<span class='macro_popup'>dcgettext (((void*)0), constants[i].name, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> gtk_widget_set_tooltip_text(item, <span class='macro'>_(constants[i].tooltip)<span class='macro_popup'>dcgettext (((void*)0), constants[i].tooltip, 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> g_object_set_data(<span class='macro'>G_OBJECT(item)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((item)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"const"</span>, g_strdup(constants[i].constant));</td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line"> gtk_menu_shell_append(<span class='macro'>GTK_MENU_SHELL(menu)<span class='macro_popup'>((((GtkMenuShell*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((menu)), ((gtk_menu_shell_get_type ()))))))</span></span>, item);</td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> <span class='macro'>g_signal_connect(item, <span class='string_literal'>"activate"</span>, G_CALLBACK(insert_const_cb), buttons)<span class='macro_popup'>g_signal_connect_data ((item), ("activate"), (((GCallback) (insert_const_cb<br>))), (buttons), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line"> gtk_widget_show(item);</td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> popup_button_menu(widget, <span class='macro'>GTK_MENU(buttons->priv->const_menu)<span class='macro_popup'>((((GtkMenu*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->const_menu)), ((gtk_menu_get_type (<br>)))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"><span class='keyword'>void</span> factorize_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line">factorize_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line"> math_equation_factorize(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line"><span class='keyword'>void</span> digit_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line">digit_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"> math_equation_insert_digit(buttons->priv->equation, <span class='macro'>GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), <span class='string_literal'>"calc_digit"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data(((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((widget)), (((GType) ((20) << (2)))<br>))))), "calc_digit")))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1077"><td class="num" id="LN1077">1077</td><td class="line"><span class='keyword'>void</span> numeric_point_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1078"><td class="num" id="LN1078">1078</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1079"><td class="num" id="LN1079">1079</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1080"><td class="num" id="LN1080">1080</td><td class="line">numeric_point_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1081"><td class="num" id="LN1081">1081</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1082"><td class="num" id="LN1082">1082</td><td class="line"> math_equation_insert_numeric_point(buttons->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="1083"><td class="num" id="LN1083">1083</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1084"><td class="num" id="LN1084">1084</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1085"><td class="num" id="LN1085">1085</td><td class="line"><span class='keyword'>void</span> finc_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1086"><td class="num" id="LN1086">1086</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1087"><td class="num" id="LN1087">1087</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1088"><td class="num" id="LN1088">1088</td><td class="line">finc_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1089"><td class="num" id="LN1089">1089</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1090"><td class="num" id="LN1090">1090</td><td class="line"> gchar *name;</td></tr> +<tr class="codeline" data-linenumber="1091"><td class="num" id="LN1091">1091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1092"><td class="num" id="LN1092">1092</td><td class="line"> name = g_object_get_data(<span class='macro'>G_OBJECT(widget)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"finc_dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="1093"><td class="num" id="LN1093">1093</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(GET_WIDGET(buttons->priv->financial_ui, name))<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((buttons->priv->financial_ui<br>), (name)))), ((gtk_widget_get_type ())))))))), ((gtk_dialog_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1094"><td class="num" id="LN1094">1094</td><td class="line"> gtk_widget_hide(<span class='macro'>GTK_WIDGET(GET_WIDGET(buttons->priv->financial_ui, name))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((buttons->priv->financial_ui<br>), (name)))), ((gtk_widget_get_type ())))))))), ((gtk_widget_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1095"><td class="num" id="LN1095">1095</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1096"><td class="num" id="LN1096">1096</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1097"><td class="num" id="LN1097">1097</td><td class="line"><span class='keyword'>void</span> insert_character_code_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1098"><td class="num" id="LN1098">1098</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1099"><td class="num" id="LN1099">1099</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1100"><td class="num" id="LN1100">1100</td><td class="line">insert_character_code_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1101"><td class="num" id="LN1101">1101</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1102"><td class="num" id="LN1102">1102</td><td class="line"> gtk_window_present(<span class='macro'>GTK_WINDOW(buttons->priv->character_code_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->character_code_dialog)), ((gtk_window_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1103"><td class="num" id="LN1103">1103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1104"><td class="num" id="LN1104">1104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1105"><td class="num" id="LN1105">1105</td><td class="line"><span class='keyword'>void</span> finc_activate_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1106"><td class="num" id="LN1106">1106</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1107"><td class="num" id="LN1107">1107</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1108"><td class="num" id="LN1108">1108</td><td class="line">finc_activate_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1109"><td class="num" id="LN1109">1109</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1110"><td class="num" id="LN1110">1110</td><td class="line"> gint dialog, field;</td></tr> +<tr class="codeline" data-linenumber="1111"><td class="num" id="LN1111">1111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1112"><td class="num" id="LN1112">1112</td><td class="line"> dialog = <span class='macro'>GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), <span class='string_literal'>"finc_dialog"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data(((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((widget)), (((GType) ((20) << (2)))<br>))))), "finc_dialog")))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1113"><td class="num" id="LN1113">1113</td><td class="line"> field = <span class='macro'>GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), <span class='string_literal'>"finc_field"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data(((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((widget)), (((GType) ((20) << (2)))<br>))))), "finc_field")))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1114"><td class="num" id="LN1114">1114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1115"><td class="num" id="LN1115">1115</td><td class="line"> <span class='keyword'>if</span> (finc_dialog_fields[dialog][field+1] == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1116"><td class="num" id="LN1116">1116</td><td class="line"> GtkWidget *dialog_widget;</td></tr> +<tr class="codeline" data-linenumber="1117"><td class="num" id="LN1117">1117</td><td class="line"> dialog_widget = gtk_widget_get_toplevel(widget);</td></tr> +<tr class="codeline" data-linenumber="1118"><td class="num" id="LN1118">1118</td><td class="line"> <span class='keyword'>if</span> (gtk_widget_is_toplevel(dialog_widget)) {</td></tr> +<tr class="codeline" data-linenumber="1119"><td class="num" id="LN1119">1119</td><td class="line"> gtk_dialog_response(<span class='macro'>GTK_DIALOG(dialog_widget)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog_widget)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1120"><td class="num" id="LN1120">1120</td><td class="line"> GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="1121"><td class="num" id="LN1121">1121</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1122"><td class="num" id="LN1122">1122</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1123"><td class="num" id="LN1123">1123</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1124"><td class="num" id="LN1124">1124</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1125"><td class="num" id="LN1125">1125</td><td class="line"> GtkWidget *next_widget;</td></tr> +<tr class="codeline" data-linenumber="1126"><td class="num" id="LN1126">1126</td><td class="line"> next_widget = <span class='macro'>GET_WIDGET(buttons->priv->financial_ui, finc_dialog_fields[dialog][field+1])<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((buttons->priv->financial_ui<br>), (finc_dialog_fields[dialog][field+1])))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1127"><td class="num" id="LN1127">1127</td><td class="line"> gtk_widget_grab_focus(next_widget);</td></tr> +<tr class="codeline" data-linenumber="1128"><td class="num" id="LN1128">1128</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1129"><td class="num" id="LN1129">1129</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1130"><td class="num" id="LN1130">1130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1131"><td class="num" id="LN1131">1131</td><td class="line"><span class='keyword'>void</span> finc_response_cb(GtkWidget *widget, gint response_id, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1132"><td class="num" id="LN1132">1132</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1133"><td class="num" id="LN1133">1133</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1134"><td class="num" id="LN1134">1134</td><td class="line">finc_response_cb(GtkWidget *widget, gint response_id, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1135"><td class="num" id="LN1135">1135</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1136"><td class="num" id="LN1136">1136</td><td class="line"> <span class='keyword'>int</span> dialog;</td></tr> +<tr class="codeline" data-linenumber="1137"><td class="num" id="LN1137">1137</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="1138"><td class="num" id="LN1138">1138</td><td class="line"> MPNumber arg[4];</td></tr> +<tr class="codeline" data-linenumber="1139"><td class="num" id="LN1139">1139</td><td class="line"> GtkWidget *entry;</td></tr> +<tr class="codeline" data-linenumber="1140"><td class="num" id="LN1140">1140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1141"><td class="num" id="LN1141">1141</td><td class="line"> <span class='keyword'>if</span> (response_id != GTK_RESPONSE_OK)</td></tr> +<tr class="codeline" data-linenumber="1142"><td class="num" id="LN1142">1142</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1143"><td class="num" id="LN1143">1143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1144"><td class="num" id="LN1144">1144</td><td class="line"> dialog = <span class='macro'>GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), <span class='string_literal'>"finc_dialog"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data(((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((widget)), (((GType) ((20) << (2)))<br>))))), "finc_dialog")))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1145"><td class="num" id="LN1145">1145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1146"><td class="num" id="LN1146">1146</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < 4; i++) {</td></tr> +<tr class="codeline" data-linenumber="1147"><td class="num" id="LN1147">1147</td><td class="line"> arg[i] = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1148"><td class="num" id="LN1148">1148</td><td class="line"> <span class='keyword'>if</span> (finc_dialog_fields[dialog][i] == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1149"><td class="num" id="LN1149">1149</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="1150"><td class="num" id="LN1150">1150</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1151"><td class="num" id="LN1151">1151</td><td class="line"> entry = <span class='macro'>GET_WIDGET(buttons->priv->financial_ui, finc_dialog_fields[dialog][i])<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((buttons->priv->financial_ui<br>), (finc_dialog_fields[dialog][i])))), ((gtk_widget_get_type (<br>)))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1152"><td class="num" id="LN1152">1152</td><td class="line"> mp_set_from_string(gtk_entry_get_text(<span class='macro'>GTK_ENTRY(entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((entry)), ((gtk_entry_get_type ()))))))</span></span>), 10, &arg[i]);</td></tr> +<tr class="codeline" data-linenumber="1153"><td class="num" id="LN1153">1153</td><td class="line"> gtk_entry_set_text(<span class='macro'>GTK_ENTRY(entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((entry)), ((gtk_entry_get_type ()))))))</span></span>, <span class='string_literal'>"0"</span>);</td></tr> +<tr class="codeline" data-linenumber="1154"><td class="num" id="LN1154">1154</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1155"><td class="num" id="LN1155">1155</td><td class="line"> gtk_widget_grab_focus(<span class='macro'>GET_WIDGET(buttons->priv->financial_ui, finc_dialog_fields[dialog][0])<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object((buttons->priv->financial_ui<br>), (finc_dialog_fields[dialog][0])))), ((gtk_widget_get_type (<br>)))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1156"><td class="num" id="LN1156">1156</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1157"><td class="num" id="LN1157">1157</td><td class="line"> do_finc_expression(buttons->priv->equation, dialog, &arg[0], &arg[1], &arg[2], &arg[3]);</td></tr> +<tr class="codeline" data-linenumber="1158"><td class="num" id="LN1158">1158</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1159"><td class="num" id="LN1159">1159</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < 4; i++) {</td></tr> +<tr class="codeline" data-linenumber="1160"><td class="num" id="LN1160">1160</td><td class="line"> mp_clear(&arg[i]);</td></tr> +<tr class="codeline" data-linenumber="1161"><td class="num" id="LN1161">1161</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1162"><td class="num" id="LN1162">1162</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1163"><td class="num" id="LN1163">1163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1164"><td class="num" id="LN1164">1164</td><td class="line"><span class='keyword'>void</span> character_code_dialog_response_cb(GtkWidget *dialog, gint response_id, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1165"><td class="num" id="LN1165">1165</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1166"><td class="num" id="LN1166">1166</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1167"><td class="num" id="LN1167">1167</td><td class="line">character_code_dialog_response_cb(GtkWidget *dialog, gint response_id, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1168"><td class="num" id="LN1168">1168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1169"><td class="num" id="LN1169">1169</td><td class="line"> <span class='keyword'>const</span> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="1170"><td class="num" id="LN1170">1170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1171"><td class="num" id="LN1171">1171</td><td class="line"> text = gtk_entry_get_text(<span class='macro'>GTK_ENTRY(buttons->priv->character_code_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->character_code_entry)), ((gtk_entry_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1172"><td class="num" id="LN1172">1172</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1173"><td class="num" id="LN1173">1173</td><td class="line"> <span class='keyword'>if</span> (response_id == GTK_RESPONSE_OK) {</td></tr> +<tr class="codeline" data-linenumber="1174"><td class="num" id="LN1174">1174</td><td class="line"> MPNumber x = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1175"><td class="num" id="LN1175">1175</td><td class="line"> <span class='keyword'>int</span> i = 0;</td></tr> +<tr class="codeline" data-linenumber="1176"><td class="num" id="LN1176">1176</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1177"><td class="num" id="LN1177">1177</td><td class="line"> mp_set_from_integer(0, &x);</td></tr> +<tr class="codeline" data-linenumber="1178"><td class="num" id="LN1178">1178</td><td class="line"> <span class='keyword'>while</span> (<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1179"><td class="num" id="LN1179">1179</td><td class="line"> mp_add_integer(&x, text[i], &x);</td></tr> +<tr class="codeline" data-linenumber="1180"><td class="num" id="LN1180">1180</td><td class="line"> <span class='keyword'>if</span> (text[i+1]) {</td></tr> +<tr class="codeline" data-linenumber="1181"><td class="num" id="LN1181">1181</td><td class="line"> mp_shift(&x, 8, &x);</td></tr> +<tr class="codeline" data-linenumber="1182"><td class="num" id="LN1182">1182</td><td class="line"> i++;</td></tr> +<tr class="codeline" data-linenumber="1183"><td class="num" id="LN1183">1183</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1184"><td class="num" id="LN1184">1184</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1185"><td class="num" id="LN1185">1185</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1186"><td class="num" id="LN1186">1186</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1187"><td class="num" id="LN1187">1187</td><td class="line"> math_equation_insert_number(buttons->priv->equation, &x);</td></tr> +<tr class="codeline" data-linenumber="1188"><td class="num" id="LN1188">1188</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="1189"><td class="num" id="LN1189">1189</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1190"><td class="num" id="LN1190">1190</td><td class="line"> gtk_widget_hide(dialog);</td></tr> +<tr class="codeline" data-linenumber="1191"><td class="num" id="LN1191">1191</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1192"><td class="num" id="LN1192">1192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1193"><td class="num" id="LN1193">1193</td><td class="line"><span class='keyword'>void</span> character_code_dialog_activate_cb(GtkWidget *entry, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1194"><td class="num" id="LN1194">1194</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1195"><td class="num" id="LN1195">1195</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1196"><td class="num" id="LN1196">1196</td><td class="line">character_code_dialog_activate_cb(GtkWidget *entry, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1197"><td class="num" id="LN1197">1197</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1198"><td class="num" id="LN1198">1198</td><td class="line"> character_code_dialog_response_cb(buttons->priv->character_code_dialog, GTK_RESPONSE_OK, buttons);</td></tr> +<tr class="codeline" data-linenumber="1199"><td class="num" id="LN1199">1199</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1200"><td class="num" id="LN1200">1200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1201"><td class="num" id="LN1201">1201</td><td class="line">gboolean character_code_dialog_delete_cb(GtkWidget *dialog, GdkEvent *event, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1202"><td class="num" id="LN1202">1202</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1203"><td class="num" id="LN1203">1203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="1204"><td class="num" id="LN1204">1204</td><td class="line">character_code_dialog_delete_cb(GtkWidget *dialog, GdkEvent *event, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1205"><td class="num" id="LN1205">1205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1206"><td class="num" id="LN1206">1206</td><td class="line"> character_code_dialog_response_cb(dialog, GTK_RESPONSE_CANCEL, buttons);</td></tr> +<tr class="codeline" data-linenumber="1207"><td class="num" id="LN1207">1207</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1208"><td class="num" id="LN1208">1208</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1209"><td class="num" id="LN1209">1209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1210"><td class="num" id="LN1210">1210</td><td class="line">gboolean bit_toggle_cb(GtkWidget *event_box, GdkEventButton *event, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1211"><td class="num" id="LN1211">1211</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1212"><td class="num" id="LN1212">1212</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="1213"><td class="num" id="LN1213">1213</td><td class="line">bit_toggle_cb(GtkWidget *event_box, GdkEventButton *event, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1214"><td class="num" id="LN1214">1214</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1215"><td class="num" id="LN1215">1215</td><td class="line"> math_equation_toggle_bit(buttons->priv->equation, <span class='macro'>GPOINTER_TO_INT(g_object_get_data(G_OBJECT(event_box), <span class='string_literal'>"bit_index"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data(((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((event_box)), (((GType) ((20) << (2<br>)))))))), "bit_index")))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1216"><td class="num" id="LN1216">1216</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1217"><td class="num" id="LN1217">1217</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1218"><td class="num" id="LN1218">1218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1219"><td class="num" id="LN1219">1219</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1220"><td class="num" id="LN1220">1220</td><td class="line">remove_trailing_spaces(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1221"><td class="num" id="LN1221">1221</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1222"><td class="num" id="LN1222">1222</td><td class="line"> GtkTextMark *insert_mark;</td></tr> +<tr class="codeline" data-linenumber="1223"><td class="num" id="LN1223">1223</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="1224"><td class="num" id="LN1224">1224</td><td class="line"> insert_mark = gtk_text_buffer_get_insert (<span class='macro'>GTK_TEXT_BUFFER(buttons->priv->equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->equation)), ((gtk_text_buffer_get_type<br> ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1225"><td class="num" id="LN1225">1225</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(buttons->priv->equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->equation)), ((gtk_text_buffer_get_type<br> ()))))))</span></span>, &end, insert_mark);</td></tr> +<tr class="codeline" data-linenumber="1226"><td class="num" id="LN1226">1226</td><td class="line"> start = end;</td></tr> +<tr class="codeline" data-linenumber="1227"><td class="num" id="LN1227">1227</td><td class="line"> <span class='keyword'>while</span> (gtk_text_iter_backward_char(&start)) {</td></tr> +<tr class="codeline" data-linenumber="1228"><td class="num" id="LN1228">1228</td><td class="line"> <span class='keyword'>if</span> (!g_unichar_isspace(gtk_text_iter_get_char(&start)))</td></tr> +<tr class="codeline" data-linenumber="1229"><td class="num" id="LN1229">1229</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1230"><td class="num" id="LN1230">1230</td><td class="line"> gtk_text_buffer_delete(<span class='macro'>GTK_TEXT_BUFFER(buttons->priv->equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->equation)), ((gtk_text_buffer_get_type<br> ()))))))</span></span>, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="1231"><td class="num" id="LN1231">1231</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1232"><td class="num" id="LN1232">1232</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1233"><td class="num" id="LN1233">1233</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1234"><td class="num" id="LN1234">1234</td><td class="line"><span class='keyword'>void</span> set_superscript_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1235"><td class="num" id="LN1235">1235</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1236"><td class="num" id="LN1236">1236</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1237"><td class="num" id="LN1237">1237</td><td class="line">set_superscript_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1238"><td class="num" id="LN1238">1238</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1239"><td class="num" id="LN1239">1239</td><td class="line"> <span class='keyword'>if</span> (gtk_toggle_button_get_active(<span class='macro'>GTK_TOGGLE_BUTTON(widget)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_toggle_button_get_type ()))))))</span></span>)) {</td></tr> +<tr class="codeline" data-linenumber="1240"><td class="num" id="LN1240">1240</td><td class="line"> math_equation_set_number_mode(buttons->priv->equation, SUPERSCRIPT);</td></tr> +<tr class="codeline" data-linenumber="1241"><td class="num" id="LN1241">1241</td><td class="line"> <span class='keyword'>if</span> (!gtk_text_buffer_get_has_selection(<span class='macro'>GTK_TEXT_BUFFER(buttons->priv->equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->equation)), ((gtk_text_buffer_get_type<br> ()))))))</span></span>)) {</td></tr> +<tr class="codeline" data-linenumber="1242"><td class="num" id="LN1242">1242</td><td class="line"> remove_trailing_spaces(buttons);</td></tr> +<tr class="codeline" data-linenumber="1243"><td class="num" id="LN1243">1243</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1244"><td class="num" id="LN1244">1244</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1245"><td class="num" id="LN1245">1245</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (math_equation_get_number_mode(buttons->priv->equation) == SUPERSCRIPT)</td></tr> +<tr class="codeline" data-linenumber="1246"><td class="num" id="LN1246">1246</td><td class="line"> math_equation_set_number_mode(buttons->priv->equation, NORMAL);</td></tr> +<tr class="codeline" data-linenumber="1247"><td class="num" id="LN1247">1247</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1248"><td class="num" id="LN1248">1248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1249"><td class="num" id="LN1249">1249</td><td class="line"><span class='keyword'>void</span> set_subscript_cb(GtkWidget *widget, MathButtons *buttons);</td></tr> +<tr class="codeline" data-linenumber="1250"><td class="num" id="LN1250">1250</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="1251"><td class="num" id="LN1251">1251</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1252"><td class="num" id="LN1252">1252</td><td class="line">set_subscript_cb(GtkWidget *widget, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1253"><td class="num" id="LN1253">1253</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1254"><td class="num" id="LN1254">1254</td><td class="line"> <span class='keyword'>if</span> (gtk_toggle_button_get_active(<span class='macro'>GTK_TOGGLE_BUTTON(widget)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_toggle_button_get_type ()))))))</span></span>)) {</td></tr> +<tr class="codeline" data-linenumber="1255"><td class="num" id="LN1255">1255</td><td class="line"> math_equation_set_number_mode(buttons->priv->equation, SUBSCRIPT);</td></tr> +<tr class="codeline" data-linenumber="1256"><td class="num" id="LN1256">1256</td><td class="line"> <span class='keyword'>if</span> (!gtk_text_buffer_get_has_selection(<span class='macro'>GTK_TEXT_BUFFER(buttons->priv->equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons->priv->equation)), ((gtk_text_buffer_get_type<br> ()))))))</span></span>)) {</td></tr> +<tr class="codeline" data-linenumber="1257"><td class="num" id="LN1257">1257</td><td class="line"> remove_trailing_spaces(buttons);</td></tr> +<tr class="codeline" data-linenumber="1258"><td class="num" id="LN1258">1258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1259"><td class="num" id="LN1259">1259</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1260"><td class="num" id="LN1260">1260</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (math_equation_get_number_mode(buttons->priv->equation) == SUBSCRIPT)</td></tr> +<tr class="codeline" data-linenumber="1261"><td class="num" id="LN1261">1261</td><td class="line"> math_equation_set_number_mode(buttons->priv->equation, NORMAL);</td></tr> +<tr class="codeline" data-linenumber="1262"><td class="num" id="LN1262">1262</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1263"><td class="num" id="LN1263">1263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1264"><td class="num" id="LN1264">1264</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1265"><td class="num" id="LN1265">1265</td><td class="line">number_mode_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1266"><td class="num" id="LN1266">1266</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1267"><td class="num" id="LN1267">1267</td><td class="line"> GList *i;</td></tr> +<tr class="codeline" data-linenumber="1268"><td class="num" id="LN1268">1268</td><td class="line"> NumberMode mode;</td></tr> +<tr class="codeline" data-linenumber="1269"><td class="num" id="LN1269">1269</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1270"><td class="num" id="LN1270">1270</td><td class="line"> mode = math_equation_get_number_mode(equation);</td></tr> +<tr class="codeline" data-linenumber="1271"><td class="num" id="LN1271">1271</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1272"><td class="num" id="LN1272">1272</td><td class="line"> <span class='keyword'>for</span> (i = buttons->priv->superscript_toggles; i; i = i->next) {</td></tr> +<tr class="codeline" data-linenumber="1273"><td class="num" id="LN1273">1273</td><td class="line"> GtkWidget *widget = i->data;</td></tr> +<tr class="codeline" data-linenumber="1274"><td class="num" id="LN1274">1274</td><td class="line"> gtk_toggle_button_set_active(<span class='macro'>GTK_TOGGLE_BUTTON(widget)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_toggle_button_get_type ()))))))</span></span>, mode == SUPERSCRIPT);</td></tr> +<tr class="codeline" data-linenumber="1275"><td class="num" id="LN1275">1275</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1276"><td class="num" id="LN1276">1276</td><td class="line"> <span class='keyword'>for</span> (i = buttons->priv->subscript_toggles; i; i = i->next) {</td></tr> +<tr class="codeline" data-linenumber="1277"><td class="num" id="LN1277">1277</td><td class="line"> GtkWidget *widget = i->data;</td></tr> +<tr class="codeline" data-linenumber="1278"><td class="num" id="LN1278">1278</td><td class="line"> gtk_toggle_button_set_active(<span class='macro'>GTK_TOGGLE_BUTTON(widget)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_toggle_button_get_type ()))))))</span></span>, mode == SUBSCRIPT);</td></tr> +<tr class="codeline" data-linenumber="1279"><td class="num" id="LN1279">1279</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1280"><td class="num" id="LN1280">1280</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1281"><td class="num" id="LN1281">1281</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1282"><td class="num" id="LN1282">1282</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1283"><td class="num" id="LN1283">1283</td><td class="line">math_buttons_set_property(GObject *object,</td></tr> +<tr class="codeline" data-linenumber="1284"><td class="num" id="LN1284">1284</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="1285"><td class="num" id="LN1285">1285</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="1286"><td class="num" id="LN1286">1286</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="1287"><td class="num" id="LN1287">1287</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1288"><td class="num" id="LN1288">1288</td><td class="line"> MathButtons *self;</td></tr> +<tr class="codeline" data-linenumber="1289"><td class="num" id="LN1289">1289</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1290"><td class="num" id="LN1290">1290</td><td class="line"> self = <span class='macro'>MATH_BUTTONS(object)<span class='macro_popup'>((((MathButtons*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), (math_buttons_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1291"><td class="num" id="LN1291">1291</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1292"><td class="num" id="LN1292">1292</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="1293"><td class="num" id="LN1293">1293</td><td class="line"> <span class='keyword'>case</span> PROP_EQUATION:</td></tr> +<tr class="codeline" data-linenumber="1294"><td class="num" id="LN1294">1294</td><td class="line"> self->priv->equation = g_value_get_object(value);</td></tr> +<tr class="codeline" data-linenumber="1295"><td class="num" id="LN1295">1295</td><td class="line"> math_buttons_set_mode(self, self->priv->mode);</td></tr> +<tr class="codeline" data-linenumber="1296"><td class="num" id="LN1296">1296</td><td class="line"> <span class='macro'>g_signal_connect(self->priv->equation, <span class='string_literal'>"notify::display"</span>, G_CALLBACK(display_changed_cb), self)<span class='macro_popup'>g_signal_connect_data ((self->priv->equation), ("notify::display"<br>), (((GCallback) (display_changed_cb))), (self), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1297"><td class="num" id="LN1297">1297</td><td class="line"> <span class='macro'>g_signal_connect(self->priv->equation, <span class='string_literal'>"notify::number-mode"</span>, G_CALLBACK(number_mode_changed_cb), self)<span class='macro_popup'>g_signal_connect_data ((self->priv->equation), ("notify::number-mode"<br>), (((GCallback) (number_mode_changed_cb))), (self), ((void*)<br>0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1298"><td class="num" id="LN1298">1298</td><td class="line"> <span class='macro'>g_signal_connect(self->priv->equation, <span class='string_literal'>"notify::angle-units"</span>, G_CALLBACK(display_changed_cb), self)<span class='macro_popup'>g_signal_connect_data ((self->priv->equation), ("notify::angle-units"<br>), (((GCallback) (display_changed_cb))), (self), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1299"><td class="num" id="LN1299">1299</td><td class="line"> <span class='macro'>g_signal_connect(self->priv->equation, <span class='string_literal'>"notify::number-format"</span>, G_CALLBACK(display_changed_cb), self)<span class='macro_popup'>g_signal_connect_data ((self->priv->equation), ("notify::number-format"<br>), (((GCallback) (display_changed_cb))), (self), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1300"><td class="num" id="LN1300">1300</td><td class="line"> number_mode_changed_cb(self->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, self);</td></tr> +<tr class="codeline" data-linenumber="1301"><td class="num" id="LN1301">1301</td><td class="line"> display_changed_cb(self->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, self);</td></tr> +<tr class="codeline" data-linenumber="1302"><td class="num" id="LN1302">1302</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1303"><td class="num" id="LN1303">1303</td><td class="line"> <span class='keyword'>case</span> PROP_MODE:</td></tr> +<tr class="codeline" data-linenumber="1304"><td class="num" id="LN1304">1304</td><td class="line"> math_buttons_set_mode(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1305"><td class="num" id="LN1305">1305</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1306"><td class="num" id="LN1306">1306</td><td class="line"> <span class='keyword'>case</span> PROP_PROGRAMMING_BASE:</td></tr> +<tr class="codeline" data-linenumber="1307"><td class="num" id="LN1307">1307</td><td class="line"> math_buttons_set_programming_base(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1308"><td class="num" id="LN1308">1308</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1309"><td class="num" id="LN1309">1309</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1310"><td class="num" id="LN1310">1310</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "math-buttons.c", 1310, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1311"><td class="num" id="LN1311">1311</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1312"><td class="num" id="LN1312">1312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1313"><td class="num" id="LN1313">1313</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1314"><td class="num" id="LN1314">1314</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1315"><td class="num" id="LN1315">1315</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1316"><td class="num" id="LN1316">1316</td><td class="line">math_buttons_get_property(GObject *object,</td></tr> +<tr class="codeline" data-linenumber="1317"><td class="num" id="LN1317">1317</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="1318"><td class="num" id="LN1318">1318</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="1319"><td class="num" id="LN1319">1319</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="1320"><td class="num" id="LN1320">1320</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1321"><td class="num" id="LN1321">1321</td><td class="line"> MathButtons *self;</td></tr> +<tr class="codeline" data-linenumber="1322"><td class="num" id="LN1322">1322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1323"><td class="num" id="LN1323">1323</td><td class="line"> self = <span class='macro'>MATH_BUTTONS(object)<span class='macro_popup'>((((MathButtons*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), (math_buttons_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1324"><td class="num" id="LN1324">1324</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1325"><td class="num" id="LN1325">1325</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="1326"><td class="num" id="LN1326">1326</td><td class="line"> <span class='keyword'>case</span> PROP_EQUATION:</td></tr> +<tr class="codeline" data-linenumber="1327"><td class="num" id="LN1327">1327</td><td class="line"> g_value_set_object(value, self->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="1328"><td class="num" id="LN1328">1328</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1329"><td class="num" id="LN1329">1329</td><td class="line"> <span class='keyword'>case</span> PROP_MODE:</td></tr> +<tr class="codeline" data-linenumber="1330"><td class="num" id="LN1330">1330</td><td class="line"> g_value_set_int(value, self->priv->mode);</td></tr> +<tr class="codeline" data-linenumber="1331"><td class="num" id="LN1331">1331</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1332"><td class="num" id="LN1332">1332</td><td class="line"> <span class='keyword'>case</span> PROP_PROGRAMMING_BASE:</td></tr> +<tr class="codeline" data-linenumber="1333"><td class="num" id="LN1333">1333</td><td class="line"> g_value_set_int(value, math_buttons_get_programming_base(self));</td></tr> +<tr class="codeline" data-linenumber="1334"><td class="num" id="LN1334">1334</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1335"><td class="num" id="LN1335">1335</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1336"><td class="num" id="LN1336">1336</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "math-buttons.c", 1336, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1337"><td class="num" id="LN1337">1337</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1338"><td class="num" id="LN1338">1338</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1339"><td class="num" id="LN1339">1339</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1340"><td class="num" id="LN1340">1340</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1341"><td class="num" id="LN1341">1341</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1342"><td class="num" id="LN1342">1342</td><td class="line">math_buttons_class_init(MathButtonsClass *klass)</td></tr> +<tr class="codeline" data-linenumber="1343"><td class="num" id="LN1343">1343</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1344"><td class="num" id="LN1344">1344</td><td class="line"> <span class='keyword'>static</span> GEnumValue button_mode_values[] =</td></tr> +<tr class="codeline" data-linenumber="1345"><td class="num" id="LN1345">1345</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1346"><td class="num" id="LN1346">1346</td><td class="line"> {BASIC, <span class='string_literal'>"basic"</span>, <span class='string_literal'>"basic"</span>},</td></tr> +<tr class="codeline" data-linenumber="1347"><td class="num" id="LN1347">1347</td><td class="line"> {ADVANCED, <span class='string_literal'>"advanced"</span>, <span class='string_literal'>"advanced"</span>},</td></tr> +<tr class="codeline" data-linenumber="1348"><td class="num" id="LN1348">1348</td><td class="line"> {FINANCIAL, <span class='string_literal'>"financial"</span>, <span class='string_literal'>"financial"</span>},</td></tr> +<tr class="codeline" data-linenumber="1349"><td class="num" id="LN1349">1349</td><td class="line"> {PROGRAMMING, <span class='string_literal'>"programming"</span>, <span class='string_literal'>"programming"</span>},</td></tr> +<tr class="codeline" data-linenumber="1350"><td class="num" id="LN1350">1350</td><td class="line"> {0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="1351"><td class="num" id="LN1351">1351</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="1352"><td class="num" id="LN1352">1352</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS(klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1353"><td class="num" id="LN1353">1353</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1354"><td class="num" id="LN1354">1354</td><td class="line"> object_class->get_property = math_buttons_get_property;</td></tr> +<tr class="codeline" data-linenumber="1355"><td class="num" id="LN1355">1355</td><td class="line"> object_class->set_property = math_buttons_set_property;</td></tr> +<tr class="codeline" data-linenumber="1356"><td class="num" id="LN1356">1356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1357"><td class="num" id="LN1357">1357</td><td class="line"> button_mode_type = g_enum_register_static(<span class='string_literal'>"ButtonMode"</span>, button_mode_values);</td></tr> +<tr class="codeline" data-linenumber="1358"><td class="num" id="LN1358">1358</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1359"><td class="num" id="LN1359">1359</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1360"><td class="num" id="LN1360">1360</td><td class="line"> PROP_EQUATION,</td></tr> +<tr class="codeline" data-linenumber="1361"><td class="num" id="LN1361">1361</td><td class="line"> g_param_spec_object(<span class='string_literal'>"equation"</span>,</td></tr> +<tr class="codeline" data-linenumber="1362"><td class="num" id="LN1362">1362</td><td class="line"> <span class='string_literal'>"equation"</span>,</td></tr> +<tr class="codeline" data-linenumber="1363"><td class="num" id="LN1363">1363</td><td class="line"> <span class='string_literal'>"Equation being controlled"</span>,</td></tr> +<tr class="codeline" data-linenumber="1364"><td class="num" id="LN1364">1364</td><td class="line"> math_equation_get_type(),</td></tr> +<tr class="codeline" data-linenumber="1365"><td class="num" id="LN1365">1365</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));</td></tr> +<tr class="codeline" data-linenumber="1366"><td class="num" id="LN1366">1366</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1367"><td class="num" id="LN1367">1367</td><td class="line"> PROP_MODE,</td></tr> +<tr class="codeline" data-linenumber="1368"><td class="num" id="LN1368">1368</td><td class="line"> g_param_spec_enum(<span class='string_literal'>"mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1369"><td class="num" id="LN1369">1369</td><td class="line"> <span class='string_literal'>"mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1370"><td class="num" id="LN1370">1370</td><td class="line"> <span class='string_literal'>"Button mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1371"><td class="num" id="LN1371">1371</td><td class="line"> button_mode_type,</td></tr> +<tr class="codeline" data-linenumber="1372"><td class="num" id="LN1372">1372</td><td class="line"> BASIC,</td></tr> +<tr class="codeline" data-linenumber="1373"><td class="num" id="LN1373">1373</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1374"><td class="num" id="LN1374">1374</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1375"><td class="num" id="LN1375">1375</td><td class="line"> PROP_PROGRAMMING_BASE,</td></tr> +<tr class="codeline" data-linenumber="1376"><td class="num" id="LN1376">1376</td><td class="line"> g_param_spec_int(<span class='string_literal'>"programming-base"</span>,</td></tr> +<tr class="codeline" data-linenumber="1377"><td class="num" id="LN1377">1377</td><td class="line"> <span class='string_literal'>"programming-base"</span>,</td></tr> +<tr class="codeline" data-linenumber="1378"><td class="num" id="LN1378">1378</td><td class="line"> <span class='string_literal'>"Base to use in programming mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1379"><td class="num" id="LN1379">1379</td><td class="line"> 2, 16, 10,</td></tr> +<tr class="codeline" data-linenumber="1380"><td class="num" id="LN1380">1380</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1381"><td class="num" id="LN1381">1381</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1382"><td class="num" id="LN1382">1382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1383"><td class="num" id="LN1383">1383</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1384"><td class="num" id="LN1384">1384</td><td class="line">math_buttons_init(MathButtons *buttons)</td></tr> +<tr class="codeline" data-linenumber="1385"><td class="num" id="LN1385">1385</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1386"><td class="num" id="LN1386">1386</td><td class="line"> buttons->priv = math_buttons_get_instance_private (buttons);</td></tr> +<tr class="codeline" data-linenumber="1387"><td class="num" id="LN1387">1387</td><td class="line"> gtk_box_set_spacing(<span class='macro'>GTK_BOX(buttons)<span class='macro_popup'>((((GtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons)), ((gtk_box_get_type ()))))))</span></span>, 6);</td></tr> +<tr class="codeline" data-linenumber="1388"><td class="num" id="LN1388">1388</td><td class="line"> gtk_orientable_set_orientation (<span class='macro'>GTK_ORIENTABLE (buttons)<span class='macro_popup'>((((GtkOrientable*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((buttons)), ((gtk_orientable_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1389"><td class="num" id="LN1389">1389</td><td class="line"> GTK_ORIENTATION_VERTICAL);</td></tr> +<tr class="codeline" data-linenumber="1390"><td class="num" id="LN1390">1390</td><td class="line"> buttons->priv->programming_base = 10;</td></tr> +<tr class="codeline" data-linenumber="1391"><td class="num" id="LN1391">1391</td><td class="line"> <span class='macro'>g_signal_connect(G_OBJECT(buttons), <span class='string_literal'>"show"</span>, G_CALLBACK(load_buttons), NULL)<span class='macro_popup'>g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((buttons)), (((GType) ((20) << (2))<br>))))))), ("show"), (((GCallback) (load_buttons))), (((void*)0<br>)), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1392"><td class="num" id="LN1392">1392</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-720c65.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-720c65.html new file mode 100644 index 0000000..9cd041f --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-720c65.html @@ -0,0 +1,1270 @@ +<!doctype html> +<html> +<head> +<title>lexer.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type' --> + +<!-- BUGTYPE Dead nested assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/src/lexer.c --> + +<!-- FILENAME lexer.c --> + +<!-- FUNCTIONNAME l_insert_next_token --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 720c658014438a1afc16acb4f1dc83ce --> + +<!-- BUGLINE 241 --> + +<!-- BUGCOLUMN 21 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>lexer.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 241, column 21</a><br />Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name lexer.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c lexer.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"241": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"><span class='directive'>#include <assert.h></span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"><span class='directive'>#include "lexer.h"</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"><span class='directive'>#include "parserfunc.h"</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"><span class='directive'>#include "mp-equation.h"</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line">l_check_if_function(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> gchar* name = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='keyword'>if</span>(!state->parent->function_is_defined)</td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='keyword'>if</span> ((*(state->parent->function_is_defined))(state->parent, name))</td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line">l_check_if_number(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> <span class='keyword'>int</span> count = 0;</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> gchar* text = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(text, state->parent->options->base, &tmp) == 0)</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='comment'>/* Try to rollback several characters to see, if that yeilds any number. */</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='keyword'>while</span>(strlen (text) > 0)</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(text, state->parent->options->base, &tmp) == 0)</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> count++;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> pl_roll_back(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> text = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>/* Undo all rollbacks. */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='keyword'>while</span>(count--)</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> pl_get_next_token (state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"><span class='comment'>/* Insert generated token to the LexerState structure. */</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='keyword'>static</span> LexerToken*</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line">l_insert_token(LexerState* state, <span class='keyword'>const</span> LexerTokenType type)</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> state->tokens = (LexerToken *) realloc(state->tokens, (state->token_count + 1) * <span class='keyword'>sizeof</span>(LexerToken));</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='macro'>assert(state->tokens != NULL)<span class='macro_popup'>((void) sizeof ((state->tokens != ((void*)0)) ? 1 : 0), __extension__<br> ({ if (state->tokens != ((void*)0)) ; else __assert_fail (<br>"state->tokens != NULL", "lexer.c", 72, __extension__ __PRETTY_FUNCTION__<br>); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> state->tokens[state->token_count].string = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> state->tokens[state->token_count].start_index = state->prelexer->mark_index;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> state->tokens[state->token_count].end_index = state->prelexer->next_index;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> state->tokens[state->token_count].token_type = type;</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> state->token_count++;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->token_count - 1];</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='comment'>/* Generates next token from pre-lexer stream and call l_insert_token() to insert it at the end. */</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='keyword'>static</span> LexerToken*</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">l_insert_next_token(LexerState* lstate)</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> PreLexerState* state = lstate->prelexer;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> LexerTokenType type;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gchar* tmp;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> pl_set_marker(state);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> <span class='comment'>/* Ignore all blank spaces. :) */</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_SKIP)</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='comment'>/* Set marker. Beginning of new token. */</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> pl_set_marker(state);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span>(type == T_AND</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> ||type == T_OR</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> ||type == T_XOR</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> ||type == T_NOT</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> ||type == T_ADD</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> ||type == T_SUBTRACT</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> ||type == T_MULTIPLY</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> ||type == T_DIV</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> ||type == T_L_FLOOR</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> ||type == T_R_FLOOR</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> ||type == T_L_CEILING</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> ||type == T_R_CEILING</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> ||type == T_ROOT</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> ||type == T_ROOT_3</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> ||type == T_ROOT_4</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> ||type == T_ASSIGN</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> ||type == T_L_R_BRACKET</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> ||type == T_R_R_BRACKET</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> ||type == T_L_S_BRACKET</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> ||type == T_R_S_BRACKET</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> ||type == T_L_C_BRACKET</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> ||type == T_R_C_BRACKET</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> ||type == T_ABS</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> ||type == T_POWER</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> ||type == T_FACTORIAL</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> ||type == T_PERCENTAGE)</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, type);</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='comment'>/* [PL_SUPER_MINUS][PL_SUPER_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUPER_MINUS)</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>if</span>((type = pl_get_next_token(state)) != PL_SUPER_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SUP_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring (state));</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='comment'>/* Get all PL_SUPER_DIGITs. */</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='keyword'>while</span> (pl_get_next_token(state) == PL_SUPER_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NSUP_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='comment'>/* [PL_SUPER_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUPER_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUPER_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_SUP_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='comment'>/* [PL_SUB_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_SUB_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> <span class='comment'>/* [PL_FRACTION] */</span></td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='keyword'>if</span>(type == PL_FRACTION)</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='keyword'>if</span>(type == PL_FRACTION)</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DEGREE)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>goto</span> ANGLE_NUM_DM_STATE;</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_MINUTE)</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='keyword'>goto</span> ANGLE_NUM_DMS_STATE;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SECOND)</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SECOND */</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring (state));</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">ANGLE_NUM_DMS_STATE:</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>if</span>((type = pl_get_next_token (state)) != PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>if</span>(type == PL_SECOND)</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SECOND */</span></td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='comment'>/* ERROR: expected PL_MINUTE | PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line">ANGLE_NUM_DM_STATE:</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>if</span>((type = <span class="mrange">pl_get_next_token(state)</span>) != PL_DIGIT)</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:21ex">Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'</div></td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='keyword'>if</span>(type == PL_MINUTE)</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='comment'>/* ERROR: expected PL_MINUTE */</span></td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_STATE;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='keyword'>goto</span> HEX_DEC_STATE;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">DECIMAL_STATE:</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='keyword'>if</span>(type == PL_DEGREE)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_HEX);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line">HEX_DEC_STATE:</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DECIMAL | PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">DECIMAL_HEX_STATE:</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>if</span>(!(type == PL_DIGIT || type == PL_HEX))</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='comment'>/* NUMBER */</span></td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='comment'>/* VARIABLE */</span></td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_LETTER)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>goto</span> LETTER_STATE;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> <span class='comment'>/* NUMBER */</span></td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> <span class='comment'>/* VARIABLE */</span></td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>if</span>(type == PL_LETTER)</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line">LETTER_STATE:</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class='keyword'>if</span>(type == PL_LETTER || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> tmp = g_ascii_strdown(pl_get_marked_substring(state), -1);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"mod"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_MOD);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"and"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_AND);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"or"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_OR);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"xor"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_XOR);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"not"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NOT);</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"in"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_IN);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> tmp = g_ascii_strdown(pl_get_marked_substring(state), -1);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"mod"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_MOD);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"and"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_AND);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"or"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_OR);</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"xor"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_XOR);</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"not"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NOT);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"in"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_IN);</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>if</span>(type == PL_EOS)</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, PL_EOS);</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='comment'>/* ERROR: Unexpected token.. X( */</span></td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> set_error(lstate->parent, PARSER_ERR_INVALID, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"><span class='comment'>/* Call l_insert_next_token() as many times as needed to completely tokenize the string. */</span></td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">l_insert_all_tokens(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> LexerToken* token;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> token = l_insert_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> <span class='macro'>assert(token != NULL)<span class='macro_popup'>((void) sizeof ((token != ((void*)0)) ? 1 : 0), __extension__<br> ({ if (token != ((void*)0)) ; else __assert_fail ("token != NULL"<br>, "lexer.c", 537, __extension__ __PRETTY_FUNCTION__); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>if</span>(token->token_type == PL_EOS)</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"><span class='comment'>/* Create a lexer state from given input string. This will take care of pre-lexer state. */</span></td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line">LexerState*</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line">l_create_lexer(<span class='keyword'>const</span> gchar* input, <span class='keyword'>struct</span> parser_state* parent)</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> LexerState* ret;</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> ret = (LexerState *) malloc(<span class='keyword'>sizeof</span>(LexerState));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='macro'>assert(ret != NULL)<span class='macro_popup'>((void) sizeof ((ret != ((void*)0)) ? 1 : 0), __extension__ (<br>{ if (ret != ((void*)0)) ; else __assert_fail ("ret != NULL",<br> "lexer.c", 551, __extension__ __PRETTY_FUNCTION__); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> ret->prelexer = pl_create_scanner(input);</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> ret->tokens = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> ret->token_count = 0;</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> ret->next_token = 0;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> ret->parent = parent;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"><span class='comment'>/* Destroy lexer state and free memory. */</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line">l_destroy_lexer(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>int</span> l;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> pl_destroy_scanner(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>for</span>(l = 0; l < state->token_count; l++)</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> free(state->tokens[l].string);</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> free(state->tokens);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> free(state);</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"><span class='comment'>/* Get next token interface. Will be called by parser to get pointer to next token in token stream. */</span></td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">LexerToken*</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line">l_get_next_token(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='comment'>/* Return PL_EOS token after token stream reaches to its end. */</span></td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span>(state->next_token >= state->token_count)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->token_count - 1];</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->next_token++];</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"><span class='comment'>/* Roll back one lexer token. */</span></td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line">l_roll_back(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span>(state->next_token > 0)</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> state->next_token--;</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-90c61f.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-90c61f.html new file mode 100644 index 0000000..158f8d8 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-90c61f.html @@ -0,0 +1,2630 @@ +<!doctype html> +<html> +<head> +<title>math-equation.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'is_digit' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/src/math-equation.c --> + +<!-- FILENAME math-equation.c --> + +<!-- FUNCTIONNAME math_equation_get_equation --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 90c61f97eb67ec661bd291e747097c5f --> + +<!-- BUGLINE 802 --> + +<!-- BUGCOLUMN 14 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>math-equation.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 802, column 14</a><br />Value stored to 'is_digit' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name math-equation.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c math-equation.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"802": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2008-2011 Robert Ancell</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify it under</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* the terms of the GNU General Public License as published by the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* Foundation, either version 2 of the License, or (at your option) any later</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* version. See http://www.gnu.org/copyleft/gpl.html the full text of the</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* license.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"><span class='directive'>#include <ctype.h></span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"><span class='directive'>#include <math.h></span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "math-equation.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include "mp.h"</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include "mp-equation.h"</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include "mp-serializer.h"</span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include "mp-enums.h"</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include "unit-manager.h"</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include "utility.h"</span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> PROP_STATUS,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> PROP_DISPLAY,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> PROP_EQUATION,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> PROP_NUMBER_MODE,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> PROP_ACCURACY,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> PROP_SHOW_THOUSANDS_SEPARATORS,</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> PROP_SHOW_TRAILING_ZEROES,</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> PROP_NUMBER_FORMAT,</td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> PROP_BASE,</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> PROP_WORD_SIZE,</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> PROP_ANGLE_UNITS,</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> PROP_SOURCE_CURRENCY,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> PROP_TARGET_CURRENCY,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> PROP_SOURCE_UNITS,</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> PROP_TARGET_UNITS,</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> PROP_SERIALIZER</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> GType number_mode_type, number_format_type, angle_unit_type;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* Expression mode state */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> MPNumber ans; <span class='comment'>/* Previously calculated answer */</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> gchar *expression; <span class='comment'>/* Expression entered by user */</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> gint ans_start, ans_end; <span class='comment'>/* Start and end characters for ans variable in expression */</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> gint cursor; <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> NumberMode number_mode; <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> gboolean can_super_minus; <span class='comment'>/* TRUE if entering minus can generate a superscript minus */</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> gboolean entered_multiply; <span class='comment'>/* Last insert was a multiply character */</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> gchar *status; <span class='comment'>/* Equation status */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">} MathEquationState;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>struct</span> MathEquationPrivate</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> GtkTextTag *ans_tag;</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> gint word_size; <span class='comment'>/* Word size in bits */</span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> MPAngleUnit angle_units; <span class='comment'>/* Units for trigonometric functions */</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> <span class='keyword'>char</span> *source_currency;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> <span class='keyword'>char</span> *target_currency;</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='keyword'>char</span> *source_units;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>char</span> *target_units;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> NumberMode number_mode; <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> gboolean can_super_minus; <span class='comment'>/* TRUE if entering minus can generate a superscript minus */</span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> gunichar digits[16]; <span class='comment'>/* Localized digits */</span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> GtkTextMark *ans_start, *ans_end;</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> MathEquationState state; <span class='comment'>/* Equation state */</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> GList *undo_stack; <span class='comment'>/* History of expression mode states */</span></td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GList *redo_stack;</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> gboolean in_undo_operation;</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> gboolean in_reformat;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gboolean in_delete;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> gboolean in_solve;</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> MathVariables *variables;</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> MpSerializer *serializer;</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> GAsyncQueue *queue;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> MPNumber *number_result;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> gchar *text_result;</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> gchar *error;</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">} SolveData;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (MathEquation, math_equation, GTK_TYPE_TEXT_BUFFER)<span class='macro_popup'>static void math_equation_init (MathEquation *self); static void<br> math_equation_class_init (MathEquationClass *klass); static GType<br> math_equation_get_type_once (void); static gpointer math_equation_parent_class<br> = ((void*)0); static gint MathEquation_private_offset; static<br> void math_equation_class_intern_init (gpointer klass) { math_equation_parent_class<br> = g_type_class_peek_parent (klass); if (MathEquation_private_offset<br> != 0) g_type_class_adjust_private_offset (klass, &MathEquation_private_offset<br>); math_equation_class_init ((MathEquationClass*) klass); } __attribute__<br> ((__unused__)) static inline gpointer math_equation_get_instance_private<br> (MathEquation *self) { return (((gpointer) ((guint8*) (self)<br> + (glong) (MathEquation_private_offset)))); } GType math_equation_get_type<br> (void) { static gsize static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0));<br> (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id<br>)); }))) { GType g_define_type_id = math_equation_get_type_once<br> (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); 0 ?<br> (void) (*(&static_g_define_type_id) = (g_define_type_id)<br>) : (void) 0; g_once_init_leave ((&static_g_define_type_id<br>), (gsize) (g_define_type_id)); })); } return static_g_define_type_id<br>; } __attribute__ ((__noinline__)) static GType math_equation_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> ((gtk_text_buffer_get_type ()), g_intern_static_string ("MathEquation"<br>), sizeof (MathEquationClass), (GClassInitFunc)(void (*)(void<br>)) math_equation_class_intern_init, sizeof (MathEquation), (GInstanceInitFunc<br>)(void (*)(void)) math_equation_init, (GTypeFlags) 0); { {{ MathEquation_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (MathEquationPrivate<br>)); };} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line">MathEquation *</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line">math_equation_new()</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>return</span> g_object_new(math_equation_get_type(), <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">MathVariables *</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">math_equation_get_variables(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='keyword'>return</span> equation->priv->variables;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line">get_ans_offsets(MathEquation *equation, gint *start, gint *end)</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> GtkTextIter iter;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='keyword'>if</span> (!equation->priv->ans_start) {</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> *start = *end = -1;</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, equation->priv->ans_start);</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> *start = gtk_text_iter_get_offset(&iter);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, equation->priv->ans_end);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> *end = gtk_text_iter_get_offset(&iter);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line">reformat_ans(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='keyword'>if</span> (!equation->priv->ans_start)</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> gchar *orig_ans_text;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> gchar *ans_text;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> GtkTextIter ans_start, ans_end;</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_start, equation->priv->ans_start);</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_end, equation->priv->ans_end);</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> orig_ans_text = gtk_text_buffer_get_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_start, &ans_end, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> ans_text = mp_serializer_to_string(equation->priv->serializer, &equation->priv->state.ans);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> <span class='keyword'>if</span> (strcmp(orig_ans_text, ans_text) != 0) {</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> gint start;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> equation->priv->in_undo_operation = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> equation->priv->in_reformat = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> start = gtk_text_iter_get_offset(&ans_start);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> gtk_text_buffer_delete(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_start, &ans_end);</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> gtk_text_buffer_insert_with_tags(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_end, ans_text, -1, equation->priv->ans_tag, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='comment'>/* There seems to be a bug in the marks as they alternate being the correct and incorrect ways. Reset them */</span></td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_start, start);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> gtk_text_buffer_move_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_start, &ans_start);</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> gtk_text_buffer_move_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_end, &ans_end);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> equation->priv->in_reformat = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> equation->priv->in_undo_operation = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_start, equation->priv->ans_start);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &ans_end, equation->priv->ans_end);</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> g_free(orig_ans_text);</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> g_free(ans_text);</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"><span class='keyword'>static</span> gint</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line">count_digits(MathEquation *equation, <span class='keyword'>const</span> gchar *text)</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> <span class='keyword'>const</span> gchar *read_iter;</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> gint count = 0;</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> read_iter = text;</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>while</span> (*read_iter != '\0') {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>if</span> (!g_unichar_isdigit(g_utf8_get_char(read_iter)))</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='keyword'>return</span> count;</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> read_iter = <span class='macro'>g_utf8_next_char(read_iter)<span class='macro_popup'>(char *)((read_iter) + g_utf8_skip[*(const guchar *)(read_iter<br>)])</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>/* Allow a thousands separator between digits follow a digit */</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>if</span> (g_utf8_get_char(read_iter) == mp_serializer_get_thousands_separator(equation->priv->serializer)) {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> read_iter = <span class='macro'>g_utf8_next_char(read_iter)<span class='macro_popup'>(char *)((read_iter) + g_utf8_skip[*(const guchar *)(read_iter<br>)])</span></span>;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='keyword'>if</span> (!g_unichar_isdigit(g_utf8_get_char(read_iter)))</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>return</span> count;</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> count++;</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='keyword'>return</span> count;</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line">reformat_separators(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> gchar *text, *read_iter;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> gint ans_start, ans_end;</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> gint offset, digit_offset = 0;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> gboolean in_number = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, in_radix = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, last_is_tsep = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> equation->priv->in_undo_operation = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> equation->priv->in_reformat = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> text = math_equation_get_display(equation);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> get_ans_offsets(equation, &ans_start, &ans_end);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>for</span> (read_iter = text, offset = 0; *read_iter != '\0'; read_iter = <span class='macro'>g_utf8_next_char(read_iter)<span class='macro_popup'>(char *)((read_iter) + g_utf8_skip[*(const guchar *)(read_iter<br>)])</span></span>, offset++) {</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> gunichar c;</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> gboolean expect_tsep;</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='comment'>/* See what digit this character is */</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> c = g_utf8_get_char(read_iter);</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> expect_tsep = math_equation_get_base(equation) == 10 &&</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> mp_serializer_get_show_thousands_separators(equation->priv->serializer) &&</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> in_number && !in_radix && !last_is_tsep &&</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> digit_offset > 0 && digit_offset % mp_serializer_get_thousands_separator_count(equation->priv->serializer) == 0;</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> last_is_tsep = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='comment'>/* Don't mess with ans */</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>if</span> (offset >= ans_start && offset <= ans_end) {</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> in_number = in_radix = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (g_unichar_isdigit(c)) {</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='keyword'>if</span> (!in_number)</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> digit_offset = count_digits(equation, read_iter);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> in_number = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> <span class='comment'>/* Expected a thousands separator between these digits - insert it */</span></td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>if</span> (expect_tsep) {</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> GtkTextIter iter;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> gchar buffer[7];</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, offset);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> len = g_unichar_to_utf8(mp_serializer_get_thousands_separator(equation->priv->serializer), buffer);</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> buffer[len] = '\0';</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> gtk_text_buffer_insert(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, buffer, -1);</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> offset++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> last_is_tsep = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> digit_offset--;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (c == mp_serializer_get_radix(equation->priv->serializer)) {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> in_number = in_radix = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (c == mp_serializer_get_thousands_separator(equation->priv->serializer)) {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> <span class='comment'>/* Didn't expect thousands separator - delete it */</span></td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>if</span> (!expect_tsep && in_number) {</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, offset);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &end, offset + 1);</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> gtk_text_buffer_delete(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> offset--;</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> last_is_tsep = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> in_number = in_radix = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> equation->priv->in_reformat = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> equation->priv->in_undo_operation = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line">reformat_display(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='comment'>/* Change ans */</span></td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> reformat_ans(equation);</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='comment'>/* Add/remove thousands separators */</span></td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> reformat_separators(equation);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> g_signal_emit_by_name(equation, <span class='string_literal'>"display-changed"</span>);</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"><span class='keyword'>static</span> MathEquationState *</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line">get_current_state(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> MathEquationState *state;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> gint ans_start = -1, ans_end = -1;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> state = g_malloc0(<span class='keyword'>sizeof</span>(MathEquationState));</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> state->ans = mp_new();</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>if</span> (equation->priv->ans_start)</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> GtkTextIter iter;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, equation->priv->ans_start);</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> ans_start = gtk_text_iter_get_offset(&iter);</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, equation->priv->ans_end);</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> ans_end = gtk_text_iter_get_offset(&iter);</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> mp_set_from_mp(&equation->priv->state.ans, &state->ans);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> state->expression = math_equation_get_display(equation);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> state->ans_start = ans_start;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> state->ans_end = ans_end;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> g_object_get(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"cursor-position"</span>, &state->cursor, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> state->number_mode = equation->priv->number_mode;</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> state->can_super_minus = equation->priv->can_super_minus;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> state->entered_multiply = equation->priv->state.entered_multiply;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> state->status = g_strdup(equation->priv->state.status);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> <span class='keyword'>return</span> state;</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line">free_state(MathEquationState *state)</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> g_free(state->expression);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> g_free(state->status);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> g_free(state);</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line">math_equation_push_undo_stack(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> GList *link;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> MathEquationState *state;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_undo_operation)</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> math_equation_set_status(equation, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>/* Can't redo anymore */</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='keyword'>for</span> (link = equation->priv->redo_stack; link; link = link->next) {</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> state = link->data;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> free_state(state);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> g_list_free(equation->priv->redo_stack);</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> equation->priv->redo_stack = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> state = get_current_state(equation);</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> equation->priv->undo_stack = g_list_prepend(equation->priv->undo_stack, state);</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line">clear_ans(MathEquation *equation, gboolean remove_tag)</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>if</span> (!equation->priv->ans_start)</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>if</span> (remove_tag) {</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, equation->priv->ans_start);</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &end, equation->priv->ans_end);</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> gtk_text_buffer_remove_tag(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_tag, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gtk_text_buffer_delete_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_start);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> gtk_text_buffer_delete_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_end);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> equation->priv->ans_start = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> equation->priv->ans_end = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line">apply_state(MathEquation *equation, MathEquationState *state)</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> GtkTextIter cursor;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='comment'>/* Disable undo detection */</span></td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> equation->priv->in_undo_operation = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> mp_set_from_mp(&state->ans, &equation->priv->state.ans);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> gtk_text_buffer_set_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, state->expression, -1);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &cursor, state->cursor);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> gtk_text_buffer_place_cursor(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &cursor);</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> clear_ans(equation, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>if</span> (state->ans_start >= 0) {</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, state->ans_start);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> equation->priv->ans_start = gtk_text_buffer_create_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &start, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &end, state->ans_end);</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> equation->priv->ans_end = gtk_text_buffer_create_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &end, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> gtk_text_buffer_apply_tag(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_tag, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> math_equation_set_number_mode(equation, state->number_mode);</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> equation->priv->can_super_minus = state->can_super_minus;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> equation->priv->state.entered_multiply = state->entered_multiply;</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> math_equation_set_status(equation, state->status);</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> equation->priv->in_undo_operation = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line">math_equation_copy(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='keyword'>if</span> (!gtk_text_buffer_get_selection_bounds(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end))</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> gtk_text_buffer_get_bounds(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> text = gtk_text_buffer_get_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> gtk_clipboard_set_text(gtk_clipboard_get(<span class='macro'>GDK_NONE<span class='macro_popup'>((GdkAtom)((gpointer) (gulong) (0)))</span></span>), g_str_to_ascii (text, <span class='string_literal'>"C"</span>), -1);</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">on_paste(GtkClipboard *clipboard, <span class='keyword'>const</span> gchar *text, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> MathEquation *equation = data;</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> <span class='keyword'>if</span> (text != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> math_equation_insert(equation, text);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line">math_equation_paste(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> gtk_clipboard_request_text(gtk_clipboard_get(<span class='macro'>GDK_NONE<span class='macro_popup'>((GdkAtom)((gpointer) (gulong) (0)))</span></span>), on_paste, equation);</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line">math_equation_undo(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> GList *link;</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> MathEquationState *state;</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (!equation->priv->undo_stack) {</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> math_equation_set_status(equation,</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='comment'>/* Error shown when trying to undo with no undo history */</span></td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"No undo history"</span>)<span class='macro_popup'>dcgettext (((void*)0), "No undo history", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> link = equation->priv->undo_stack;</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> equation->priv->undo_stack = g_list_remove_link(equation->priv->undo_stack, link);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> state = link->data;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> g_list_free(link);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> equation->priv->redo_stack = g_list_prepend(equation->priv->redo_stack, get_current_state(equation));</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> apply_state(equation, state);</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> free_state(state);</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">math_equation_redo(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> GList *link;</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> MathEquationState *state;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (!equation->priv->redo_stack) {</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> math_equation_set_status(equation,</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='comment'>/* Error shown when trying to redo with no redo history */</span></td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"No redo history"</span>)<span class='macro_popup'>dcgettext (((void*)0), "No redo history", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> link = equation->priv->redo_stack;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> equation->priv->redo_stack = g_list_remove_link(equation->priv->redo_stack, link);</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> state = link->data;</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> g_list_free(link);</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> equation->priv->undo_stack = g_list_prepend(equation->priv->undo_stack, get_current_state(equation));</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> apply_state(equation, state);</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> free_state(state);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line">gunichar</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line">math_equation_get_digit_text(MathEquation *equation, guint digit)</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, '?')<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ('?'); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='macro'>g_return_val_if_fail(digit < 16, '?')<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (digit < 16) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "digit < 16");<br> return ('?'); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='keyword'>return</span> equation->priv->digits[digit];</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">math_equation_set_accuracy(MathEquation *equation, gint accuracy)</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>if</span> (mp_serializer_get_trailing_digits(equation->priv->serializer) == accuracy)</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> mp_serializer_set_trailing_digits(equation->priv->serializer, accuracy);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> reformat_display(equation);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"accuracy"</span>);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line">gint</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line">math_equation_get_accuracy(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, 0)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (0); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>return</span> mp_serializer_get_trailing_digits(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line">math_equation_set_show_thousands_separators(MathEquation *equation, gboolean visible)</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>if</span> (mp_serializer_get_show_thousands_separators(equation->priv->serializer) == visible)</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> mp_serializer_set_show_thousands_separators(equation->priv->serializer, visible);</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> reformat_display(equation);</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"show-thousands-separators"</span>);</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line">math_equation_get_show_thousands_separators(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> <span class='keyword'>return</span> mp_serializer_get_show_thousands_separators(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">math_equation_set_show_trailing_zeroes(MathEquation *equation, gboolean visible)</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> <span class='keyword'>if</span> (mp_serializer_get_show_trailing_zeroes(equation->priv->serializer) == visible)</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> mp_serializer_set_show_trailing_zeroes(equation->priv->serializer, visible);</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> reformat_display(equation);</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"show-trailing-zeroes"</span>);</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line">math_equation_get_show_trailing_zeroes(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='keyword'>return</span> mp_serializer_get_show_trailing_zeroes(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line">math_equation_set_number_format(MathEquation *equation, MpDisplayFormat format)</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='keyword'>if</span> (mp_serializer_get_number_format(equation->priv->serializer) == format)</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> mp_serializer_set_number_format(equation->priv->serializer, format);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> reformat_display(equation);</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"number-format"</span>);</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line">MpDisplayFormat</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line">math_equation_get_number_format(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, MP_DISPLAY_FORMAT_AUTOMATIC)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (MP_DISPLAY_FORMAT_AUTOMATIC); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> <span class='keyword'>return</span> mp_serializer_get_number_format(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">math_equation_set_base(MathEquation *equation, gint base)</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span> (mp_serializer_get_base(equation->priv->serializer) == base)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mp_serializer_set_base(equation->priv->serializer, base);</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> reformat_display(equation);</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"base"</span>);</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line">gint</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line">math_equation_get_base(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, 10)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (10); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>return</span> mp_serializer_get_base(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line">math_equation_set_word_size(MathEquation *equation, gint word_size)</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> <span class='keyword'>if</span> (equation->priv->word_size == word_size)</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> equation->priv->word_size = word_size;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"word-size"</span>);</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line">gint</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line">math_equation_get_word_size(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, 64)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (64); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> <span class='keyword'>return</span> equation->priv->word_size;</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line">math_equation_set_angle_units(MathEquation *equation, MPAngleUnit angle_units)</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> <span class='keyword'>if</span> (equation->priv->angle_units == angle_units)</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> equation->priv->angle_units = angle_units;</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"angle-units"</span>);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line">MPAngleUnit</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">math_equation_get_angle_units(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, MP_DEGREES)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (MP_DEGREES); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> <span class='keyword'>return</span> equation->priv->angle_units;</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line">math_equation_set_source_currency(MathEquation *equation, <span class='keyword'>const</span> gchar *currency)</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='macro'>g_return_if_fail(currency != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (currency != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "currency != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> <span class='keyword'>if</span> (strcmp(equation->priv->source_currency, currency) == 0)</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> g_free(equation->priv->source_currency);</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> equation->priv->source_currency = g_strdup(currency);</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> g_settings_set_string(g_settings_var, <span class='string_literal'>"source-currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> math_equation_get_source_currency(equation));</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"><span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line">math_equation_get_source_currency(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> <span class='keyword'>return</span> equation->priv->source_currency;</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line">math_equation_set_target_currency(MathEquation *equation, <span class='keyword'>const</span> gchar *currency)</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> <span class='macro'>g_return_if_fail(currency != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (currency != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "currency != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> <span class='keyword'>if</span> (strcmp(equation->priv->target_currency, currency) == 0)</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> g_free(equation->priv->target_currency);</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> equation->priv->target_currency = g_strdup(currency);</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> g_settings_set_string(g_settings_var, <span class='string_literal'>"target-currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> math_equation_get_target_currency(equation));</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"><span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line">math_equation_get_target_currency(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> <span class='keyword'>return</span> equation->priv->target_currency;</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line">math_equation_set_source_units(MathEquation *equation, <span class='keyword'>const</span> gchar *units)</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> <span class='macro'>g_return_if_fail(units != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (units != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "units != NULL");<br> return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> <span class='keyword'>if</span> (strcmp(equation->priv->source_units, units) == 0)</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> g_free(equation->priv->source_units);</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> equation->priv->source_units = g_strdup(units);</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> g_settings_set_string(g_settings_var, <span class='string_literal'>"source-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> math_equation_get_source_units(equation));</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"><span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line">math_equation_get_source_units(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> <span class='keyword'>return</span> equation->priv->source_units;</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line">math_equation_set_target_units(MathEquation *equation, <span class='keyword'>const</span> gchar *units)</td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> <span class='macro'>g_return_if_fail(units != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (units != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "units != NULL");<br> return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='keyword'>if</span> (strcmp(equation->priv->target_units, units) == 0)</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> g_free(equation->priv->target_units);</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> equation->priv->target_units = g_strdup(units);</td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> g_settings_set_string(g_settings_var, <span class='string_literal'>"target-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> math_equation_get_target_units(equation));</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"><span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line">math_equation_get_target_units(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> <span class='keyword'>return</span> equation->priv->target_units;</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line">math_equation_set_status(MathEquation *equation, <span class='keyword'>const</span> gchar *status)</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> <span class='macro'>g_return_if_fail(status != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (status != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "status != NULL")<br>; return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> <span class='keyword'>if</span> (strcmp(equation->priv->state.status, status) == 0)</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> g_free(equation->priv->state.status);</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> equation->priv->state.status = g_strdup(status);</td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"status"</span>);</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"><span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line">math_equation_get_status(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> <span class='keyword'>return</span> equation->priv->state.status;</td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line">math_equation_is_empty(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> <span class='keyword'>return</span> gtk_text_buffer_get_char_count(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line">math_equation_is_result(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> <span class='keyword'>char</span> *text;</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> gboolean result;</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> text = math_equation_get_equation(equation);</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> result = strcmp(text, <span class='string_literal'>"ans"</span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> <span class='keyword'>return</span> result;</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line">gchar *</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line">math_equation_get_display(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> gtk_text_buffer_get_bounds(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> <span class='keyword'>return</span> gtk_text_buffer_get_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line">gchar *</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line">math_equation_get_equation(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> GString *eq_text;</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> gint ans_start = -1, ans_end = -1, offset;</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> <span class='keyword'>const</span> gchar *read_iter;</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> gboolean last_is_digit = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> text = math_equation_get_display(equation);</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> eq_text = g_string_sized_new(strlen(text));</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> <span class='keyword'>if</span> (equation->priv->ans_start)</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> get_ans_offsets(equation, &ans_start, &ans_end);</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> <span class='keyword'>for</span> (read_iter = text, offset = 0; *read_iter != '\0'; read_iter = <span class='macro'>g_utf8_next_char(read_iter)<span class='macro_popup'>(char *)((read_iter) + g_utf8_skip[*(const guchar *)(read_iter<br>)])</span></span>, offset++) {</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> gunichar c;</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> gboolean is_digit, next_is_digit;</td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line"> c = g_utf8_get_char(read_iter);</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> is_digit = g_unichar_isdigit(c);</td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> next_is_digit = g_unichar_isdigit(g_utf8_get_char(<span class='macro'>g_utf8_next_char(read_iter)<span class='macro_popup'>(char *)((read_iter) + g_utf8_skip[*(const guchar *)(read_iter<br>)])</span></span>));</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> <span class='comment'>/* Replace ans text with variable */</span></td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> <span class='keyword'>if</span> (offset == ans_start) {</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line"> g_string_append(eq_text, <span class='string_literal'>"ans"</span>);</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line"> read_iter = g_utf8_offset_to_pointer(read_iter, ans_end - ans_start - 1);</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> offset += ans_end - ans_start - 1;</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> is_digit = <span class="mrange"><span class='macro'>FALSE<span class='macro_popup'>(0)</span></span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:14ex">Value stored to 'is_digit' is never read</div></td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> <span class='comment'>/* Ignore thousands separators */</span></td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> <span class='keyword'>if</span> (c == mp_serializer_get_thousands_separator(equation->priv->serializer) && last_is_digit && next_is_digit)</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> ;</td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> <span class='comment'>/* Substitute radix character */</span></td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (c == mp_serializer_get_radix(equation->priv->serializer) && (last_is_digit || next_is_digit))</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> g_string_append_unichar(eq_text, '.');</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> g_string_append_unichar(eq_text, c);</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> last_is_digit = is_digit;</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> text = eq_text->str;</td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> g_string_free(eq_text, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> <span class='keyword'>return</span> text;</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line">math_equation_get_number(MathEquation *equation, MPNumber *z)</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> gboolean result;</td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> <span class='macro'>g_return_val_if_fail(z != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (z != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "z != NULL"); return<br> ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> <span class='keyword'>if</span> (math_equation_is_result(equation)) {</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> mp_set_from_mp(math_equation_get_answer(equation), z);</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> text = math_equation_get_equation(equation);</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> result = !mp_serializer_from_string(equation->priv->serializer, text, z);</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> <span class='keyword'>return</span> result;</td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line">MpSerializer *</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line">math_equation_get_serializer(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> <span class='keyword'>return</span> equation->priv->serializer;</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line">math_equation_set_number_mode(MathEquation *equation, NumberMode mode)</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> <span class='keyword'>if</span> (equation->priv->number_mode == mode)</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> equation->priv->can_super_minus = mode == SUPERSCRIPT;</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> equation->priv->number_mode = mode;</td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"number-mode"</span>);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line">NumberMode</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line">math_equation_get_number_mode(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, NORMAL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return (NORMAL); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> <span class='keyword'>return</span> equation->priv->number_mode;</td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line">math_equation_in_solve(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> <span class='keyword'>return</span> equation->priv->in_solve;</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"><span class='keyword'>const</span> MPNumber *</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line">math_equation_get_answer(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> <span class='macro'>g_return_val_if_fail(equation != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> <span class='keyword'>return</span> &equation->priv->state.ans;</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line">math_equation_store(MathEquation *equation, <span class='keyword'>const</span> gchar *name)</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> MPNumber t = mp_new();</td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> <span class='macro'>g_return_if_fail(name != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (name != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "name != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> <span class='keyword'>if</span> (!math_equation_get_number(equation, &t))</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> math_equation_set_status(equation, <span class='macro'>_(<span class='string_literal'>"No sane value to store"</span>)<span class='macro_popup'>dcgettext (((void*)0), "No sane value to store", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> math_variables_set(equation->priv->variables, name, &t);</td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> mp_clear(&t);</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line">math_equation_recall(MathEquation *equation, <span class='keyword'>const</span> gchar *name)</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> <span class='macro'>g_return_if_fail(name != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (name != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "name != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> math_equation_insert(equation, name);</td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line">math_equation_set(MathEquation *equation, <span class='keyword'>const</span> gchar *text)</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> <span class='macro'>g_return_if_fail(text != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (text != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "text != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> gtk_text_buffer_set_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, text, -1);</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> clear_ans(equation, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line">math_equation_set_with_history(MathEquation *equation, <span class='keyword'>const</span> gchar *text)</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> MathEquationState *state;</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> MPNumber x = mp_new();</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> math_equation_get_number(equation, &x);</td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> math_equation_set(equation, text);</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> <span class='comment'>/* Notify history */</span></td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> state = get_current_state(equation);</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> g_signal_emit_by_name(equation, <span class='string_literal'>"history"</span>, state->expression, &x);</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> free_state(state);</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line">math_equation_set_number(MathEquation *equation, <span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> <span class='keyword'>char</span> *text;</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> MathEquationState *state;</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> <span class='macro'>g_return_if_fail(x != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (x != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "x != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> <span class='comment'>/* Notify history */</span></td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> state = get_current_state(equation);</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> g_signal_emit_by_name(equation, <span class='string_literal'>"history"</span>, state->expression, x);</td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> <span class='comment'>/* Show the number in the user chosen format */</span></td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> text = mp_serializer_to_string(equation->priv->serializer, x);</td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> gtk_text_buffer_set_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, text, -1);</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line"> mp_set_from_mp(x, &equation->priv->state.ans);</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"> <span class='comment'>/* Mark this text as the answer variable */</span></td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"> gtk_text_buffer_get_bounds(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"> clear_ans(equation, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"> equation->priv->ans_start = gtk_text_buffer_create_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &start, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> equation->priv->ans_end = gtk_text_buffer_create_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &end, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> gtk_text_buffer_apply_tag(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, equation->priv->ans_tag, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"display"</span>);</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> free_state(state);</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line">math_equation_insert(MathEquation *equation, <span class='keyword'>const</span> gchar *text)</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> <span class='macro'>g_return_if_fail(text != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (text != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "text != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> <span class='comment'>/* Replace ** with ^ (not on all keyboards) */</span></td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> <span class='keyword'>if</span> (!gtk_text_buffer_get_has_selection(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>) &&</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> strcmp(text, <span class='string_literal'>"×"</span>) == 0 && equation->priv->state.entered_multiply) {</td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> GtkTextIter iter;</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, gtk_text_buffer_get_insert(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>));</td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"> gtk_text_buffer_backspace(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line"> gtk_text_buffer_insert_at_cursor(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='string_literal'>"^"</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> <span class='comment'>/* Can't enter superscript minus after entering digits */</span></td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> <span class='keyword'>if</span> (strstr(<span class='string_literal'>"⁰¹²³⁴⁵⁶⁷⁸⁹"</span>, text) != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> || strcmp(<span class='string_literal'>"⁻"</span>, text) == 0)</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> equation->priv->can_super_minus = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> <span class='comment'>/* Disable super/subscript mode when finished entering */</span></td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"> <span class='keyword'>if</span> (strstr(<span class='string_literal'>"⁻⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉"</span>, text) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line"> math_equation_set_number_mode(equation, NORMAL);</td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line"> gtk_text_buffer_delete_selection(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> gtk_text_buffer_insert_at_cursor(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, text, -1);</td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line">math_equation_insert_digit(MathEquation *equation, guint digit)</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> *subscript_digits[] = {<span class='string_literal'>"₀"</span>, <span class='string_literal'>"₁"</span>, <span class='string_literal'>"₂"</span>, <span class='string_literal'>"₃"</span>, <span class='string_literal'>"₄"</span>, <span class='string_literal'>"₅"</span>, <span class='string_literal'>"₆"</span>, <span class='string_literal'>"₇"</span>, <span class='string_literal'>"₈"</span>, <span class='string_literal'>"₉"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>};</td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> *superscript_digits[] = {<span class='string_literal'>"⁰"</span>, <span class='string_literal'>"¹"</span>, <span class='string_literal'>"²"</span>, <span class='string_literal'>"³"</span>, <span class='string_literal'>"⁴"</span>, <span class='string_literal'>"⁵"</span>, <span class='string_literal'>"⁶"</span>, <span class='string_literal'>"⁷"</span>, <span class='string_literal'>"⁸"</span>, <span class='string_literal'>"⁹"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>};</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"> <span class='macro'>g_return_if_fail(digit < 16)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (digit < 16) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "digit < 16");<br> return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> <span class='keyword'>if</span> (equation->priv->number_mode == NORMAL || digit >= 10) {</td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line"> gchar buffer[7];</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"> len = g_unichar_to_utf8(math_equation_get_digit_text(equation, digit), buffer);</td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"> buffer[len] = '\0';</td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line"> math_equation_insert(equation, buffer);</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (equation->priv->number_mode == SUPERSCRIPT)</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line"> math_equation_insert(equation, superscript_digits[digit]);</td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (equation->priv->number_mode == SUBSCRIPT)</td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"> math_equation_insert(equation, subscript_digits[digit]);</td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line">math_equation_insert_numeric_point(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line"> gchar buffer[7];</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> len = g_unichar_to_utf8(mp_serializer_get_radix(equation->priv->serializer), buffer);</td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> buffer[len] = '\0';</td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> math_equation_insert(equation, buffer);</td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line">math_equation_insert_number(MathEquation *equation, <span class='keyword'>const</span> MPNumber *x)</td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line"> <span class='keyword'>char</span> *text;</td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line"> <span class='macro'>g_return_if_fail(x != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (x != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "x != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> text = mp_serializer_to_string(equation->priv->serializer, x);</td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line"> math_equation_insert(equation, text);</td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line">math_equation_insert_exponent(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> math_equation_insert(equation, <span class='string_literal'>"×10"</span>);</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> math_equation_set_number_mode(equation, SUPERSCRIPT);</td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line">math_equation_insert_subtract(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> <span class='keyword'>if</span> (equation->priv->number_mode == SUPERSCRIPT && equation->priv->can_super_minus) {</td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line"> math_equation_insert(equation, <span class='string_literal'>"⁻"</span>);</td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line"> equation->priv->can_super_minus = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"> math_equation_insert(equation, <span class='string_literal'>"−"</span>);</td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line"> math_equation_set_number_mode(equation, NORMAL);</td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line">variable_is_defined(<span class='keyword'>const</span> <span class='keyword'>char</span> *name, <span class='keyword'>void</span> *data)</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"> MathEquation *equation = data;</td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line"> <span class='keyword'>char</span> *c, *lower_name;</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"> lower_name = strdup(name);</td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line"> <span class='keyword'>for</span> (c = lower_name; *c; c++)</td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line"> *c = <span class='macro'>tolower(*c)<span class='macro_popup'>(__extension__ ({ int __res; if (sizeof (*c) > 1) { if (__builtin_constant_p<br> (*c)) { int __c = (*c); __res = __c < -128 || __c > 255<br> ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower<br> (*c); } else __res = (*__ctype_tolower_loc ())[(int) (*c)]; __res<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1077"><td class="num" id="LN1077">1077</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1078"><td class="num" id="LN1078">1078</td><td class="line"> <span class='keyword'>if</span> (strcmp(lower_name, <span class='string_literal'>"rand"</span>) == 0 ||</td></tr> +<tr class="codeline" data-linenumber="1079"><td class="num" id="LN1079">1079</td><td class="line"> strcmp(lower_name, <span class='string_literal'>"ans"</span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1080"><td class="num" id="LN1080">1080</td><td class="line"> g_free(lower_name);</td></tr> +<tr class="codeline" data-linenumber="1081"><td class="num" id="LN1081">1081</td><td class="line"> <span class='keyword'>return</span> 1;</td></tr> +<tr class="codeline" data-linenumber="1082"><td class="num" id="LN1082">1082</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1083"><td class="num" id="LN1083">1083</td><td class="line"> g_free(lower_name);</td></tr> +<tr class="codeline" data-linenumber="1084"><td class="num" id="LN1084">1084</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1085"><td class="num" id="LN1085">1085</td><td class="line"> <span class='keyword'>return</span> math_variables_get(equation->priv->variables, name) != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1086"><td class="num" id="LN1086">1086</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1087"><td class="num" id="LN1087">1087</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1088"><td class="num" id="LN1088">1088</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="1089"><td class="num" id="LN1089">1089</td><td class="line">get_variable(<span class='keyword'>const</span> <span class='keyword'>char</span> *name, MPNumber *z, <span class='keyword'>void</span> *data)</td></tr> +<tr class="codeline" data-linenumber="1090"><td class="num" id="LN1090">1090</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1091"><td class="num" id="LN1091">1091</td><td class="line"> <span class='keyword'>char</span> *c, *lower_name;</td></tr> +<tr class="codeline" data-linenumber="1092"><td class="num" id="LN1092">1092</td><td class="line"> <span class='keyword'>int</span> result = 1;</td></tr> +<tr class="codeline" data-linenumber="1093"><td class="num" id="LN1093">1093</td><td class="line"> MathEquation *equation = data;</td></tr> +<tr class="codeline" data-linenumber="1094"><td class="num" id="LN1094">1094</td><td class="line"> MPNumber *t;</td></tr> +<tr class="codeline" data-linenumber="1095"><td class="num" id="LN1095">1095</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1096"><td class="num" id="LN1096">1096</td><td class="line"> lower_name = strdup(name);</td></tr> +<tr class="codeline" data-linenumber="1097"><td class="num" id="LN1097">1097</td><td class="line"> <span class='keyword'>for</span> (c = lower_name; *c; c++)</td></tr> +<tr class="codeline" data-linenumber="1098"><td class="num" id="LN1098">1098</td><td class="line"> *c = <span class='macro'>tolower(*c)<span class='macro_popup'>(__extension__ ({ int __res; if (sizeof (*c) > 1) { if (__builtin_constant_p<br> (*c)) { int __c = (*c); __res = __c < -128 || __c > 255<br> ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower<br> (*c); } else __res = (*__ctype_tolower_loc ())[(int) (*c)]; __res<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1099"><td class="num" id="LN1099">1099</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1100"><td class="num" id="LN1100">1100</td><td class="line"> <span class='keyword'>if</span> (strcmp(lower_name, <span class='string_literal'>"rand"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="1101"><td class="num" id="LN1101">1101</td><td class="line"> mp_set_from_random(z);</td></tr> +<tr class="codeline" data-linenumber="1102"><td class="num" id="LN1102">1102</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (strcmp(lower_name, <span class='string_literal'>"ans"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="1103"><td class="num" id="LN1103">1103</td><td class="line"> mp_set_from_mp(&equation->priv->state.ans, z);</td></tr> +<tr class="codeline" data-linenumber="1104"><td class="num" id="LN1104">1104</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1105"><td class="num" id="LN1105">1105</td><td class="line"> t = math_variables_get(equation->priv->variables, name);</td></tr> +<tr class="codeline" data-linenumber="1106"><td class="num" id="LN1106">1106</td><td class="line"> <span class='keyword'>if</span> (t)</td></tr> +<tr class="codeline" data-linenumber="1107"><td class="num" id="LN1107">1107</td><td class="line"> mp_set_from_mp(t, z);</td></tr> +<tr class="codeline" data-linenumber="1108"><td class="num" id="LN1108">1108</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1109"><td class="num" id="LN1109">1109</td><td class="line"> result = 0;</td></tr> +<tr class="codeline" data-linenumber="1110"><td class="num" id="LN1110">1110</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1111"><td class="num" id="LN1111">1111</td><td class="line"> free(lower_name);</td></tr> +<tr class="codeline" data-linenumber="1112"><td class="num" id="LN1112">1112</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1113"><td class="num" id="LN1113">1113</td><td class="line"> <span class='keyword'>return</span> result;</td></tr> +<tr class="codeline" data-linenumber="1114"><td class="num" id="LN1114">1114</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1115"><td class="num" id="LN1115">1115</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1116"><td class="num" id="LN1116">1116</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1117"><td class="num" id="LN1117">1117</td><td class="line">set_variable(<span class='keyword'>const</span> <span class='keyword'>char</span> *name, <span class='keyword'>const</span> MPNumber *x, <span class='keyword'>void</span> *data)</td></tr> +<tr class="codeline" data-linenumber="1118"><td class="num" id="LN1118">1118</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1119"><td class="num" id="LN1119">1119</td><td class="line"> MathEquation *equation = data;</td></tr> +<tr class="codeline" data-linenumber="1120"><td class="num" id="LN1120">1120</td><td class="line"> <span class='comment'>/* FIXME: Don't allow writing to built-in variables, e.g. ans, rand, sin, ... */</span></td></tr> +<tr class="codeline" data-linenumber="1121"><td class="num" id="LN1121">1121</td><td class="line"> math_variables_set(equation->priv->variables, name, x);</td></tr> +<tr class="codeline" data-linenumber="1122"><td class="num" id="LN1122">1122</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1123"><td class="num" id="LN1123">1123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1124"><td class="num" id="LN1124">1124</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="1125"><td class="num" id="LN1125">1125</td><td class="line">convert(<span class='keyword'>const</span> MPNumber *x, <span class='keyword'>const</span> <span class='keyword'>char</span> *x_units, <span class='keyword'>const</span> <span class='keyword'>char</span> *z_units, MPNumber *z, <span class='keyword'>void</span> *data)</td></tr> +<tr class="codeline" data-linenumber="1126"><td class="num" id="LN1126">1126</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1127"><td class="num" id="LN1127">1127</td><td class="line"> <span class='keyword'>return</span> unit_manager_convert_by_symbol(unit_manager_get_default(), x, x_units, z_units, z);</td></tr> +<tr class="codeline" data-linenumber="1128"><td class="num" id="LN1128">1128</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1129"><td class="num" id="LN1129">1129</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1130"><td class="num" id="LN1130">1130</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="1131"><td class="num" id="LN1131">1131</td><td class="line">parse(MathEquation *equation, <span class='keyword'>const</span> <span class='keyword'>char</span> *text, MPNumber *z, <span class='keyword'>char</span> **error_token)</td></tr> +<tr class="codeline" data-linenumber="1132"><td class="num" id="LN1132">1132</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1133"><td class="num" id="LN1133">1133</td><td class="line"> MPEquationOptions options;</td></tr> +<tr class="codeline" data-linenumber="1134"><td class="num" id="LN1134">1134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1135"><td class="num" id="LN1135">1135</td><td class="line"> memset(&options, 0, <span class='keyword'>sizeof</span>(options));</td></tr> +<tr class="codeline" data-linenumber="1136"><td class="num" id="LN1136">1136</td><td class="line"> options.base = mp_serializer_get_base(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="1137"><td class="num" id="LN1137">1137</td><td class="line"> options.wordlen = equation->priv->word_size;</td></tr> +<tr class="codeline" data-linenumber="1138"><td class="num" id="LN1138">1138</td><td class="line"> options.angle_units = equation->priv->angle_units;</td></tr> +<tr class="codeline" data-linenumber="1139"><td class="num" id="LN1139">1139</td><td class="line"> options.variable_is_defined = variable_is_defined;</td></tr> +<tr class="codeline" data-linenumber="1140"><td class="num" id="LN1140">1140</td><td class="line"> options.get_variable = get_variable;</td></tr> +<tr class="codeline" data-linenumber="1141"><td class="num" id="LN1141">1141</td><td class="line"> options.set_variable = set_variable;</td></tr> +<tr class="codeline" data-linenumber="1142"><td class="num" id="LN1142">1142</td><td class="line"> options.convert = convert;</td></tr> +<tr class="codeline" data-linenumber="1143"><td class="num" id="LN1143">1143</td><td class="line"> options.callback_data = equation;</td></tr> +<tr class="codeline" data-linenumber="1144"><td class="num" id="LN1144">1144</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1145"><td class="num" id="LN1145">1145</td><td class="line"> <span class='keyword'>return</span> mp_equation_parse(text, &options, z, error_token);</td></tr> +<tr class="codeline" data-linenumber="1146"><td class="num" id="LN1146">1146</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1147"><td class="num" id="LN1147">1147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1148"><td class="num" id="LN1148">1148</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="1149"><td class="num" id="LN1149">1149</td><td class="line"> <span class='comment'>* Executed in separate thread. It is thus not a good idea to write to anything</span></td></tr> +<tr class="codeline" data-linenumber="1150"><td class="num" id="LN1150">1150</td><td class="line"> <span class='comment'>* in MathEquation but the async queue from here.</span></td></tr> +<tr class="codeline" data-linenumber="1151"><td class="num" id="LN1151">1151</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1152"><td class="num" id="LN1152">1152</td><td class="line"><span class='keyword'>static</span> gpointer</td></tr> +<tr class="codeline" data-linenumber="1153"><td class="num" id="LN1153">1153</td><td class="line">math_equation_solve_real(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="1154"><td class="num" id="LN1154">1154</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1155"><td class="num" id="LN1155">1155</td><td class="line"> MathEquation *equation = <span class='macro'>MATH_EQUATION(data)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((data)), (math_equation_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1156"><td class="num" id="LN1156">1156</td><td class="line"> SolveData *solvedata = <span class='macro'>g_slice_new0(SolveData)<span class='macro_popup'>(SolveData *) (__extension__ ({ gsize __s = sizeof (SolveData<br>); gpointer __p; __p = g_slice_alloc (__s); memset (__p, 0, __s<br>); __p; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1157"><td class="num" id="LN1157">1157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1158"><td class="num" id="LN1158">1158</td><td class="line"> gint n_brackets = 0, result;</td></tr> +<tr class="codeline" data-linenumber="1159"><td class="num" id="LN1159">1159</td><td class="line"> gchar *c, *text, *error_token;</td></tr> +<tr class="codeline" data-linenumber="1160"><td class="num" id="LN1160">1160</td><td class="line"> GString *equation_text;</td></tr> +<tr class="codeline" data-linenumber="1161"><td class="num" id="LN1161">1161</td><td class="line"> MPNumber z = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1162"><td class="num" id="LN1162">1162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1163"><td class="num" id="LN1163">1163</td><td class="line"> text = math_equation_get_equation(equation);</td></tr> +<tr class="codeline" data-linenumber="1164"><td class="num" id="LN1164">1164</td><td class="line"> equation_text = g_string_new(text);</td></tr> +<tr class="codeline" data-linenumber="1165"><td class="num" id="LN1165">1165</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="1166"><td class="num" id="LN1166">1166</td><td class="line"> <span class='comment'>/* Count the number of brackets and automatically add missing closing brackets */</span></td></tr> +<tr class="codeline" data-linenumber="1167"><td class="num" id="LN1167">1167</td><td class="line"> <span class='keyword'>for</span> (c = equation_text->str; *c; c++) {</td></tr> +<tr class="codeline" data-linenumber="1168"><td class="num" id="LN1168">1168</td><td class="line"> <span class='keyword'>if</span> (*c == '(')</td></tr> +<tr class="codeline" data-linenumber="1169"><td class="num" id="LN1169">1169</td><td class="line"> n_brackets++;</td></tr> +<tr class="codeline" data-linenumber="1170"><td class="num" id="LN1170">1170</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (*c == ')')</td></tr> +<tr class="codeline" data-linenumber="1171"><td class="num" id="LN1171">1171</td><td class="line"> n_brackets--;</td></tr> +<tr class="codeline" data-linenumber="1172"><td class="num" id="LN1172">1172</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1173"><td class="num" id="LN1173">1173</td><td class="line"> <span class='keyword'>while</span> (n_brackets > 0) {</td></tr> +<tr class="codeline" data-linenumber="1174"><td class="num" id="LN1174">1174</td><td class="line"> <span class='macro'>g_string_append_c(equation_text, ')')<span class='macro_popup'>g_string_append_c_inline (equation_text, ')')</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1175"><td class="num" id="LN1175">1175</td><td class="line"> n_brackets--;</td></tr> +<tr class="codeline" data-linenumber="1176"><td class="num" id="LN1176">1176</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1177"><td class="num" id="LN1177">1177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1178"><td class="num" id="LN1178">1178</td><td class="line"> result = parse(equation, equation_text->str, &z, &error_token);</td></tr> +<tr class="codeline" data-linenumber="1179"><td class="num" id="LN1179">1179</td><td class="line"> g_string_free(equation_text, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1180"><td class="num" id="LN1180">1180</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1181"><td class="num" id="LN1181">1181</td><td class="line"> <span class='keyword'>switch</span> (result) {</td></tr> +<tr class="codeline" data-linenumber="1182"><td class="num" id="LN1182">1182</td><td class="line"> <span class='keyword'>case</span> PARSER_ERR_NONE:</td></tr> +<tr class="codeline" data-linenumber="1183"><td class="num" id="LN1183">1183</td><td class="line"> solvedata->number_result = <span class='macro'>g_slice_new(MPNumber)<span class='macro_popup'>((MPNumber*) g_slice_alloc (sizeof (MPNumber)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1184"><td class="num" id="LN1184">1184</td><td class="line"> *solvedata->number_result = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1185"><td class="num" id="LN1185">1185</td><td class="line"> mp_set_from_mp(&z, solvedata->number_result);</td></tr> +<tr class="codeline" data-linenumber="1186"><td class="num" id="LN1186">1186</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1187"><td class="num" id="LN1187">1187</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1188"><td class="num" id="LN1188">1188</td><td class="line"> <span class='keyword'>case</span> PARSER_ERR_OVERFLOW:</td></tr> +<tr class="codeline" data-linenumber="1189"><td class="num" id="LN1189">1189</td><td class="line"> solvedata->error = g_strdup(<span class='comment'>/* Error displayed to user when they perform a bitwise operation on numbers greater than the current word */</span></td></tr> +<tr class="codeline" data-linenumber="1190"><td class="num" id="LN1190">1190</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Overflow. Try a bigger word size"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Overflow. Try a bigger word size", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1191"><td class="num" id="LN1191">1191</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1192"><td class="num" id="LN1192">1192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1193"><td class="num" id="LN1193">1193</td><td class="line"> <span class='keyword'>case</span> PARSER_ERR_UNKNOWN_VARIABLE:</td></tr> +<tr class="codeline" data-linenumber="1194"><td class="num" id="LN1194">1194</td><td class="line"> solvedata->error = g_strdup_printf(<span class='comment'>/* Error displayed to user when they an unknown variable is entered */</span></td></tr> +<tr class="codeline" data-linenumber="1195"><td class="num" id="LN1195">1195</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Unknown variable '%s'"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Unknown variable '%s'", 5)</span></span>, error_token);</td></tr> +<tr class="codeline" data-linenumber="1196"><td class="num" id="LN1196">1196</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1197"><td class="num" id="LN1197">1197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1198"><td class="num" id="LN1198">1198</td><td class="line"> <span class='keyword'>case</span> PARSER_ERR_UNKNOWN_FUNCTION:</td></tr> +<tr class="codeline" data-linenumber="1199"><td class="num" id="LN1199">1199</td><td class="line"> solvedata->error = g_strdup_printf(<span class='comment'>/* Error displayed to user when an unknown function is entered */</span></td></tr> +<tr class="codeline" data-linenumber="1200"><td class="num" id="LN1200">1200</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Function '%s' is not defined"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Function '%s' is not defined", 5)</span></span>, error_token);</td></tr> +<tr class="codeline" data-linenumber="1201"><td class="num" id="LN1201">1201</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1202"><td class="num" id="LN1202">1202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1203"><td class="num" id="LN1203">1203</td><td class="line"> <span class='keyword'>case</span> PARSER_ERR_UNKNOWN_CONVERSION:</td></tr> +<tr class="codeline" data-linenumber="1204"><td class="num" id="LN1204">1204</td><td class="line"> solvedata->error = g_strdup(<span class='comment'>/* Error displayed to user when an conversion with unknown units is attempted */</span></td></tr> +<tr class="codeline" data-linenumber="1205"><td class="num" id="LN1205">1205</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Unknown conversion"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Unknown conversion", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1206"><td class="num" id="LN1206">1206</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1207"><td class="num" id="LN1207">1207</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1208"><td class="num" id="LN1208">1208</td><td class="line"> <span class='keyword'>case</span> PARSER_ERR_MP:</td></tr> +<tr class="codeline" data-linenumber="1209"><td class="num" id="LN1209">1209</td><td class="line"> <span class='keyword'>if</span> (mp_get_error())</td></tr> +<tr class="codeline" data-linenumber="1210"><td class="num" id="LN1210">1210</td><td class="line"> solvedata->error = g_strdup(mp_get_error());</td></tr> +<tr class="codeline" data-linenumber="1211"><td class="num" id="LN1211">1211</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (error_token)</td></tr> +<tr class="codeline" data-linenumber="1212"><td class="num" id="LN1212">1212</td><td class="line"> solvedata->error = g_strdup_printf(<span class='comment'>/* Uncategorized error. Show error token to user*/</span></td></tr> +<tr class="codeline" data-linenumber="1213"><td class="num" id="LN1213">1213</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Malformed expression at token '%s'"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Malformed expression at token '%s'", 5<br>)</span></span>, error_token);</td></tr> +<tr class="codeline" data-linenumber="1214"><td class="num" id="LN1214">1214</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1215"><td class="num" id="LN1215">1215</td><td class="line"> solvedata->error = g_strdup (<span class='comment'>/* Unknown error. */</span></td></tr> +<tr class="codeline" data-linenumber="1216"><td class="num" id="LN1216">1216</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Malformed expression"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Malformed expression", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1217"><td class="num" id="LN1217">1217</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1218"><td class="num" id="LN1218">1218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1219"><td class="num" id="LN1219">1219</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1220"><td class="num" id="LN1220">1220</td><td class="line"> solvedata->error = g_strdup(<span class='comment'>/* Error displayed to user when they enter an invalid calculation */</span></td></tr> +<tr class="codeline" data-linenumber="1221"><td class="num" id="LN1221">1221</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Malformed expression"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Malformed expression", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1222"><td class="num" id="LN1222">1222</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1223"><td class="num" id="LN1223">1223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1224"><td class="num" id="LN1224">1224</td><td class="line"> g_async_queue_push(equation->priv->queue, solvedata);</td></tr> +<tr class="codeline" data-linenumber="1225"><td class="num" id="LN1225">1225</td><td class="line"> mp_clear(&z);</td></tr> +<tr class="codeline" data-linenumber="1226"><td class="num" id="LN1226">1226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1227"><td class="num" id="LN1227">1227</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1228"><td class="num" id="LN1228">1228</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1229"><td class="num" id="LN1229">1229</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1230"><td class="num" id="LN1230">1230</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1231"><td class="num" id="LN1231">1231</td><td class="line">math_equation_show_in_progress(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="1232"><td class="num" id="LN1232">1232</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1233"><td class="num" id="LN1233">1233</td><td class="line"> MathEquation *equation = <span class='macro'>MATH_EQUATION(data)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((data)), (math_equation_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1234"><td class="num" id="LN1234">1234</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_solve)</td></tr> +<tr class="codeline" data-linenumber="1235"><td class="num" id="LN1235">1235</td><td class="line"> math_equation_set_status(equation, <span class='macro'>_(<span class='string_literal'>"Calculating"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Calculating", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1236"><td class="num" id="LN1236">1236</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>false<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1237"><td class="num" id="LN1237">1237</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1238"><td class="num" id="LN1238">1238</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1239"><td class="num" id="LN1239">1239</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1240"><td class="num" id="LN1240">1240</td><td class="line">math_equation_look_for_answer(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="1241"><td class="num" id="LN1241">1241</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1242"><td class="num" id="LN1242">1242</td><td class="line"> MathEquation *equation = <span class='macro'>MATH_EQUATION(data)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((data)), (math_equation_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1243"><td class="num" id="LN1243">1243</td><td class="line"> SolveData *result = g_async_queue_try_pop(equation->priv->queue);</td></tr> +<tr class="codeline" data-linenumber="1244"><td class="num" id="LN1244">1244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1245"><td class="num" id="LN1245">1245</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="1246"><td class="num" id="LN1246">1246</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>true<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1247"><td class="num" id="LN1247">1247</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1248"><td class="num" id="LN1248">1248</td><td class="line"> equation->priv->in_solve = <span class='macro'>false<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1249"><td class="num" id="LN1249">1249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1250"><td class="num" id="LN1250">1250</td><td class="line"> <span class='keyword'>if</span> (!result->error)</td></tr> +<tr class="codeline" data-linenumber="1251"><td class="num" id="LN1251">1251</td><td class="line"> math_equation_set_status(equation, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1252"><td class="num" id="LN1252">1252</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1253"><td class="num" id="LN1253">1253</td><td class="line"> <span class='keyword'>if</span> (result->error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1254"><td class="num" id="LN1254">1254</td><td class="line"> math_equation_set_status(equation, result->error);</td></tr> +<tr class="codeline" data-linenumber="1255"><td class="num" id="LN1255">1255</td><td class="line"> g_free(result->error);</td></tr> +<tr class="codeline" data-linenumber="1256"><td class="num" id="LN1256">1256</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1257"><td class="num" id="LN1257">1257</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (result->number_result != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1258"><td class="num" id="LN1258">1258</td><td class="line"> math_equation_set_number(equation, result->number_result);</td></tr> +<tr class="codeline" data-linenumber="1259"><td class="num" id="LN1259">1259</td><td class="line"> mp_clear(result->number_result);</td></tr> +<tr class="codeline" data-linenumber="1260"><td class="num" id="LN1260">1260</td><td class="line"> <span class='macro'>g_slice_free(MPNumber, result->number_result)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MPNumber), (result->number_result<br>)); else (void) ((MPNumber*) 0 == (result->number_result))<br>; } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1261"><td class="num" id="LN1261">1261</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1262"><td class="num" id="LN1262">1262</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (result->text_result != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1263"><td class="num" id="LN1263">1263</td><td class="line"> math_equation_set_with_history(equation, result->text_result);</td></tr> +<tr class="codeline" data-linenumber="1264"><td class="num" id="LN1264">1264</td><td class="line"> g_free(result->text_result);</td></tr> +<tr class="codeline" data-linenumber="1265"><td class="num" id="LN1265">1265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1266"><td class="num" id="LN1266">1266</td><td class="line"> <span class='macro'>g_slice_free(SolveData, result)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (SolveData), (result)); else<br> (void) ((SolveData*) 0 == (result)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1267"><td class="num" id="LN1267">1267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1268"><td class="num" id="LN1268">1268</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>false<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1269"><td class="num" id="LN1269">1269</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1270"><td class="num" id="LN1270">1270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1271"><td class="num" id="LN1271">1271</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1272"><td class="num" id="LN1272">1272</td><td class="line">math_equation_solve(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1273"><td class="num" id="LN1273">1273</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1274"><td class="num" id="LN1274">1274</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1275"><td class="num" id="LN1275">1275</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1276"><td class="num" id="LN1276">1276</td><td class="line"> <span class='comment'>// FIXME: should replace calculation or give error message</span></td></tr> +<tr class="codeline" data-linenumber="1277"><td class="num" id="LN1277">1277</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_solve)</td></tr> +<tr class="codeline" data-linenumber="1278"><td class="num" id="LN1278">1278</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1279"><td class="num" id="LN1279">1279</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1280"><td class="num" id="LN1280">1280</td><td class="line"> <span class='keyword'>if</span> (math_equation_is_empty(equation))</td></tr> +<tr class="codeline" data-linenumber="1281"><td class="num" id="LN1281">1281</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1282"><td class="num" id="LN1282">1282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1283"><td class="num" id="LN1283">1283</td><td class="line"> <span class='comment'>/* If showing a result return to the equation that caused it */</span></td></tr> +<tr class="codeline" data-linenumber="1284"><td class="num" id="LN1284">1284</td><td class="line"> <span class='comment'>// FIXME: Result may not be here due to solve (i.e. the user may have entered "ans")</span></td></tr> +<tr class="codeline" data-linenumber="1285"><td class="num" id="LN1285">1285</td><td class="line"> <span class='keyword'>if</span> (math_equation_is_result(equation)) {</td></tr> +<tr class="codeline" data-linenumber="1286"><td class="num" id="LN1286">1286</td><td class="line"> math_equation_undo(equation);</td></tr> +<tr class="codeline" data-linenumber="1287"><td class="num" id="LN1287">1287</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1288"><td class="num" id="LN1288">1288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1289"><td class="num" id="LN1289">1289</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1290"><td class="num" id="LN1290">1290</td><td class="line"> equation->priv->in_solve = <span class='macro'>true<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1291"><td class="num" id="LN1291">1291</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1292"><td class="num" id="LN1292">1292</td><td class="line"> math_equation_set_number_mode(equation, NORMAL);</td></tr> +<tr class="codeline" data-linenumber="1293"><td class="num" id="LN1293">1293</td><td class="line"> g_thread_new(<span class='string_literal'>""</span>, math_equation_solve_real, equation);</td></tr> +<tr class="codeline" data-linenumber="1294"><td class="num" id="LN1294">1294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1295"><td class="num" id="LN1295">1295</td><td class="line"> g_timeout_add(50, math_equation_look_for_answer, equation);</td></tr> +<tr class="codeline" data-linenumber="1296"><td class="num" id="LN1296">1296</td><td class="line"> g_timeout_add(100, math_equation_show_in_progress, equation);</td></tr> +<tr class="codeline" data-linenumber="1297"><td class="num" id="LN1297">1297</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1298"><td class="num" id="LN1298">1298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1299"><td class="num" id="LN1299">1299</td><td class="line"><span class='keyword'>static</span> gpointer</td></tr> +<tr class="codeline" data-linenumber="1300"><td class="num" id="LN1300">1300</td><td class="line">math_equation_factorize_real(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="1301"><td class="num" id="LN1301">1301</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1302"><td class="num" id="LN1302">1302</td><td class="line"> GString *text;</td></tr> +<tr class="codeline" data-linenumber="1303"><td class="num" id="LN1303">1303</td><td class="line"> GList *factors, *factor, *next_factor;</td></tr> +<tr class="codeline" data-linenumber="1304"><td class="num" id="LN1304">1304</td><td class="line"> MPNumber x = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1305"><td class="num" id="LN1305">1305</td><td class="line"> MathEquation *equation = <span class='macro'>MATH_EQUATION(data)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((data)), (math_equation_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1306"><td class="num" id="LN1306">1306</td><td class="line"> SolveData *result = <span class='macro'>g_slice_new0(SolveData)<span class='macro_popup'>(SolveData *) (__extension__ ({ gsize __s = sizeof (SolveData<br>); gpointer __p; __p = g_slice_alloc (__s); memset (__p, 0, __s<br>); __p; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1307"><td class="num" id="LN1307">1307</td><td class="line"> MpDisplayFormat format = mp_serializer_get_number_format(equation->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="1308"><td class="num" id="LN1308">1308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1309"><td class="num" id="LN1309">1309</td><td class="line"> mp_serializer_set_number_format(equation->priv->serializer, MP_DISPLAY_FORMAT_FIXED);</td></tr> +<tr class="codeline" data-linenumber="1310"><td class="num" id="LN1310">1310</td><td class="line"> math_equation_get_number(equation, &x);</td></tr> +<tr class="codeline" data-linenumber="1311"><td class="num" id="LN1311">1311</td><td class="line"> factors = mp_factorize(&x);</td></tr> +<tr class="codeline" data-linenumber="1312"><td class="num" id="LN1312">1312</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1313"><td class="num" id="LN1313">1313</td><td class="line"> text = g_string_new(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1314"><td class="num" id="LN1314">1314</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1315"><td class="num" id="LN1315">1315</td><td class="line"> <span class='keyword'>int</span> e = 1;</td></tr> +<tr class="codeline" data-linenumber="1316"><td class="num" id="LN1316">1316</td><td class="line"> <span class='keyword'>for</span> (factor = factors; factor != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; factor = factor->next)</td></tr> +<tr class="codeline" data-linenumber="1317"><td class="num" id="LN1317">1317</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1318"><td class="num" id="LN1318">1318</td><td class="line"> gchar *temp;</td></tr> +<tr class="codeline" data-linenumber="1319"><td class="num" id="LN1319">1319</td><td class="line"> MPNumber *n;</td></tr> +<tr class="codeline" data-linenumber="1320"><td class="num" id="LN1320">1320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1321"><td class="num" id="LN1321">1321</td><td class="line"> n = factor->data;</td></tr> +<tr class="codeline" data-linenumber="1322"><td class="num" id="LN1322">1322</td><td class="line"> next_factor = factor->next;</td></tr> +<tr class="codeline" data-linenumber="1323"><td class="num" id="LN1323">1323</td><td class="line"> <span class='keyword'>if</span> (next_factor != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && mp_compare(n, next_factor->data) == 0)</td></tr> +<tr class="codeline" data-linenumber="1324"><td class="num" id="LN1324">1324</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1325"><td class="num" id="LN1325">1325</td><td class="line"> e++;</td></tr> +<tr class="codeline" data-linenumber="1326"><td class="num" id="LN1326">1326</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="1327"><td class="num" id="LN1327">1327</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1328"><td class="num" id="LN1328">1328</td><td class="line"> temp = mp_serializer_to_string(equation->priv->serializer, n);</td></tr> +<tr class="codeline" data-linenumber="1329"><td class="num" id="LN1329">1329</td><td class="line"> g_string_append(text, temp);</td></tr> +<tr class="codeline" data-linenumber="1330"><td class="num" id="LN1330">1330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1331"><td class="num" id="LN1331">1331</td><td class="line"> <span class='keyword'>if</span> (e > 1)</td></tr> +<tr class="codeline" data-linenumber="1332"><td class="num" id="LN1332">1332</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1333"><td class="num" id="LN1333">1333</td><td class="line"> g_string_append(text, <span class='string_literal'>"^"</span>);</td></tr> +<tr class="codeline" data-linenumber="1334"><td class="num" id="LN1334">1334</td><td class="line"> g_string_append_printf(text, <span class='string_literal'>"%d"</span>, e);</td></tr> +<tr class="codeline" data-linenumber="1335"><td class="num" id="LN1335">1335</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1336"><td class="num" id="LN1336">1336</td><td class="line"> <span class='keyword'>if</span> (factor->next)</td></tr> +<tr class="codeline" data-linenumber="1337"><td class="num" id="LN1337">1337</td><td class="line"> g_string_append(text, <span class='string_literal'>" × "</span>);</td></tr> +<tr class="codeline" data-linenumber="1338"><td class="num" id="LN1338">1338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1339"><td class="num" id="LN1339">1339</td><td class="line"> e = 1;</td></tr> +<tr class="codeline" data-linenumber="1340"><td class="num" id="LN1340">1340</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1341"><td class="num" id="LN1341">1341</td><td class="line"> mp_clear(n);</td></tr> +<tr class="codeline" data-linenumber="1342"><td class="num" id="LN1342">1342</td><td class="line"> <span class='macro'>g_slice_free(MPNumber, n)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MPNumber), (n)); else (void<br>) ((MPNumber*) 0 == (n)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1343"><td class="num" id="LN1343">1343</td><td class="line"> g_free(temp);</td></tr> +<tr class="codeline" data-linenumber="1344"><td class="num" id="LN1344">1344</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1345"><td class="num" id="LN1345">1345</td><td class="line"> g_list_free(factors);</td></tr> +<tr class="codeline" data-linenumber="1346"><td class="num" id="LN1346">1346</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1347"><td class="num" id="LN1347">1347</td><td class="line"> result->text_result = g_strndup(text->str, text->len);</td></tr> +<tr class="codeline" data-linenumber="1348"><td class="num" id="LN1348">1348</td><td class="line"> g_async_queue_push(equation->priv->queue, result);</td></tr> +<tr class="codeline" data-linenumber="1349"><td class="num" id="LN1349">1349</td><td class="line"> g_string_free(text, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1350"><td class="num" id="LN1350">1350</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="1351"><td class="num" id="LN1351">1351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1352"><td class="num" id="LN1352">1352</td><td class="line"> mp_serializer_set_number_format(equation->priv->serializer, format);</td></tr> +<tr class="codeline" data-linenumber="1353"><td class="num" id="LN1353">1353</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1354"><td class="num" id="LN1354">1354</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1355"><td class="num" id="LN1355">1355</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1356"><td class="num" id="LN1356">1356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1357"><td class="num" id="LN1357">1357</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1358"><td class="num" id="LN1358">1358</td><td class="line">math_equation_factorize(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1359"><td class="num" id="LN1359">1359</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1360"><td class="num" id="LN1360">1360</td><td class="line"> MPNumber x = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1361"><td class="num" id="LN1361">1361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1362"><td class="num" id="LN1362">1362</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1363"><td class="num" id="LN1363">1363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1364"><td class="num" id="LN1364">1364</td><td class="line"> <span class='comment'>// FIXME: should replace calculation or give error message</span></td></tr> +<tr class="codeline" data-linenumber="1365"><td class="num" id="LN1365">1365</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_solve)</td></tr> +<tr class="codeline" data-linenumber="1366"><td class="num" id="LN1366">1366</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1367"><td class="num" id="LN1367">1367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1368"><td class="num" id="LN1368">1368</td><td class="line"> <span class='keyword'>if</span> (!math_equation_get_number(equation, &x) || !mp_is_integer(&x)) {</td></tr> +<tr class="codeline" data-linenumber="1369"><td class="num" id="LN1369">1369</td><td class="line"> <span class='comment'>/* Error displayed when trying to factorize a non-integer value */</span></td></tr> +<tr class="codeline" data-linenumber="1370"><td class="num" id="LN1370">1370</td><td class="line"> math_equation_set_status(equation, <span class='macro'>_(<span class='string_literal'>"Need an integer to factorize"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Need an integer to factorize", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1371"><td class="num" id="LN1371">1371</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="1372"><td class="num" id="LN1372">1372</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1373"><td class="num" id="LN1373">1373</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1374"><td class="num" id="LN1374">1374</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="1375"><td class="num" id="LN1375">1375</td><td class="line"> equation->priv->in_solve = <span class='macro'>true<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1376"><td class="num" id="LN1376">1376</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1377"><td class="num" id="LN1377">1377</td><td class="line"> g_thread_new(<span class='string_literal'>""</span>, math_equation_factorize_real, equation);</td></tr> +<tr class="codeline" data-linenumber="1378"><td class="num" id="LN1378">1378</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1379"><td class="num" id="LN1379">1379</td><td class="line"> g_timeout_add(50, math_equation_look_for_answer, equation);</td></tr> +<tr class="codeline" data-linenumber="1380"><td class="num" id="LN1380">1380</td><td class="line"> g_timeout_add(100, math_equation_show_in_progress, equation);</td></tr> +<tr class="codeline" data-linenumber="1381"><td class="num" id="LN1381">1381</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1382"><td class="num" id="LN1382">1382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1383"><td class="num" id="LN1383">1383</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1384"><td class="num" id="LN1384">1384</td><td class="line">math_equation_delete(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1385"><td class="num" id="LN1385">1385</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1386"><td class="num" id="LN1386">1386</td><td class="line"> gint cursor;</td></tr> +<tr class="codeline" data-linenumber="1387"><td class="num" id="LN1387">1387</td><td class="line"> GtkTextIter start, end;</td></tr> +<tr class="codeline" data-linenumber="1388"><td class="num" id="LN1388">1388</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1389"><td class="num" id="LN1389">1389</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1390"><td class="num" id="LN1390">1390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1391"><td class="num" id="LN1391">1391</td><td class="line"> g_object_get(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"cursor-position"</span>, &cursor, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1392"><td class="num" id="LN1392">1392</td><td class="line"> <span class='keyword'>if</span> (cursor >= gtk_text_buffer_get_char_count(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1393"><td class="num" id="LN1393">1393</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1394"><td class="num" id="LN1394">1394</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1395"><td class="num" id="LN1395">1395</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, cursor);</td></tr> +<tr class="codeline" data-linenumber="1396"><td class="num" id="LN1396">1396</td><td class="line"> gtk_text_buffer_get_iter_at_offset(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &end, cursor+1);</td></tr> +<tr class="codeline" data-linenumber="1397"><td class="num" id="LN1397">1397</td><td class="line"> gtk_text_buffer_delete(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &start, &end);</td></tr> +<tr class="codeline" data-linenumber="1398"><td class="num" id="LN1398">1398</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1399"><td class="num" id="LN1399">1399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1400"><td class="num" id="LN1400">1400</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1401"><td class="num" id="LN1401">1401</td><td class="line">math_equation_backspace(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1402"><td class="num" id="LN1402">1402</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1403"><td class="num" id="LN1403">1403</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1404"><td class="num" id="LN1404">1404</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1405"><td class="num" id="LN1405">1405</td><td class="line"> <span class='comment'>/* Can't delete empty display */</span></td></tr> +<tr class="codeline" data-linenumber="1406"><td class="num" id="LN1406">1406</td><td class="line"> <span class='keyword'>if</span> (math_equation_is_empty(equation))</td></tr> +<tr class="codeline" data-linenumber="1407"><td class="num" id="LN1407">1407</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1408"><td class="num" id="LN1408">1408</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1409"><td class="num" id="LN1409">1409</td><td class="line"> <span class='keyword'>if</span> (gtk_text_buffer_get_has_selection(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1410"><td class="num" id="LN1410">1410</td><td class="line"> gtk_text_buffer_delete_selection(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1411"><td class="num" id="LN1411">1411</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1412"><td class="num" id="LN1412">1412</td><td class="line"> GtkTextIter iter;</td></tr> +<tr class="codeline" data-linenumber="1413"><td class="num" id="LN1413">1413</td><td class="line"> gtk_text_buffer_get_iter_at_mark(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, gtk_text_buffer_get_insert(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>));</td></tr> +<tr class="codeline" data-linenumber="1414"><td class="num" id="LN1414">1414</td><td class="line"> gtk_text_buffer_backspace(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, &iter, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1415"><td class="num" id="LN1415">1415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1416"><td class="num" id="LN1416">1416</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1417"><td class="num" id="LN1417">1417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1418"><td class="num" id="LN1418">1418</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1419"><td class="num" id="LN1419">1419</td><td class="line">math_equation_clear(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1420"><td class="num" id="LN1420">1420</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1421"><td class="num" id="LN1421">1421</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1422"><td class="num" id="LN1422">1422</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1423"><td class="num" id="LN1423">1423</td><td class="line"> math_equation_set_number_mode(equation, NORMAL);</td></tr> +<tr class="codeline" data-linenumber="1424"><td class="num" id="LN1424">1424</td><td class="line"> gtk_text_buffer_set_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='string_literal'>""</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="1425"><td class="num" id="LN1425">1425</td><td class="line"> clear_ans(equation, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1426"><td class="num" id="LN1426">1426</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1427"><td class="num" id="LN1427">1427</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1428"><td class="num" id="LN1428">1428</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1429"><td class="num" id="LN1429">1429</td><td class="line">math_equation_shift(MathEquation *equation, gint count)</td></tr> +<tr class="codeline" data-linenumber="1430"><td class="num" id="LN1430">1430</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1431"><td class="num" id="LN1431">1431</td><td class="line"> MPNumber z = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1432"><td class="num" id="LN1432">1432</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1433"><td class="num" id="LN1433">1433</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1434"><td class="num" id="LN1434">1434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1435"><td class="num" id="LN1435">1435</td><td class="line"> <span class='keyword'>if</span> (!math_equation_get_number(equation, &z)) {</td></tr> +<tr class="codeline" data-linenumber="1436"><td class="num" id="LN1436">1436</td><td class="line"> math_equation_set_status(equation,</td></tr> +<tr class="codeline" data-linenumber="1437"><td class="num" id="LN1437">1437</td><td class="line"> <span class='comment'>/* This message is displayed in the status bar when a bit</span></td></tr> +<tr class="codeline" data-linenumber="1438"><td class="num" id="LN1438">1438</td><td class="line"> <span class='comment'>shift operation is performed and the display does not contain a number */</span></td></tr> +<tr class="codeline" data-linenumber="1439"><td class="num" id="LN1439">1439</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"No sane value to bitwise shift"</span>)<span class='macro_popup'>dcgettext (((void*)0), "No sane value to bitwise shift", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1440"><td class="num" id="LN1440">1440</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1441"><td class="num" id="LN1441">1441</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1442"><td class="num" id="LN1442">1442</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1443"><td class="num" id="LN1443">1443</td><td class="line"> mp_shift(&z, count, &z);</td></tr> +<tr class="codeline" data-linenumber="1444"><td class="num" id="LN1444">1444</td><td class="line"> math_equation_set_number(equation, &z);</td></tr> +<tr class="codeline" data-linenumber="1445"><td class="num" id="LN1445">1445</td><td class="line"> mp_clear(&z);</td></tr> +<tr class="codeline" data-linenumber="1446"><td class="num" id="LN1446">1446</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1447"><td class="num" id="LN1447">1447</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1448"><td class="num" id="LN1448">1448</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1449"><td class="num" id="LN1449">1449</td><td class="line">math_equation_toggle_bit(MathEquation *equation, guint bit)</td></tr> +<tr class="codeline" data-linenumber="1450"><td class="num" id="LN1450">1450</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1451"><td class="num" id="LN1451">1451</td><td class="line"> MPNumber x = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1452"><td class="num" id="LN1452">1452</td><td class="line"> guint64 bits;</td></tr> +<tr class="codeline" data-linenumber="1453"><td class="num" id="LN1453">1453</td><td class="line"> gboolean result;</td></tr> +<tr class="codeline" data-linenumber="1454"><td class="num" id="LN1454">1454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1455"><td class="num" id="LN1455">1455</td><td class="line"> <span class='macro'>g_return_if_fail(equation != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (equation != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "equation != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1456"><td class="num" id="LN1456">1456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1457"><td class="num" id="LN1457">1457</td><td class="line"> result = math_equation_get_number(equation, &x);</td></tr> +<tr class="codeline" data-linenumber="1458"><td class="num" id="LN1458">1458</td><td class="line"> <span class='keyword'>if</span> (result) {</td></tr> +<tr class="codeline" data-linenumber="1459"><td class="num" id="LN1459">1459</td><td class="line"> MPNumber max = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1460"><td class="num" id="LN1460">1460</td><td class="line"> mp_set_from_unsigned_integer(<span class='macro'>G_MAXUINT64<span class='macro_popup'>(0xffffffffffffffffUL)</span></span>, &max);</td></tr> +<tr class="codeline" data-linenumber="1461"><td class="num" id="LN1461">1461</td><td class="line"> <span class='keyword'>if</span> (mp_is_negative(&x) || mp_is_greater_than(&x, &max))</td></tr> +<tr class="codeline" data-linenumber="1462"><td class="num" id="LN1462">1462</td><td class="line"> result = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1463"><td class="num" id="LN1463">1463</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1464"><td class="num" id="LN1464">1464</td><td class="line"> bits = mp_to_unsigned_integer(&x);</td></tr> +<tr class="codeline" data-linenumber="1465"><td class="num" id="LN1465">1465</td><td class="line"> mp_clear(&max);</td></tr> +<tr class="codeline" data-linenumber="1466"><td class="num" id="LN1466">1466</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1467"><td class="num" id="LN1467">1467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1468"><td class="num" id="LN1468">1468</td><td class="line"> <span class='keyword'>if</span> (!result) {</td></tr> +<tr class="codeline" data-linenumber="1469"><td class="num" id="LN1469">1469</td><td class="line"> math_equation_set_status(equation,</td></tr> +<tr class="codeline" data-linenumber="1470"><td class="num" id="LN1470">1470</td><td class="line"> <span class='comment'>/* Message displayed when cannot toggle bit in display*/</span></td></tr> +<tr class="codeline" data-linenumber="1471"><td class="num" id="LN1471">1471</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Displayed value not an integer"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Displayed value not an integer", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1472"><td class="num" id="LN1472">1472</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="1473"><td class="num" id="LN1473">1473</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1474"><td class="num" id="LN1474">1474</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1475"><td class="num" id="LN1475">1475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1476"><td class="num" id="LN1476">1476</td><td class="line"> bits ^= (1LL << (63 - bit));</td></tr> +<tr class="codeline" data-linenumber="1477"><td class="num" id="LN1477">1477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1478"><td class="num" id="LN1478">1478</td><td class="line"> mp_set_from_unsigned_integer(bits, &x);</td></tr> +<tr class="codeline" data-linenumber="1479"><td class="num" id="LN1479">1479</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1480"><td class="num" id="LN1480">1480</td><td class="line"> <span class='comment'>// FIXME: Only do this if in ans format, otherwise set text in same format as previous number</span></td></tr> +<tr class="codeline" data-linenumber="1481"><td class="num" id="LN1481">1481</td><td class="line"> math_equation_set_number(equation, &x);</td></tr> +<tr class="codeline" data-linenumber="1482"><td class="num" id="LN1482">1482</td><td class="line"> mp_clear(&x);</td></tr> +<tr class="codeline" data-linenumber="1483"><td class="num" id="LN1483">1483</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1484"><td class="num" id="LN1484">1484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1485"><td class="num" id="LN1485">1485</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1486"><td class="num" id="LN1486">1486</td><td class="line">math_equation_set_property(GObject *object,</td></tr> +<tr class="codeline" data-linenumber="1487"><td class="num" id="LN1487">1487</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="1488"><td class="num" id="LN1488">1488</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="1489"><td class="num" id="LN1489">1489</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="1490"><td class="num" id="LN1490">1490</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1491"><td class="num" id="LN1491">1491</td><td class="line"> MathEquation *self;</td></tr> +<tr class="codeline" data-linenumber="1492"><td class="num" id="LN1492">1492</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1493"><td class="num" id="LN1493">1493</td><td class="line"> self = <span class='macro'>MATH_EQUATION(object)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), (math_equation_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1494"><td class="num" id="LN1494">1494</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1495"><td class="num" id="LN1495">1495</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="1496"><td class="num" id="LN1496">1496</td><td class="line"> <span class='keyword'>case</span> PROP_STATUS:</td></tr> +<tr class="codeline" data-linenumber="1497"><td class="num" id="LN1497">1497</td><td class="line"> math_equation_set_status(self, g_value_get_string(value));</td></tr> +<tr class="codeline" data-linenumber="1498"><td class="num" id="LN1498">1498</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1499"><td class="num" id="LN1499">1499</td><td class="line"> <span class='keyword'>case</span> PROP_DISPLAY:</td></tr> +<tr class="codeline" data-linenumber="1500"><td class="num" id="LN1500">1500</td><td class="line"> math_equation_set(self, g_value_get_string(value));</td></tr> +<tr class="codeline" data-linenumber="1501"><td class="num" id="LN1501">1501</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1502"><td class="num" id="LN1502">1502</td><td class="line"> <span class='keyword'>case</span> PROP_NUMBER_MODE:</td></tr> +<tr class="codeline" data-linenumber="1503"><td class="num" id="LN1503">1503</td><td class="line"> math_equation_set_number_mode(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1504"><td class="num" id="LN1504">1504</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1505"><td class="num" id="LN1505">1505</td><td class="line"> <span class='keyword'>case</span> PROP_ACCURACY:</td></tr> +<tr class="codeline" data-linenumber="1506"><td class="num" id="LN1506">1506</td><td class="line"> math_equation_set_accuracy(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1507"><td class="num" id="LN1507">1507</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1508"><td class="num" id="LN1508">1508</td><td class="line"> <span class='keyword'>case</span> PROP_SHOW_THOUSANDS_SEPARATORS:</td></tr> +<tr class="codeline" data-linenumber="1509"><td class="num" id="LN1509">1509</td><td class="line"> math_equation_set_show_thousands_separators(self, g_value_get_boolean(value));</td></tr> +<tr class="codeline" data-linenumber="1510"><td class="num" id="LN1510">1510</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1511"><td class="num" id="LN1511">1511</td><td class="line"> <span class='keyword'>case</span> PROP_SHOW_TRAILING_ZEROES:</td></tr> +<tr class="codeline" data-linenumber="1512"><td class="num" id="LN1512">1512</td><td class="line"> math_equation_set_show_trailing_zeroes(self, g_value_get_boolean(value));</td></tr> +<tr class="codeline" data-linenumber="1513"><td class="num" id="LN1513">1513</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1514"><td class="num" id="LN1514">1514</td><td class="line"> <span class='keyword'>case</span> PROP_NUMBER_FORMAT:</td></tr> +<tr class="codeline" data-linenumber="1515"><td class="num" id="LN1515">1515</td><td class="line"> math_equation_set_number_format(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1516"><td class="num" id="LN1516">1516</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1517"><td class="num" id="LN1517">1517</td><td class="line"> <span class='keyword'>case</span> PROP_BASE:</td></tr> +<tr class="codeline" data-linenumber="1518"><td class="num" id="LN1518">1518</td><td class="line"> math_equation_set_base(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1519"><td class="num" id="LN1519">1519</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1520"><td class="num" id="LN1520">1520</td><td class="line"> <span class='keyword'>case</span> PROP_WORD_SIZE:</td></tr> +<tr class="codeline" data-linenumber="1521"><td class="num" id="LN1521">1521</td><td class="line"> math_equation_set_word_size(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1522"><td class="num" id="LN1522">1522</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1523"><td class="num" id="LN1523">1523</td><td class="line"> <span class='keyword'>case</span> PROP_ANGLE_UNITS:</td></tr> +<tr class="codeline" data-linenumber="1524"><td class="num" id="LN1524">1524</td><td class="line"> math_equation_set_angle_units(self, g_value_get_int(value));</td></tr> +<tr class="codeline" data-linenumber="1525"><td class="num" id="LN1525">1525</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1526"><td class="num" id="LN1526">1526</td><td class="line"> <span class='keyword'>case</span> PROP_SOURCE_CURRENCY:</td></tr> +<tr class="codeline" data-linenumber="1527"><td class="num" id="LN1527">1527</td><td class="line"> math_equation_set_source_currency(self, g_value_get_string(value));</td></tr> +<tr class="codeline" data-linenumber="1528"><td class="num" id="LN1528">1528</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1529"><td class="num" id="LN1529">1529</td><td class="line"> <span class='keyword'>case</span> PROP_TARGET_CURRENCY:</td></tr> +<tr class="codeline" data-linenumber="1530"><td class="num" id="LN1530">1530</td><td class="line"> math_equation_set_target_currency(self, g_value_get_string(value));</td></tr> +<tr class="codeline" data-linenumber="1531"><td class="num" id="LN1531">1531</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1532"><td class="num" id="LN1532">1532</td><td class="line"> <span class='keyword'>case</span> PROP_SOURCE_UNITS:</td></tr> +<tr class="codeline" data-linenumber="1533"><td class="num" id="LN1533">1533</td><td class="line"> math_equation_set_source_units(self, g_value_get_string(value));</td></tr> +<tr class="codeline" data-linenumber="1534"><td class="num" id="LN1534">1534</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1535"><td class="num" id="LN1535">1535</td><td class="line"> <span class='keyword'>case</span> PROP_TARGET_UNITS:</td></tr> +<tr class="codeline" data-linenumber="1536"><td class="num" id="LN1536">1536</td><td class="line"> math_equation_set_target_units(self, g_value_get_string(value));</td></tr> +<tr class="codeline" data-linenumber="1537"><td class="num" id="LN1537">1537</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1538"><td class="num" id="LN1538">1538</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1539"><td class="num" id="LN1539">1539</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "math-equation.c", 1539, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1540"><td class="num" id="LN1540">1540</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1541"><td class="num" id="LN1541">1541</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1542"><td class="num" id="LN1542">1542</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1543"><td class="num" id="LN1543">1543</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1544"><td class="num" id="LN1544">1544</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1545"><td class="num" id="LN1545">1545</td><td class="line">math_equation_get_property(GObject *object,</td></tr> +<tr class="codeline" data-linenumber="1546"><td class="num" id="LN1546">1546</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="1547"><td class="num" id="LN1547">1547</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="1548"><td class="num" id="LN1548">1548</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="1549"><td class="num" id="LN1549">1549</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1550"><td class="num" id="LN1550">1550</td><td class="line"> MathEquation *self;</td></tr> +<tr class="codeline" data-linenumber="1551"><td class="num" id="LN1551">1551</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="1552"><td class="num" id="LN1552">1552</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1553"><td class="num" id="LN1553">1553</td><td class="line"> self = <span class='macro'>MATH_EQUATION(object)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), (math_equation_get_type())))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1554"><td class="num" id="LN1554">1554</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1555"><td class="num" id="LN1555">1555</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="1556"><td class="num" id="LN1556">1556</td><td class="line"> <span class='keyword'>case</span> PROP_STATUS:</td></tr> +<tr class="codeline" data-linenumber="1557"><td class="num" id="LN1557">1557</td><td class="line"> g_value_set_string(value, self->priv->state.status);</td></tr> +<tr class="codeline" data-linenumber="1558"><td class="num" id="LN1558">1558</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1559"><td class="num" id="LN1559">1559</td><td class="line"> <span class='keyword'>case</span> PROP_DISPLAY:</td></tr> +<tr class="codeline" data-linenumber="1560"><td class="num" id="LN1560">1560</td><td class="line"> text = math_equation_get_display(self);</td></tr> +<tr class="codeline" data-linenumber="1561"><td class="num" id="LN1561">1561</td><td class="line"> g_value_set_string(value, text);</td></tr> +<tr class="codeline" data-linenumber="1562"><td class="num" id="LN1562">1562</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="1563"><td class="num" id="LN1563">1563</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1564"><td class="num" id="LN1564">1564</td><td class="line"> <span class='keyword'>case</span> PROP_EQUATION:</td></tr> +<tr class="codeline" data-linenumber="1565"><td class="num" id="LN1565">1565</td><td class="line"> text = math_equation_get_equation(self);</td></tr> +<tr class="codeline" data-linenumber="1566"><td class="num" id="LN1566">1566</td><td class="line"> g_value_set_string(value, text);</td></tr> +<tr class="codeline" data-linenumber="1567"><td class="num" id="LN1567">1567</td><td class="line"> g_free(text);</td></tr> +<tr class="codeline" data-linenumber="1568"><td class="num" id="LN1568">1568</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1569"><td class="num" id="LN1569">1569</td><td class="line"> <span class='keyword'>case</span> PROP_NUMBER_MODE:</td></tr> +<tr class="codeline" data-linenumber="1570"><td class="num" id="LN1570">1570</td><td class="line"> g_value_set_enum(value, self->priv->number_mode);</td></tr> +<tr class="codeline" data-linenumber="1571"><td class="num" id="LN1571">1571</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1572"><td class="num" id="LN1572">1572</td><td class="line"> <span class='keyword'>case</span> PROP_ACCURACY:</td></tr> +<tr class="codeline" data-linenumber="1573"><td class="num" id="LN1573">1573</td><td class="line"> g_value_set_int(value, mp_serializer_get_trailing_digits(self->priv->serializer));</td></tr> +<tr class="codeline" data-linenumber="1574"><td class="num" id="LN1574">1574</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1575"><td class="num" id="LN1575">1575</td><td class="line"> <span class='keyword'>case</span> PROP_SHOW_THOUSANDS_SEPARATORS:</td></tr> +<tr class="codeline" data-linenumber="1576"><td class="num" id="LN1576">1576</td><td class="line"> g_value_set_boolean(value, mp_serializer_get_show_thousands_separators(self->priv->serializer));</td></tr> +<tr class="codeline" data-linenumber="1577"><td class="num" id="LN1577">1577</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1578"><td class="num" id="LN1578">1578</td><td class="line"> <span class='keyword'>case</span> PROP_SHOW_TRAILING_ZEROES:</td></tr> +<tr class="codeline" data-linenumber="1579"><td class="num" id="LN1579">1579</td><td class="line"> g_value_set_boolean(value, mp_serializer_get_show_trailing_zeroes(self->priv->serializer));</td></tr> +<tr class="codeline" data-linenumber="1580"><td class="num" id="LN1580">1580</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1581"><td class="num" id="LN1581">1581</td><td class="line"> <span class='keyword'>case</span> PROP_NUMBER_FORMAT:</td></tr> +<tr class="codeline" data-linenumber="1582"><td class="num" id="LN1582">1582</td><td class="line"> g_value_set_enum(value, mp_serializer_get_number_format(self->priv->serializer));</td></tr> +<tr class="codeline" data-linenumber="1583"><td class="num" id="LN1583">1583</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1584"><td class="num" id="LN1584">1584</td><td class="line"> <span class='keyword'>case</span> PROP_BASE:</td></tr> +<tr class="codeline" data-linenumber="1585"><td class="num" id="LN1585">1585</td><td class="line"> g_value_set_int(value, math_equation_get_base(self));</td></tr> +<tr class="codeline" data-linenumber="1586"><td class="num" id="LN1586">1586</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1587"><td class="num" id="LN1587">1587</td><td class="line"> <span class='keyword'>case</span> PROP_WORD_SIZE:</td></tr> +<tr class="codeline" data-linenumber="1588"><td class="num" id="LN1588">1588</td><td class="line"> g_value_set_int(value, self->priv->word_size);</td></tr> +<tr class="codeline" data-linenumber="1589"><td class="num" id="LN1589">1589</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1590"><td class="num" id="LN1590">1590</td><td class="line"> <span class='keyword'>case</span> PROP_ANGLE_UNITS:</td></tr> +<tr class="codeline" data-linenumber="1591"><td class="num" id="LN1591">1591</td><td class="line"> g_value_set_enum(value, self->priv->angle_units);</td></tr> +<tr class="codeline" data-linenumber="1592"><td class="num" id="LN1592">1592</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1593"><td class="num" id="LN1593">1593</td><td class="line"> <span class='keyword'>case</span> PROP_SOURCE_CURRENCY:</td></tr> +<tr class="codeline" data-linenumber="1594"><td class="num" id="LN1594">1594</td><td class="line"> g_value_set_string(value, self->priv->source_currency);</td></tr> +<tr class="codeline" data-linenumber="1595"><td class="num" id="LN1595">1595</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1596"><td class="num" id="LN1596">1596</td><td class="line"> <span class='keyword'>case</span> PROP_TARGET_CURRENCY:</td></tr> +<tr class="codeline" data-linenumber="1597"><td class="num" id="LN1597">1597</td><td class="line"> g_value_set_string(value, self->priv->target_currency);</td></tr> +<tr class="codeline" data-linenumber="1598"><td class="num" id="LN1598">1598</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1599"><td class="num" id="LN1599">1599</td><td class="line"> <span class='keyword'>case</span> PROP_SOURCE_UNITS:</td></tr> +<tr class="codeline" data-linenumber="1600"><td class="num" id="LN1600">1600</td><td class="line"> g_value_set_string(value, self->priv->source_units);</td></tr> +<tr class="codeline" data-linenumber="1601"><td class="num" id="LN1601">1601</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1602"><td class="num" id="LN1602">1602</td><td class="line"> <span class='keyword'>case</span> PROP_TARGET_UNITS:</td></tr> +<tr class="codeline" data-linenumber="1603"><td class="num" id="LN1603">1603</td><td class="line"> g_value_set_string(value, self->priv->target_units);</td></tr> +<tr class="codeline" data-linenumber="1604"><td class="num" id="LN1604">1604</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1605"><td class="num" id="LN1605">1605</td><td class="line"> <span class='keyword'>case</span> PROP_SERIALIZER:</td></tr> +<tr class="codeline" data-linenumber="1606"><td class="num" id="LN1606">1606</td><td class="line"> g_value_set_object(value, self->priv->serializer);</td></tr> +<tr class="codeline" data-linenumber="1607"><td class="num" id="LN1607">1607</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1608"><td class="num" id="LN1608">1608</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1609"><td class="num" id="LN1609">1609</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "math-equation.c", 1609, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1610"><td class="num" id="LN1610">1610</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1611"><td class="num" id="LN1611">1611</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1612"><td class="num" id="LN1612">1612</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1613"><td class="num" id="LN1613">1613</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1614"><td class="num" id="LN1614">1614</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1615"><td class="num" id="LN1615">1615</td><td class="line">math_equation_constructed(GObject *object)</td></tr> +<tr class="codeline" data-linenumber="1616"><td class="num" id="LN1616">1616</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1617"><td class="num" id="LN1617">1617</td><td class="line"> GtkTextBuffer *parent_class;</td></tr> +<tr class="codeline" data-linenumber="1618"><td class="num" id="LN1618">1618</td><td class="line"> parent_class = g_type_class_peek_parent(<span class='macro'>MATH_EQUATION_GET_CLASS(object)<span class='macro_popup'>((((MathEquationClass*) (((GTypeInstance*) ((object)))->g_class<br>))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1619"><td class="num" id="LN1619">1619</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>G_OBJECT_CLASS(parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((parent_class)), (((GType) ((20) << (2))))))))</span></span>->constructed)</td></tr> +<tr class="codeline" data-linenumber="1620"><td class="num" id="LN1620">1620</td><td class="line"> <span class='macro'>G_OBJECT_CLASS(parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((parent_class)), (((GType) ((20) << (2))))))))</span></span>->constructed(object);</td></tr> +<tr class="codeline" data-linenumber="1621"><td class="num" id="LN1621">1621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1622"><td class="num" id="LN1622">1622</td><td class="line"> <span class='macro'>MATH_EQUATION(object)<span class='macro_popup'>((((MathEquation*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), (math_equation_get_type())))))</span></span>->priv->ans_tag = gtk_text_buffer_create_tag(<span class='macro'>GTK_TEXT_BUFFER(object)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='string_literal'>"weight"</span>, PANGO_WEIGHT_BOLD, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1623"><td class="num" id="LN1623">1623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1624"><td class="num" id="LN1624">1624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1625"><td class="num" id="LN1625">1625</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1626"><td class="num" id="LN1626">1626</td><td class="line">math_equation_class_init(MathEquationClass *klass)</td></tr> +<tr class="codeline" data-linenumber="1627"><td class="num" id="LN1627">1627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1628"><td class="num" id="LN1628">1628</td><td class="line"> <span class='keyword'>static</span> GEnumValue number_mode_values[] =</td></tr> +<tr class="codeline" data-linenumber="1629"><td class="num" id="LN1629">1629</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1630"><td class="num" id="LN1630">1630</td><td class="line"> {NORMAL, <span class='string_literal'>"normal"</span>, <span class='string_literal'>"normal"</span>},</td></tr> +<tr class="codeline" data-linenumber="1631"><td class="num" id="LN1631">1631</td><td class="line"> {SUPERSCRIPT, <span class='string_literal'>"superscript"</span>, <span class='string_literal'>"superscript"</span>},</td></tr> +<tr class="codeline" data-linenumber="1632"><td class="num" id="LN1632">1632</td><td class="line"> {SUBSCRIPT, <span class='string_literal'>"subscript"</span>, <span class='string_literal'>"subscript"</span>},</td></tr> +<tr class="codeline" data-linenumber="1633"><td class="num" id="LN1633">1633</td><td class="line"> {0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="1634"><td class="num" id="LN1634">1634</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="1635"><td class="num" id="LN1635">1635</td><td class="line"> <span class='keyword'>static</span> GEnumValue angle_unit_values[] =</td></tr> +<tr class="codeline" data-linenumber="1636"><td class="num" id="LN1636">1636</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1637"><td class="num" id="LN1637">1637</td><td class="line"> {MP_RADIANS, <span class='string_literal'>"radians"</span>, <span class='string_literal'>"radians"</span>},</td></tr> +<tr class="codeline" data-linenumber="1638"><td class="num" id="LN1638">1638</td><td class="line"> {MP_DEGREES, <span class='string_literal'>"degrees"</span>, <span class='string_literal'>"degrees"</span>},</td></tr> +<tr class="codeline" data-linenumber="1639"><td class="num" id="LN1639">1639</td><td class="line"> {MP_GRADIANS, <span class='string_literal'>"gradians"</span>, <span class='string_literal'>"gradians"</span>},</td></tr> +<tr class="codeline" data-linenumber="1640"><td class="num" id="LN1640">1640</td><td class="line"> {0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="1641"><td class="num" id="LN1641">1641</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="1642"><td class="num" id="LN1642">1642</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS(klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1643"><td class="num" id="LN1643">1643</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1644"><td class="num" id="LN1644">1644</td><td class="line"> object_class->get_property = math_equation_get_property;</td></tr> +<tr class="codeline" data-linenumber="1645"><td class="num" id="LN1645">1645</td><td class="line"> object_class->set_property = math_equation_set_property;</td></tr> +<tr class="codeline" data-linenumber="1646"><td class="num" id="LN1646">1646</td><td class="line"> object_class->constructed = math_equation_constructed;</td></tr> +<tr class="codeline" data-linenumber="1647"><td class="num" id="LN1647">1647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1648"><td class="num" id="LN1648">1648</td><td class="line"> number_mode_type = g_enum_register_static(<span class='string_literal'>"NumberMode"</span>, number_mode_values);</td></tr> +<tr class="codeline" data-linenumber="1649"><td class="num" id="LN1649">1649</td><td class="line"> number_format_type = math_mp_display_format_get_type();</td></tr> +<tr class="codeline" data-linenumber="1650"><td class="num" id="LN1650">1650</td><td class="line"> angle_unit_type = g_enum_register_static(<span class='string_literal'>"AngleUnit"</span>, angle_unit_values);</td></tr> +<tr class="codeline" data-linenumber="1651"><td class="num" id="LN1651">1651</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1652"><td class="num" id="LN1652">1652</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1653"><td class="num" id="LN1653">1653</td><td class="line"> PROP_STATUS,</td></tr> +<tr class="codeline" data-linenumber="1654"><td class="num" id="LN1654">1654</td><td class="line"> g_param_spec_string(<span class='string_literal'>"status"</span>,</td></tr> +<tr class="codeline" data-linenumber="1655"><td class="num" id="LN1655">1655</td><td class="line"> <span class='string_literal'>"status"</span>,</td></tr> +<tr class="codeline" data-linenumber="1656"><td class="num" id="LN1656">1656</td><td class="line"> <span class='string_literal'>"Equation status"</span>,</td></tr> +<tr class="codeline" data-linenumber="1657"><td class="num" id="LN1657">1657</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1658"><td class="num" id="LN1658">1658</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1659"><td class="num" id="LN1659">1659</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1660"><td class="num" id="LN1660">1660</td><td class="line"> PROP_DISPLAY,</td></tr> +<tr class="codeline" data-linenumber="1661"><td class="num" id="LN1661">1661</td><td class="line"> g_param_spec_string(<span class='string_literal'>"display"</span>,</td></tr> +<tr class="codeline" data-linenumber="1662"><td class="num" id="LN1662">1662</td><td class="line"> <span class='string_literal'>"display"</span>,</td></tr> +<tr class="codeline" data-linenumber="1663"><td class="num" id="LN1663">1663</td><td class="line"> <span class='string_literal'>"Displayed equation text"</span>,</td></tr> +<tr class="codeline" data-linenumber="1664"><td class="num" id="LN1664">1664</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1665"><td class="num" id="LN1665">1665</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1666"><td class="num" id="LN1666">1666</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1667"><td class="num" id="LN1667">1667</td><td class="line"> PROP_EQUATION,</td></tr> +<tr class="codeline" data-linenumber="1668"><td class="num" id="LN1668">1668</td><td class="line"> g_param_spec_string(<span class='string_literal'>"equation"</span>,</td></tr> +<tr class="codeline" data-linenumber="1669"><td class="num" id="LN1669">1669</td><td class="line"> <span class='string_literal'>"equation"</span>,</td></tr> +<tr class="codeline" data-linenumber="1670"><td class="num" id="LN1670">1670</td><td class="line"> <span class='string_literal'>"Equation text"</span>,</td></tr> +<tr class="codeline" data-linenumber="1671"><td class="num" id="LN1671">1671</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1672"><td class="num" id="LN1672">1672</td><td class="line"> G_PARAM_READABLE));</td></tr> +<tr class="codeline" data-linenumber="1673"><td class="num" id="LN1673">1673</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1674"><td class="num" id="LN1674">1674</td><td class="line"> PROP_NUMBER_MODE,</td></tr> +<tr class="codeline" data-linenumber="1675"><td class="num" id="LN1675">1675</td><td class="line"> g_param_spec_enum(<span class='string_literal'>"number-mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1676"><td class="num" id="LN1676">1676</td><td class="line"> <span class='string_literal'>"number-mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1677"><td class="num" id="LN1677">1677</td><td class="line"> <span class='string_literal'>"Input number mode"</span>,</td></tr> +<tr class="codeline" data-linenumber="1678"><td class="num" id="LN1678">1678</td><td class="line"> number_mode_type,</td></tr> +<tr class="codeline" data-linenumber="1679"><td class="num" id="LN1679">1679</td><td class="line"> NORMAL,</td></tr> +<tr class="codeline" data-linenumber="1680"><td class="num" id="LN1680">1680</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1681"><td class="num" id="LN1681">1681</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1682"><td class="num" id="LN1682">1682</td><td class="line"> PROP_ACCURACY,</td></tr> +<tr class="codeline" data-linenumber="1683"><td class="num" id="LN1683">1683</td><td class="line"> g_param_spec_int(<span class='string_literal'>"accuracy"</span>,</td></tr> +<tr class="codeline" data-linenumber="1684"><td class="num" id="LN1684">1684</td><td class="line"> <span class='string_literal'>"accuracy"</span>,</td></tr> +<tr class="codeline" data-linenumber="1685"><td class="num" id="LN1685">1685</td><td class="line"> <span class='string_literal'>"Display accuracy"</span>,</td></tr> +<tr class="codeline" data-linenumber="1686"><td class="num" id="LN1686">1686</td><td class="line"> 0, 20, 9,</td></tr> +<tr class="codeline" data-linenumber="1687"><td class="num" id="LN1687">1687</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1688"><td class="num" id="LN1688">1688</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1689"><td class="num" id="LN1689">1689</td><td class="line"> PROP_SHOW_THOUSANDS_SEPARATORS,</td></tr> +<tr class="codeline" data-linenumber="1690"><td class="num" id="LN1690">1690</td><td class="line"> g_param_spec_boolean(<span class='string_literal'>"show-thousands-separators"</span>,</td></tr> +<tr class="codeline" data-linenumber="1691"><td class="num" id="LN1691">1691</td><td class="line"> <span class='string_literal'>"show-thousands-separators"</span>,</td></tr> +<tr class="codeline" data-linenumber="1692"><td class="num" id="LN1692">1692</td><td class="line"> <span class='string_literal'>"Show thousands separators"</span>,</td></tr> +<tr class="codeline" data-linenumber="1693"><td class="num" id="LN1693">1693</td><td class="line"> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1694"><td class="num" id="LN1694">1694</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1695"><td class="num" id="LN1695">1695</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1696"><td class="num" id="LN1696">1696</td><td class="line"> PROP_SHOW_TRAILING_ZEROES,</td></tr> +<tr class="codeline" data-linenumber="1697"><td class="num" id="LN1697">1697</td><td class="line"> g_param_spec_boolean(<span class='string_literal'>"show-trailing-zeroes"</span>,</td></tr> +<tr class="codeline" data-linenumber="1698"><td class="num" id="LN1698">1698</td><td class="line"> <span class='string_literal'>"show-trailing-zeroes"</span>,</td></tr> +<tr class="codeline" data-linenumber="1699"><td class="num" id="LN1699">1699</td><td class="line"> <span class='string_literal'>"Show trailing zeroes"</span>,</td></tr> +<tr class="codeline" data-linenumber="1700"><td class="num" id="LN1700">1700</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1701"><td class="num" id="LN1701">1701</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1702"><td class="num" id="LN1702">1702</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1703"><td class="num" id="LN1703">1703</td><td class="line"> PROP_NUMBER_FORMAT,</td></tr> +<tr class="codeline" data-linenumber="1704"><td class="num" id="LN1704">1704</td><td class="line"> g_param_spec_enum(<span class='string_literal'>"number-format"</span>,</td></tr> +<tr class="codeline" data-linenumber="1705"><td class="num" id="LN1705">1705</td><td class="line"> <span class='string_literal'>"number-format"</span>,</td></tr> +<tr class="codeline" data-linenumber="1706"><td class="num" id="LN1706">1706</td><td class="line"> <span class='string_literal'>"Display format"</span>,</td></tr> +<tr class="codeline" data-linenumber="1707"><td class="num" id="LN1707">1707</td><td class="line"> number_format_type,</td></tr> +<tr class="codeline" data-linenumber="1708"><td class="num" id="LN1708">1708</td><td class="line"> MP_DISPLAY_FORMAT_FIXED,</td></tr> +<tr class="codeline" data-linenumber="1709"><td class="num" id="LN1709">1709</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1710"><td class="num" id="LN1710">1710</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1711"><td class="num" id="LN1711">1711</td><td class="line"> PROP_BASE,</td></tr> +<tr class="codeline" data-linenumber="1712"><td class="num" id="LN1712">1712</td><td class="line"> g_param_spec_int(<span class='string_literal'>"base"</span>,</td></tr> +<tr class="codeline" data-linenumber="1713"><td class="num" id="LN1713">1713</td><td class="line"> <span class='string_literal'>"base"</span>,</td></tr> +<tr class="codeline" data-linenumber="1714"><td class="num" id="LN1714">1714</td><td class="line"> <span class='string_literal'>"Default number base (derived from number-format)"</span>,</td></tr> +<tr class="codeline" data-linenumber="1715"><td class="num" id="LN1715">1715</td><td class="line"> 2, 16, 10,</td></tr> +<tr class="codeline" data-linenumber="1716"><td class="num" id="LN1716">1716</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1717"><td class="num" id="LN1717">1717</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1718"><td class="num" id="LN1718">1718</td><td class="line"> PROP_WORD_SIZE,</td></tr> +<tr class="codeline" data-linenumber="1719"><td class="num" id="LN1719">1719</td><td class="line"> g_param_spec_int(<span class='string_literal'>"word-size"</span>,</td></tr> +<tr class="codeline" data-linenumber="1720"><td class="num" id="LN1720">1720</td><td class="line"> <span class='string_literal'>"word-size"</span>,</td></tr> +<tr class="codeline" data-linenumber="1721"><td class="num" id="LN1721">1721</td><td class="line"> <span class='string_literal'>"Word size in bits"</span>,</td></tr> +<tr class="codeline" data-linenumber="1722"><td class="num" id="LN1722">1722</td><td class="line"> 8, 64, 64,</td></tr> +<tr class="codeline" data-linenumber="1723"><td class="num" id="LN1723">1723</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1724"><td class="num" id="LN1724">1724</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1725"><td class="num" id="LN1725">1725</td><td class="line"> PROP_ANGLE_UNITS,</td></tr> +<tr class="codeline" data-linenumber="1726"><td class="num" id="LN1726">1726</td><td class="line"> g_param_spec_enum(<span class='string_literal'>"angle-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1727"><td class="num" id="LN1727">1727</td><td class="line"> <span class='string_literal'>"angle-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1728"><td class="num" id="LN1728">1728</td><td class="line"> <span class='string_literal'>"Angle units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1729"><td class="num" id="LN1729">1729</td><td class="line"> angle_unit_type,</td></tr> +<tr class="codeline" data-linenumber="1730"><td class="num" id="LN1730">1730</td><td class="line"> MP_DEGREES,</td></tr> +<tr class="codeline" data-linenumber="1731"><td class="num" id="LN1731">1731</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1732"><td class="num" id="LN1732">1732</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1733"><td class="num" id="LN1733">1733</td><td class="line"> PROP_SOURCE_CURRENCY,</td></tr> +<tr class="codeline" data-linenumber="1734"><td class="num" id="LN1734">1734</td><td class="line"> g_param_spec_string(<span class='string_literal'>"source-currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="1735"><td class="num" id="LN1735">1735</td><td class="line"> <span class='string_literal'>"source-currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="1736"><td class="num" id="LN1736">1736</td><td class="line"> <span class='string_literal'>"Source Currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="1737"><td class="num" id="LN1737">1737</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1738"><td class="num" id="LN1738">1738</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1739"><td class="num" id="LN1739">1739</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1740"><td class="num" id="LN1740">1740</td><td class="line"> PROP_TARGET_CURRENCY,</td></tr> +<tr class="codeline" data-linenumber="1741"><td class="num" id="LN1741">1741</td><td class="line"> g_param_spec_string(<span class='string_literal'>"target-currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="1742"><td class="num" id="LN1742">1742</td><td class="line"> <span class='string_literal'>"target-currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="1743"><td class="num" id="LN1743">1743</td><td class="line"> <span class='string_literal'>"target Currency"</span>,</td></tr> +<tr class="codeline" data-linenumber="1744"><td class="num" id="LN1744">1744</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1745"><td class="num" id="LN1745">1745</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1746"><td class="num" id="LN1746">1746</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1747"><td class="num" id="LN1747">1747</td><td class="line"> PROP_SOURCE_UNITS,</td></tr> +<tr class="codeline" data-linenumber="1748"><td class="num" id="LN1748">1748</td><td class="line"> g_param_spec_string(<span class='string_literal'>"source-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1749"><td class="num" id="LN1749">1749</td><td class="line"> <span class='string_literal'>"source-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1750"><td class="num" id="LN1750">1750</td><td class="line"> <span class='string_literal'>"Source Units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1751"><td class="num" id="LN1751">1751</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1752"><td class="num" id="LN1752">1752</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1753"><td class="num" id="LN1753">1753</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1754"><td class="num" id="LN1754">1754</td><td class="line"> PROP_TARGET_UNITS,</td></tr> +<tr class="codeline" data-linenumber="1755"><td class="num" id="LN1755">1755</td><td class="line"> g_param_spec_string(<span class='string_literal'>"target-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1756"><td class="num" id="LN1756">1756</td><td class="line"> <span class='string_literal'>"target-units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1757"><td class="num" id="LN1757">1757</td><td class="line"> <span class='string_literal'>"target Units"</span>,</td></tr> +<tr class="codeline" data-linenumber="1758"><td class="num" id="LN1758">1758</td><td class="line"> <span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="1759"><td class="num" id="LN1759">1759</td><td class="line"> G_PARAM_READWRITE));</td></tr> +<tr class="codeline" data-linenumber="1760"><td class="num" id="LN1760">1760</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="1761"><td class="num" id="LN1761">1761</td><td class="line"> PROP_SERIALIZER,</td></tr> +<tr class="codeline" data-linenumber="1762"><td class="num" id="LN1762">1762</td><td class="line"> g_param_spec_object(<span class='string_literal'>"serializer"</span>,</td></tr> +<tr class="codeline" data-linenumber="1763"><td class="num" id="LN1763">1763</td><td class="line"> <span class='string_literal'>"serializer"</span>,</td></tr> +<tr class="codeline" data-linenumber="1764"><td class="num" id="LN1764">1764</td><td class="line"> <span class='string_literal'>"Serializer"</span>,</td></tr> +<tr class="codeline" data-linenumber="1765"><td class="num" id="LN1765">1765</td><td class="line"> <span class='macro'>MP_TYPE_SERIALIZER<span class='macro_popup'>(mp_serializer_get_type())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1766"><td class="num" id="LN1766">1766</td><td class="line"> G_PARAM_READABLE));</td></tr> +<tr class="codeline" data-linenumber="1767"><td class="num" id="LN1767">1767</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1768"><td class="num" id="LN1768">1768</td><td class="line"> GType param_types[2] = {<span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, <span class='macro'>G_TYPE_POINTER<span class='macro_popup'>((GType) ((17) << (2)))</span></span>};</td></tr> +<tr class="codeline" data-linenumber="1769"><td class="num" id="LN1769">1769</td><td class="line"> g_signal_newv(<span class='string_literal'>"history"</span>,</td></tr> +<tr class="codeline" data-linenumber="1770"><td class="num" id="LN1770">1770</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS(klass)<span class='macro_popup'>(((GTypeClass*) (klass))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1771"><td class="num" id="LN1771">1771</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="1772"><td class="num" id="LN1772">1772</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="1773"><td class="num" id="LN1773">1773</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1774"><td class="num" id="LN1774">1774</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1775"><td class="num" id="LN1775">1775</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1776"><td class="num" id="LN1776">1776</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1777"><td class="num" id="LN1777">1777</td><td class="line"> 2,</td></tr> +<tr class="codeline" data-linenumber="1778"><td class="num" id="LN1778">1778</td><td class="line"> param_types);</td></tr> +<tr class="codeline" data-linenumber="1779"><td class="num" id="LN1779">1779</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1780"><td class="num" id="LN1780">1780</td><td class="line"> g_signal_new (<span class='string_literal'>"display-changed"</span>,</td></tr> +<tr class="codeline" data-linenumber="1781"><td class="num" id="LN1781">1781</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS(klass)<span class='macro_popup'>(((GTypeClass*) (klass))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1782"><td class="num" id="LN1782">1782</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="1783"><td class="num" id="LN1783">1783</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="1784"><td class="num" id="LN1784">1784</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1785"><td class="num" id="LN1785">1785</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1786"><td class="num" id="LN1786">1786</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1787"><td class="num" id="LN1787">1787</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1788"><td class="num" id="LN1788">1788</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="1789"><td class="num" id="LN1789">1789</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1790"><td class="num" id="LN1790">1790</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1791"><td class="num" id="LN1791">1791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1792"><td class="num" id="LN1792">1792</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1793"><td class="num" id="LN1793">1793</td><td class="line">pre_insert_text_cb(MathEquation *equation,</td></tr> +<tr class="codeline" data-linenumber="1794"><td class="num" id="LN1794">1794</td><td class="line"> GtkTextIter *location,</td></tr> +<tr class="codeline" data-linenumber="1795"><td class="num" id="LN1795">1795</td><td class="line"> gchar *text,</td></tr> +<tr class="codeline" data-linenumber="1796"><td class="num" id="LN1796">1796</td><td class="line"> gint len,</td></tr> +<tr class="codeline" data-linenumber="1797"><td class="num" id="LN1797">1797</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="1798"><td class="num" id="LN1798">1798</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1799"><td class="num" id="LN1799">1799</td><td class="line"> gunichar c;</td></tr> +<tr class="codeline" data-linenumber="1800"><td class="num" id="LN1800">1800</td><td class="line"> gint cursor;</td></tr> +<tr class="codeline" data-linenumber="1801"><td class="num" id="LN1801">1801</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1802"><td class="num" id="LN1802">1802</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_reformat)</td></tr> +<tr class="codeline" data-linenumber="1803"><td class="num" id="LN1803">1803</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1804"><td class="num" id="LN1804">1804</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1805"><td class="num" id="LN1805">1805</td><td class="line"> <span class='comment'>/* If following a delete then have already pushed undo stack (GtkTextBuffer</span></td></tr> +<tr class="codeline" data-linenumber="1806"><td class="num" id="LN1806">1806</td><td class="line"> <span class='comment'>doesn't indicate replace operations so we have to infer them) */</span></td></tr> +<tr class="codeline" data-linenumber="1807"><td class="num" id="LN1807">1807</td><td class="line"> <span class='keyword'>if</span> (!equation->priv->in_delete)</td></tr> +<tr class="codeline" data-linenumber="1808"><td class="num" id="LN1808">1808</td><td class="line"> math_equation_push_undo_stack(equation);</td></tr> +<tr class="codeline" data-linenumber="1809"><td class="num" id="LN1809">1809</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1810"><td class="num" id="LN1810">1810</td><td class="line"> <span class='comment'>/* Clear result on next digit entered if cursor at end of line */</span></td></tr> +<tr class="codeline" data-linenumber="1811"><td class="num" id="LN1811">1811</td><td class="line"> c = g_utf8_get_char(text);</td></tr> +<tr class="codeline" data-linenumber="1812"><td class="num" id="LN1812">1812</td><td class="line"> g_object_get(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"cursor-position"</span>, &cursor, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1813"><td class="num" id="LN1813">1813</td><td class="line"> <span class='keyword'>if</span> ((g_unichar_isdigit(c) || c == mp_serializer_get_radix(equation->priv->serializer)) &&</td></tr> +<tr class="codeline" data-linenumber="1814"><td class="num" id="LN1814">1814</td><td class="line"> math_equation_is_result(equation) &&</td></tr> +<tr class="codeline" data-linenumber="1815"><td class="num" id="LN1815">1815</td><td class="line"> cursor >= gtk_text_buffer_get_char_count(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>)) {</td></tr> +<tr class="codeline" data-linenumber="1816"><td class="num" id="LN1816">1816</td><td class="line"> gtk_text_buffer_set_text(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, <span class='string_literal'>""</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="1817"><td class="num" id="LN1817">1817</td><td class="line"> clear_ans(equation, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1818"><td class="num" id="LN1818">1818</td><td class="line"> gtk_text_buffer_get_end_iter(<span class='macro'>GTK_TEXT_BUFFER(equation)<span class='macro_popup'>((((GtkTextBuffer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), ((gtk_text_buffer_get_type ()))))))</span></span>, location);</td></tr> +<tr class="codeline" data-linenumber="1819"><td class="num" id="LN1819">1819</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1820"><td class="num" id="LN1820">1820</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1821"><td class="num" id="LN1821">1821</td><td class="line"> <span class='keyword'>if</span> (equation->priv->ans_start) {</td></tr> +<tr class="codeline" data-linenumber="1822"><td class="num" id="LN1822">1822</td><td class="line"> gint ans_start, ans_end;</td></tr> +<tr class="codeline" data-linenumber="1823"><td class="num" id="LN1823">1823</td><td class="line"> gint offset;</td></tr> +<tr class="codeline" data-linenumber="1824"><td class="num" id="LN1824">1824</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1825"><td class="num" id="LN1825">1825</td><td class="line"> offset = gtk_text_iter_get_offset(location);</td></tr> +<tr class="codeline" data-linenumber="1826"><td class="num" id="LN1826">1826</td><td class="line"> get_ans_offsets(equation, &ans_start, &ans_end);</td></tr> +<tr class="codeline" data-linenumber="1827"><td class="num" id="LN1827">1827</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1828"><td class="num" id="LN1828">1828</td><td class="line"> <span class='comment'>/* Inserted inside or right before ans */</span></td></tr> +<tr class="codeline" data-linenumber="1829"><td class="num" id="LN1829">1829</td><td class="line"> <span class='keyword'>if</span> (offset >= ans_start && offset < ans_end)</td></tr> +<tr class="codeline" data-linenumber="1830"><td class="num" id="LN1830">1830</td><td class="line"> clear_ans(equation, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1831"><td class="num" id="LN1831">1831</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1832"><td class="num" id="LN1832">1832</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1833"><td class="num" id="LN1833">1833</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1834"><td class="num" id="LN1834">1834</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1835"><td class="num" id="LN1835">1835</td><td class="line">on_delete(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1836"><td class="num" id="LN1836">1836</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1837"><td class="num" id="LN1837">1837</td><td class="line"> equation->priv->in_delete = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1838"><td class="num" id="LN1838">1838</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1839"><td class="num" id="LN1839">1839</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1840"><td class="num" id="LN1840">1840</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1841"><td class="num" id="LN1841">1841</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1842"><td class="num" id="LN1842">1842</td><td class="line">pre_delete_range_cb(MathEquation *equation,</td></tr> +<tr class="codeline" data-linenumber="1843"><td class="num" id="LN1843">1843</td><td class="line"> GtkTextIter *start,</td></tr> +<tr class="codeline" data-linenumber="1844"><td class="num" id="LN1844">1844</td><td class="line"> GtkTextIter *end,</td></tr> +<tr class="codeline" data-linenumber="1845"><td class="num" id="LN1845">1845</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="1846"><td class="num" id="LN1846">1846</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1847"><td class="num" id="LN1847">1847</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_reformat)</td></tr> +<tr class="codeline" data-linenumber="1848"><td class="num" id="LN1848">1848</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1849"><td class="num" id="LN1849">1849</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1850"><td class="num" id="LN1850">1850</td><td class="line"> math_equation_push_undo_stack(equation);</td></tr> +<tr class="codeline" data-linenumber="1851"><td class="num" id="LN1851">1851</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1852"><td class="num" id="LN1852">1852</td><td class="line"> equation->priv->in_delete = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1853"><td class="num" id="LN1853">1853</td><td class="line"> g_idle_add((GSourceFunc)on_delete, equation);</td></tr> +<tr class="codeline" data-linenumber="1854"><td class="num" id="LN1854">1854</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1855"><td class="num" id="LN1855">1855</td><td class="line"> <span class='keyword'>if</span> (equation->priv->ans_start) {</td></tr> +<tr class="codeline" data-linenumber="1856"><td class="num" id="LN1856">1856</td><td class="line"> gint ans_start, ans_end;</td></tr> +<tr class="codeline" data-linenumber="1857"><td class="num" id="LN1857">1857</td><td class="line"> gint start_offset, end_offset;</td></tr> +<tr class="codeline" data-linenumber="1858"><td class="num" id="LN1858">1858</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1859"><td class="num" id="LN1859">1859</td><td class="line"> start_offset = gtk_text_iter_get_offset(start);</td></tr> +<tr class="codeline" data-linenumber="1860"><td class="num" id="LN1860">1860</td><td class="line"> end_offset = gtk_text_iter_get_offset(end);</td></tr> +<tr class="codeline" data-linenumber="1861"><td class="num" id="LN1861">1861</td><td class="line"> get_ans_offsets(equation, &ans_start, &ans_end);</td></tr> +<tr class="codeline" data-linenumber="1862"><td class="num" id="LN1862">1862</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1863"><td class="num" id="LN1863">1863</td><td class="line"> <span class='comment'>/* Deleted part of ans */</span></td></tr> +<tr class="codeline" data-linenumber="1864"><td class="num" id="LN1864">1864</td><td class="line"> <span class='keyword'>if</span> (start_offset < ans_end && end_offset > ans_start)</td></tr> +<tr class="codeline" data-linenumber="1865"><td class="num" id="LN1865">1865</td><td class="line"> clear_ans(equation, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1866"><td class="num" id="LN1866">1866</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1867"><td class="num" id="LN1867">1867</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1868"><td class="num" id="LN1868">1868</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1869"><td class="num" id="LN1869">1869</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1870"><td class="num" id="LN1870">1870</td><td class="line">insert_text_cb(MathEquation *equation,</td></tr> +<tr class="codeline" data-linenumber="1871"><td class="num" id="LN1871">1871</td><td class="line"> GtkTextIter *location,</td></tr> +<tr class="codeline" data-linenumber="1872"><td class="num" id="LN1872">1872</td><td class="line"> gchar *text,</td></tr> +<tr class="codeline" data-linenumber="1873"><td class="num" id="LN1873">1873</td><td class="line"> gint len,</td></tr> +<tr class="codeline" data-linenumber="1874"><td class="num" id="LN1874">1874</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="1875"><td class="num" id="LN1875">1875</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1876"><td class="num" id="LN1876">1876</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_reformat)</td></tr> +<tr class="codeline" data-linenumber="1877"><td class="num" id="LN1877">1877</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1878"><td class="num" id="LN1878">1878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1879"><td class="num" id="LN1879">1879</td><td class="line"> equation->priv->state.entered_multiply = strcmp(text, <span class='string_literal'>"×"</span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="1880"><td class="num" id="LN1880">1880</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1881"><td class="num" id="LN1881">1881</td><td class="line"> <span class='comment'>/* Update thousands separators */</span></td></tr> +<tr class="codeline" data-linenumber="1882"><td class="num" id="LN1882">1882</td><td class="line"> reformat_separators(equation);</td></tr> +<tr class="codeline" data-linenumber="1883"><td class="num" id="LN1883">1883</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1884"><td class="num" id="LN1884">1884</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"display"</span>);</td></tr> +<tr class="codeline" data-linenumber="1885"><td class="num" id="LN1885">1885</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1886"><td class="num" id="LN1886">1886</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1887"><td class="num" id="LN1887">1887</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1888"><td class="num" id="LN1888">1888</td><td class="line">delete_range_cb(MathEquation *equation,</td></tr> +<tr class="codeline" data-linenumber="1889"><td class="num" id="LN1889">1889</td><td class="line"> GtkTextIter *start,</td></tr> +<tr class="codeline" data-linenumber="1890"><td class="num" id="LN1890">1890</td><td class="line"> GtkTextIter *end,</td></tr> +<tr class="codeline" data-linenumber="1891"><td class="num" id="LN1891">1891</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="1892"><td class="num" id="LN1892">1892</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1893"><td class="num" id="LN1893">1893</td><td class="line"> <span class='keyword'>if</span> (equation->priv->in_reformat)</td></tr> +<tr class="codeline" data-linenumber="1894"><td class="num" id="LN1894">1894</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1895"><td class="num" id="LN1895">1895</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1896"><td class="num" id="LN1896">1896</td><td class="line"> equation->priv->state.entered_multiply = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1897"><td class="num" id="LN1897">1897</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1898"><td class="num" id="LN1898">1898</td><td class="line"> <span class='comment'>/* Update thousands separators */</span></td></tr> +<tr class="codeline" data-linenumber="1899"><td class="num" id="LN1899">1899</td><td class="line"> reformat_separators(equation);</td></tr> +<tr class="codeline" data-linenumber="1900"><td class="num" id="LN1900">1900</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1901"><td class="num" id="LN1901">1901</td><td class="line"> <span class='comment'>// FIXME: A replace will emit this both for delete-range and insert-text, can it be avoided?</span></td></tr> +<tr class="codeline" data-linenumber="1902"><td class="num" id="LN1902">1902</td><td class="line"> g_object_notify(<span class='macro'>G_OBJECT(equation)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((equation)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"display"</span>);</td></tr> +<tr class="codeline" data-linenumber="1903"><td class="num" id="LN1903">1903</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1904"><td class="num" id="LN1904">1904</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1905"><td class="num" id="LN1905">1905</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1906"><td class="num" id="LN1906">1906</td><td class="line">math_equation_init(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="1907"><td class="num" id="LN1907">1907</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1908"><td class="num" id="LN1908">1908</td><td class="line"> <span class='comment'>/* Digits localized for the given language */</span></td></tr> +<tr class="codeline" data-linenumber="1909"><td class="num" id="LN1909">1909</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *digit_values = <span class='macro'>_(<span class='string_literal'>"0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F"</span>)<span class='macro_popup'>dcgettext (((void*)0), "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F", 5)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1910"><td class="num" id="LN1910">1910</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *default_digits[] = {<span class='string_literal'>"0"</span>, <span class='string_literal'>"1"</span>, <span class='string_literal'>"2"</span>, <span class='string_literal'>"3"</span>, <span class='string_literal'>"4"</span>, <span class='string_literal'>"5"</span>, <span class='string_literal'>"6"</span>, <span class='string_literal'>"7"</span>, <span class='string_literal'>"8"</span>, <span class='string_literal'>"9"</span>, <span class='string_literal'>"A"</span>, <span class='string_literal'>"B"</span>, <span class='string_literal'>"C"</span>, <span class='string_literal'>"D"</span>, <span class='string_literal'>"E"</span>, <span class='string_literal'>"F"</span>};</td></tr> +<tr class="codeline" data-linenumber="1911"><td class="num" id="LN1911">1911</td><td class="line"> gchar **digits;</td></tr> +<tr class="codeline" data-linenumber="1912"><td class="num" id="LN1912">1912</td><td class="line"> <span class='comment'>/* Default to using untranslated digits, this is because it doesn't make sense in most languages and we need to make this optional.</span></td></tr> +<tr class="codeline" data-linenumber="1913"><td class="num" id="LN1913">1913</td><td class="line"> <span class='comment'>* See https://bugzilla.gnome.org/show_bug.cgi?id=632661 */</span></td></tr> +<tr class="codeline" data-linenumber="1914"><td class="num" id="LN1914">1914</td><td class="line"> gboolean use_default_digits = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1915"><td class="num" id="LN1915">1915</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="1916"><td class="num" id="LN1916">1916</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1917"><td class="num" id="LN1917">1917</td><td class="line"> equation->priv = math_equation_get_instance_private (equation);</td></tr> +<tr class="codeline" data-linenumber="1918"><td class="num" id="LN1918">1918</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1919"><td class="num" id="LN1919">1919</td><td class="line"> <span class='macro'>g_signal_connect(equation, <span class='string_literal'>"insert-text"</span>, G_CALLBACK(pre_insert_text_cb), equation)<span class='macro_popup'>g_signal_connect_data ((equation), ("insert-text"), (((GCallback<br>) (pre_insert_text_cb))), (equation), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1920"><td class="num" id="LN1920">1920</td><td class="line"> <span class='macro'>g_signal_connect(equation, <span class='string_literal'>"delete-range"</span>, G_CALLBACK(pre_delete_range_cb), equation)<span class='macro_popup'>g_signal_connect_data ((equation), ("delete-range"), (((GCallback<br>) (pre_delete_range_cb))), (equation), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1921"><td class="num" id="LN1921">1921</td><td class="line"> <span class='macro'>g_signal_connect_after(equation, <span class='string_literal'>"insert-text"</span>, G_CALLBACK(insert_text_cb), equation)<span class='macro_popup'>g_signal_connect_data ((equation), ("insert-text"), (((GCallback<br>) (insert_text_cb))), (equation), ((void*)0), G_CONNECT_AFTER<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1922"><td class="num" id="LN1922">1922</td><td class="line"> <span class='macro'>g_signal_connect_after(equation, <span class='string_literal'>"delete-range"</span>, G_CALLBACK(delete_range_cb), equation)<span class='macro_popup'>g_signal_connect_data ((equation), ("delete-range"), (((GCallback<br>) (delete_range_cb))), (equation), ((void*)0), G_CONNECT_AFTER<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1923"><td class="num" id="LN1923">1923</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1924"><td class="num" id="LN1924">1924</td><td class="line"> digits = g_strsplit(digit_values, <span class='string_literal'>","</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="1925"><td class="num" id="LN1925">1925</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < 16; i++) {</td></tr> +<tr class="codeline" data-linenumber="1926"><td class="num" id="LN1926">1926</td><td class="line"> <span class='keyword'>if</span> (use_default_digits || digits[i] == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1927"><td class="num" id="LN1927">1927</td><td class="line"> use_default_digits = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1928"><td class="num" id="LN1928">1928</td><td class="line"> equation->priv->digits[i] = g_utf8_get_char(default_digits[i]);</td></tr> +<tr class="codeline" data-linenumber="1929"><td class="num" id="LN1929">1929</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1930"><td class="num" id="LN1930">1930</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1931"><td class="num" id="LN1931">1931</td><td class="line"> equation->priv->digits[i] = g_utf8_get_char(digits[i]);</td></tr> +<tr class="codeline" data-linenumber="1932"><td class="num" id="LN1932">1932</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1933"><td class="num" id="LN1933">1933</td><td class="line"> g_strfreev(digits);</td></tr> +<tr class="codeline" data-linenumber="1934"><td class="num" id="LN1934">1934</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1935"><td class="num" id="LN1935">1935</td><td class="line"> equation->priv->variables = math_variables_new();</td></tr> +<tr class="codeline" data-linenumber="1936"><td class="num" id="LN1936">1936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1937"><td class="num" id="LN1937">1937</td><td class="line"> equation->priv->state.ans = mp_new();</td></tr> +<tr class="codeline" data-linenumber="1938"><td class="num" id="LN1938">1938</td><td class="line"> equation->priv->state.status = g_strdup(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1939"><td class="num" id="LN1939">1939</td><td class="line"> equation->priv->word_size = 32;</td></tr> +<tr class="codeline" data-linenumber="1940"><td class="num" id="LN1940">1940</td><td class="line"> equation->priv->angle_units = MP_DEGREES;</td></tr> +<tr class="codeline" data-linenumber="1941"><td class="num" id="LN1941">1941</td><td class="line"> <span class='comment'>// FIXME: Pick based on locale</span></td></tr> +<tr class="codeline" data-linenumber="1942"><td class="num" id="LN1942">1942</td><td class="line"> equation->priv->source_currency = g_strdup(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1943"><td class="num" id="LN1943">1943</td><td class="line"> equation->priv->target_currency = g_strdup(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1944"><td class="num" id="LN1944">1944</td><td class="line"> equation->priv->source_units = g_strdup(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1945"><td class="num" id="LN1945">1945</td><td class="line"> equation->priv->target_units = g_strdup(<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="1946"><td class="num" id="LN1946">1946</td><td class="line"> equation->priv->serializer = mp_serializer_new(MP_DISPLAY_FORMAT_AUTOMATIC, 10, 9);</td></tr> +<tr class="codeline" data-linenumber="1947"><td class="num" id="LN1947">1947</td><td class="line"> equation->priv->queue = g_async_queue_new();</td></tr> +<tr class="codeline" data-linenumber="1948"><td class="num" id="LN1948">1948</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1949"><td class="num" id="LN1949">1949</td><td class="line"> mp_set_from_integer(0, &equation->priv->state.ans);</td></tr> +<tr class="codeline" data-linenumber="1950"><td class="num" id="LN1950">1950</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-b1189a.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-b1189a.html new file mode 100644 index 0000000..b4212e0 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-b1189a.html @@ -0,0 +1,1270 @@ +<!doctype html> +<html> +<head> +<title>lexer.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type' --> + +<!-- BUGTYPE Dead nested assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/src/lexer.c --> + +<!-- FILENAME lexer.c --> + +<!-- FUNCTIONNAME l_insert_next_token --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT b1189ac72a8d90e9428ce64c7e65fb12 --> + +<!-- BUGLINE 125 --> + +<!-- BUGCOLUMN 13 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>lexer.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 125, column 13</a><br />Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name lexer.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c lexer.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"125": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"><span class='directive'>#include <assert.h></span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"><span class='directive'>#include "lexer.h"</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"><span class='directive'>#include "parserfunc.h"</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"><span class='directive'>#include "mp-equation.h"</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line">l_check_if_function(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> gchar* name = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='keyword'>if</span>(!state->parent->function_is_defined)</td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='keyword'>if</span> ((*(state->parent->function_is_defined))(state->parent, name))</td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> free(name);</td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line">l_check_if_number(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> <span class='keyword'>int</span> count = 0;</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> gchar* text = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(text, state->parent->options->base, &tmp) == 0)</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='comment'>/* Try to rollback several characters to see, if that yeilds any number. */</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='keyword'>while</span>(strlen (text) > 0)</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(text, state->parent->options->base, &tmp) == 0)</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> count++;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> pl_roll_back(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> text = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>/* Undo all rollbacks. */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='keyword'>while</span>(count--)</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> pl_get_next_token (state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> free(text);</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"><span class='comment'>/* Insert generated token to the LexerState structure. */</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='keyword'>static</span> LexerToken*</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line">l_insert_token(LexerState* state, <span class='keyword'>const</span> LexerTokenType type)</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> state->tokens = (LexerToken *) realloc(state->tokens, (state->token_count + 1) * <span class='keyword'>sizeof</span>(LexerToken));</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='macro'>assert(state->tokens != NULL)<span class='macro_popup'>((void) sizeof ((state->tokens != ((void*)0)) ? 1 : 0), __extension__<br> ({ if (state->tokens != ((void*)0)) ; else __assert_fail (<br>"state->tokens != NULL", "lexer.c", 72, __extension__ __PRETTY_FUNCTION__<br>); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> state->tokens[state->token_count].string = pl_get_marked_substring(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> state->tokens[state->token_count].start_index = state->prelexer->mark_index;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> state->tokens[state->token_count].end_index = state->prelexer->next_index;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> state->tokens[state->token_count].token_type = type;</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> state->token_count++;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->token_count - 1];</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='comment'>/* Generates next token from pre-lexer stream and call l_insert_token() to insert it at the end. */</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='keyword'>static</span> LexerToken*</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">l_insert_next_token(LexerState* lstate)</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> PreLexerState* state = lstate->prelexer;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> LexerTokenType type;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gchar* tmp;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> pl_set_marker(state);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> <span class='comment'>/* Ignore all blank spaces. :) */</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_SKIP)</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='comment'>/* Set marker. Beginning of new token. */</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> pl_set_marker(state);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span>(type == T_AND</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> ||type == T_OR</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> ||type == T_XOR</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> ||type == T_NOT</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> ||type == T_ADD</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> ||type == T_SUBTRACT</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> ||type == T_MULTIPLY</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> ||type == T_DIV</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> ||type == T_L_FLOOR</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> ||type == T_R_FLOOR</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> ||type == T_L_CEILING</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> ||type == T_R_CEILING</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> ||type == T_ROOT</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> ||type == T_ROOT_3</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> ||type == T_ROOT_4</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> ||type == T_ASSIGN</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> ||type == T_L_R_BRACKET</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> ||type == T_R_R_BRACKET</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> ||type == T_L_S_BRACKET</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> ||type == T_R_S_BRACKET</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> ||type == T_L_C_BRACKET</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> ||type == T_R_C_BRACKET</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> ||type == T_ABS</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> ||type == T_POWER</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> ||type == T_FACTORIAL</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> ||type == T_PERCENTAGE)</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, type);</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='comment'>/* [PL_SUPER_MINUS][PL_SUPER_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUPER_MINUS)</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>if</span>((type = <span class="mrange">pl_get_next_token(state)</span>) != PL_SUPER_DIGIT)</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:13ex">Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'</div></td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SUP_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring (state));</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='comment'>/* Get all PL_SUPER_DIGITs. */</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='keyword'>while</span> (pl_get_next_token(state) == PL_SUPER_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NSUP_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='comment'>/* [PL_SUPER_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUPER_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUPER_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_SUP_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='comment'>/* [PL_SUB_DIGIT]+ */</span></td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_SUB_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> <span class='comment'>/* [PL_FRACTION] */</span></td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='keyword'>if</span>(type == PL_FRACTION)</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='keyword'>if</span>(type == PL_FRACTION)</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DEGREE)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>goto</span> ANGLE_NUM_DM_STATE;</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_MINUTE)</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='keyword'>goto</span> ANGLE_NUM_DMS_STATE;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SECOND)</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SECOND */</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring (state));</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">ANGLE_NUM_DMS_STATE:</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>if</span>((type = pl_get_next_token (state)) != PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>if</span>(type == PL_SECOND)</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='comment'>/* ERROR: expected PL_SECOND */</span></td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='comment'>/* ERROR: expected PL_MINUTE | PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line">ANGLE_NUM_DM_STATE:</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>if</span>((type = pl_get_next_token(state)) != PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT */</span></td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='keyword'>if</span>(type == PL_MINUTE)</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='comment'>/* ERROR: expected PL_MINUTE */</span></td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_STATE;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='keyword'>goto</span> HEX_DEC_STATE;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">DECIMAL_STATE:</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='keyword'>if</span>(type == PL_DEGREE)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span>(type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>while</span>((type = pl_get_next_token(state)) == PL_HEX);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line">HEX_DEC_STATE:</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>goto</span> DECIMAL_HEX_STATE;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DECIMAL | PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_DECIMAL)</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">DECIMAL_HEX_STATE:</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>if</span>(!(type == PL_DIGIT || type == PL_HEX))</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='comment'>/* ERROR: expected PL_DIGIT | PL_HEX */</span></td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> set_error(lstate->parent, PARSER_ERR_MP, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>if</span>(type == PL_DIGIT || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='comment'>/* NUMBER */</span></td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='comment'>/* VARIABLE */</span></td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_LETTER)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>goto</span> LETTER_STATE;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='keyword'>if</span>(l_check_if_number(lstate))</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> <span class='comment'>/* NUMBER */</span></td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NUMBER);</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> <span class='comment'>/* VARIABLE */</span></td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>if</span>(type == PL_LETTER)</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line">LETTER_STATE:</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> type = pl_get_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class='keyword'>if</span>(type == PL_LETTER || type == PL_HEX)</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span>(type == PL_SUB_DIGIT)</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='keyword'>while</span>(pl_get_next_token(state) == PL_SUB_DIGIT);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> tmp = g_ascii_strdown(pl_get_marked_substring(state), -1);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"mod"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_MOD);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"and"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_AND);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"or"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_OR);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"xor"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_XOR);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"not"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NOT);</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"in"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_IN);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> pl_roll_back(state);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> tmp = g_ascii_strdown(pl_get_marked_substring(state), -1);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"mod"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_MOD);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"and"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_AND);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"or"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_OR);</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"xor"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_XOR);</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"not"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_NOT);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>if</span>(g_strcmp0(tmp, <span class='string_literal'>"in"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_IN);</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='keyword'>if</span>(l_check_if_function(lstate))</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_FUNCTION);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_VARIABLE);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>if</span>(type == PL_EOS)</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, PL_EOS);</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='comment'>/* ERROR: Unexpected token.. X( */</span></td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> set_error(lstate->parent, PARSER_ERR_INVALID, tmp = pl_get_marked_substring(state));</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> free(tmp);</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='keyword'>return</span> l_insert_token(lstate, T_UNKNOWN);</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"><span class='comment'>/* Call l_insert_next_token() as many times as needed to completely tokenize the string. */</span></td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">l_insert_all_tokens(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> LexerToken* token;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>while</span>(1)</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> token = l_insert_next_token(state);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> <span class='macro'>assert(token != NULL)<span class='macro_popup'>((void) sizeof ((token != ((void*)0)) ? 1 : 0), __extension__<br> ({ if (token != ((void*)0)) ; else __assert_fail ("token != NULL"<br>, "lexer.c", 537, __extension__ __PRETTY_FUNCTION__); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>if</span>(token->token_type == PL_EOS)</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"><span class='comment'>/* Create a lexer state from given input string. This will take care of pre-lexer state. */</span></td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line">LexerState*</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line">l_create_lexer(<span class='keyword'>const</span> gchar* input, <span class='keyword'>struct</span> parser_state* parent)</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> LexerState* ret;</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> ret = (LexerState *) malloc(<span class='keyword'>sizeof</span>(LexerState));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='macro'>assert(ret != NULL)<span class='macro_popup'>((void) sizeof ((ret != ((void*)0)) ? 1 : 0), __extension__ (<br>{ if (ret != ((void*)0)) ; else __assert_fail ("ret != NULL",<br> "lexer.c", 551, __extension__ __PRETTY_FUNCTION__); }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> ret->prelexer = pl_create_scanner(input);</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> ret->tokens = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> ret->token_count = 0;</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> ret->next_token = 0;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> ret->parent = parent;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"><span class='comment'>/* Destroy lexer state and free memory. */</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line">l_destroy_lexer(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>int</span> l;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> pl_destroy_scanner(state->prelexer);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>for</span>(l = 0; l < state->token_count; l++)</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> free(state->tokens[l].string);</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> free(state->tokens);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> free(state);</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"><span class='comment'>/* Get next token interface. Will be called by parser to get pointer to next token in token stream. */</span></td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">LexerToken*</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line">l_get_next_token(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='comment'>/* Return PL_EOS token after token stream reaches to its end. */</span></td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span>(state->next_token >= state->token_count)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->token_count - 1];</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>return</span> &state->tokens[state->next_token++];</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"><span class='comment'>/* Roll back one lexer token. */</span></td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line">l_roll_back(LexerState* state)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span>(state->next_token > 0)</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> state->next_token--;</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-c223fe.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-c223fe.html new file mode 100644 index 0000000..574ef3b --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-c223fe.html @@ -0,0 +1,1651 @@ +<!doctype html> +<html> +<head> +<title>parserfunc.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcat' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/src/parserfunc.c --> + +<!-- FILENAME parserfunc.c --> + +<!-- FUNCTIONNAME pf_apply_func_with_npower --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT c223fe72055ae2460b26993ea236829c --> + +<!-- BUGLINE 366 --> + +<!-- BUGCOLUMN 5 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>parserfunc.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 366, column 5</a><br />Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name parserfunc.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c parserfunc.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"366": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"><span class='directive'>#include "parser.h"</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"><span class='directive'>#include "parserfunc.h"</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"><span class='comment'>/* Register error variables in ParserState structure. */</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line">set_error(ParserState* state, gint errorno, <span class='keyword'>const</span> gchar *token)</td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> state->error = errorno;</td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='keyword'>if</span>(token)</td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> state->error_token = strdup(token);</td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"><span class='comment'>/* Unused function pointer. This won't be called anytime. */</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line">pf_none(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='comment'>/* Set variable. */</span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line">pf_set_var(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> val = (MPNumber *) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> <span class='keyword'>if</span>(!val || !(self->state->set_variable))</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> (*(self->state->set_variable))(self->state, self->left->token->string, val);</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> <span class='keyword'>return</span> val;</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='comment'>/* Converts Number from one unit to other. */</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">pf_convert_number(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> gchar* from;</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> gchar* to;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> gint free_from = 0;</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> gint free_to = 0;</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='keyword'>if</span>(self->left->value)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> from = (gchar*) self->left->value;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> free_from = 1;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> from = self->left->token->string;</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='keyword'>if</span>(self->right->value)</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> to = (gchar*) self->right->value;</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> free_to = 1;</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> to = self->right->token->string;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(self->left->left->token->string, self->state->options->base, &tmp) != 0)</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> <span class='keyword'>goto</span> END_PF_CONVERT_NUMBER;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='keyword'>if</span>(!(self->state->convert))</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>goto</span> END_PF_CONVERT_NUMBER;</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->convert))(self->state, &tmp, from, to, ans))</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_CONVERSION, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line">END_PF_CONVERT_NUMBER:</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> <span class='keyword'>if</span>(free_from)</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> g_free(self->left->value);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> self->left->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>if</span>(free_to)</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_free(self->right->value);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> self->right->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='comment'>/* Conversion rate. */</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">pf_convert_1(ParseNode* self )</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> gchar* from;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> gchar* to;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> gint free_from = 0;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> gint free_to = 0;</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> MPNumber tmp = mp_new();</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span>(self->left->value)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> from = (gchar*) self->left->value;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> free_from = 1;</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> from = self->left->token->string;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='keyword'>if</span>(self->right->value)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> to = (gchar*) self->right->value;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> free_to = 1;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> to = self->right->token->string;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> mp_set_from_integer(1, &tmp);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span>(!(self->state->convert))</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->convert))(self->state, &tmp, from, to, ans))</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_CONVERSION, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>if</span>(free_from)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_free(self->left->value);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> self->left->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>if</span>(free_to)</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> g_free(self->right->value);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> self->right->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> mp_clear(&tmp);</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"><span class='comment'>/* Join source unit and power. */</span></td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line">pf_make_unit(gchar* source, gchar* power)</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>return</span> g_strjoin(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, source, power, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>static</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line">utf8_next_char(<span class='keyword'>const</span> gchar *c)</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> c++;</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>while</span>((*c & 0xC0) == 0x80)</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> c++;</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='keyword'>return</span>(gchar *) c;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"><span class='comment'>/* Get value of variable. */</span></td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">pf_get_variable(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> gint result = 0;</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>const</span> gchar *c, *next;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> gchar *buffer;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> MPNumber value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> MPNumber t = mp_new();</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_variable))</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>/* If defined, then get the variable */</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span>((*(self->state->get_variable))(self->state, self->token->string, ans))</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>/* If has more than one character then assume a multiplication of variables */</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>if</span>(utf8_next_char(self->token->string)[0] != '\0')</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> result = 1;</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> buffer = (gchar*) malloc(<span class='keyword'>sizeof</span>(gchar) * strlen(self->token->string));</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> mp_set_from_integer(1, &value);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='keyword'>for</span>(c = self->token->string; *c != '\0'; c = next)</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> next = utf8_next_char(c);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> snprintf(buffer, next - c + 1, <span class='string_literal'>"%s"</span>, c);</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_variable))(self->state, buffer, &t))</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> result = 0;</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> mp_multiply(&value, &t, &value);</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> free(buffer);</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>if</span>(result)</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> mp_set_from_mp(&value, ans);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>if</span>(!result)</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> free (ans);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_VARIABLE, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"><span class='comment'>/* Get value of variable with power. */</span></td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line">pf_get_variable_with_power(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> gint result = 0;</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>const</span> gchar *c, *next;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> gchar *buffer;</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> MPNumber value = mp_new();</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> MPNumber t = mp_new();</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> pow = super_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='comment'>/* No need to free the memory. It is allocated and freed somewhere else. */</span></td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_variable))</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> <span class='comment'>/* If defined, then get the variable */</span></td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='keyword'>if</span>((*(self->state->get_variable))(self->state, self->token->string, ans))</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> mp_xpowy_integer(ans, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='comment'>/* If has more than one character then assume a multiplication of variables */</span></td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span>(utf8_next_char(self->token->string)[0] != '\0')</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> result = 1;</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> buffer = (gchar*) malloc(<span class='keyword'>sizeof</span>(gchar) * strlen(self->token->string));</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> mp_set_from_integer(1, &value);</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>for</span>(c = self->token->string; *c != '\0'; c = next)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> next = utf8_next_char(c);</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> snprintf(buffer, next - c + 1, <span class='string_literal'>"%s"</span>, c);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_variable))(self->state, buffer, &t))</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> result = 0;</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='comment'>/* If last term do power */</span></td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>if</span>(*next == '\0')</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> mp_xpowy_integer(&t, pow, &t);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> mp_multiply(&value, &t, &value);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> free(buffer);</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>if</span>(result)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> mp_set_from_mp(&value, ans);</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='keyword'>if</span>(!result)</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> ans = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_VARIABLE, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"><span class='comment'>/* Apply function on child. */</span></td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">pf_apply_func(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_function))</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_function))(self->state, self->token->string, val, ans))</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_FUNCTION, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"><span class='comment'>/* Apply function with +ve power. */</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line">pf_apply_func_with_power(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> MPNumber* tmp = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_function))</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_function))(self->state, self->token->string, val, tmp))</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_FUNCTION, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> pow = super_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> mp_xpowy_integer(tmp, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"><span class='comment'>/* Apply function with -ve power. */</span></td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line">pf_apply_func_with_npower(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> MPNumber* tmp = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar* inv_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> inv_name = (gchar*) malloc(<span class='keyword'>sizeof</span>(gchar) * strlen(self->token->string) + strlen(<span class='string_literal'>"⁻¹"</span>) + 1);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> strcpy(inv_name, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> <span class="mrange">strcat</span>(inv_name, <span class='string_literal'>"⁻¹"</span>);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:5ex; max-width:52em">Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='keyword'>if</span>(!(self->state->get_function))</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>if</span>(!(*(self->state->get_function))(self->state, inv_name, val, tmp))</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> set_error(self->state, PARSER_ERR_UNKNOWN_FUNCTION, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> pow = super_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> mp_xpowy_integer(tmp, -pow, ans);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> mp_free(tmp);</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> free(inv_name);</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='comment'>/* Find nth root of child. */</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line">pf_do_nth_root(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gint pow;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> pow = sub_atoi(((LexerToken*) self->value)->string);</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> self->value = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> mp_root(val, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"><span class='comment'>/* Find sqrt of child. */</span></td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">pf_do_sqrt(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> mp_sqrt(val, ans);</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> free(val);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"><span class='comment'>/* Find 3rd root of child. */</span></td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line">pf_do_root_3(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> mp_root(val, 3, ans);</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"><span class='comment'>/* Find 4th root of child. */</span></td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line">pf_do_root_4(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> mp_root(val, 4, ans);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"><span class='comment'>/* Apply floor function. */</span></td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line">pf_do_floor(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> mp_floor(val, ans);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='comment'>/* Apply ceiling function. */</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"><span class='keyword'>void</span>* pf_do_ceiling (ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> mp_ceiling(val, ans);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"><span class='comment'>/* Round off. */</span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line">pf_do_round(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> mp_round(val, ans);</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"><span class='comment'>/* Fraction. */</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line">pf_do_fraction(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> mp_fractional_part(val, ans);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"><span class='comment'>/* Absolute value. */</span></td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line">pf_do_abs(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> mp_abs(val, ans);</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"><span class='comment'>/* Find x^y for x and y being MPNumber. */</span></td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line">pf_do_x_pow_y(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> MPNumber* pow;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> pow = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> <span class='keyword'>if</span>(!val || !pow)</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> <span class='keyword'>if</span>(pow)</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> mp_free(pow);</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> mp_xpowy(val, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> mp_free(pow);</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"><span class='comment'>/* Find x^y for MPNumber x and integer y. */</span></td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line">pf_do_x_pow_y_int(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> <span class='keyword'>long</span> pow;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> val = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> mp_set_from_integer(super_atoi(self->left->token->string), val);</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> <span class='keyword'>if</span> (self->right->token != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> pow = super_atoi(self->right->token->string);</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> MPNumber* aux = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> pow = mp_to_integer(aux);</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> mp_free(aux);</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> mp_xpowy_integer(val, pow, ans);</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"><span class='comment'>/* Find factorial. */</span></td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line">pf_do_factorial(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> mp_factorial(val, ans);</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"><span class='comment'>/* Apply unary minus. */</span></td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line">pf_unary_minus(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> mp_invert_sign(val, ans);</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"><span class='comment'>/* Divide. */</span></td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line">pf_do_divide(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> mp_divide(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"><span class='comment'>/* Modulus. */</span></td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line">pf_do_mod(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> <span class='keyword'>if</span> (self->left->evaluate == pf_do_x_pow_y)</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> MPNumber* base_value = (MPNumber*) (*(self->left->left->evaluate))(self->left->left);</td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> MPNumber* exponent = (MPNumber*) (*(self->left->right->evaluate))(self->left->right);</td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='keyword'>if</span>(!base_value || !exponent)</td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> <span class='keyword'>if</span>(base_value)</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> mp_free(base_value);</td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='keyword'>if</span>(exponent)</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> mp_free(exponent);</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> mp_modular_exponentiation(base_value, exponent, right, ans);</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> mp_free(base_value);</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> mp_free(exponent);</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> mp_modulus_divide(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"><span class='comment'>/* Multiply two numbers. */</span></td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line">pf_do_multiply(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> mp_multiply(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"><span class='comment'>/* Subtract two numbers. */</span></td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line">pf_do_subtract(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> mp_subtract(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"><span class='comment'>/* Add two numbers. */</span></td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line">pf_do_add(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> mp_add(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"><span class='comment'>/* Add (x) Percentage to value. */</span></td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">pf_do_add_percent(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> MPNumber* per;</td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line"> per = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line"> <span class='keyword'>if</span>(!val || !per)</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> <span class='keyword'>if</span>(per)</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> mp_add_integer(per, 100, per);</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> mp_divide_integer(per, 100, per);</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> mp_multiply(val, per, ans);</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"><span class='comment'>/* Subtract (x) Percentage to value. */</span></td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line">pf_do_subtract_percent(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> MPNumber* per;</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> val = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> per = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> <span class='keyword'>if</span>(!val || !per)</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> <span class='keyword'>if</span>(val)</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> <span class='keyword'>if</span>(per)</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> mp_add_integer(per, -100, per);</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"> mp_divide_integer(per, -100, per);</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> mp_multiply(val, per, ans);</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> mp_free(per);</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"><span class='comment'>/* Converts a constant into percentage. */</span></td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line">pf_do_percent(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> mp_divide_integer(val, 100, ans);</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"><span class='comment'>/* NOT. */</span></td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line">pf_do_not(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> MPNumber* val;</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> val = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> <span class='keyword'>if</span>(!val)</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"> <span class='keyword'>if</span>(!mp_is_overflow(val, self->state->options->wordlen))</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> set_error(self->state, PARSER_ERR_OVERFLOW, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> mp_not(val, self->state->options->wordlen, ans);</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> mp_free(val);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"><span class='comment'>/* AND. */</span></td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line">pf_do_and(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> mp_and(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"><span class='comment'>/* OR. */</span></td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line">pf_do_or(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> mp_or(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"><span class='comment'>/* XOR. */</span></td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line">pf_do_xor(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> MPNumber* left;</td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> MPNumber* right;</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> left = (MPNumber*) (*(self->left->evaluate))(self->left);</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> right = (MPNumber*) (*(self->right->evaluate))(self->right);</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> <span class='keyword'>if</span>(!left || !right)</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> <span class='keyword'>if</span>(left)</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> <span class='keyword'>if</span>(right)</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> free(ans);</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> mp_xor(left, right, ans);</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> mp_free(left);</td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> mp_free(right);</td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"><span class='comment'>/* Constant value. Convert into MPNumber and return. */</span></td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"><span class='keyword'>void</span>*</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line">pf_constant(ParseNode* self)</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> MPNumber* ans = mp_new_ptr();</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> <span class='keyword'>if</span>(mp_set_from_string(self->token->string, self->state->options->base, ans) != 0)</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> <span class='comment'>/* This should never happen, as l_check_if_number() has already passed the string once. */</span></td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> <span class='comment'>/* If the code reaches this point, something is really wrong. X( */</span></td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> mp_free(ans);</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> set_error(self->state, PARSER_ERR_INVALID, self->token->string);</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> <span class='keyword'>return</span> ans;</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> </td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-c8cbaf.html b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-c8cbaf.html new file mode 100644 index 0000000..894498e --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/report-c8cbaf.html @@ -0,0 +1,1062 @@ +<!doctype html> +<html> +<head> +<title>math-preferences.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'valid' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/src/math-preferences.c --> + +<!-- FILENAME math-preferences.c --> + +<!-- FUNCTIONNAME set_combo_box_from_int --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT c8cbafb7be749acb4e30494a5280842e --> + +<!-- BUGLINE 150 --> + +<!-- BUGCOLUMN 9 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>math-preferences.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 150, column 9</a><br />Value stored to 'valid' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name math-preferences.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-30-113850-3702-1 -x c math-preferences.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"150": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2008-2011 Robert Ancell</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify it under</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* the terms of the GNU General Public License as published by the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Foundation, either version 2 of the License, or (at your option) any later</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* version. See http://www.gnu.org/copyleft/gpl.html the full text of the</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* license.</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"><span class='directive'>#include "math-preferences.h"</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"><span class='directive'>#include "utility.h"</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> PROP_EQUATION</td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='keyword'>struct</span> MathPreferencesDialogPrivate</td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> MathEquation *equation;</td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> GtkBuilder *ui;</td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (MathPreferencesDialog, math_preferences, GTK_TYPE_DIALOG)<span class='macro_popup'>static void math_preferences_init (MathPreferencesDialog *self<br>); static void math_preferences_class_init (MathPreferencesDialogClass<br> *klass); static GType math_preferences_get_type_once (void);<br> static gpointer math_preferences_parent_class = ((void*)0); static<br> gint MathPreferencesDialog_private_offset; static void math_preferences_class_intern_init<br> (gpointer klass) { math_preferences_parent_class = g_type_class_peek_parent<br> (klass); if (MathPreferencesDialog_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &MathPreferencesDialog_private_offset); math_preferences_class_init<br> ((MathPreferencesDialogClass*) klass); } __attribute__ ((__unused__<br>)) static inline gpointer math_preferences_get_instance_private<br> (MathPreferencesDialog *self) { return (((gpointer) ((guint8<br>*) (self) + (glong) (MathPreferencesDialog_private_offset))))<br>; } GType math_preferences_get_type (void) { static gsize static_g_define_type_id<br> = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); (void<br>) (0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0<br>)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id<br>)); }))) { GType g_define_type_id = math_preferences_get_type_once<br> (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); 0 ?<br> (void) (*(&static_g_define_type_id) = (g_define_type_id)<br>) : (void) 0; g_once_init_leave ((&static_g_define_type_id<br>), (gsize) (g_define_type_id)); })); } return static_g_define_type_id<br>; } __attribute__ ((__noinline__)) static GType math_preferences_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> ((gtk_dialog_get_type ()), g_intern_static_string ("MathPreferencesDialog"<br>), sizeof (MathPreferencesDialogClass), (GClassInitFunc)(void<br> (*)(void)) math_preferences_class_intern_init, sizeof (MathPreferencesDialog<br>), (GInstanceInitFunc)(void (*)(void)) math_preferences_init,<br> (GTypeFlags) 0); { {{ MathPreferencesDialog_private_offset =<br> g_type_add_instance_private (g_define_type_id, sizeof (MathPreferencesDialogPrivate<br>)); };} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#define <span class='macro'>UI_DIALOGS_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/preferences.ui"</span></span> "/org/mate/calculator/ui/preferences.ui"</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#define <span class='macro'>GET_WIDGET(ui, name)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(ui, name))), ((gtk_widget_get_type<br> ()))))))</span></span> \</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> <span class='directive'><span class='macro'>GTK_WIDGET(gtk_builder_get_object(ui, name))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(ui, name))), ((gtk_widget_get_type<br> ()))))))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line">MathPreferencesDialog *</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line">math_preferences_dialog_new(MathEquation *equation)</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> <span class='keyword'>return</span> g_object_new(math_preferences_get_type(), <span class='string_literal'>"equation"</span>, equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line">preferences_response_cb(GtkWidget *widget, gint id)</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> gtk_widget_hide(widget);</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line">preferences_dialog_delete_cb(GtkWidget *widget, GdkEvent *event)</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> preferences_response_cb(widget, 0);</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>void</span> number_format_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog);</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line">number_format_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> MpDisplayFormat value;</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> gtk_combo_box_get_active_iter(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> gtk_tree_model_get(model, &iter, 1, &value, -1);</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> math_equation_set_number_format(dialog->priv->equation, value);</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='keyword'>void</span> angle_unit_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog);</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">angle_unit_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> MPAngleUnit value;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> gtk_combo_box_get_active_iter(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> gtk_tree_model_get(model, &iter, 1, &value, -1);</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> math_equation_set_angle_units(dialog->priv->equation, value);</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='keyword'>void</span> word_size_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">word_size_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gint value;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> gtk_combo_box_get_active_iter(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> gtk_tree_model_get(model, &iter, 1, &value, -1);</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> math_equation_set_word_size(dialog->priv->equation, value);</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"><span class='keyword'>void</span> decimal_places_spin_change_value_cb(GtkWidget *spin, MathPreferencesDialog *dialog);</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">decimal_places_spin_change_value_cb(GtkWidget *spin, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> gint value = 0;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> value = gtk_spin_button_get_value_as_int(<span class='macro'>GTK_SPIN_BUTTON(spin)<span class='macro_popup'>((((GtkSpinButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((spin)), ((gtk_spin_button_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> math_equation_set_accuracy(dialog->priv->equation, value);</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"><span class='keyword'>void</span> thousands_separator_check_toggled_cb(GtkWidget *check, MathPreferencesDialog *dialog);</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">thousands_separator_check_toggled_cb(GtkWidget *check, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> gboolean value;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> value = gtk_toggle_button_get_active(<span class='macro'>GTK_TOGGLE_BUTTON(check)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((check)), ((gtk_toggle_button_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> math_equation_set_show_thousands_separators(dialog->priv->equation, value);</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"><span class='keyword'>void</span> trailing_zeroes_check_toggled_cb(GtkWidget *check, MathPreferencesDialog *dialog);</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"><span class='macro'>G_MODULE_EXPORT<span class='macro_popup'>__attribute__((visibility("default")))</span></span></td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line">trailing_zeroes_check_toggled_cb(GtkWidget *check, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> gboolean value;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> value = gtk_toggle_button_get_active(<span class='macro'>GTK_TOGGLE_BUTTON(check)<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((check)), ((gtk_toggle_button_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> math_equation_set_show_trailing_zeroes(dialog->priv->equation, value);</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line">set_combo_box_from_int(GtkWidget *combo, <span class='keyword'>int</span> value)</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> gboolean valid;</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> valid = gtk_tree_model_get_iter_first(model, &iter);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> <span class='keyword'>while</span> (valid) {</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> gint v;</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> gtk_tree_model_get(model, &iter, 1, &v, -1);</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span> (v == value)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> valid = gtk_tree_model_iter_next(model, &iter);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>if</span> (!valid)</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> valid = <span class="mrange">gtk_tree_model_get_iter_first(model, &iter)</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex">Value stored to 'valid' is never read</div></td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> gtk_combo_box_set_active_iter(<span class='macro'>GTK_COMBO_BOX(combo)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((combo)), ((gtk_combo_box_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">accuracy_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> gtk_spin_button_set_value(<span class='macro'>GTK_SPIN_BUTTON(gtk_builder_get_object(dialog->priv->ui, <span class='string_literal'>"decimal_places_spin"</span>))<span class='macro_popup'>((((GtkSpinButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "decimal_places_spin"<br>))), ((gtk_spin_button_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> math_equation_get_accuracy(equation));</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> g_settings_set_int(g_settings_var, <span class='string_literal'>"accuracy"</span>, math_equation_get_accuracy(equation));</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">show_thousands_separators_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> gtk_toggle_button_set_active(<span class='macro'>GTK_TOGGLE_BUTTON(gtk_builder_get_object(dialog->priv->ui, <span class='string_literal'>"thousands_separator_check"</span>))<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "thousands_separator_check"<br>))), ((gtk_toggle_button_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> math_equation_get_show_thousands_separators(equation));</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> g_settings_set_boolean(g_settings_var, <span class='string_literal'>"show-thousands"</span>, math_equation_get_show_thousands_separators(equation));</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line">show_trailing_zeroes_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> gtk_toggle_button_set_active(<span class='macro'>GTK_TOGGLE_BUTTON(gtk_builder_get_object(dialog->priv->ui, <span class='string_literal'>"trailing_zeroes_check"</span>))<span class='macro_popup'>((((GtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "trailing_zeroes_check"<br>))), ((gtk_toggle_button_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> math_equation_get_show_trailing_zeroes(equation));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> g_settings_set_boolean(g_settings_var, <span class='string_literal'>"show-zeroes"</span>, math_equation_get_show_trailing_zeroes(equation));</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line">number_format_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> set_combo_box_from_int(<span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"number_format_combobox"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "number_format_combobox"<br>))), ((gtk_widget_get_type ()))))))</span></span>, math_equation_get_number_format(equation));</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> g_settings_set_enum(g_settings_var, <span class='string_literal'>"number-format"</span>, math_equation_get_number_format(equation));</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line">word_size_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> set_combo_box_from_int(<span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"word_size_combobox"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "word_size_combobox"<br>))), ((gtk_widget_get_type ()))))))</span></span>, math_equation_get_word_size(equation));</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> g_settings_set_int(g_settings_var, <span class='string_literal'>"word-size"</span>, math_equation_get_word_size(equation));</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">angle_unit_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> set_combo_box_from_int(<span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"angle_unit_combobox"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "angle_unit_combobox"<br>))), ((gtk_widget_get_type ()))))))</span></span>, math_equation_get_angle_units(equation));</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> g_settings_set_enum(g_settings_var, <span class='string_literal'>"angle-units"</span>, math_equation_get_angle_units(equation));</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line">create_gui(MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> GtkWidget *widget;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> GtkTreeModel *model;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> GtkTreeIter iter;</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GtkCellRenderer *renderer;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> gchar *string, **tokens;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>static</span> gchar *objects[] = { <span class='string_literal'>"preferences_table"</span>, <span class='string_literal'>"angle_unit_model"</span>, <span class='string_literal'>"number_format_model"</span>,</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='string_literal'>"word_size_model"</span>, <span class='string_literal'>"decimal_places_adjustment"</span>, <span class='string_literal'>"number_base_model"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> };</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='comment'>// FIXME: Handle errors</span></td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> dialog->priv->ui = gtk_builder_new();</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> gtk_builder_add_objects_from_resource(dialog->priv->ui, <span class='macro'>UI_DIALOGS_RESOURCE_PATH<span class='macro_popup'>"/org/mate/calculator/ui/preferences.ui"</span></span>, objects, &error);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (error)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> g_warning(<span class='string_literal'>"Error loading preferences UI: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> g_clear_error(&error);</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> gtk_window_set_title(<span class='macro'>GTK_WINDOW(dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='comment'>/* Title of preferences dialog */</span></td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Preferences"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Preferences", 5)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> gtk_container_set_border_width(<span class='macro'>GTK_CONTAINER(dialog)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_container_get_type ()))))))</span></span>, 8);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> gtk_dialog_add_button(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='comment'>/* Icon name on close button in preferences dialog */</span></td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='string_literal'>"gtk-close"</span>, GTK_RESPONSE_CLOSE);</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> gtk_window_set_icon_name (<span class='macro'>GTK_WINDOW(dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='string_literal'>"accessories-calculator"</span>);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='macro'>g_signal_connect(dialog, <span class='string_literal'>"response"</span>, G_CALLBACK(preferences_response_cb), NULL)<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>preferences_response_cb))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='macro'>g_signal_connect(dialog, <span class='string_literal'>"delete-event"</span>, G_CALLBACK(preferences_dialog_delete_cb), NULL)<span class='macro_popup'>g_signal_connect_data ((dialog), ("delete-event"), (((GCallback<br>) (preferences_dialog_delete_cb))), (((void*)0)), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> gtk_box_pack_start(<span class='macro'>GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog)))<span class='macro_popup'>((((GtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_dialog_get_content_area(((((GtkDialog*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((dialog)), ((gtk_dialog_get_type ()))))))<br>))), ((gtk_box_get_type ()))))))</span></span>, <span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"preferences_table"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "preferences_table"<br>))), ((gtk_widget_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> widget = <span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"angle_unit_combobox"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "angle_unit_combobox"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(widget)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='comment'>/* Preferences dialog: Angle unit combo box: Use degrees for trigonometric calculations */</span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Degrees"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Degrees", 5)</span></span>, 1, MP_DEGREES, -1);</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='comment'>/* Preferences dialog: Angle unit combo box: Use radians for trigonometric calculations */</span></td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Radians"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Radians", 5)</span></span>, 1, MP_RADIANS, -1);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='comment'>/* Preferences dialog: Angle unit combo box: Use gradians for trigonometric calculations */</span></td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Gradians"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Gradians", 5)</span></span>, 1, MP_GRADIANS, -1);</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> renderer = gtk_cell_renderer_text_new();</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> gtk_cell_layout_pack_start(<span class='macro'>GTK_CELL_LAYOUT(widget)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_cell_layout_get_type ()))))))</span></span>, renderer, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> gtk_cell_layout_add_attribute(<span class='macro'>GTK_CELL_LAYOUT(widget)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_cell_layout_get_type ()))))))</span></span>, renderer, <span class='string_literal'>"text"</span>, 0);</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> widget = <span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"number_format_combobox"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "number_format_combobox"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> model = gtk_combo_box_get_model(<span class='macro'>GTK_COMBO_BOX(widget)<span class='macro_popup'>((((GtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_combo_box_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='comment'>/* Number display mode combo: Automatic, e.g. 1234 (or scientific for large number 1.234×10^99) */</span></td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Automatic"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Automatic", 5)</span></span>, 1, MP_DISPLAY_FORMAT_AUTOMATIC, -1);</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='comment'>/* Number display mode combo: Fixed, e.g. 1234 */</span></td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Fixed"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Fixed", 5)</span></span>, 1, MP_DISPLAY_FORMAT_FIXED, -1);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='comment'>/* Number display mode combo: Scientific, e.g. 1.234×10^3 */</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Scientific"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Scientific", 5)</span></span>, 1, MP_DISPLAY_FORMAT_SCIENTIFIC, -1);</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> gtk_list_store_append(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter);</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> gtk_list_store_set(<span class='macro'>GTK_LIST_STORE(model)<span class='macro_popup'>((((GtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((model)), ((gtk_list_store_get_type ()))))))</span></span>, &iter, 0,</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='comment'>/* Number display mode combo: Engineering, e.g. 1.234k */</span></td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Engineering"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Engineering", 5)</span></span>, 1, MP_DISPLAY_FORMAT_ENGINEERING, -1);</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> renderer = gtk_cell_renderer_text_new();</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> gtk_cell_layout_pack_start(<span class='macro'>GTK_CELL_LAYOUT(widget)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_cell_layout_get_type ()))))))</span></span>, renderer, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> gtk_cell_layout_add_attribute(<span class='macro'>GTK_CELL_LAYOUT(widget)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_cell_layout_get_type ()))))))</span></span>, renderer, <span class='string_literal'>"text"</span>, 0);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> widget = <span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"word_size_combobox"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "word_size_combobox"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> renderer = gtk_cell_renderer_text_new();</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> gtk_cell_layout_pack_start(<span class='macro'>GTK_CELL_LAYOUT(widget)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_cell_layout_get_type ()))))))</span></span>, renderer, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> gtk_cell_layout_add_attribute(<span class='macro'>GTK_CELL_LAYOUT(widget)<span class='macro_popup'>((((GtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_cell_layout_get_type ()))))))</span></span>, renderer, <span class='string_literal'>"text"</span>, 0);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> <span class='comment'>/* Label used in preferences dialog. The %d is replaced by a spinbutton */</span></td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> string = <span class='macro'>_(<span class='string_literal'>"Show %d decimal _places"</span>)<span class='macro_popup'>dcgettext (((void*)0), "Show %d decimal _places", 5)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> tokens = g_strsplit(string, <span class='string_literal'>"%d"</span>, 2);</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> widget = <span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"decimal_places_label1"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "decimal_places_label1"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='keyword'>if</span> (tokens[0])</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> string = <span class='macro'>g_strstrip(tokens[0])<span class='macro_popup'>g_strchomp (g_strchug (tokens[0]))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> string = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>if</span> (string[0] != '\0')</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> gtk_label_set_text_with_mnemonic(<span class='macro'>GTK_LABEL(widget)<span class='macro_popup'>((((GtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_label_get_type ()))))))</span></span>, string);</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> gtk_widget_hide(widget);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> widget = <span class='macro'>GET_WIDGET(dialog->priv->ui, <span class='string_literal'>"decimal_places_label2"</span>)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object(dialog->priv->ui, "decimal_places_label2"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span> (tokens[0] && tokens[1])</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> string = <span class='macro'>g_strstrip(tokens[1])<span class='macro_popup'>g_strchomp (g_strchug (tokens[1]))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> string = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>if</span> (string[0] != '\0')</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> gtk_label_set_text_with_mnemonic(<span class='macro'>GTK_LABEL(widget)<span class='macro_popup'>((((GtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((widget)), ((gtk_label_get_type ()))))))</span></span>, string);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> gtk_widget_hide(widget);</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> g_strfreev(tokens);</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gtk_builder_connect_signals(dialog->priv->ui, dialog);</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> <span class='macro'>g_signal_connect(dialog->priv->equation, <span class='string_literal'>"notify::accuracy"</span>, G_CALLBACK(accuracy_cb), dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->priv->equation), ("notify::accuracy"<br>), (((GCallback) (accuracy_cb))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='macro'>g_signal_connect(dialog->priv->equation, <span class='string_literal'>"notify::show-thousands-separators"</span>, G_CALLBACK(show_thousands_separators_cb), dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->priv->equation), ("notify::show-thousands-separators"<br>), (((GCallback) (show_thousands_separators_cb))), (dialog), (<br>(void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='macro'>g_signal_connect(dialog->priv->equation, <span class='string_literal'>"notify::show-trailing_zeroes"</span>, G_CALLBACK(show_trailing_zeroes_cb), dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->priv->equation), ("notify::show-trailing_zeroes"<br>), (((GCallback) (show_trailing_zeroes_cb))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> <span class='macro'>g_signal_connect(dialog->priv->equation, <span class='string_literal'>"notify::number-format"</span>, G_CALLBACK(number_format_cb), dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->priv->equation), ("notify::number-format"<br>), (((GCallback) (number_format_cb))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='macro'>g_signal_connect(dialog->priv->equation, <span class='string_literal'>"notify::word-size"</span>, G_CALLBACK(word_size_cb), dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->priv->equation), ("notify::word-size"<br>), (((GCallback) (word_size_cb))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> <span class='macro'>g_signal_connect(dialog->priv->equation, <span class='string_literal'>"notify::angle-units"</span>, G_CALLBACK(angle_unit_cb), dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->priv->equation), ("notify::angle-units"<br>), (((GCallback) (angle_unit_cb))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> accuracy_cb(dialog->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, dialog);</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> show_thousands_separators_cb(dialog->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, dialog);</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> show_trailing_zeroes_cb(dialog->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, dialog);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> number_format_cb(dialog->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, dialog);</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> word_size_cb(dialog->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, dialog);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> angle_unit_cb(dialog->priv->equation, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, dialog);</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line">math_preferences_set_property(GObject *object,</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> MathPreferencesDialog *self;</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> self = <span class='macro'>MATH_PREFERENCES(object)<span class='macro_popup'>((((MathPreferencesDialog*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((object)), (math_preferences_get_type()))<br>)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>case</span> PROP_EQUATION:</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> self->priv->equation = g_value_get_object(value);</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> create_gui(self);</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "math-preferences.c", 336, ("property"), _glib__property_id<br>, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance<br>*) (_glib__pspec))->g_class))->g_type)))), (g_type_name<br> ((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line">math_preferences_get_property(GObject *object,</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> MathPreferencesDialog *self;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> self = <span class='macro'>MATH_PREFERENCES(object)<span class='macro_popup'>((((MathPreferencesDialog*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((object)), (math_preferences_get_type()))<br>)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>case</span> PROP_EQUATION:</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> g_value_set_object(value, self->priv->equation);</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "math-preferences.c", 356, ("property"), _glib__property_id<br>, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance<br>*) (_glib__pspec))->g_class))->g_type)))), (g_type_name<br> ((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line">math_preferences_class_init(MathPreferencesDialogClass *klass)</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS(klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> object_class->get_property = math_preferences_get_property;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> object_class->set_property = math_preferences_set_property;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> g_object_class_install_property(object_class,</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> PROP_EQUATION,</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> g_param_spec_object(<span class='string_literal'>"equation"</span>,</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> <span class='string_literal'>"equation"</span>,</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='string_literal'>"Equation being configured"</span>,</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> math_equation_get_type(),</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line">math_preferences_init(MathPreferencesDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> dialog->priv = math_preferences_get_instance_private (dialog);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/scanview.css b/2022-10-30-113850-3702-1@9f60058d4b7d_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-10-30-113850-3702-1@9f60058d4b7d_master/sorttable.js b/2022-10-30-113850-3702-1@9f60058d4b7d_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-10-30-113850-3702-1@9f60058d4b7d_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add <script src="sorttable.js"></script> to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i<table.rows.length; i++) { + if (table.rows[i].className.search(/\bsortbottom\b/) != -1) { + sortbottomrows[sortbottomrows.length] = table.rows[i]; + } + } + if (sortbottomrows) { + if (table.tFoot == null) { + // table doesn't have a tfoot. Create one. + tfo = document.createElement('tfoot'); + table.appendChild(tfo); + } + for (var i=0; i<sortbottomrows.length; i++) { + tfo.appendChild(sortbottomrows[i]); + } + delete sortbottomrows; + } + + // work through each column and calculate its type + headrow = table.tHead.rows[0].cells; + for (var i=0; i<headrow.length; i++) { + // manually override the type with a sorttable_type attribute + if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col + mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/); + if (mtch) { override = mtch[1]; } + if (mtch && typeof sorttable["sort_"+override] == 'function') { + headrow[i].sorttable_sortfunction = sorttable["sort_"+override]; + } else { + headrow[i].sorttable_sortfunction = sorttable.guessType(table,i); + } + // make it clickable to sort + headrow[i].sorttable_columnindex = i; + headrow[i].sorttable_tbody = table.tBodies[0]; + dean_addEvent(headrow[i],"click", function(e) { + + if (this.className.search(/\bsorttable_sorted\b/) != -1) { + // if we're already sorted by this column, just + // reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted', + 'sorttable_sorted_reverse'); + this.removeChild(document.getElementById('sorttable_sortfwdind')); + sortrevind = document.createElement('span'); + sortrevind.id = "sorttable_sortrevind"; + sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j<rows.length; j++) { + row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]]; + } + /* If you want a stable sort, uncomment the following line */ + sorttable.shaker_sort(row_array, this.sorttable_sortfunction); + /* and comment out this one */ + //row_array.sort(this.sorttable_sortfunction); + + tb = this.sorttable_tbody; + for (var j=0; j<row_array.length; j++) { + tb.appendChild(row_array[j][1]); + } + + delete row_array; + }); + } + } + }, + + guessType: function(table, column) { + // guess the type of a column based on its first non-blank row + sortfn = sorttable.sort_alpha; + for (var i=0; i<table.tBodies[0].rows.length; i++) { + text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]); + if (text != '') { + if (text.match(/^-?[�$�]?[\d,.]+%?$/)) { + return sorttable.sort_numeric; + } + // check for a date: dd/mm/yyyy or dd/mm/yy + // can have / or . or - as separator + // can be mm/dd as well + possdate = text.match(sorttable.DATE_RE) + if (possdate) { + // looks like a date + first = parseInt(possdate[1]); + second = parseInt(possdate[2]); + if (first > 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for <input> fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i<tbody.rows.length; i++) { + newrows[newrows.length] = tbody.rows[i]; + } + for (var i=newrows.length-1; i>=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0]<b[0]) return -1; + return 1; + }, + sort_ddmm: function(a,b) { + mtch = a[0].match(sorttable.DATE_RE); + y = mtch[3]; m = mtch[2]; d = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt1 = y+m+d; + mtch = b[0].match(sorttable.DATE_RE); + y = mtch[3]; m = mtch[2]; d = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt2 = y+m+d; + if (dt1==dt2) return 0; + if (dt1<dt2) return -1; + return 1; + }, + sort_mmdd: function(a,b) { + mtch = a[0].match(sorttable.DATE_RE); + y = mtch[3]; d = mtch[2]; m = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt1 = y+m+d; + mtch = b[0].match(sorttable.DATE_RE); + y = mtch[3]; d = mtch[2]; m = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt2 = y+m+d; + if (dt1==dt2) return 0; + if (dt1<dt2) return -1; + return 1; + }, + + shaker_sort: function(list, comp_func) { + // A stable sort function to allow multi-level sorting of data + // see: http://en.wikipedia.org/wiki/Cocktail_sort + // thanks to Joseph Nahmias + var b = 0; + var t = list.length - 1; + var swap = true; + + while(swap) { + swap = false; + for(var i = b; i < t; ++i) { + if ( comp_func(list[i], list[i+1]) > 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); + var script = document.getElementById("__ie_onload"); + script.onreadystatechange = function() { + if (this.readyState == "complete") { + sorttable.init(); // call the onload handler + } + }; +/*@end @*/ + +/* for Safari */ +if (/WebKit/i.test(navigator.userAgent)) { // sniff + var _timer = setInterval(function() { + if (/loaded|complete/.test(document.readyState)) { + sorttable.init(); // call the onload handler + } + }, 10); +} + +/* for other browsers */ +window.onload = sorttable.init; + +// written by Dean Edwards, 2005 +// with input from Tino Zijdel, Matthias Miller, Diego Perini + +// http://dean.edwards.name/weblog/2005/10/add-event/ + +function dean_addEvent(element, type, handler) { + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else { + // assign each event handler a unique ID + if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++; + // create a hash table of event types for the element + if (!element.events) element.events = {}; + // create a hash table of event handlers for each element/event pair + var handlers = element.events[type]; + if (!handlers) { + handlers = element.events[type] = {}; + // store the existing event handler (if there is one) + if (element["on" + type]) { + handlers[0] = element["on" + type]; + } + } + // store the event handler in the hash table + handlers[handler.$$guid] = handler; + // assign a global event handler to do all the work + element["on" + type] = handleEvent; + } +}; +// a counter used to create unique IDs +dean_addEvent.guid = 1; + +function removeEvent(element, type, handler) { + if (element.removeEventListener) { + element.removeEventListener(type, handler, false); + } else { + // delete the event handler from the hash table + if (element.events && element.events[type]) { + delete element.events[type][handler.$$guid]; + } + } +}; + +function handleEvent(event) { + var returnValue = true; + // grab the event object (IE uses a global event object) + event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); + // get a reference to the hash table of event handlers + var handlers = this.events[event.type]; + // execute each event handler + for (var i in handlers) { + this.$$handleEvent = handlers[i]; + if (this.$$handleEvent(event) === false) { + returnValue = false; + } + } + return returnValue; +}; + +function fixEvent(event) { + // add W3C standard event methods + event.preventDefault = fixEvent.preventDefault; + event.stopPropagation = fixEvent.stopPropagation; + return event; +}; +fixEvent.preventDefault = function() { + this.returnValue = false; +}; +fixEvent.stopPropagation = function() { + this.cancelBubble = true; +} + +// Dean's forEach: http://dean.edwards.name/base/forEach.js +/* + forEach, version 1.0 + Copyright 2006, Dean Edwards + License: http://www.opensource.org/licenses/mit-license.php +*/ + +// array-like enumeration +if (!Array.forEach) { // mozilla already supports this + Array.forEach = function(array, block, context) { + for (var i = 0; i < array.length; i++) { + block.call(context, array[i], i, array); + } + }; +} + +// generic enumeration +Function.prototype.forEach = function(object, block, context) { + for (var key in object) { + if (typeof this.prototype[key] == "undefined") { + block.call(context, object[key], key, object); + } + } +}; + +// character enumeration +String.forEach = function(string, block, context) { + Array.forEach(string.split(""), function(chr, index) { + block.call(context, chr, index, string); + }); +}; + +// globally resolve forEach enumeration +var forEach = function(object, block, context) { + if (object) { + var resolve = Object; // default + if (object instanceof Function) { + // functions have a "length" property + resolve = Function; + } else if (object.forEach instanceof Function) { + // the object implements a custom forEach method so use that + object.forEach(block, context); + return; + } else if (typeof object == "string") { + // the object is a string + resolve = String; + } else if (typeof object.length == "number") { + // the object is array-like + resolve = Array; + } + resolve.forEach(object, block, context); + } +}; |