EENX15/simulink_export/html/rt_logging_c.html

8611 lines
826 KiB
HTML
Raw Normal View History

2021-04-15 16:54:53 +02:00
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="./js/coder_app.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="./rtwreport_utils.js"></script>
<script type="text/javascript" src="./rtwannotate.js"></script>
<link rel="stylesheet" type="text/css" href="./css/coder_app.css"/>
</head>
<body onload="srcFileOnload();">
<pre id="code">
<table class="code" id="codeTbl">
<tr name="1" id="1">
<td><a id="l1" class='ln'>1</a></td><td><span class="ct">/* </span></td></tr>
<tr name="2" id="2">
<td><a id="l2" class='ln'>2</a></td><td><span class="ct"> *</span></td></tr>
<tr name="3" id="3">
<td><a id="l3" class='ln'>3</a></td><td><span class="ct"> * Copyright 1994-2020 The MathWorks, Inc.</span></td></tr>
<tr name="4" id="4">
<td><a id="l4" class='ln'>4</a></td><td><span class="ct"> *</span></td></tr>
<tr name="5" id="5">
<td><a id="l5" class='ln'>5</a></td><td><span class="ct"> * File: rt_logging.c</span></td></tr>
<tr name="6" id="6">
<td><a id="l6" class='ln'>6</a></td><td><span class="ct"> *</span></td></tr>
<tr name="7" id="7">
<td><a id="l7" class='ln'>7</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="8" id="8">
<td><a id="l8" class='ln'>8</a></td><td><span class="ct"> * Real-Time Workshop data logging routines using circular buffers of</span></td></tr>
<tr name="9" id="9">
<td><a id="l9" class='ln'>9</a></td><td><span class="ct"> * fixed size. The buffers are allocated at start, filled in at each</span></td></tr>
<tr name="10" id="10">
<td><a id="l10" class='ln'>10</a></td><td><span class="ct"> * major time step and finally written to a MAT-file at the end of the</span></td></tr>
<tr name="11" id="11">
<td><a id="l11" class='ln'>11</a></td><td><span class="ct"> * simulation.</span></td></tr>
<tr name="12" id="12">
<td><a id="l12" class='ln'>12</a></td><td><span class="ct"> *</span></td></tr>
<tr name="13" id="13">
<td><a id="l13" class='ln'>13</a></td><td><span class="ct"> * This file handles redefining the following standard MathWorks types</span></td></tr>
<tr name="14" id="14">
<td><a id="l14" class='ln'>14</a></td><td><span class="ct"> * (see tmwtypes.h):</span></td></tr>
<tr name="15" id="15">
<td><a id="l15" class='ln'>15</a></td><td><span class="ct"> * [u]int8_T to be int32_T (logged as Matlab [u]int32)</span></td></tr>
<tr name="16" id="16">
<td><a id="l16" class='ln'>16</a></td><td><span class="ct"> * [u]int16_T to be int32_T (logged as Matlab [u]int32)</span></td></tr>
<tr name="17" id="17">
<td><a id="l17" class='ln'>17</a></td><td><span class="ct"> * real_T to be real32_T (logged as Matlab single)</span></td></tr>
<tr name="18" id="18">
<td><a id="l18" class='ln'>18</a></td><td><span class="ct"> *</span></td></tr>
<tr name="19" id="19">
<td><a id="l19" class='ln'>19</a></td><td><span class="ct"> */</span></td></tr>
<tr name="20" id="20">
<td><a id="l20" class='ln'>20</a></td><td></td></tr>
<tr name="21" id="21">
<td><a id="l21" class='ln'>21</a></td><td><span class="pp">#include &lt;stdlib.h&gt;</span></td></tr>
<tr name="22" id="22">
<td><a id="l22" class='ln'>22</a></td><td><span class="pp">#include &lt;string.h&gt;</span></td></tr>
<tr name="23" id="23">
<td><a id="l23" class='ln'>23</a></td><td><span class="pp">#include &lt;stdio.h&gt;</span></td></tr>
<tr name="24" id="24">
<td><a id="l24" class='ln'>24</a></td><td><span class="pp">#include &lt;limits.h&gt;</span></td></tr>
<tr name="25" id="25">
<td><a id="l25" class='ln'>25</a></td><td><span class="pp">#include &lt;math.h&gt;</span></td></tr>
<tr name="26" id="26">
<td><a id="l26" class='ln'>26</a></td><td></td></tr>
<tr name="27" id="27">
<td><a id="l27" class='ln'>27</a></td><td></td></tr>
<tr name="28" id="28">
<td><a id="l28" class='ln'>28</a></td><td><span class="pp">#if</span> <a id="28c5" class="tk">!</a><a id="28c6" class="tk">defined</a>(<a id="28c14" class="tk">MAT_FILE</a>) <a id="28c24" class="tk">||</a> (<a id="28c28" class="tk">defined</a>(<a id="28c36" class="tk">MAT_FILE</a>) <a id="28c46" class="tk">&amp;&amp;</a> <a id="28c49" class="tk">MAT_FILE</a> <a id="28c58" class="tk">==</a> 1)</td></tr>
<tr name="29" id="29">
<td><a id="l29" class='ln'>29</a></td><td></td></tr>
<tr name="30" id="30">
<td><a id="l30" class='ln'>30</a></td><td><span class="pp">#include &lt;stddef.h&gt;</span> <span class="ct">/* size_t */</span></td></tr>
<tr name="31" id="31">
<td><a id="l31" class='ln'>31</a></td><td><span class="pp">#include "rt_logging.h"</span></td></tr>
<tr name="32" id="32">
<td><a id="l32" class='ln'>32</a></td><td><span class="pp">#ifndef</span> <a id="32c9" class="tk">IS_RAPID_ACCEL</a></td></tr>
<tr name="33" id="33">
<td><a id="l33" class='ln'>33</a></td><td><span class="pp">#include "rt_mxclassid.h"</span></td></tr>
<tr name="34" id="34">
<td><a id="l34" class='ln'>34</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="35" id="35">
<td><a id="l35" class='ln'>35</a></td><td><span class="pp">#include "rtw_matlogging.h"</span></td></tr>
<tr name="36" id="36">
<td><a id="l36" class='ln'>36</a></td><td></td></tr>
<tr name="37" id="37">
<td><a id="l37" class='ln'>37</a></td><td><span class="pp">#ifndef</span> <a id="37c9" class="tk">TMW_NAME_LENGTH_MAX</a></td></tr>
<tr name="38" id="38">
<td><a id="l38" class='ln'>38</a></td><td><span class="pp">#define</span> <a id="38c9" class="tk">TMW_NAME_LENGTH_MAX</a> 64</td></tr>
<tr name="39" id="39">
<td><a id="l39" class='ln'>39</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="40" id="40">
<td><a id="l40" class='ln'>40</a></td><td><span class="pp">#define</span> <a id="40c9" class="tk">mxMAXNAM</a> <a id="40c19" class="tk">TMW_NAME_LENGTH_MAX</a> <span class="ct">/* maximum name length */</span></td></tr>
<tr name="41" id="41">
<td><a id="l41" class='ln'>41</a></td><td><span class="pp">#define</span> <a id="41c9" class="tk">matUNKNOWN</a> 0</td></tr>
<tr name="42" id="42">
<td><a id="l42" class='ln'>42</a></td><td><span class="pp">#define</span> <a id="42c9" class="tk">matINT8</a> 1</td></tr>
<tr name="43" id="43">
<td><a id="l43" class='ln'>43</a></td><td><span class="pp">#define</span> <a id="43c9" class="tk">matUINT8</a> 2</td></tr>
<tr name="44" id="44">
<td><a id="l44" class='ln'>44</a></td><td><span class="pp">#define</span> <a id="44c9" class="tk">matINT16</a> 3</td></tr>
<tr name="45" id="45">
<td><a id="l45" class='ln'>45</a></td><td><span class="pp">#define</span> <a id="45c9" class="tk">matUINT16</a> 4</td></tr>
<tr name="46" id="46">
<td><a id="l46" class='ln'>46</a></td><td><span class="pp">#define</span> <a id="46c9" class="tk">matINT32</a> 5</td></tr>
<tr name="47" id="47">
<td><a id="l47" class='ln'>47</a></td><td><span class="pp">#define</span> <a id="47c9" class="tk">matUINT32</a> 6</td></tr>
<tr name="48" id="48">
<td><a id="l48" class='ln'>48</a></td><td><span class="pp">#define</span> <a id="48c9" class="tk">matFLOAT</a> 7</td></tr>
<tr name="49" id="49">
<td><a id="l49" class='ln'>49</a></td><td><span class="pp">#define</span> <a id="49c9" class="tk">matDOUBLE</a> 9</td></tr>
<tr name="50" id="50">
<td><a id="l50" class='ln'>50</a></td><td><span class="pp">#define</span> <a id="50c9" class="tk">matINT64</a> 12</td></tr>
<tr name="51" id="51">
<td><a id="l51" class='ln'>51</a></td><td><span class="pp">#define</span> <a id="51c9" class="tk">matUINT64</a> 13</td></tr>
<tr name="52" id="52">
<td><a id="l52" class='ln'>52</a></td><td><span class="pp">#define</span> <a id="52c9" class="tk">matMATRIX</a> 14</td></tr>
<tr name="53" id="53">
<td><a id="l53" class='ln'>53</a></td><td></td></tr>
<tr name="54" id="54">
<td><a id="l54" class='ln'>54</a></td><td><span class="pp">#define</span> <a id="54c9" class="tk">matLOGICAL_BIT</a> 0x200</td></tr>
<tr name="55" id="55">
<td><a id="l55" class='ln'>55</a></td><td><span class="pp">#define</span> <a id="55c9" class="tk">matCOMPLEX_BIT</a> 0x800</td></tr>
<tr name="56" id="56">
<td><a id="l56" class='ln'>56</a></td><td></td></tr>
<tr name="57" id="57">
<td><a id="l57" class='ln'>57</a></td><td><span class="pp">#define</span> <a id="57c9" class="tk">matKEY</a> 0x4D49</td></tr>
<tr name="58" id="58">
<td><a id="l58" class='ln'>58</a></td><td><span class="pp">#define</span> <a id="58c9" class="tk">matVERSION</a> 0x0100</td></tr>
<tr name="59" id="59">
<td><a id="l59" class='ln'>59</a></td><td><span class="pp">#define</span> <a id="59c9" class="tk">matVERSION_INFO_OFFSET</a> 124L</td></tr>
<tr name="60" id="60">
<td><a id="l60" class='ln'>60</a></td><td></td></tr>
<tr name="61" id="61">
<td><a id="l61" class='ln'>61</a></td><td><span class="pp">#define</span> <a id="61c9" class="tk">matINT64_ALIGN</a>(<a id="61c24" class="tk">e</a>) ( ( ((<span class="kw">unsigned</span>)(<a id="61c48" class="tk">e</a>))<a id="61c51" class="tk">+</a>7 ) <a id="61c56" class="tk">&amp;</a> (<a id="61c59" class="tk">~</a>7) )</td></tr>
<tr name="62" id="62">
<td><a id="l62" class='ln'>62</a></td><td><span class="pp">#define</span> <a id="62c9" class="tk">matTAG_SIZE</a> (<span class="kw">sizeof</span>(<a id="62c40" class="tk">int32_T</a>) <a id="62c49" class="tk">&lt;&lt;</a> 1)</td></tr>
<tr name="63" id="63">
<td><a id="l63" class='ln'>63</a></td><td></td></tr>
<tr name="64" id="64">
<td><a id="l64" class='ln'>64</a></td><td><span class="pp">#ifndef</span> <a id="64c9" class="tk">DEFAULT_BUFFER_SIZE</a></td></tr>
<tr name="65" id="65">
<td><a id="l65" class='ln'>65</a></td><td><span class="pp">#define</span> <a id="65c9" class="tk">DEFAULT_BUFFER_SIZE</a> 1024 <span class="ct">/* used if maxRows=0 and Tfinal=0.0 */</span></td></tr>
<tr name="66" id="66">
<td><a id="l66" class='ln'>66</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="67" id="67">
<td><a id="l67" class='ln'>67</a></td><td></td></tr>
<tr name="68" id="68">
<td><a id="l68" class='ln'>68</a></td><td><span class="pp">#define</span> <a id="68c9" class="tk">FREE</a>(<a id="68c14" class="tk">m</a>) <span class="kw">if</span> (<a id="68c21" class="tk">m</a> <a id="68c23" class="tk">!=</a> <a id="68c26" class="tk">NULL</a>) <a id="68c32" class="tk">free</a>(<a id="68c37" class="tk">m</a>)</td></tr>
<tr name="69" id="69">
<td><a id="l69" class='ln'>69</a></td><td></td></tr>
<tr name="70" id="70">
<td><a id="l70" class='ln'>70</a></td><td><span class="ct">/* Logical definitions */</span></td></tr>
<tr name="71" id="71">
<td><a id="l71" class='ln'>71</a></td><td><span class="pp">#if</span> (<a id="71c6" class="tk">!</a><a id="71c7" class="tk">defined</a>(<a id="71c15" class="tk">__cplusplus</a>))</td></tr>
<tr name="72" id="72">
<td><a id="l72" class='ln'>72</a></td><td><span class="pp"># ifndef</span> false</td></tr>
<tr name="73" id="73">
<td><a id="l73" class='ln'>73</a></td><td><span class="pp"># define</span> false (0U)</td></tr>
<tr name="74" id="74">
<td><a id="l74" class='ln'>74</a></td><td><span class="pp"># endif</span></td></tr>
<tr name="75" id="75">
<td><a id="l75" class='ln'>75</a></td><td><span class="pp"># ifndef</span> true</td></tr>
<tr name="76" id="76">
<td><a id="l76" class='ln'>76</a></td><td><span class="pp"># define</span> true (1U)</td></tr>
<tr name="77" id="77">
<td><a id="l77" class='ln'>77</a></td><td><span class="pp"># endif</span></td></tr>
<tr name="78" id="78">
<td><a id="l78" class='ln'>78</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="79" id="79">
<td><a id="l79" class='ln'>79</a></td><td></td></tr>
<tr name="80" id="80">
<td><a id="l80" class='ln'>80</a></td><td><span class="ct">/*==========*</span></td></tr>
<tr name="81" id="81">
<td><a id="l81" class='ln'>81</a></td><td><span class="ct"> * typedefs *</span></td></tr>
<tr name="82" id="82">
<td><a id="l82" class='ln'>82</a></td><td><span class="ct"> *==========*/</span></td></tr>
<tr name="83" id="83">
<td><a id="l83" class='ln'>83</a></td><td></td></tr>
<tr name="84" id="84">
<td><a id="l84" class='ln'>84</a></td><td><span class="kw">typedef</span> <span class="kw">struct</span> <a id="84c16" class="tk">LogInfo_Tag</a> <span class="br">{</span></td></tr>
<tr name="85" id="85">
<td><a id="l85" class='ln'>85</a></td><td> <a id="85c5" class="tk">LogVar</a> <a id="85c18" class="tk">*</a><a id="85c19" class="tk">t</a>; <span class="ct">/* Time log variable */</span></td></tr>
<tr name="86" id="86">
<td><a id="l86" class='ln'>86</a></td><td> <span class="kw">void</span> <a id="86c18" class="tk">*</a><a id="86c19" class="tk">x</a>; <span class="ct">/* State log variable */</span></td></tr>
<tr name="87" id="87">
<td><a id="l87" class='ln'>87</a></td><td> <a id="87c5" class="tk">int_T</a> <a id="87c18" class="tk">ny</a>; <span class="ct">/* Length of "y" log variables */</span></td></tr>
<tr name="88" id="88">
<td><a id="l88" class='ln'>88</a></td><td> <span class="kw">void</span> <a id="88c18" class="tk">*</a><a id="88c19" class="tk">*</a><a id="88c20" class="tk">y</a>; <span class="ct">/* Output log vars */</span></td></tr>
<tr name="89" id="89">
<td><a id="l89" class='ln'>89</a></td><td> <span class="kw">void</span> <a id="89c18" class="tk">*</a><a id="89c19" class="tk">xFinal</a>; <span class="ct">/* Final state log variable */</span></td></tr>
<tr name="90" id="90">
<td><a id="l90" class='ln'>90</a></td><td></td></tr>
<tr name="91" id="91">
<td><a id="l91" class='ln'>91</a></td><td> <a id="91c5" class="tk">LogVar</a> <a id="91c18" class="tk">*</a><a id="91c19" class="tk">logVarsList</a>; <span class="ct">/* Linked list of all LogVars */</span></td></tr>
<tr name="92" id="92">
<td><a id="l92" class='ln'>92</a></td><td> <a id="92c5" class="tk">StructLogVar</a> <a id="92c18" class="tk">*</a><a id="92c19" class="tk">structLogVarsList</a>; <span class="ct">/* Linked list of all StructLogVars */</span></td></tr>
<tr name="93" id="93">
<td><a id="l93" class='ln'>93</a></td><td></td></tr>
<tr name="94" id="94">
<td><a id="l94" class='ln'>94</a></td><td> <a id="94c5" class="tk">boolean_T</a> <a id="94c17" class="tk">haveLogVars</a>; <span class="ct">/* Are logging one or more vars? */</span></td></tr>
<tr name="95" id="95">
<td><a id="l95" class='ln'>95</a></td><td><span class="br">}</span> <a id="95c3" class="tk">LogInfo</a>;</td></tr>
<tr name="96" id="96">
<td><a id="l96" class='ln'>96</a></td><td></td></tr>
<tr name="97" id="97">
<td><a id="l97" class='ln'>97</a></td><td><span class="kw">typedef</span> <span class="kw">struct</span> <a id="97c16" class="tk">MatItem_tag</a> <span class="br">{</span></td></tr>
<tr name="98" id="98">
<td><a id="l98" class='ln'>98</a></td><td> <a id="98c3" class="tk">int32_T</a> <a id="98c14" class="tk">type</a>;</td></tr>
<tr name="99" id="99">
<td><a id="l99" class='ln'>99</a></td><td> <a id="99c3" class="tk">uint32_T</a> <a id="99c15" class="tk">nbytes</a>;</td></tr>
<tr name="100" id="100">
<td><a id="l100" class='ln'>100</a></td><td> <span class="kw">const</span> <span class="kw">void</span> <a id="100c14" class="tk">*</a><a id="100c15" class="tk">data</a>;</td></tr>
<tr name="101" id="101">
<td><a id="l101" class='ln'>101</a></td><td><span class="br">}</span> <a id="101c3" class="tk">MatItem</a>;</td></tr>
<tr name="102" id="102">
<td><a id="l102" class='ln'>102</a></td><td></td></tr>
<tr name="103" id="103">
<td><a id="l103" class='ln'>103</a></td><td><span class="kw">typedef</span> <span class="kw">enum</span> <span class="br">{</span></td></tr>
<tr name="104" id="104">
<td><a id="l104" class='ln'>104</a></td><td> <a id="104c5" class="tk">DATA_ITEM</a>,</td></tr>
<tr name="105" id="105">
<td><a id="l105" class='ln'>105</a></td><td> <a id="105c5" class="tk">MATRIX_ITEM</a>,</td></tr>
<tr name="106" id="106">
<td><a id="l106" class='ln'>106</a></td><td> <a id="106c5" class="tk">STRUCT_LOG_VAR_ITEM</a>,</td></tr>
<tr name="107" id="107">
<td><a id="l107" class='ln'>107</a></td><td> <a id="107c5" class="tk">SIGNALS_STRUCT_ITEM</a></td></tr>
<tr name="108" id="108">
<td><a id="l108" class='ln'>108</a></td><td><span class="br">}</span> <a id="108c3" class="tk">ItemDataKind</a>;</td></tr>
<tr name="109" id="109">
<td><a id="l109" class='ln'>109</a></td><td></td></tr>
<tr name="110" id="110">
<td><a id="l110" class='ln'>110</a></td><td><span class="ct">/*===========*</span></td></tr>
<tr name="111" id="111">
<td><a id="l111" class='ln'>111</a></td><td><span class="ct"> * Constants *</span></td></tr>
<tr name="112" id="112">
<td><a id="l112" class='ln'>112</a></td><td><span class="ct"> *===========*/</span></td></tr>
<tr name="113" id="113">
<td><a id="l113" class='ln'>113</a></td><td></td></tr>
<tr name="114" id="114">
<td><a id="l114" class='ln'>114</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="114c14" class="tk">char_T</a> <a id="114c21" class="tk">rtMemAllocError</a>[] = "Memory allocation error";</td></tr>
<tr name="115" id="115">
<td><a id="l115" class='ln'>115</a></td><td></td></tr>
<tr name="116" id="116">
<td><a id="l116" class='ln'>116</a></td><td><span class="pp">#define</span> <a id="116c9" class="tk">ZEROS32</a> "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"</td></tr>
<tr name="117" id="117">
<td><a id="l117" class='ln'>117</a></td><td></td></tr>
<tr name="118" id="118">
<td><a id="l118" class='ln'>118</a></td><td><span class="pp">#if</span> <a id="118c5" class="tk">mxMAXNAM</a><a id="118c13" class="tk">==</a>32</td></tr>
<tr name="119" id="119">
<td><a id="l119" class='ln'>119</a></td><td></td></tr>
<tr name="120" id="120">
<td><a id="l120" class='ln'>120</a></td><td><span class="pp">#define</span> <a id="120c9" class="tk">ZERO_PAD</a></td></tr>
<tr name="121" id="121">
<td><a id="l121" class='ln'>121</a></td><td></td></tr>
<tr name="122" id="122">
<td><a id="l122" class='ln'>122</a></td><td><span class="pp">#elif</span> <a id="122c7" class="tk">mxMAXNAM</a><a id="122c15" class="tk">==</a>64</td></tr>
<tr name="123" id="123">
<td><a id="l123" class='ln'>123</a></td><td></td></tr>
<tr name="124" id="124">
<td><a id="l124" class='ln'>124</a></td><td><span class="pp">#define</span> <a id="124c9" class="tk">ZERO_PAD</a> <a id="124c18" class="tk">ZEROS32</a></td></tr>
<tr name="125" id="125">
<td><a id="l125" class='ln'>125</a></td><td></td></tr>
<tr name="126" id="126">
<td><a id="l126" class='ln'>126</a></td><td><span class="pp">#elif</span> <a id="126c7" class="tk">mxMAXNAM</a><a id="126c15" class="tk">==</a>128</td></tr>
<tr name="127" id="127">
<td><a id="l127" class='ln'>127</a></td><td></td></tr>
<tr name="128" id="128">
<td><a id="l128" class='ln'>128</a></td><td><span class="pp">#define</span> <a id="128c9" class="tk">ZERO_PAD</a> <a id="128c20" class="tk">ZEROS32</a> <a id="128c29" class="tk">ZEROS32</a> <a id="128c38" class="tk">ZEROS32</a></td></tr>
<tr name="129" id="129">
<td><a id="l129" class='ln'>129</a></td><td></td></tr>
<tr name="130" id="130">
<td><a id="l130" class='ln'>130</a></td><td><span class="pp">#else</span></td></tr>
<tr name="131" id="131">
<td><a id="l131" class='ln'>131</a></td><td></td></tr>
<tr name="132" id="132">
<td><a id="l132" class='ln'>132</a></td><td><span class="pp">#error</span> "Cannot Handle mxMAXNAM other than 32,64, and 128"</td></tr>
<tr name="133" id="133">
<td><a id="l133" class='ln'>133</a></td><td></td></tr>
<tr name="134" id="134">
<td><a id="l134" class='ln'>134</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="135" id="135">
<td><a id="l135" class='ln'>135</a></td><td><span class="ct">/* field names: for variable-size signal logging */</span></td></tr>
<tr name="136" id="136">
<td><a id="l136" class='ln'>136</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="136c14" class="tk">char_T</a> <a id="136c21" class="tk">rtStructLogVarFieldNames</a>[] =</td></tr>
<tr name="137" id="137">
<td><a id="l137" class='ln'>137</a></td><td> "time\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="137c82" class="tk">ZERO_PAD</a></td></tr>
<tr name="138" id="138">
<td><a id="l138" class='ln'>138</a></td><td> "signals\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="138c79" class="tk">ZERO_PAD</a></td></tr>
<tr name="139" id="139">
<td><a id="l139" class='ln'>139</a></td><td> "blockName\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="139c77" class="tk">ZERO_PAD</a>;</td></tr>
<tr name="140" id="140">
<td><a id="l140" class='ln'>140</a></td><td></td></tr>
<tr name="141" id="141">
<td><a id="l141" class='ln'>141</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="141c14" class="tk">char_T</a> <a id="141c21" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[] =</td></tr>
<tr name="142" id="142">
<td><a id="l142" class='ln'>142</a></td><td> "values\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="142c80" class="tk">ZERO_PAD</a></td></tr>
<tr name="143" id="143">
<td><a id="l143" class='ln'>143</a></td><td> "valueDimensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="143c71" class="tk">ZERO_PAD</a></td></tr>
<tr name="144" id="144">
<td><a id="l144" class='ln'>144</a></td><td> "dimensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="144c76" class="tk">ZERO_PAD</a></td></tr>
<tr name="145" id="145">
<td><a id="l145" class='ln'>145</a></td><td> "label\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="145c81" class="tk">ZERO_PAD</a></td></tr>
<tr name="146" id="146">
<td><a id="l146" class='ln'>146</a></td><td> "title\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="146c81" class="tk">ZERO_PAD</a></td></tr>
<tr name="147" id="147">
<td><a id="l147" class='ln'>147</a></td><td> "plotStyle\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="147c77" class="tk">ZERO_PAD</a>;</td></tr>
<tr name="148" id="148">
<td><a id="l148" class='ln'>148</a></td><td></td></tr>
<tr name="149" id="149">
<td><a id="l149" class='ln'>149</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="149c14" class="tk">char_T</a> <a id="149c21" class="tk">rtGlobalLoggingSignalsStructFieldNames</a>[] =</td></tr>
<tr name="150" id="150">
<td><a id="l150" class='ln'>150</a></td><td> "values\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="150c80" class="tk">ZERO_PAD</a></td></tr>
<tr name="151" id="151">
<td><a id="l151" class='ln'>151</a></td><td> "valueDimensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="151c71" class="tk">ZERO_PAD</a></td></tr>
<tr name="152" id="152">
<td><a id="l152" class='ln'>152</a></td><td> "dimensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="152c76" class="tk">ZERO_PAD</a></td></tr>
<tr name="153" id="153">
<td><a id="l153" class='ln'>153</a></td><td> "label\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="153c81" class="tk">ZERO_PAD</a></td></tr>
<tr name="154" id="154">
<td><a id="l154" class='ln'>154</a></td><td> "blockName\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="154c77" class="tk">ZERO_PAD</a></td></tr>
<tr name="155" id="155">
<td><a id="l155" class='ln'>155</a></td><td> "stateName\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="155c77" class="tk">ZERO_PAD</a></td></tr>
<tr name="156" id="156">
<td><a id="l156" class='ln'>156</a></td><td> "inReferencedModel\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="156c69" class="tk">ZERO_PAD</a>;</td></tr>
<tr name="157" id="157">
<td><a id="l157" class='ln'>157</a></td><td> </td></tr>
<tr name="158" id="158">
<td><a id="l158" class='ln'>158</a></td><td></td></tr>
<tr name="159" id="159">
<td><a id="l159" class='ln'>159</a></td><td><span class="pp">#define</span> <a id="159c9" class="tk">TIME_FIELD_NAME</a> (<a id="159c31" class="tk">rtStructLogVarFieldNames</a>[0<a id="159c57" class="tk">*</a><a id="159c58" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="160" id="160">
<td><a id="l160" class='ln'>160</a></td><td><span class="pp">#define</span> <a id="160c9" class="tk">SIGNALS_FIELD_NAME</a> (<a id="160c31" class="tk">rtStructLogVarFieldNames</a>[1<a id="160c57" class="tk">*</a><a id="160c58" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="161" id="161">
<td><a id="l161" class='ln'>161</a></td><td><span class="pp">#define</span> <a id="161c9" class="tk">BLOCKNAME_FIELD_NAME</a> (<a id="161c31" class="tk">rtStructLogVarFieldNames</a>[2<a id="161c57" class="tk">*</a><a id="161c58" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="162" id="162">
<td><a id="l162" class='ln'>162</a></td><td></td></tr>
<tr name="163" id="163">
<td><a id="l163" class='ln'>163</a></td><td><span class="pp">#define</span> <a id="163c9" class="tk">VALUES_FIELD_NAME</a> (<a id="163c31" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[0<a id="163c70" class="tk">*</a><a id="163c71" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="164" id="164">
<td><a id="l164" class='ln'>164</a></td><td><span class="pp">#define</span> <a id="164c9" class="tk">VALUEDIMENSIONS_FIELD_NAME</a> (<a id="164c37" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[1<a id="164c76" class="tk">*</a><a id="164c77" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="165" id="165">
<td><a id="l165" class='ln'>165</a></td><td><span class="pp">#define</span> <a id="165c9" class="tk">DIMENSION_FIELD_NAME</a> (<a id="165c31" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[2<a id="165c70" class="tk">*</a><a id="165c71" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="166" id="166">
<td><a id="l166" class='ln'>166</a></td><td><span class="pp">#define</span> <a id="166c9" class="tk">LABEL_FIELD_NAME</a> (<a id="166c31" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[3<a id="166c70" class="tk">*</a><a id="166c71" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="167" id="167">
<td><a id="l167" class='ln'>167</a></td><td><span class="pp">#define</span> <a id="167c9" class="tk">TITLE_FIELD_NAME</a> (<a id="167c31" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[4<a id="167c70" class="tk">*</a><a id="167c71" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="168" id="168">
<td><a id="l168" class='ln'>168</a></td><td><span class="pp">#define</span> <a id="168c9" class="tk">PLOTSTYLE_FIELD_NAME</a> (<a id="168c31" class="tk">rtLocalLoggingSignalsStructFieldNames</a>[5<a id="168c70" class="tk">*</a><a id="168c71" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="169" id="169">
<td><a id="l169" class='ln'>169</a></td><td></td></tr>
<tr name="170" id="170">
<td><a id="l170" class='ln'>170</a></td><td><span class="pp">#define</span> <a id="170c9" class="tk">STATENAME_FIELD_NAME</a> (<a id="170c31" class="tk">rtGlobalLoggingSignalsStructFieldNames</a>[5<a id="170c71" class="tk">*</a><a id="170c72" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="171" id="171">
<td><a id="l171" class='ln'>171</a></td><td><span class="pp">#define</span> <a id="171c9" class="tk">CROSS_MDL_REF_FIELD_NAME</a> (<a id="171c35" class="tk">rtGlobalLoggingSignalsStructFieldNames</a>[6<a id="171c75" class="tk">*</a><a id="171c76" class="tk">mxMAXNAM</a>])</td></tr>
<tr name="172" id="172">
<td><a id="l172" class='ln'>172</a></td><td></td></tr>
<tr name="173" id="173">
<td><a id="l173" class='ln'>173</a></td><td><span class="ct">/* field names: for fixed-size signal logging */</span></td></tr>
<tr name="174" id="174">
<td><a id="l174" class='ln'>174</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="174c14" class="tk">char_T</a> <a id="174c21" class="tk">rtLocalLoggingSignalsStructFieldNames_noValDims</a>[] =</td></tr>
<tr name="175" id="175">
<td><a id="l175" class='ln'>175</a></td><td> "values\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="175c80" class="tk">ZERO_PAD</a></td></tr>
<tr name="176" id="176">
<td><a id="l176" class='ln'>176</a></td><td> "dimensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="176c76" class="tk">ZERO_PAD</a></td></tr>
<tr name="177" id="177">
<td><a id="l177" class='ln'>177</a></td><td> "label\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="177c81" class="tk">ZERO_PAD</a></td></tr>
<tr name="178" id="178">
<td><a id="l178" class='ln'>178</a></td><td> "title\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="178c81" class="tk">ZERO_PAD</a></td></tr>
<tr name="179" id="179">
<td><a id="l179" class='ln'>179</a></td><td> "plotStyle\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="179c77" class="tk">ZERO_PAD</a>;</td></tr>
<tr name="180" id="180">
<td><a id="l180" class='ln'>180</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="180c14" class="tk">char_T</a> <a id="180c21" class="tk">rtGlobalLoggingSignalsStructFieldNames_noValDims</a>[] =</td></tr>
<tr name="181" id="181">
<td><a id="l181" class='ln'>181</a></td><td> "values\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="181c80" class="tk">ZERO_PAD</a></td></tr>
<tr name="182" id="182">
<td><a id="l182" class='ln'>182</a></td><td> "dimensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="182c76" class="tk">ZERO_PAD</a></td></tr>
<tr name="183" id="183">
<td><a id="l183" class='ln'>183</a></td><td> "label\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="183c81" class="tk">ZERO_PAD</a></td></tr>
<tr name="184" id="184">
<td><a id="l184" class='ln'>184</a></td><td> "blockName\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="184c77" class="tk">ZERO_PAD</a></td></tr>
<tr name="185" id="185">
<td><a id="l185" class='ln'>185</a></td><td> "stateName\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="185c77" class="tk">ZERO_PAD</a></td></tr>
<tr name="186" id="186">
<td><a id="l186" class='ln'>186</a></td><td> "inReferencedModel\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" <a id="186c69" class="tk">ZERO_PAD</a>;</td></tr>
<tr name="187" id="187">
<td><a id="l187" class='ln'>187</a></td><td></td></tr>
<tr name="188" id="188">
<td><a id="l188" class='ln'>188</a></td><td><span class="kw">extern</span> <a id="188c8" class="tk">real_T</a> <a id="188c15" class="tk">rtInf</a>; <span class="ct">/* declared by rt_nonfinite.c */</span></td></tr>
<tr name="189" id="189">
<td><a id="l189" class='ln'>189</a></td><td><span class="kw">extern</span> <a id="189c8" class="tk">real_T</a> <a id="189c15" class="tk">rtNaN</a>;</td></tr>
<tr name="190" id="190">
<td><a id="l190" class='ln'>190</a></td><td><span class="kw">extern</span> <a id="190c8" class="tk">real32_T</a> <a id="190c17" class="tk">rtNaNF</a>;</td></tr>
<tr name="191" id="191">
<td><a id="l191" class='ln'>191</a></td><td></td></tr>
<tr name="192" id="192">
<td><a id="l192" class='ln'>192</a></td><td><span class="ct">/*================*</span></td></tr>
<tr name="193" id="193">
<td><a id="l193" class='ln'>193</a></td><td><span class="ct"> * Local routines *</span></td></tr>
<tr name="194" id="194">
<td><a id="l194" class='ln'>194</a></td><td><span class="ct"> *================*/</span></td></tr>
<tr name="195" id="195">
<td><a id="l195" class='ln'>195</a></td><td></td></tr>
<tr name="196" id="196">
<td><a id="l196" class='ln'>196</a></td><td><span class="ct">/* Function: rt_GetSizeofDataType ==============================================</span></td></tr>
<tr name="197" id="197">
<td><a id="l197" class='ln'>197</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="198" id="198">
<td><a id="l198" class='ln'>198</a></td><td><span class="ct"> * Get the element size in bytes given the data type id.</span></td></tr>
<tr name="199" id="199">
<td><a id="l199" class='ln'>199</a></td><td><span class="ct"> */</span></td></tr>
<tr name="200" id="200">
<td><a id="l200" class='ln'>200</a></td><td><span class="kw">static</span> <a id="200c8" class="tk">size_t</a> <a id="200c15" class="tk">rt_GetSizeofDataType</a>(<a id="200c36" class="tk">BuiltInDTypeId</a> <a id="200c51" class="tk">dTypeID</a>)</td></tr>
<tr name="201" id="201">
<td><a id="l201" class='ln'>201</a></td><td><span class="br">{</span></td></tr>
<tr name="202" id="202">
<td><a id="l202" class='ln'>202</a></td><td> <a id="202c5" class="tk">size_t</a> <a id="202c12" class="tk">elSz</a> = 0; <span class="ct">/* unknown */</span></td></tr>
<tr name="203" id="203">
<td><a id="l203" class='ln'>203</a></td><td></td></tr>
<tr name="204" id="204">
<td><a id="l204" class='ln'>204</a></td><td> <span class="kw">switch</span> (<a id="204c13" class="tk">dTypeID</a>) <span class="br">{</span></td></tr>
<tr name="205" id="205">
<td><a id="l205" class='ln'>205</a></td><td> <span class="kw">case</span> <a id="205c12" class="tk">SS_DOUBLE</a><a id="205c21" class="tk">:</a></td></tr>
<tr name="206" id="206">
<td><a id="l206" class='ln'>206</a></td><td> <a id="206c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="206c23" class="tk">real_T</a>);</td></tr>
<tr name="207" id="207">
<td><a id="l207" class='ln'>207</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="208" id="208">
<td><a id="l208" class='ln'>208</a></td><td> <span class="kw">case</span> <a id="208c12" class="tk">SS_SINGLE</a><a id="208c21" class="tk">:</a></td></tr>
<tr name="209" id="209">
<td><a id="l209" class='ln'>209</a></td><td> <a id="209c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="209c23" class="tk">real32_T</a>);</td></tr>
<tr name="210" id="210">
<td><a id="l210" class='ln'>210</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="211" id="211">
<td><a id="l211" class='ln'>211</a></td><td> <span class="kw">case</span> <a id="211c12" class="tk">SS_INT8</a><a id="211c19" class="tk">:</a></td></tr>
<tr name="212" id="212">
<td><a id="l212" class='ln'>212</a></td><td> <a id="212c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="212c23" class="tk">int8_T</a>);</td></tr>
<tr name="213" id="213">
<td><a id="l213" class='ln'>213</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="214" id="214">
<td><a id="l214" class='ln'>214</a></td><td> <span class="kw">case</span> <a id="214c12" class="tk">SS_UINT8</a><a id="214c20" class="tk">:</a></td></tr>
<tr name="215" id="215">
<td><a id="l215" class='ln'>215</a></td><td> <a id="215c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="215c23" class="tk">uint8_T</a>);</td></tr>
<tr name="216" id="216">
<td><a id="l216" class='ln'>216</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="217" id="217">
<td><a id="l217" class='ln'>217</a></td><td> <span class="kw">case</span> <a id="217c12" class="tk">SS_INT16</a><a id="217c20" class="tk">:</a></td></tr>
<tr name="218" id="218">
<td><a id="l218" class='ln'>218</a></td><td> <a id="218c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="218c23" class="tk">int16_T</a>);</td></tr>
<tr name="219" id="219">
<td><a id="l219" class='ln'>219</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="220" id="220">
<td><a id="l220" class='ln'>220</a></td><td> <span class="kw">case</span> <a id="220c12" class="tk">SS_UINT16</a><a id="220c21" class="tk">:</a></td></tr>
<tr name="221" id="221">
<td><a id="l221" class='ln'>221</a></td><td> <a id="221c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="221c23" class="tk">uint16_T</a>);</td></tr>
<tr name="222" id="222">
<td><a id="l222" class='ln'>222</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="223" id="223">
<td><a id="l223" class='ln'>223</a></td><td> <span class="kw">case</span> <a id="223c12" class="tk">SS_INT32</a><a id="223c20" class="tk">:</a></td></tr>
<tr name="224" id="224">
<td><a id="l224" class='ln'>224</a></td><td> <a id="224c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="224c23" class="tk">int32_T</a>);</td></tr>
<tr name="225" id="225">
<td><a id="l225" class='ln'>225</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="226" id="226">
<td><a id="l226" class='ln'>226</a></td><td> <span class="kw">case</span> <a id="226c12" class="tk">SS_UINT32</a><a id="226c21" class="tk">:</a></td></tr>
<tr name="227" id="227">
<td><a id="l227" class='ln'>227</a></td><td> <a id="227c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="227c23" class="tk">uint32_T</a>);</td></tr>
<tr name="228" id="228">
<td><a id="l228" class='ln'>228</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="229" id="229">
<td><a id="l229" class='ln'>229</a></td><td> <span class="kw">case</span> <a id="229c12" class="tk">SS_BOOLEAN</a><a id="229c22" class="tk">:</a></td></tr>
<tr name="230" id="230">
<td><a id="l230" class='ln'>230</a></td><td> <a id="230c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="230c23" class="tk">boolean_T</a>);</td></tr>
<tr name="231" id="231">
<td><a id="l231" class='ln'>231</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="232" id="232">
<td><a id="l232" class='ln'>232</a></td><td> <span class="br">}</span></td></tr>
<tr name="233" id="233">
<td><a id="l233" class='ln'>233</a></td><td> <span class="kw">return</span>(<a id="233c12" class="tk">elSz</a>);</td></tr>
<tr name="234" id="234">
<td><a id="l234" class='ln'>234</a></td><td></td></tr>
<tr name="235" id="235">
<td><a id="l235" class='ln'>235</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetSizeofDataType */</span></td></tr>
<tr name="236" id="236">
<td><a id="l236" class='ln'>236</a></td><td></td></tr>
<tr name="237" id="237">
<td><a id="l237" class='ln'>237</a></td><td></td></tr>
<tr name="238" id="238">
<td><a id="l238" class='ln'>238</a></td><td><span class="ct">/* Function: rt_GetSizeofComplexType ===========================================</span></td></tr>
<tr name="239" id="239">
<td><a id="l239" class='ln'>239</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="240" id="240">
<td><a id="l240" class='ln'>240</a></td><td><span class="ct"> * Get the element size in bytes given the data type id.</span></td></tr>
<tr name="241" id="241">
<td><a id="l241" class='ln'>241</a></td><td><span class="ct"> */</span></td></tr>
<tr name="242" id="242">
<td><a id="l242" class='ln'>242</a></td><td><span class="kw">static</span> <a id="242c8" class="tk">size_t</a> <a id="242c15" class="tk">rt_GetSizeofComplexType</a>(<a id="242c39" class="tk">BuiltInDTypeId</a> <a id="242c54" class="tk">dTypeID</a>)</td></tr>
<tr name="243" id="243">
<td><a id="l243" class='ln'>243</a></td><td><span class="br">{</span></td></tr>
<tr name="244" id="244">
<td><a id="l244" class='ln'>244</a></td><td> <a id="244c5" class="tk">size_t</a> <a id="244c12" class="tk">elSz</a> = 2<a id="244c20" class="tk">*</a><a id="244c21" class="tk">rt_GetSizeofDataType</a>(<a id="244c42" class="tk">dTypeID</a>);</td></tr>
<tr name="245" id="245">
<td><a id="l245" class='ln'>245</a></td><td></td></tr>
<tr name="246" id="246">
<td><a id="l246" class='ln'>246</a></td><td> <span class="kw">switch</span> (<a id="246c13" class="tk">dTypeID</a>) <span class="br">{</span></td></tr>
<tr name="247" id="247">
<td><a id="l247" class='ln'>247</a></td><td> <span class="kw">case</span> <a id="247c12" class="tk">SS_DOUBLE</a><a id="247c21" class="tk">:</a></td></tr>
<tr name="248" id="248">
<td><a id="l248" class='ln'>248</a></td><td> <span class="pp">#ifdef</span> <a id="248c14" class="tk">CREAL_T</a></td></tr>
<tr name="249" id="249">
<td><a id="l249" class='ln'>249</a></td><td> <a id="249c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="249c23" class="tk">creal_T</a>);</td></tr>
<tr name="250" id="250">
<td><a id="l250" class='ln'>250</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="251" id="251">
<td><a id="l251" class='ln'>251</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="252" id="252">
<td><a id="l252" class='ln'>252</a></td><td> <span class="kw">case</span> <a id="252c12" class="tk">SS_SINGLE</a><a id="252c21" class="tk">:</a></td></tr>
<tr name="253" id="253">
<td><a id="l253" class='ln'>253</a></td><td> <span class="pp">#ifdef</span> <a id="253c14" class="tk">CREAL_T</a></td></tr>
<tr name="254" id="254">
<td><a id="l254" class='ln'>254</a></td><td> <a id="254c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="254c23" class="tk">creal32_T</a>);</td></tr>
<tr name="255" id="255">
<td><a id="l255" class='ln'>255</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="256" id="256">
<td><a id="l256" class='ln'>256</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="257" id="257">
<td><a id="l257" class='ln'>257</a></td><td> <span class="kw">case</span> <a id="257c12" class="tk">SS_INT8</a><a id="257c19" class="tk">:</a></td></tr>
<tr name="258" id="258">
<td><a id="l258" class='ln'>258</a></td><td> <span class="pp">#ifdef</span> <a id="258c14" class="tk">CINT8_T</a></td></tr>
<tr name="259" id="259">
<td><a id="l259" class='ln'>259</a></td><td> <a id="259c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="259c23" class="tk">cint8_T</a>);</td></tr>
<tr name="260" id="260">
<td><a id="l260" class='ln'>260</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="261" id="261">
<td><a id="l261" class='ln'>261</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="262" id="262">
<td><a id="l262" class='ln'>262</a></td><td> <span class="kw">case</span> <a id="262c12" class="tk">SS_UINT8</a><a id="262c20" class="tk">:</a></td></tr>
<tr name="263" id="263">
<td><a id="l263" class='ln'>263</a></td><td> <span class="pp">#ifdef</span> <a id="263c14" class="tk">CUINT8_T</a></td></tr>
<tr name="264" id="264">
<td><a id="l264" class='ln'>264</a></td><td> <a id="264c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="264c23" class="tk">cuint8_T</a>);</td></tr>
<tr name="265" id="265">
<td><a id="l265" class='ln'>265</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="266" id="266">
<td><a id="l266" class='ln'>266</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="267" id="267">
<td><a id="l267" class='ln'>267</a></td><td> <span class="kw">case</span> <a id="267c12" class="tk">SS_INT16</a><a id="267c20" class="tk">:</a></td></tr>
<tr name="268" id="268">
<td><a id="l268" class='ln'>268</a></td><td> <span class="pp">#ifdef</span> <a id="268c14" class="tk">CINT16_T</a></td></tr>
<tr name="269" id="269">
<td><a id="l269" class='ln'>269</a></td><td> <a id="269c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="269c23" class="tk">cint16_T</a>);</td></tr>
<tr name="270" id="270">
<td><a id="l270" class='ln'>270</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="271" id="271">
<td><a id="l271" class='ln'>271</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="272" id="272">
<td><a id="l272" class='ln'>272</a></td><td> <span class="kw">case</span> <a id="272c12" class="tk">SS_UINT16</a><a id="272c21" class="tk">:</a></td></tr>
<tr name="273" id="273">
<td><a id="l273" class='ln'>273</a></td><td> <span class="pp">#ifdef</span> <a id="273c14" class="tk">CUINT16_T</a></td></tr>
<tr name="274" id="274">
<td><a id="l274" class='ln'>274</a></td><td> <a id="274c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="274c23" class="tk">cuint16_T</a>);</td></tr>
<tr name="275" id="275">
<td><a id="l275" class='ln'>275</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="276" id="276">
<td><a id="l276" class='ln'>276</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="277" id="277">
<td><a id="l277" class='ln'>277</a></td><td> <span class="kw">case</span> <a id="277c12" class="tk">SS_INT32</a><a id="277c20" class="tk">:</a></td></tr>
<tr name="278" id="278">
<td><a id="l278" class='ln'>278</a></td><td> <span class="pp">#ifdef</span> <a id="278c14" class="tk">CINT32_T</a></td></tr>
<tr name="279" id="279">
<td><a id="l279" class='ln'>279</a></td><td> <a id="279c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="279c23" class="tk">cint32_T</a>);</td></tr>
<tr name="280" id="280">
<td><a id="l280" class='ln'>280</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="281" id="281">
<td><a id="l281" class='ln'>281</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="282" id="282">
<td><a id="l282" class='ln'>282</a></td><td> <span class="kw">case</span> <a id="282c12" class="tk">SS_UINT32</a><a id="282c21" class="tk">:</a></td></tr>
<tr name="283" id="283">
<td><a id="l283" class='ln'>283</a></td><td> <span class="pp">#ifdef</span> <a id="283c14" class="tk">CUINT32_T</a></td></tr>
<tr name="284" id="284">
<td><a id="l284" class='ln'>284</a></td><td> <a id="284c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="284c23" class="tk">cuint32_T</a>);</td></tr>
<tr name="285" id="285">
<td><a id="l285" class='ln'>285</a></td><td> <span class="pp">#endif</span></td></tr>
<tr name="286" id="286">
<td><a id="l286" class='ln'>286</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="287" id="287">
<td><a id="l287" class='ln'>287</a></td><td> <span class="kw">case</span> <a id="287c12" class="tk">SS_BOOLEAN</a><a id="287c22" class="tk">:</a></td></tr>
<tr name="288" id="288">
<td><a id="l288" class='ln'>288</a></td><td> <a id="288c9" class="tk">elSz</a> = <span class="kw">sizeof</span>(<a id="288c23" class="tk">boolean_T</a>);</td></tr>
<tr name="289" id="289">
<td><a id="l289" class='ln'>289</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="290" id="290">
<td><a id="l290" class='ln'>290</a></td><td> <span class="br">}</span></td></tr>
<tr name="291" id="291">
<td><a id="l291" class='ln'>291</a></td><td></td></tr>
<tr name="292" id="292">
<td><a id="l292" class='ln'>292</a></td><td> <span class="kw">return</span>(<a id="292c12" class="tk">elSz</a>);</td></tr>
<tr name="293" id="293">
<td><a id="l293" class='ln'>293</a></td><td></td></tr>
<tr name="294" id="294">
<td><a id="l294" class='ln'>294</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetSizeofComplexType */</span></td></tr>
<tr name="295" id="295">
<td><a id="l295" class='ln'>295</a></td><td></td></tr>
<tr name="296" id="296">
<td><a id="l296" class='ln'>296</a></td><td></td></tr>
<tr name="297" id="297">
<td><a id="l297" class='ln'>297</a></td><td><span class="ct">/* Function: rt_GetDataTypeConvertInfo =========================================</span></td></tr>
<tr name="298" id="298">
<td><a id="l298" class='ln'>298</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="299" id="299">
<td><a id="l299" class='ln'>299</a></td><td><span class="ct"> * Directly copy if pointer to structure is non-NULL, otherwise set to</span></td></tr>
<tr name="300" id="300">
<td><a id="l300" class='ln'>300</a></td><td><span class="ct"> * default.</span></td></tr>
<tr name="301" id="301">
<td><a id="l301" class='ln'>301</a></td><td><span class="ct"> */</span></td></tr>
<tr name="302" id="302">
<td><a id="l302" class='ln'>302</a></td><td><span class="kw">static</span> <a id="302c8" class="tk">RTWLogDataTypeConvert</a> <a id="302c30" class="tk">rt_GetDataTypeConvertInfo</a>(</td></tr>
<tr name="303" id="303">
<td><a id="l303" class='ln'>303</a></td><td> <span class="kw">const</span> <a id="303c11" class="tk">RTWLogDataTypeConvert</a> <a id="303c33" class="tk">*</a><a id="303c34" class="tk">pDataTypeConvertInfo</a>,</td></tr>
<tr name="304" id="304">
<td><a id="l304" class='ln'>304</a></td><td> <a id="304c5" class="tk">BuiltInDTypeId</a> <a id="304c20" class="tk">dTypeID</a></td></tr>
<tr name="305" id="305">
<td><a id="l305" class='ln'>305</a></td><td> )</td></tr>
<tr name="306" id="306">
<td><a id="l306" class='ln'>306</a></td><td><span class="br">{</span></td></tr>
<tr name="307" id="307">
<td><a id="l307" class='ln'>307</a></td><td> <a id="307c5" class="tk">RTWLogDataTypeConvert</a> <a id="307c27" class="tk">dataTypeConvertInfoCopy</a>;</td></tr>
<tr name="308" id="308">
<td><a id="l308" class='ln'>308</a></td><td></td></tr>
<tr name="309" id="309">
<td><a id="l309" class='ln'>309</a></td><td> <span class="kw">if</span> (<a id="309c9" class="tk">pDataTypeConvertInfo</a> <a id="309c30" class="tk">==</a> <a id="309c33" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="310" id="310">
<td><a id="l310" class='ln'>310</a></td><td> <a id="310c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="310c33" class="tk">conversionNeeded</a> = 0;</td></tr>
<tr name="311" id="311">
<td><a id="l311" class='ln'>311</a></td><td> <a id="311c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="311c33" class="tk">dataTypeIdLoggingTo</a> = <a id="311c55" class="tk">dTypeID</a>;</td></tr>
<tr name="312" id="312">
<td><a id="l312" class='ln'>312</a></td><td> <a id="312c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="312c33" class="tk">dataTypeIdOriginal</a> = (<a id="312c56" class="tk">DTypeId</a>)<a id="312c64" class="tk">dTypeID</a>;</td></tr>
<tr name="313" id="313">
<td><a id="l313" class='ln'>313</a></td><td> <a id="313c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="313c33" class="tk">bitsPerChunk</a> = 0;</td></tr>
<tr name="314" id="314">
<td><a id="l314" class='ln'>314</a></td><td> <a id="314c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="314c33" class="tk">numOfChunk</a> = 0;</td></tr>
<tr name="315" id="315">
<td><a id="l315" class='ln'>315</a></td><td> <a id="315c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="315c33" class="tk">isSigned</a> = 0;</td></tr>
<tr name="316" id="316">
<td><a id="l316" class='ln'>316</a></td><td> <a id="316c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="316c33" class="tk">fracSlope</a> = 1.0;</td></tr>
<tr name="317" id="317">
<td><a id="l317" class='ln'>317</a></td><td> <a id="317c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="317c33" class="tk">fixedExp</a> = 0;</td></tr>
<tr name="318" id="318">
<td><a id="l318" class='ln'>318</a></td><td> <a id="318c9" class="tk">dataTypeConvertInfoCopy</a>.<a id="318c33" class="tk">bias</a> = 0.0;</td></tr>
<tr name="319" id="319">
<td><a id="l319" class='ln'>319</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="320" id="320">
<td><a id="l320" class='ln'>320</a></td><td> <a id="320c9" class="tk">dataTypeConvertInfoCopy</a> = <a id="320c35" class="tk">*</a><a id="320c36" class="tk">pDataTypeConvertInfo</a>;</td></tr>
<tr name="321" id="321">
<td><a id="l321" class='ln'>321</a></td><td> <span class="br">}</span></td></tr>
<tr name="322" id="322">
<td><a id="l322" class='ln'>322</a></td><td></td></tr>
<tr name="323" id="323">
<td><a id="l323" class='ln'>323</a></td><td> <span class="kw">return</span> <a id="323c12" class="tk">dataTypeConvertInfoCopy</a>;</td></tr>
<tr name="324" id="324">
<td><a id="l324" class='ln'>324</a></td><td></td></tr>
<tr name="325" id="325">
<td><a id="l325" class='ln'>325</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetDataTypeConvertInfo */</span></td></tr>
<tr name="326" id="326">
<td><a id="l326" class='ln'>326</a></td><td></td></tr>
<tr name="327" id="327">
<td><a id="l327" class='ln'>327</a></td><td></td></tr>
<tr name="328" id="328">
<td><a id="l328" class='ln'>328</a></td><td><span class="ct">/* Function: rt_GetDblValueFromOverSizedData ===================================</span></td></tr>
<tr name="329" id="329">
<td><a id="l329" class='ln'>329</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="330" id="330">
<td><a id="l330" class='ln'>330</a></td><td><span class="ct"> */</span></td></tr>
<tr name="331" id="331">
<td><a id="l331" class='ln'>331</a></td><td><span class="kw">static</span> <span class="kw">double</span> <a id="331c15" class="tk">rt_GetDblValueFromOverSizedData</a>(</td></tr>
<tr name="332" id="332">
<td><a id="l332" class='ln'>332</a></td><td> <span class="kw">const</span> <span class="kw">void</span> <a id="332c16" class="tk">*</a><a id="332c17" class="tk">pVoid</a>, </td></tr>
<tr name="333" id="333">
<td><a id="l333" class='ln'>333</a></td><td> <span class="kw">int</span> <a id="333c9" class="tk">bitsPerChunk</a>, </td></tr>
<tr name="334" id="334">
<td><a id="l334" class='ln'>334</a></td><td> <span class="kw">int</span> <a id="334c9" class="tk">numOfChunk</a>,</td></tr>
<tr name="335" id="335">
<td><a id="l335" class='ln'>335</a></td><td> <span class="kw">unsigned</span> <span class="kw">int</span> <a id="335c18" class="tk">isSigned</a>, </td></tr>
<tr name="336" id="336">
<td><a id="l336" class='ln'>336</a></td><td> <span class="kw">double</span> <a id="336c12" class="tk">fracSlope</a>, </td></tr>
<tr name="337" id="337">
<td><a id="l337" class='ln'>337</a></td><td> <span class="kw">int</span> <a id="337c9" class="tk">fixedExp</a>, </td></tr>
<tr name="338" id="338">
<td><a id="l338" class='ln'>338</a></td><td> <span class="kw">double</span> <a id="338c12" class="tk">bias</a>)</td></tr>
<tr name="339" id="339">
<td><a id="l339" class='ln'>339</a></td><td><span class="br">{</span></td></tr>
<tr name="340" id="340">
<td><a id="l340" class='ln'>340</a></td><td> <span class="kw">double</span> <a id="340c12" class="tk">retValue</a> = 0;</td></tr>
<tr name="341" id="341">
<td><a id="l341" class='ln'>341</a></td><td></td></tr>
<tr name="342" id="342">
<td><a id="l342" class='ln'>342</a></td><td> <span class="kw">double</span> <a id="342c12" class="tk">*</a><a id="342c13" class="tk">dblValue</a> = (<span class="kw">double</span> <a id="342c32" class="tk">*</a>) <a id="342c35" class="tk">calloc</a>(<a id="342c42" class="tk">numOfChunk</a>, <span class="kw">sizeof</span>(<span class="kw">double</span>));</td></tr>
<tr name="343" id="343">
<td><a id="l343" class='ln'>343</a></td><td></td></tr>
<tr name="344" id="344">
<td><a id="l344" class='ln'>344</a></td><td> <span class="kw">int</span> <a id="344c9" class="tk">i</a>; </td></tr>
<tr name="345" id="345">
<td><a id="l345" class='ln'>345</a></td><td> <span class="kw">double</span> <a id="345c12" class="tk">isSignedNeg</a>;</td></tr>
<tr name="346" id="346">
<td><a id="l346" class='ln'>346</a></td><td></td></tr>
<tr name="347" id="347">
<td><a id="l347" class='ln'>347</a></td><td> <span class="kw">if</span>(<a id="347c8" class="tk">isSigned</a>) <span class="br">{</span></td></tr>
<tr name="348" id="348">
<td><a id="l348" class='ln'>348</a></td><td> <span class="kw">const</span> <a id="348c15" class="tk">chunk_T</a> <a id="348c23" class="tk">*</a><a id="348c24" class="tk">pData</a> = (<span class="kw">const</span> <a id="348c39" class="tk">chunk_T</a> <a id="348c47" class="tk">*</a>) (<a id="348c51" class="tk">pVoid</a>);</td></tr>
<tr name="349" id="349">
<td><a id="l349" class='ln'>349</a></td><td> <span class="kw">for</span> (<a id="349c14" class="tk">i</a> = 0; <a id="349c21" class="tk">i</a> <a id="349c23" class="tk">&lt;</a><a id="349c24" class="tk">numOfChunk</a>; <a id="349c36" class="tk">i</a><a id="349c37" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="350" id="350">
<td><a id="l350" class='ln'>350</a></td><td> <a id="350c13" class="tk">dblValue</a>[<a id="350c22" class="tk">i</a>] = (<span class="kw">double</span>)(<a id="350c36" class="tk">pData</a>[<a id="350c42" class="tk">i</a>]);</td></tr>
<tr name="351" id="351">
<td><a id="l351" class='ln'>351</a></td><td> <span class="br">}</span></td></tr>
<tr name="352" id="352">
<td><a id="l352" class='ln'>352</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="353" id="353">
<td><a id="l353" class='ln'>353</a></td><td> <span class="kw">const</span> <a id="353c15" class="tk">uchunk_T</a> <a id="353c24" class="tk">*</a><a id="353c25" class="tk">pData</a> = (<span class="kw">const</span> <a id="353c40" class="tk">uchunk_T</a> <a id="353c49" class="tk">*</a>) (<a id="353c53" class="tk">pVoid</a>);</td></tr>
<tr name="354" id="354">
<td><a id="l354" class='ln'>354</a></td><td> <span class="kw">for</span> (<a id="354c14" class="tk">i</a> = 0; <a id="354c21" class="tk">i</a> <a id="354c23" class="tk">&lt;</a><a id="354c24" class="tk">numOfChunk</a>; <a id="354c36" class="tk">i</a><a id="354c37" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="355" id="355">
<td><a id="l355" class='ln'>355</a></td><td> <a id="355c13" class="tk">dblValue</a>[<a id="355c22" class="tk">i</a>] = (<span class="kw">double</span>)(<a id="355c36" class="tk">pData</a>[<a id="355c42" class="tk">i</a>]);</td></tr>
<tr name="356" id="356">
<td><a id="l356" class='ln'>356</a></td><td> <span class="br">}</span></td></tr>
<tr name="357" id="357">
<td><a id="l357" class='ln'>357</a></td><td> <span class="br">}</span></td></tr>
<tr name="358" id="358">
<td><a id="l358" class='ln'>358</a></td><td></td></tr>
<tr name="359" id="359">
<td><a id="l359" class='ln'>359</a></td><td> <span class="ct">/* </span></td></tr>
<tr name="360" id="360">
<td><a id="l360" class='ln'>360</a></td><td><span class="ct"> Assuming multi chunks b_n ... b_2 b_1 b_0, and the length of each chunk is N.</span></td></tr>
<tr name="361" id="361">
<td><a id="l361" class='ln'>361</a></td><td><span class="ct"> Suppose b_i is the i-th chunk's value.</span></td></tr>
<tr name="362" id="362">
<td><a id="l362" class='ln'>362</a></td><td><span class="ct"> Then for unsigned data or data with one chunk: we have</span></td></tr>
<tr name="363" id="363">
<td><a id="l363" class='ln'>363</a></td><td><span class="ct"> retValue = b_n * 2^(n*N) + ... + b_1 * 2^N + b_0 * 2^0;</span></td></tr>
<tr name="364" id="364">
<td><a id="l364" class='ln'>364</a></td><td><span class="ct"> But for signed data, we have</span></td></tr>
<tr name="365" id="365">
<td><a id="l365" class='ln'>365</a></td><td><span class="ct"> retValue = b_n * 2^(n*N) + ... + b_1 * 2^N + b_0 * 2^0+ (b_0&lt;0) * 2^N + </span></td></tr>
<tr name="366" id="366">
<td><a id="l366" class='ln'>366</a></td><td><span class="ct"> ... (b_(n-1) &lt;0) * 2^(n*N) </span></td></tr>
<tr name="367" id="367">
<td><a id="l367" class='ln'>367</a></td><td><span class="ct"> = (b_n + (b_(n-1)&lt;0)) * 2^(n*N) +... + (b_1 + (b_0&lt;0)) * 2^N + b_0 * 2^0;</span></td></tr>
<tr name="368" id="368">
<td><a id="l368" class='ln'>368</a></td><td><span class="ct"> Together:</span></td></tr>
<tr name="369" id="369">
<td><a id="l369" class='ln'>369</a></td><td><span class="ct"> retValue = </span></td></tr>
<tr name="370" id="370">
<td><a id="l370" class='ln'>370</a></td><td><span class="ct"> (b_n + isSigned * (b_(n-1)&lt;0)) * 2^(n*N) +... + (b_1 + isSigned * (b_0&lt;0)) * 2^N + b_0 * 2^0;</span></td></tr>
<tr name="371" id="371">
<td><a id="l371" class='ln'>371</a></td><td><span class="ct"> */</span></td></tr>
<tr name="372" id="372">
<td><a id="l372" class='ln'>372</a></td><td></td></tr>
<tr name="373" id="373">
<td><a id="l373" class='ln'>373</a></td><td> <a id="373c5" class="tk">retValue</a> = <a id="373c16" class="tk">dblValue</a>[<a id="373c25" class="tk">numOfChunk</a> <a id="373c36" class="tk">-</a> 1];</td></tr>
<tr name="374" id="374">
<td><a id="l374" class='ln'>374</a></td><td> </td></tr>
<tr name="375" id="375">
<td><a id="l375" class='ln'>375</a></td><td> <span class="kw">for</span>(<a id="375c9" class="tk">i</a> = <a id="375c13" class="tk">numOfChunk</a> <a id="375c24" class="tk">-</a> 1; <a id="375c29" class="tk">i</a> <a id="375c31" class="tk">&gt;</a> 0; <a id="375c36" class="tk">i</a><a id="375c37" class="tk">--</a>) <span class="br">{</span></td></tr>
<tr name="376" id="376">
<td><a id="l376" class='ln'>376</a></td><td> <a id="376c9" class="tk">isSignedNeg</a> = <a id="376c23" class="tk">dblValue</a>[<a id="376c32" class="tk">i</a> <a id="376c34" class="tk">-</a> 1] <a id="376c39" class="tk">&lt;</a> 0 <a id="376c43" class="tk">?</a> (<span class="kw">double</span>)<a id="376c53" class="tk">isSigned</a> <a id="376c62" class="tk">:</a> 0;</td></tr>
<tr name="377" id="377">
<td><a id="l377" class='ln'>377</a></td><td> <a id="377c9" class="tk">retValue</a> = <a id="377c20" class="tk">retValue</a> <a id="377c29" class="tk">+</a> <a id="377c31" class="tk">isSignedNeg</a>;</td></tr>
<tr name="378" id="378">
<td><a id="l378" class='ln'>378</a></td><td></td></tr>
<tr name="379" id="379">
<td><a id="l379" class='ln'>379</a></td><td> <a id="379c9" class="tk">retValue</a> = <a id="379c20" class="tk">ldexp</a>(<a id="379c26" class="tk">retValue</a>, <a id="379c36" class="tk">bitsPerChunk</a>)<a id="379c49" class="tk">+</a> <a id="379c51" class="tk">dblValue</a>[<a id="379c60" class="tk">i</a><a id="379c61" class="tk">-</a>1];</td></tr>
<tr name="380" id="380">
<td><a id="l380" class='ln'>380</a></td><td> <span class="br">}</span></td></tr>
<tr name="381" id="381">
<td><a id="l381" class='ln'>381</a></td><td> <a id="381c5" class="tk">retValue</a> = <a id="381c16" class="tk">ldexp</a>( <a id="381c23" class="tk">fracSlope</a> <a id="381c33" class="tk">*</a> <a id="381c35" class="tk">retValue</a>, <a id="381c45" class="tk">fixedExp</a> ) <a id="381c56" class="tk">+</a> <a id="381c58" class="tk">bias</a>;</td></tr>
<tr name="382" id="382">
<td><a id="l382" class='ln'>382</a></td><td></td></tr>
<tr name="383" id="383">
<td><a id="l383" class='ln'>383</a></td><td> <a id="383c5" class="tk">FREE</a>(<a id="383c10" class="tk">dblValue</a>);</td></tr>
<tr name="384" id="384">
<td><a id="l384" class='ln'>384</a></td><td> <span class="kw">return</span> (<a id="384c13" class="tk">retValue</a>);</td></tr>
<tr name="385" id="385">
<td><a id="l385" class='ln'>385</a></td><td></td></tr>
<tr name="386" id="386">
<td><a id="l386" class='ln'>386</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetDblValueFromOverSizedData */</span></td></tr>
<tr name="387" id="387">
<td><a id="l387" class='ln'>387</a></td><td></td></tr>
<tr name="388" id="388">
<td><a id="l388" class='ln'>388</a></td><td></td></tr>
<tr name="389" id="389">
<td><a id="l389" class='ln'>389</a></td><td><span class="ct">/* Function: rt_GetNonBoolMxIdFromDTypeId ======================================</span></td></tr>
<tr name="390" id="390">
<td><a id="l390" class='ln'>390</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="391" id="391">
<td><a id="l391" class='ln'>391</a></td><td><span class="ct"> * Get the mx???_CLASS given the simulink builtin data type id.</span></td></tr>
<tr name="392" id="392">
<td><a id="l392" class='ln'>392</a></td><td><span class="ct"> */</span></td></tr>
<tr name="393" id="393">
<td><a id="l393" class='ln'>393</a></td><td><span class="kw">static</span> <a id="393c8" class="tk">mxClassID</a> <a id="393c18" class="tk">rt_GetNonBoolMxIdFromDTypeId</a>(<a id="393c47" class="tk">BuiltInDTypeId</a> <a id="393c62" class="tk">dTypeID</a>)</td></tr>
<tr name="394" id="394">
<td><a id="l394" class='ln'>394</a></td><td><span class="br">{</span></td></tr>
<tr name="395" id="395">
<td><a id="l395" class='ln'>395</a></td><td> <a id="395c5" class="tk">mxClassID</a> <a id="395c15" class="tk">mxID</a>;</td></tr>
<tr name="396" id="396">
<td><a id="l396" class='ln'>396</a></td><td></td></tr>
<tr name="397" id="397">
<td><a id="l397" class='ln'>397</a></td><td> <span class="kw">switch</span> (<a id="397c13" class="tk">dTypeID</a>) <span class="br">{</span></td></tr>
<tr name="398" id="398">
<td><a id="l398" class='ln'>398</a></td><td> <span class="kw">case</span> <a id="398c12" class="tk">SS_DOUBLE</a><a id="398c21" class="tk">:</a></td></tr>
<tr name="399" id="399">
<td><a id="l399" class='ln'>399</a></td><td> <a id="399c9" class="tk">mxID</a> = (<span class="kw">sizeof</span>(<a id="399c24" class="tk">real_T</a>)<a id="399c31" class="tk">==</a>4<a id="399c34" class="tk">?</a> <a id="399c36" class="tk">mxSINGLE_CLASS</a><a id="399c50" class="tk">:</a> <a id="399c52" class="tk">mxDOUBLE_CLASS</a>);</td></tr>
<tr name="400" id="400">
<td><a id="l400" class='ln'>400</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="401" id="401">
<td><a id="l401" class='ln'>401</a></td><td> <span class="kw">case</span> <a id="401c12" class="tk">SS_SINGLE</a><a id="401c21" class="tk">:</a></td></tr>
<tr name="402" id="402">
<td><a id="l402" class='ln'>402</a></td><td> <a id="402c9" class="tk">mxID</a> = <a id="402c16" class="tk">mxSINGLE_CLASS</a>;</td></tr>
<tr name="403" id="403">
<td><a id="l403" class='ln'>403</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="404" id="404">
<td><a id="l404" class='ln'>404</a></td><td> <span class="kw">case</span> <a id="404c12" class="tk">SS_INT8</a><a id="404c19" class="tk">:</a></td></tr>
<tr name="405" id="405">
<td><a id="l405" class='ln'>405</a></td><td> <span class="kw">switch</span> (<span class="kw">sizeof</span>(<a id="405c24" class="tk">int8_T</a>)) <span class="br">{</span></td></tr>
<tr name="406" id="406">
<td><a id="l406" class='ln'>406</a></td><td> <span class="kw">case</span> 4<a id="406c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="407" id="407">
<td><a id="l407" class='ln'>407</a></td><td><span class="ct"> "Needed for when PWS maps int8_T into 32-bits" */</span></td></tr>
<tr name="408" id="408">
<td><a id="l408" class='ln'>408</a></td><td> <a id="408c13" class="tk">mxID</a> = <a id="408c20" class="tk">mxINT32_CLASS</a>;</td></tr>
<tr name="409" id="409">
<td><a id="l409" class='ln'>409</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="410" id="410">
<td><a id="l410" class='ln'>410</a></td><td> <span class="kw">case</span> 2<a id="410c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="411" id="411">
<td><a id="l411" class='ln'>411</a></td><td><span class="ct"> "Needed for when PWS maps int8_T into 16-bits" */</span></td></tr>
<tr name="412" id="412">
<td><a id="l412" class='ln'>412</a></td><td> <a id="412c13" class="tk">mxID</a> = <a id="412c20" class="tk">mxINT16_CLASS</a>;</td></tr>
<tr name="413" id="413">
<td><a id="l413" class='ln'>413</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="414" id="414">
<td><a id="l414" class='ln'>414</a></td><td> <span class="kw">case</span> 1<a id="414c17" class="tk">:</a></td></tr>
<tr name="415" id="415">
<td><a id="l415" class='ln'>415</a></td><td> <a id="415c13" class="tk">mxID</a> = <a id="415c20" class="tk">mxINT8_CLASS</a>;</td></tr>
<tr name="416" id="416">
<td><a id="l416" class='ln'>416</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="417" id="417">
<td><a id="l417" class='ln'>417</a></td><td> <span class="kw">default</span><a id="417c18" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="418" id="418">
<td><a id="l418" class='ln'>418</a></td><td><span class="ct"> "Needed to handle an unknown data type ID" */</span></td></tr>
<tr name="419" id="419">
<td><a id="l419" class='ln'>419</a></td><td> <a id="419c13" class="tk">mxID</a> = <a id="419c20" class="tk">mxUNKNOWN_CLASS</a>;</td></tr>
<tr name="420" id="420">
<td><a id="l420" class='ln'>420</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="421" id="421">
<td><a id="l421" class='ln'>421</a></td><td> <span class="br">}</span></td></tr>
<tr name="422" id="422">
<td><a id="l422" class='ln'>422</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="423" id="423">
<td><a id="l423" class='ln'>423</a></td><td> <span class="kw">case</span> <a id="423c12" class="tk">SS_UINT8</a><a id="423c20" class="tk">:</a></td></tr>
<tr name="424" id="424">
<td><a id="l424" class='ln'>424</a></td><td> <span class="kw">switch</span> (<span class="kw">sizeof</span>(<a id="424c24" class="tk">uint8_T</a>)) <span class="br">{</span></td></tr>
<tr name="425" id="425">
<td><a id="l425" class='ln'>425</a></td><td> <span class="kw">case</span> 4<a id="425c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="426" id="426">
<td><a id="l426" class='ln'>426</a></td><td><span class="ct"> "Needed for when PWS maps uint8_T into 32-bits" */</span></td></tr>
<tr name="427" id="427">
<td><a id="l427" class='ln'>427</a></td><td> <a id="427c13" class="tk">mxID</a> = <a id="427c20" class="tk">mxUINT32_CLASS</a>;</td></tr>
<tr name="428" id="428">
<td><a id="l428" class='ln'>428</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="429" id="429">
<td><a id="l429" class='ln'>429</a></td><td> <span class="kw">case</span> 2<a id="429c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="430" id="430">
<td><a id="l430" class='ln'>430</a></td><td><span class="ct"> "Needed for when PWS maps uint8_T into 16-bits" */</span></td></tr>
<tr name="431" id="431">
<td><a id="l431" class='ln'>431</a></td><td> <a id="431c13" class="tk">mxID</a> = <a id="431c20" class="tk">mxUINT16_CLASS</a>;</td></tr>
<tr name="432" id="432">
<td><a id="l432" class='ln'>432</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="433" id="433">
<td><a id="l433" class='ln'>433</a></td><td> <span class="kw">case</span> 1<a id="433c17" class="tk">:</a></td></tr>
<tr name="434" id="434">
<td><a id="l434" class='ln'>434</a></td><td> <a id="434c13" class="tk">mxID</a> = <a id="434c20" class="tk">mxUINT8_CLASS</a>;</td></tr>
<tr name="435" id="435">
<td><a id="l435" class='ln'>435</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="436" id="436">
<td><a id="l436" class='ln'>436</a></td><td> <span class="kw">default</span><a id="436c18" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="437" id="437">
<td><a id="l437" class='ln'>437</a></td><td><span class="ct"> "Needed to handle an unknown data type ID" */</span></td></tr>
<tr name="438" id="438">
<td><a id="l438" class='ln'>438</a></td><td> <a id="438c13" class="tk">mxID</a> = <a id="438c20" class="tk">mxUNKNOWN_CLASS</a>;</td></tr>
<tr name="439" id="439">
<td><a id="l439" class='ln'>439</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="440" id="440">
<td><a id="l440" class='ln'>440</a></td><td> <span class="br">}</span></td></tr>
<tr name="441" id="441">
<td><a id="l441" class='ln'>441</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="442" id="442">
<td><a id="l442" class='ln'>442</a></td><td> <span class="kw">case</span> <a id="442c12" class="tk">SS_INT16</a><a id="442c20" class="tk">:</a></td></tr>
<tr name="443" id="443">
<td><a id="l443" class='ln'>443</a></td><td> <a id="443c9" class="tk">mxID</a> = (<span class="kw">sizeof</span>(<a id="443c24" class="tk">int16_T</a>)<a id="443c32" class="tk">==</a>4<a id="443c35" class="tk">?</a> <a id="443c37" class="tk">mxINT32_CLASS</a><a id="443c50" class="tk">:</a> <a id="443c52" class="tk">mxINT16_CLASS</a>);</td></tr>
<tr name="444" id="444">
<td><a id="l444" class='ln'>444</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="445" id="445">
<td><a id="l445" class='ln'>445</a></td><td> <span class="kw">case</span> <a id="445c12" class="tk">SS_UINT16</a><a id="445c21" class="tk">:</a></td></tr>
<tr name="446" id="446">
<td><a id="l446" class='ln'>446</a></td><td> <a id="446c9" class="tk">mxID</a> = (<span class="kw">sizeof</span>(<a id="446c24" class="tk">uint16_T</a>)<a id="446c33" class="tk">==</a>4<a id="446c36" class="tk">?</a> <a id="446c38" class="tk">mxUINT32_CLASS</a><a id="446c52" class="tk">:</a> <a id="446c54" class="tk">mxUINT16_CLASS</a>);</td></tr>
<tr name="447" id="447">
<td><a id="l447" class='ln'>447</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="448" id="448">
<td><a id="l448" class='ln'>448</a></td><td> <span class="kw">case</span> <a id="448c12" class="tk">SS_INT32</a><a id="448c20" class="tk">:</a></td></tr>
<tr name="449" id="449">
<td><a id="l449" class='ln'>449</a></td><td> <a id="449c9" class="tk">mxID</a> = <a id="449c16" class="tk">mxINT32_CLASS</a>;</td></tr>
<tr name="450" id="450">
<td><a id="l450" class='ln'>450</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="451" id="451">
<td><a id="l451" class='ln'>451</a></td><td> <span class="kw">case</span> <a id="451c12" class="tk">SS_UINT32</a><a id="451c21" class="tk">:</a></td></tr>
<tr name="452" id="452">
<td><a id="l452" class='ln'>452</a></td><td> <a id="452c9" class="tk">mxID</a> = <a id="452c16" class="tk">mxUINT32_CLASS</a>;</td></tr>
<tr name="453" id="453">
<td><a id="l453" class='ln'>453</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="454" id="454">
<td><a id="l454" class='ln'>454</a></td><td> <span class="ct">/*case SS_BOOLEAN:</span></td></tr>
<tr name="455" id="455">
<td><a id="l455" class='ln'>455</a></td><td><span class="ct"> mxID = (sizeof(boolean_T)==4? mxUINT32_CLASS: mxLOGICAL_CLASS);</span></td></tr>
<tr name="456" id="456">
<td><a id="l456" class='ln'>456</a></td><td><span class="ct"> break;*/</span></td></tr>
<tr name="457" id="457">
<td><a id="l457" class='ln'>457</a></td><td> <span class="kw">default</span><a id="457c14" class="tk">:</a></td></tr>
<tr name="458" id="458">
<td><a id="l458" class='ln'>458</a></td><td> <a id="458c9" class="tk">mxID</a> = <a id="458c16" class="tk">mxUNKNOWN_CLASS</a>;</td></tr>
<tr name="459" id="459">
<td><a id="l459" class='ln'>459</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="460" id="460">
<td><a id="l460" class='ln'>460</a></td><td> <span class="br">}</span></td></tr>
<tr name="461" id="461">
<td><a id="l461" class='ln'>461</a></td><td></td></tr>
<tr name="462" id="462">
<td><a id="l462" class='ln'>462</a></td><td> <span class="kw">return</span>(<a id="462c12" class="tk">mxID</a>);</td></tr>
<tr name="463" id="463">
<td><a id="l463" class='ln'>463</a></td><td></td></tr>
<tr name="464" id="464">
<td><a id="l464" class='ln'>464</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetNonBoolMxIdFromDTypeId */</span></td></tr>
<tr name="465" id="465">
<td><a id="l465" class='ln'>465</a></td><td></td></tr>
<tr name="466" id="466">
<td><a id="l466" class='ln'>466</a></td><td></td></tr>
<tr name="467" id="467">
<td><a id="l467" class='ln'>467</a></td><td></td></tr>
<tr name="468" id="468">
<td><a id="l468" class='ln'>468</a></td><td><span class="pp">#ifdef</span> <a id="468c8" class="tk">__cplusplus</a></td></tr>
<tr name="469" id="469">
<td><a id="l469" class='ln'>469</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="470" id="470">
<td><a id="l470" class='ln'>470</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="471" id="471">
<td><a id="l471" class='ln'>471</a></td><td></td></tr>
<tr name="472" id="472">
<td><a id="l472" class='ln'>472</a></td><td></td></tr>
<tr name="473" id="473">
<td><a id="l473" class='ln'>473</a></td><td><span class="ct">/* Function: rt_GetMxIdFromDTypeIdForRSim ======================================</span></td></tr>
<tr name="474" id="474">
<td><a id="l474" class='ln'>474</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="475" id="475">
<td><a id="l475" class='ln'>475</a></td><td><span class="ct"> * Get the mx???_CLASS given the simulink builtin data type id.</span></td></tr>
<tr name="476" id="476">
<td><a id="l476" class='ln'>476</a></td><td><span class="ct"> */</span></td></tr>
<tr name="477" id="477">
<td><a id="l477" class='ln'>477</a></td><td><a id="477c1" class="tk">mxClassID</a> <a id="477c11" class="tk">rt_GetMxIdFromDTypeIdForRSim</a>(<a id="477c40" class="tk">BuiltInDTypeId</a> <a id="477c55" class="tk">dTypeID</a>)</td></tr>
<tr name="478" id="478">
<td><a id="l478" class='ln'>478</a></td><td><span class="br">{</span></td></tr>
<tr name="479" id="479">
<td><a id="l479" class='ln'>479</a></td><td> <a id="479c5" class="tk">mxClassID</a> <a id="479c15" class="tk">mxID</a>;</td></tr>
<tr name="480" id="480">
<td><a id="l480" class='ln'>480</a></td><td></td></tr>
<tr name="481" id="481">
<td><a id="l481" class='ln'>481</a></td><td> <span class="kw">if</span> (<a id="481c9" class="tk">dTypeID</a> <a id="481c17" class="tk">==</a> <a id="481c20" class="tk">SS_BOOLEAN</a>) <span class="br">{</span></td></tr>
<tr name="482" id="482">
<td><a id="l482" class='ln'>482</a></td><td> <span class="kw">switch</span> (<span class="kw">sizeof</span>(<a id="482c24" class="tk">boolean_T</a>)) <span class="br">{</span></td></tr>
<tr name="483" id="483">
<td><a id="l483" class='ln'>483</a></td><td> <span class="kw">case</span> 4<a id="483c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="484" id="484">
<td><a id="l484" class='ln'>484</a></td><td><span class="ct"> "Needed for when PWS maps boolean_T into 32-bits" */</span></td></tr>
<tr name="485" id="485">
<td><a id="l485" class='ln'>485</a></td><td> <a id="485c13" class="tk">mxID</a> = <a id="485c20" class="tk">mxUINT32_CLASS</a>;</td></tr>
<tr name="486" id="486">
<td><a id="l486" class='ln'>486</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="487" id="487">
<td><a id="l487" class='ln'>487</a></td><td> <span class="kw">case</span> 2<a id="487c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="488" id="488">
<td><a id="l488" class='ln'>488</a></td><td><span class="ct"> "Needed for when PWS maps boolean_T into 16-bits" */</span></td></tr>
<tr name="489" id="489">
<td><a id="l489" class='ln'>489</a></td><td> <a id="489c13" class="tk">mxID</a> = <a id="489c20" class="tk">mxUINT16_CLASS</a>;</td></tr>
<tr name="490" id="490">
<td><a id="l490" class='ln'>490</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="491" id="491">
<td><a id="l491" class='ln'>491</a></td><td> <span class="kw">default</span><a id="491c18" class="tk">:</a></td></tr>
<tr name="492" id="492">
<td><a id="l492" class='ln'>492</a></td><td> <a id="492c13" class="tk">mxID</a> = <a id="492c20" class="tk">mxLOGICAL_CLASS</a>;</td></tr>
<tr name="493" id="493">
<td><a id="l493" class='ln'>493</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="494" id="494">
<td><a id="l494" class='ln'>494</a></td><td> <span class="br">}</span></td></tr>
<tr name="495" id="495">
<td><a id="l495" class='ln'>495</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="496" id="496">
<td><a id="l496" class='ln'>496</a></td><td> <a id="496c9" class="tk">mxID</a> = <a id="496c16" class="tk">rt_GetNonBoolMxIdFromDTypeId</a>(<a id="496c45" class="tk">dTypeID</a>);</td></tr>
<tr name="497" id="497">
<td><a id="l497" class='ln'>497</a></td><td> <span class="br">}</span></td></tr>
<tr name="498" id="498">
<td><a id="l498" class='ln'>498</a></td><td></td></tr>
<tr name="499" id="499">
<td><a id="l499" class='ln'>499</a></td><td> <span class="kw">return</span>(<a id="499c12" class="tk">mxID</a>);</td></tr>
<tr name="500" id="500">
<td><a id="l500" class='ln'>500</a></td><td></td></tr>
<tr name="501" id="501">
<td><a id="l501" class='ln'>501</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetMxIdFromDTypeIdForRSim */</span></td></tr>
<tr name="502" id="502">
<td><a id="l502" class='ln'>502</a></td><td></td></tr>
<tr name="503" id="503">
<td><a id="l503" class='ln'>503</a></td><td></td></tr>
<tr name="504" id="504">
<td><a id="l504" class='ln'>504</a></td><td><span class="pp">#ifdef</span> <a id="504c8" class="tk">__cplusplus</a></td></tr>
<tr name="505" id="505">
<td><a id="l505" class='ln'>505</a></td><td><span class="br">}</span></td></tr>
<tr name="506" id="506">
<td><a id="l506" class='ln'>506</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="507" id="507">
<td><a id="l507" class='ln'>507</a></td><td></td></tr>
<tr name="508" id="508">
<td><a id="l508" class='ln'>508</a></td><td></td></tr>
<tr name="509" id="509">
<td><a id="l509" class='ln'>509</a></td><td></td></tr>
<tr name="510" id="510">
<td><a id="l510" class='ln'>510</a></td><td></td></tr>
<tr name="511" id="511">
<td><a id="l511" class='ln'>511</a></td><td><span class="pp">#ifdef</span> <a id="511c8" class="tk">__cplusplus</a></td></tr>
<tr name="512" id="512">
<td><a id="l512" class='ln'>512</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="513" id="513">
<td><a id="l513" class='ln'>513</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="514" id="514">
<td><a id="l514" class='ln'>514</a></td><td></td></tr>
<tr name="515" id="515">
<td><a id="l515" class='ln'>515</a></td><td></td></tr>
<tr name="516" id="516">
<td><a id="l516" class='ln'>516</a></td><td><span class="ct">/* Function: rt_GetMxIdFromDTypeId =============================================</span></td></tr>
<tr name="517" id="517">
<td><a id="l517" class='ln'>517</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="518" id="518">
<td><a id="l518" class='ln'>518</a></td><td><span class="ct"> * Get the mx???_CLASS given the simulink builtin data type id.</span></td></tr>
<tr name="519" id="519">
<td><a id="l519" class='ln'>519</a></td><td><span class="ct"> */</span></td></tr>
<tr name="520" id="520">
<td><a id="l520" class='ln'>520</a></td><td><a id="520c1" class="tk">mxClassID</a> <a id="520c11" class="tk">rt_GetMxIdFromDTypeId</a>(<a id="520c33" class="tk">BuiltInDTypeId</a> <a id="520c48" class="tk">dTypeID</a>)</td></tr>
<tr name="521" id="521">
<td><a id="l521" class='ln'>521</a></td><td><span class="br">{</span></td></tr>
<tr name="522" id="522">
<td><a id="l522" class='ln'>522</a></td><td> <a id="522c5" class="tk">mxClassID</a> <a id="522c15" class="tk">mxID</a>;</td></tr>
<tr name="523" id="523">
<td><a id="l523" class='ln'>523</a></td><td></td></tr>
<tr name="524" id="524">
<td><a id="l524" class='ln'>524</a></td><td> <span class="kw">if</span> (<a id="524c9" class="tk">dTypeID</a> <a id="524c17" class="tk">==</a> <a id="524c20" class="tk">SS_BOOLEAN</a>) <span class="br">{</span></td></tr>
<tr name="525" id="525">
<td><a id="l525" class='ln'>525</a></td><td> <span class="kw">switch</span> (<span class="kw">sizeof</span>(<a id="525c24" class="tk">boolean_T</a>)) <span class="br">{</span></td></tr>
<tr name="526" id="526">
<td><a id="l526" class='ln'>526</a></td><td> <span class="kw">case</span> 4<a id="526c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="527" id="527">
<td><a id="l527" class='ln'>527</a></td><td><span class="ct"> "Needed for when PWS maps boolean_T into 32-bits" */</span></td></tr>
<tr name="528" id="528">
<td><a id="l528" class='ln'>528</a></td><td> <a id="528c13" class="tk">mxID</a> = <a id="528c20" class="tk">mxUINT32_CLASS</a>;</td></tr>
<tr name="529" id="529">
<td><a id="l529" class='ln'>529</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="530" id="530">
<td><a id="l530" class='ln'>530</a></td><td> <span class="kw">case</span> 2<a id="530c17" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="531" id="531">
<td><a id="l531" class='ln'>531</a></td><td><span class="ct"> "Needed for when PWS maps boolean_T into 16-bits" */</span></td></tr>
<tr name="532" id="532">
<td><a id="l532" class='ln'>532</a></td><td> <a id="532c13" class="tk">mxID</a> = <a id="532c20" class="tk">mxUINT16_CLASS</a>;</td></tr>
<tr name="533" id="533">
<td><a id="l533" class='ln'>533</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="534" id="534">
<td><a id="l534" class='ln'>534</a></td><td> <span class="kw">default</span><a id="534c18" class="tk">:</a></td></tr>
<tr name="535" id="535">
<td><a id="l535" class='ln'>535</a></td><td> <a id="535c13" class="tk">mxID</a> = <a id="535c20" class="tk">mxUINT8_CLASS</a>;</td></tr>
<tr name="536" id="536">
<td><a id="l536" class='ln'>536</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="537" id="537">
<td><a id="l537" class='ln'>537</a></td><td> <span class="br">}</span></td></tr>
<tr name="538" id="538">
<td><a id="l538" class='ln'>538</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="539" id="539">
<td><a id="l539" class='ln'>539</a></td><td> <a id="539c9" class="tk">mxID</a> = <a id="539c16" class="tk">rt_GetNonBoolMxIdFromDTypeId</a>(<a id="539c45" class="tk">dTypeID</a>);</td></tr>
<tr name="540" id="540">
<td><a id="l540" class='ln'>540</a></td><td> <span class="br">}</span></td></tr>
<tr name="541" id="541">
<td><a id="l541" class='ln'>541</a></td><td> <span class="kw">return</span>(<a id="541c12" class="tk">mxID</a>);</td></tr>
<tr name="542" id="542">
<td><a id="l542" class='ln'>542</a></td><td></td></tr>
<tr name="543" id="543">
<td><a id="l543" class='ln'>543</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetMxIdFromDTypeId */</span></td></tr>
<tr name="544" id="544">
<td><a id="l544" class='ln'>544</a></td><td></td></tr>
<tr name="545" id="545">
<td><a id="l545" class='ln'>545</a></td><td></td></tr>
<tr name="546" id="546">
<td><a id="l546" class='ln'>546</a></td><td><span class="pp">#ifdef</span> <a id="546c8" class="tk">__cplusplus</a></td></tr>
<tr name="547" id="547">
<td><a id="l547" class='ln'>547</a></td><td><span class="br">}</span></td></tr>
<tr name="548" id="548">
<td><a id="l548" class='ln'>548</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="549" id="549">
<td><a id="l549" class='ln'>549</a></td><td></td></tr>
<tr name="550" id="550">
<td><a id="l550" class='ln'>550</a></td><td></td></tr>
<tr name="551" id="551">
<td><a id="l551" class='ln'>551</a></td><td></td></tr>
<tr name="552" id="552">
<td><a id="l552" class='ln'>552</a></td><td><span class="ct">/* Function: rt_GetMatIdFromMxId ===============================================</span></td></tr>
<tr name="553" id="553">
<td><a id="l553" class='ln'>553</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="554" id="554">
<td><a id="l554" class='ln'>554</a></td><td><span class="ct"> * Get the MatId given the mxClassID.</span></td></tr>
<tr name="555" id="555">
<td><a id="l555" class='ln'>555</a></td><td><span class="ct"> */</span></td></tr>
<tr name="556" id="556">
<td><a id="l556" class='ln'>556</a></td><td><span class="kw">static</span> <a id="556c8" class="tk">int_T</a> <a id="556c14" class="tk">rt_GetMatIdFromMxId</a>(<a id="556c34" class="tk">mxClassID</a> <a id="556c44" class="tk">mxID</a>)</td></tr>
<tr name="557" id="557">
<td><a id="l557" class='ln'>557</a></td><td><span class="br">{</span></td></tr>
<tr name="558" id="558">
<td><a id="l558" class='ln'>558</a></td><td> <a id="558c5" class="tk">int_T</a> <a id="558c11" class="tk">matID</a>;</td></tr>
<tr name="559" id="559">
<td><a id="l559" class='ln'>559</a></td><td></td></tr>
<tr name="560" id="560">
<td><a id="l560" class='ln'>560</a></td><td> <span class="kw">switch</span> (<a id="560c13" class="tk">mxID</a>) <span class="br">{</span></td></tr>
<tr name="561" id="561">
<td><a id="l561" class='ln'>561</a></td><td> <span class="kw">case</span> <a id="561c12" class="tk">mxCELL_CLASS</a><a id="561c24" class="tk">:</a></td></tr>
<tr name="562" id="562">
<td><a id="l562" class='ln'>562</a></td><td> <span class="kw">case</span> <a id="562c12" class="tk">mxSTRUCT_CLASS</a><a id="562c26" class="tk">:</a></td></tr>
<tr name="563" id="563">
<td><a id="l563" class='ln'>563</a></td><td> <span class="kw">case</span> <a id="563c12" class="tk">mxOBJECT_CLASS</a><a id="563c26" class="tk">:</a></td></tr>
<tr name="564" id="564">
<td><a id="l564" class='ln'>564</a></td><td> <a id="564c9" class="tk">matID</a> = <a id="564c17" class="tk">-</a>1;</td></tr>
<tr name="565" id="565">
<td><a id="l565" class='ln'>565</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="566" id="566">
<td><a id="l566" class='ln'>566</a></td><td> <span class="kw">case</span> <a id="566c12" class="tk">mxCHAR_CLASS</a><a id="566c24" class="tk">:</a></td></tr>
<tr name="567" id="567">
<td><a id="l567" class='ln'>567</a></td><td> <a id="567c9" class="tk">matID</a> = <a id="567c17" class="tk">matUINT16</a>;</td></tr>
<tr name="568" id="568">
<td><a id="l568" class='ln'>568</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="569" id="569">
<td><a id="l569" class='ln'>569</a></td><td> <span class="kw">case</span> <a id="569c12" class="tk">mxDOUBLE_CLASS</a><a id="569c26" class="tk">:</a></td></tr>
<tr name="570" id="570">
<td><a id="l570" class='ln'>570</a></td><td> <a id="570c9" class="tk">matID</a> = <a id="570c17" class="tk">matDOUBLE</a>;</td></tr>
<tr name="571" id="571">
<td><a id="l571" class='ln'>571</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="572" id="572">
<td><a id="l572" class='ln'>572</a></td><td> <span class="kw">case</span> <a id="572c12" class="tk">mxSINGLE_CLASS</a><a id="572c26" class="tk">:</a></td></tr>
<tr name="573" id="573">
<td><a id="l573" class='ln'>573</a></td><td> <a id="573c9" class="tk">matID</a> = <a id="573c17" class="tk">matFLOAT</a>;</td></tr>
<tr name="574" id="574">
<td><a id="l574" class='ln'>574</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="575" id="575">
<td><a id="l575" class='ln'>575</a></td><td> <span class="kw">case</span> <a id="575c12" class="tk">mxINT8_CLASS</a><a id="575c24" class="tk">:</a></td></tr>
<tr name="576" id="576">
<td><a id="l576" class='ln'>576</a></td><td> <a id="576c9" class="tk">matID</a> = <a id="576c17" class="tk">matINT8</a>;</td></tr>
<tr name="577" id="577">
<td><a id="l577" class='ln'>577</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="578" id="578">
<td><a id="l578" class='ln'>578</a></td><td> <span class="kw">case</span> <a id="578c12" class="tk">mxUINT8_CLASS</a><a id="578c25" class="tk">:</a></td></tr>
<tr name="579" id="579">
<td><a id="l579" class='ln'>579</a></td><td> <a id="579c9" class="tk">matID</a> = <a id="579c17" class="tk">matUINT8</a>;</td></tr>
<tr name="580" id="580">
<td><a id="l580" class='ln'>580</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="581" id="581">
<td><a id="l581" class='ln'>581</a></td><td> <span class="kw">case</span> <a id="581c12" class="tk">mxINT16_CLASS</a><a id="581c25" class="tk">:</a></td></tr>
<tr name="582" id="582">
<td><a id="l582" class='ln'>582</a></td><td> <a id="582c9" class="tk">matID</a> = <a id="582c17" class="tk">matINT16</a>;</td></tr>
<tr name="583" id="583">
<td><a id="l583" class='ln'>583</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="584" id="584">
<td><a id="l584" class='ln'>584</a></td><td> <span class="kw">case</span> <a id="584c12" class="tk">mxUINT16_CLASS</a><a id="584c26" class="tk">:</a></td></tr>
<tr name="585" id="585">
<td><a id="l585" class='ln'>585</a></td><td> <a id="585c9" class="tk">matID</a> = <a id="585c17" class="tk">matUINT16</a>;</td></tr>
<tr name="586" id="586">
<td><a id="l586" class='ln'>586</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="587" id="587">
<td><a id="l587" class='ln'>587</a></td><td> <span class="kw">case</span> <a id="587c12" class="tk">mxINT32_CLASS</a><a id="587c25" class="tk">:</a></td></tr>
<tr name="588" id="588">
<td><a id="l588" class='ln'>588</a></td><td> <a id="588c9" class="tk">matID</a> = <a id="588c17" class="tk">matINT32</a>;</td></tr>
<tr name="589" id="589">
<td><a id="l589" class='ln'>589</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="590" id="590">
<td><a id="l590" class='ln'>590</a></td><td> <span class="kw">case</span> <a id="590c12" class="tk">mxUINT32_CLASS</a><a id="590c26" class="tk">:</a></td></tr>
<tr name="591" id="591">
<td><a id="l591" class='ln'>591</a></td><td> <a id="591c9" class="tk">matID</a> = <a id="591c17" class="tk">matUINT32</a>;</td></tr>
<tr name="592" id="592">
<td><a id="l592" class='ln'>592</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="593" id="593">
<td><a id="l593" class='ln'>593</a></td><td> <span class="kw">case</span> <a id="593c12" class="tk">mxINT64_CLASS</a><a id="593c25" class="tk">:</a></td></tr>
<tr name="594" id="594">
<td><a id="l594" class='ln'>594</a></td><td> <a id="594c9" class="tk">matID</a> = <a id="594c17" class="tk">matINT64</a>;</td></tr>
<tr name="595" id="595">
<td><a id="l595" class='ln'>595</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="596" id="596">
<td><a id="l596" class='ln'>596</a></td><td> <span class="kw">case</span> <a id="596c12" class="tk">mxUINT64_CLASS</a><a id="596c26" class="tk">:</a></td></tr>
<tr name="597" id="597">
<td><a id="l597" class='ln'>597</a></td><td> <a id="597c9" class="tk">matID</a> = <a id="597c17" class="tk">matUINT64</a>;</td></tr>
<tr name="598" id="598">
<td><a id="l598" class='ln'>598</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="599" id="599">
<td><a id="l599" class='ln'>599</a></td><td> <span class="kw">default</span><a id="599c14" class="tk">:</a></td></tr>
<tr name="600" id="600">
<td><a id="l600" class='ln'>600</a></td><td> <a id="600c9" class="tk">matID</a> = <a id="600c17" class="tk">matUNKNOWN</a>;</td></tr>
<tr name="601" id="601">
<td><a id="l601" class='ln'>601</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="602" id="602">
<td><a id="l602" class='ln'>602</a></td><td> <span class="br">}</span></td></tr>
<tr name="603" id="603">
<td><a id="l603" class='ln'>603</a></td><td> <span class="kw">return</span>(<a id="603c12" class="tk">matID</a>);</td></tr>
<tr name="604" id="604">
<td><a id="l604" class='ln'>604</a></td><td></td></tr>
<tr name="605" id="605">
<td><a id="l605" class='ln'>605</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetMatIdFromMxId */</span></td></tr>
<tr name="606" id="606">
<td><a id="l606" class='ln'>606</a></td><td></td></tr>
<tr name="607" id="607">
<td><a id="l607" class='ln'>607</a></td><td></td></tr>
<tr name="608" id="608">
<td><a id="l608" class='ln'>608</a></td><td><span class="ct">/* Forward declaration */</span></td></tr>
<tr name="609" id="609">
<td><a id="l609" class='ln'>609</a></td><td><span class="kw">static</span> <a id="609c8" class="tk">int_T</a> <a id="609c14" class="tk">rt_WriteItemToMatFile</a>(<a id="609c36" class="tk">FILE</a> <a id="609c49" class="tk">*</a><a id="609c50" class="tk">fp</a>,</td></tr>
<tr name="610" id="610">
<td><a id="l610" class='ln'>610</a></td><td> <a id="610c36" class="tk">MatItem</a> <a id="610c49" class="tk">*</a><a id="610c50" class="tk">pItem</a>,</td></tr>
<tr name="611" id="611">
<td><a id="l611" class='ln'>611</a></td><td> <a id="611c36" class="tk">ItemDataKind</a> <a id="611c49" class="tk">dataKind</a>);</td></tr>
<tr name="612" id="612">
<td><a id="l612" class='ln'>612</a></td><td></td></tr>
<tr name="613" id="613">
<td><a id="l613" class='ln'>613</a></td><td></td></tr>
<tr name="614" id="614">
<td><a id="l614" class='ln'>614</a></td><td><span class="ct">/* Function: rt_ProcessMatItem =================================================</span></td></tr>
<tr name="615" id="615">
<td><a id="l615" class='ln'>615</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="616" id="616">
<td><a id="l616" class='ln'>616</a></td><td><span class="ct"> * This routine along with rt_WriteItemToMatFile() write out a specified</span></td></tr>
<tr name="617" id="617">
<td><a id="l617" class='ln'>617</a></td><td><span class="ct"> * mat-item the .mat file. Note that if the input argument</span></td></tr>
<tr name="618" id="618">
<td><a id="l618" class='ln'>618</a></td><td><span class="ct"> * cmd == 0, then this function just calculates the size of the item.</span></td></tr>
<tr name="619" id="619">
<td><a id="l619" class='ln'>619</a></td><td><span class="ct"> * cmd &lt;&gt; 0, this function writes the mat-item to the file.</span></td></tr>
<tr name="620" id="620">
<td><a id="l620" class='ln'>620</a></td><td><span class="ct"> * Return values is</span></td></tr>
<tr name="621" id="621">
<td><a id="l621" class='ln'>621</a></td><td><span class="ct"> * -1 : coding/logic error</span></td></tr>
<tr name="622" id="622">
<td><a id="l622" class='ln'>622</a></td><td><span class="ct"> * 0 : upon success</span></td></tr>
<tr name="623" id="623">
<td><a id="l623" class='ln'>623</a></td><td><span class="ct"> * &gt; 0 : upon write failure (1)</span></td></tr>
<tr name="624" id="624">
<td><a id="l624" class='ln'>624</a></td><td><span class="ct"> */</span></td></tr>
<tr name="625" id="625">
<td><a id="l625" class='ln'>625</a></td><td><span class="kw">static</span> <a id="625c8" class="tk">int_T</a> <a id="625c14" class="tk">rt_ProcessMatItem</a>(<a id="625c32" class="tk">FILE</a> <a id="625c45" class="tk">*</a><a id="625c46" class="tk">fp</a>,</td></tr>
<tr name="626" id="626">
<td><a id="l626" class='ln'>626</a></td><td> <a id="626c32" class="tk">MatItem</a> <a id="626c45" class="tk">*</a><a id="626c46" class="tk">pItem</a>,</td></tr>
<tr name="627" id="627">
<td><a id="l627" class='ln'>627</a></td><td> <a id="627c32" class="tk">ItemDataKind</a> <a id="627c45" class="tk">itemKind</a>,</td></tr>
<tr name="628" id="628">
<td><a id="l628" class='ln'>628</a></td><td> <a id="628c32" class="tk">int_T</a> <a id="628c45" class="tk">cmd</a>)</td></tr>
<tr name="629" id="629">
<td><a id="l629" class='ln'>629</a></td><td><span class="br">{</span></td></tr>
<tr name="630" id="630">
<td><a id="l630" class='ln'>630</a></td><td> <a id="630c5" class="tk">mxClassID</a> <a id="630c18" class="tk">mxID</a> = <a id="630c34" class="tk">mxUNKNOWN_CLASS</a>;</td></tr>
<tr name="631" id="631">
<td><a id="l631" class='ln'>631</a></td><td> <a id="631c5" class="tk">uint32_T</a> <a id="631c18" class="tk">arrayFlags</a>[2] = <span class="br">{</span>0, 0<span class="br">}</span>;</td></tr>
<tr name="632" id="632">
<td><a id="l632" class='ln'>632</a></td><td> <a id="632c5" class="tk">int32_T</a> <a id="632c18" class="tk">*</a><a id="632c19" class="tk">dims</a> = <a id="632c34" class="tk">NULL</a>;</td></tr>
<tr name="633" id="633">
<td><a id="l633" class='ln'>633</a></td><td> <a id="633c5" class="tk">int32_T</a> <a id="633c18" class="tk">_dims</a>[3] = <span class="br">{</span>0, 0, 0<span class="br">}</span>;</td></tr>
<tr name="634" id="634">
<td><a id="l634" class='ln'>634</a></td><td> <a id="634c5" class="tk">int32_T</a> <a id="634c18" class="tk">nDims</a> = 2;</td></tr>
<tr name="635" id="635">
<td><a id="l635" class='ln'>635</a></td><td> <a id="635c5" class="tk">int32_T</a> <a id="635c18" class="tk">nBytesInItem</a> = 0;</td></tr>
<tr name="636" id="636">
<td><a id="l636" class='ln'>636</a></td><td> <span class="kw">const</span> <a id="636c11" class="tk">char_T</a> <a id="636c18" class="tk">*</a><a id="636c19" class="tk">itemName</a>;</td></tr>
<tr name="637" id="637">
<td><a id="l637" class='ln'>637</a></td><td> <a id="637c5" class="tk">MatItem</a> <a id="637c18" class="tk">item</a>;</td></tr>
<tr name="638" id="638">
<td><a id="l638" class='ln'>638</a></td><td> <a id="638c5" class="tk">int_T</a> <a id="638c18" class="tk">retStat</a> = 0;</td></tr>
<tr name="639" id="639">
<td><a id="l639" class='ln'>639</a></td><td></td></tr>
<tr name="640" id="640">
<td><a id="l640" class='ln'>640</a></td><td> <span class="kw">switch</span> (<a id="640c13" class="tk">itemKind</a>) <span class="br">{</span></td></tr>
<tr name="641" id="641">
<td><a id="l641" class='ln'>641</a></td><td> <span class="kw">case</span> <a id="641c12" class="tk">DATA_ITEM</a><a id="641c21" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="642" id="642">
<td><a id="l642" class='ln'>642</a></td><td> (<span class="kw">void</span>)<a id="642c17" class="tk">fprintf</a>(<a id="642c25" class="tk">stderr</a>,"Unexpected itemKind = DATA_ITEM in "</td></tr>
<tr name="643" id="643">
<td><a id="l643" class='ln'>643</a></td><td> "rt_ProcessMatItem @A\n");</td></tr>
<tr name="644" id="644">
<td><a id="l644" class='ln'>644</a></td><td> <a id="644c11" class="tk">retStat</a> = <a id="644c21" class="tk">-</a>1;</td></tr>
<tr name="645" id="645">
<td><a id="l645" class='ln'>645</a></td><td> <span class="kw">goto</span> <a id="645c16" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="646" id="646">
<td><a id="l646" class='ln'>646</a></td><td> <span class="br">}</span></td></tr>
<tr name="647" id="647">
<td><a id="l647" class='ln'>647</a></td><td> <span class="kw">case</span> <a id="647c12" class="tk">MATRIX_ITEM</a><a id="647c23" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="648" id="648">
<td><a id="l648" class='ln'>648</a></td><td> <span class="kw">const</span> <a id="648c17" class="tk">MatrixData</a> <a id="648c28" class="tk">*</a><a id="648c29" class="tk">var</a> = (<span class="kw">const</span> <a id="648c42" class="tk">MatrixData</a> <a id="648c53" class="tk">*</a>) <a id="648c56" class="tk">pItem</a>-&gt;<a id="648c63" class="tk">data</a>;</td></tr>
<tr name="649" id="649">
<td><a id="l649" class='ln'>649</a></td><td></td></tr>
<tr name="650" id="650">
<td><a id="l650" class='ln'>650</a></td><td> <a id="650c11" class="tk">mxID</a> = <a id="650c28" class="tk">var</a>-&gt;<a id="650c33" class="tk">mxID</a>;</td></tr>
<tr name="651" id="651">
<td><a id="l651" class='ln'>651</a></td><td> <a id="651c11" class="tk">arrayFlags</a>[0] = <a id="651c28" class="tk">mxID</a>;</td></tr>
<tr name="652" id="652">
<td><a id="l652" class='ln'>652</a></td><td> <a id="652c11" class="tk">arrayFlags</a>[0] <a id="652c25" class="tk">|=</a> <a id="652c28" class="tk">var</a>-&gt;<a id="652c33" class="tk">logical</a>;</td></tr>
<tr name="653" id="653">
<td><a id="l653" class='ln'>653</a></td><td> <a id="653c11" class="tk">arrayFlags</a>[0] <a id="653c25" class="tk">|=</a> <a id="653c28" class="tk">var</a>-&gt;<a id="653c33" class="tk">complex</a>;</td></tr>
<tr name="654" id="654">
<td><a id="l654" class='ln'>654</a></td><td> <span class="kw">if</span> (<a id="654c15" class="tk">var</a>-&gt;<a id="654c20" class="tk">nDims</a> <a id="654c26" class="tk">&lt;</a> 2) <span class="br">{</span></td></tr>
<tr name="655" id="655">
<td><a id="l655" class='ln'>655</a></td><td> <a id="655c15" class="tk">dims</a> = <a id="655c30" class="tk">_dims</a>;</td></tr>
<tr name="656" id="656">
<td><a id="l656" class='ln'>656</a></td><td> <a id="656c15" class="tk">dims</a>[0] = <a id="656c30" class="tk">var</a>-&gt;<a id="656c35" class="tk">nRows</a>;</td></tr>
<tr name="657" id="657">
<td><a id="l657" class='ln'>657</a></td><td> <a id="657c15" class="tk">dims</a>[1] = <a id="657c30" class="tk">var</a>-&gt;<a id="657c35" class="tk">nCols</a>;</td></tr>
<tr name="658" id="658">
<td><a id="l658" class='ln'>658</a></td><td> <a id="658c15" class="tk">nDims</a> = 2;</td></tr>
<tr name="659" id="659">
<td><a id="l659" class='ln'>659</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="660" id="660">
<td><a id="l660" class='ln'>660</a></td><td> <a id="660c15" class="tk">int32_T</a> <a id="660c23" class="tk">k</a>;</td></tr>
<tr name="661" id="661">
<td><a id="l661" class='ln'>661</a></td><td> <a id="661c15" class="tk">dims</a> = (<a id="661c23" class="tk">int32_T</a><a id="661c30" class="tk">*</a>)<a id="661c32" class="tk">malloc</a>(<span class="kw">sizeof</span>(<a id="661c46" class="tk">int32_T</a>)<a id="661c54" class="tk">*</a>(<a id="661c56" class="tk">var</a>-&gt;<a id="661c61" class="tk">nDims</a><a id="661c66" class="tk">+</a>1));</td></tr>
<tr name="662" id="662">
<td><a id="l662" class='ln'>662</a></td><td> <span class="kw">for</span> (<a id="662c20" class="tk">k</a> = 0; <a id="662c27" class="tk">k</a> <a id="662c29" class="tk">&lt;</a> <a id="662c31" class="tk">var</a>-&gt;<a id="662c36" class="tk">nDims</a>; <a id="662c43" class="tk">k</a><a id="662c44" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="663" id="663">
<td><a id="l663" class='ln'>663</a></td><td> <a id="663c19" class="tk">dims</a>[<a id="663c24" class="tk">k</a>] = <a id="663c29" class="tk">var</a>-&gt;<a id="663c34" class="tk">dims</a>[<a id="663c39" class="tk">k</a>];</td></tr>
<tr name="664" id="664">
<td><a id="l664" class='ln'>664</a></td><td> <span class="br">}</span></td></tr>
<tr name="665" id="665">
<td><a id="l665" class='ln'>665</a></td><td> <a id="665c15" class="tk">dims</a>[<a id="665c20" class="tk">var</a>-&gt;<a id="665c25" class="tk">nDims</a>] = <a id="665c34" class="tk">var</a>-&gt;<a id="665c39" class="tk">nRows</a>;</td></tr>
<tr name="666" id="666">
<td><a id="l666" class='ln'>666</a></td><td> <a id="666c15" class="tk">nDims</a> = <a id="666c23" class="tk">var</a>-&gt;<a id="666c28" class="tk">nDims</a> <a id="666c34" class="tk">+</a> 1;</td></tr>
<tr name="667" id="667">
<td><a id="l667" class='ln'>667</a></td><td> <span class="br">}</span></td></tr>
<tr name="668" id="668">
<td><a id="l668" class='ln'>668</a></td><td> <a id="668c11" class="tk">itemName</a> = <a id="668c22" class="tk">var</a>-&gt;<a id="668c27" class="tk">name</a>;</td></tr>
<tr name="669" id="669">
<td><a id="l669" class='ln'>669</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="670" id="670">
<td><a id="l670" class='ln'>670</a></td><td> <span class="br">}</span></td></tr>
<tr name="671" id="671">
<td><a id="l671" class='ln'>671</a></td><td> <span class="kw">case</span> <a id="671c12" class="tk">STRUCT_LOG_VAR_ITEM</a><a id="671c31" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="672" id="672">
<td><a id="l672" class='ln'>672</a></td><td> <span class="kw">const</span> <a id="672c17" class="tk">StructLogVar</a> <a id="672c30" class="tk">*</a><a id="672c31" class="tk">var</a> = (<span class="kw">const</span> <a id="672c44" class="tk">StructLogVar</a> <a id="672c57" class="tk">*</a>) <a id="672c60" class="tk">pItem</a>-&gt;<a id="672c67" class="tk">data</a>;</td></tr>
<tr name="673" id="673">
<td><a id="l673" class='ln'>673</a></td><td></td></tr>
<tr name="674" id="674">
<td><a id="l674" class='ln'>674</a></td><td> <a id="674c11" class="tk">mxID</a> = <a id="674c27" class="tk">mxSTRUCT_CLASS</a>;</td></tr>
<tr name="675" id="675">
<td><a id="l675" class='ln'>675</a></td><td> <a id="675c11" class="tk">arrayFlags</a>[0] = <a id="675c27" class="tk">mxID</a>;</td></tr>
<tr name="676" id="676">
<td><a id="l676" class='ln'>676</a></td><td> <a id="676c11" class="tk">dims</a> = <a id="676c27" class="tk">_dims</a>;</td></tr>
<tr name="677" id="677">
<td><a id="l677" class='ln'>677</a></td><td> <a id="677c11" class="tk">dims</a>[0] = 1;</td></tr>
<tr name="678" id="678">
<td><a id="l678" class='ln'>678</a></td><td> <a id="678c11" class="tk">dims</a>[1] = 1;</td></tr>
<tr name="679" id="679">
<td><a id="l679" class='ln'>679</a></td><td> <a id="679c11" class="tk">itemName</a> = <a id="679c27" class="tk">var</a>-&gt;<a id="679c32" class="tk">name</a>;</td></tr>
<tr name="680" id="680">
<td><a id="l680" class='ln'>680</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="681" id="681">
<td><a id="l681" class='ln'>681</a></td><td> <span class="br">}</span></td></tr>
<tr name="682" id="682">
<td><a id="l682" class='ln'>682</a></td><td> <span class="kw">case</span> <a id="682c12" class="tk">SIGNALS_STRUCT_ITEM</a><a id="682c31" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="683" id="683">
<td><a id="l683" class='ln'>683</a></td><td> <span class="kw">const</span> <a id="683c17" class="tk">SignalsStruct</a> <a id="683c31" class="tk">*</a><a id="683c32" class="tk">var</a> = (<span class="kw">const</span> <a id="683c45" class="tk">SignalsStruct</a> <a id="683c59" class="tk">*</a>) <a id="683c62" class="tk">pItem</a>-&gt;<a id="683c69" class="tk">data</a>;</td></tr>
<tr name="684" id="684">
<td><a id="l684" class='ln'>684</a></td><td></td></tr>
<tr name="685" id="685">
<td><a id="l685" class='ln'>685</a></td><td> <a id="685c11" class="tk">mxID</a> = <a id="685c27" class="tk">mxSTRUCT_CLASS</a>;</td></tr>
<tr name="686" id="686">
<td><a id="l686" class='ln'>686</a></td><td> <a id="686c11" class="tk">arrayFlags</a>[0] = <a id="686c27" class="tk">mxID</a>;</td></tr>
<tr name="687" id="687">
<td><a id="l687" class='ln'>687</a></td><td> <a id="687c11" class="tk">dims</a> = <a id="687c27" class="tk">_dims</a>;</td></tr>
<tr name="688" id="688">
<td><a id="l688" class='ln'>688</a></td><td> <a id="688c11" class="tk">dims</a>[0] = 1;</td></tr>
<tr name="689" id="689">
<td><a id="l689" class='ln'>689</a></td><td> <a id="689c11" class="tk">dims</a>[1] = <a id="689c27" class="tk">var</a>-&gt;<a id="689c32" class="tk">numSignals</a>;</td></tr>
<tr name="690" id="690">
<td><a id="l690" class='ln'>690</a></td><td> <a id="690c11" class="tk">itemName</a> = <a id="690c27" class="tk">&amp;</a><a id="690c28" class="tk">SIGNALS_FIELD_NAME</a>;</td></tr>
<tr name="691" id="691">
<td><a id="l691" class='ln'>691</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="692" id="692">
<td><a id="l692" class='ln'>692</a></td><td> <span class="br">}</span></td></tr>
<tr name="693" id="693">
<td><a id="l693" class='ln'>693</a></td><td> <span class="kw">default</span><a id="693c14" class="tk">:</a></td></tr>
<tr name="694" id="694">
<td><a id="l694" class='ln'>694</a></td><td> (<span class="kw">void</span>)<a id="694c15" class="tk">fprintf</a>(<a id="694c23" class="tk">stderr</a>,"Unexpected itemKind=%d in rt_ProcessMatItem @B\n",</td></tr>
<tr name="695" id="695">
<td><a id="l695" class='ln'>695</a></td><td> <a id="695c23" class="tk">itemKind</a>);</td></tr>
<tr name="696" id="696">
<td><a id="l696" class='ln'>696</a></td><td> <a id="696c9" class="tk">retStat</a> = <a id="696c19" class="tk">-</a>1;</td></tr>
<tr name="697" id="697">
<td><a id="l697" class='ln'>697</a></td><td> <span class="kw">goto</span> <a id="697c14" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="698" id="698">
<td><a id="l698" class='ln'>698</a></td><td> <span class="br">}</span></td></tr>
<tr name="699" id="699">
<td><a id="l699" class='ln'>699</a></td><td></td></tr>
<tr name="700" id="700">
<td><a id="l700" class='ln'>700</a></td><td> <span class="ct">/* array flags */</span></td></tr>
<tr name="701" id="701">
<td><a id="l701" class='ln'>701</a></td><td> <a id="701c5" class="tk">item</a>.<a id="701c10" class="tk">nbytes</a> = 2<a id="701c20" class="tk">*</a><span class="kw">sizeof</span>(<a id="701c28" class="tk">uint32_T</a>);</td></tr>
<tr name="702" id="702">
<td><a id="l702" class='ln'>702</a></td><td> <span class="kw">if</span> (<a id="702c9" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="703" id="703">
<td><a id="l703" class='ln'>703</a></td><td> <a id="703c9" class="tk">item</a>.<a id="703c14" class="tk">type</a> = <a id="703c21" class="tk">matUINT32</a>;</td></tr>
<tr name="704" id="704">
<td><a id="l704" class='ln'>704</a></td><td> <a id="704c9" class="tk">item</a>.<a id="704c14" class="tk">data</a> = <a id="704c21" class="tk">arrayFlags</a>;</td></tr>
<tr name="705" id="705">
<td><a id="l705" class='ln'>705</a></td><td> <span class="kw">if</span> (<a id="705c13" class="tk">rt_WriteItemToMatFile</a>(<a id="705c35" class="tk">fp</a>,<a id="705c38" class="tk">&amp;</a><a id="705c39" class="tk">item</a>, <a id="705c45" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="706" id="706">
<td><a id="l706" class='ln'>706</a></td><td> <a id="706c13" class="tk">retStat</a> = 1;</td></tr>
<tr name="707" id="707">
<td><a id="l707" class='ln'>707</a></td><td> <span class="kw">goto</span> <a id="707c18" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="708" id="708">
<td><a id="l708" class='ln'>708</a></td><td> <span class="br">}</span></td></tr>
<tr name="709" id="709">
<td><a id="l709" class='ln'>709</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="710" id="710">
<td><a id="l710" class='ln'>710</a></td><td> <span class="ct">/*LINTED E_CAST_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="711" id="711">
<td><a id="l711" class='ln'>711</a></td><td> <a id="711c9" class="tk">nBytesInItem</a> <a id="711c22" class="tk">+=</a> <a id="711c25" class="tk">matINT64_ALIGN</a>(<a id="711c40" class="tk">matTAG_SIZE</a> <a id="711c52" class="tk">+</a> <a id="711c54" class="tk">item</a>.<a id="711c59" class="tk">nbytes</a>);</td></tr>
<tr name="712" id="712">
<td><a id="l712" class='ln'>712</a></td><td> <span class="br">}</span></td></tr>
<tr name="713" id="713">
<td><a id="l713" class='ln'>713</a></td><td> <span class="ct">/* dimensions */</span></td></tr>
<tr name="714" id="714">
<td><a id="l714" class='ln'>714</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="715" id="715">
<td><a id="l715" class='ln'>715</a></td><td> <a id="715c5" class="tk">item</a>.<a id="715c10" class="tk">nbytes</a> = <a id="715c19" class="tk">nDims</a><a id="715c24" class="tk">*</a><span class="kw">sizeof</span>(<a id="715c32" class="tk">int32_T</a>);</td></tr>
<tr name="716" id="716">
<td><a id="l716" class='ln'>716</a></td><td> <span class="kw">if</span> (<a id="716c9" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="717" id="717">
<td><a id="l717" class='ln'>717</a></td><td> <a id="717c9" class="tk">item</a>.<a id="717c14" class="tk">type</a> = <a id="717c21" class="tk">matINT32</a>;</td></tr>
<tr name="718" id="718">
<td><a id="l718" class='ln'>718</a></td><td> <a id="718c9" class="tk">item</a>.<a id="718c14" class="tk">data</a> = <a id="718c21" class="tk">dims</a>;</td></tr>
<tr name="719" id="719">
<td><a id="l719" class='ln'>719</a></td><td> <span class="kw">if</span> (<a id="719c13" class="tk">rt_WriteItemToMatFile</a>(<a id="719c35" class="tk">fp</a>,<a id="719c38" class="tk">&amp;</a><a id="719c39" class="tk">item</a>, <a id="719c45" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="720" id="720">
<td><a id="l720" class='ln'>720</a></td><td> <a id="720c13" class="tk">retStat</a> = 1;</td></tr>
<tr name="721" id="721">
<td><a id="l721" class='ln'>721</a></td><td> <span class="kw">goto</span> <a id="721c18" class="tk">EXIT_POINT</a>; </td></tr>
<tr name="722" id="722">
<td><a id="l722" class='ln'>722</a></td><td> <span class="br">}</span></td></tr>
<tr name="723" id="723">
<td><a id="l723" class='ln'>723</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="724" id="724">
<td><a id="l724" class='ln'>724</a></td><td> <span class="ct">/*LINTED E_CAST_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="725" id="725">
<td><a id="l725" class='ln'>725</a></td><td> <a id="725c9" class="tk">nBytesInItem</a> <a id="725c22" class="tk">+=</a> <a id="725c25" class="tk">matINT64_ALIGN</a>(<a id="725c40" class="tk">matTAG_SIZE</a> <a id="725c52" class="tk">+</a> <a id="725c54" class="tk">item</a>.<a id="725c59" class="tk">nbytes</a>);</td></tr>
<tr name="726" id="726">
<td><a id="l726" class='ln'>726</a></td><td> <span class="br">}</span></td></tr>
<tr name="727" id="727">
<td><a id="l727" class='ln'>727</a></td><td> <span class="ct">/* name */</span></td></tr>
<tr name="728" id="728">
<td><a id="l728" class='ln'>728</a></td><td> <a id="728c5" class="tk">item</a>.<a id="728c10" class="tk">nbytes</a> = (<a id="728c20" class="tk">int32_T</a>)<a id="728c28" class="tk">strlen</a>(<a id="728c35" class="tk">itemName</a>);</td></tr>
<tr name="729" id="729">
<td><a id="l729" class='ln'>729</a></td><td> <span class="kw">if</span> (<a id="729c9" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="730" id="730">
<td><a id="l730" class='ln'>730</a></td><td> <a id="730c9" class="tk">item</a>.<a id="730c14" class="tk">type</a> = <a id="730c21" class="tk">matINT8</a>;</td></tr>
<tr name="731" id="731">
<td><a id="l731" class='ln'>731</a></td><td> <a id="731c9" class="tk">item</a>.<a id="731c14" class="tk">data</a> = (<span class="kw">const</span> <a id="731c28" class="tk">char_T</a><a id="731c34" class="tk">*</a>) <a id="731c37" class="tk">itemName</a>;</td></tr>
<tr name="732" id="732">
<td><a id="l732" class='ln'>732</a></td><td> <span class="kw">if</span> (<a id="732c13" class="tk">rt_WriteItemToMatFile</a>(<a id="732c35" class="tk">fp</a>,<a id="732c38" class="tk">&amp;</a><a id="732c39" class="tk">item</a>, <a id="732c45" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="733" id="733">
<td><a id="l733" class='ln'>733</a></td><td> <a id="733c13" class="tk">retStat</a> = 1;</td></tr>
<tr name="734" id="734">
<td><a id="l734" class='ln'>734</a></td><td> <span class="kw">goto</span> <a id="734c18" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="735" id="735">
<td><a id="l735" class='ln'>735</a></td><td> <span class="br">}</span></td></tr>
<tr name="736" id="736">
<td><a id="l736" class='ln'>736</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="737" id="737">
<td><a id="l737" class='ln'>737</a></td><td> <a id="737c9" class="tk">nBytesInItem</a> <a id="737c22" class="tk">+=</a> (<a id="737c26" class="tk">item</a>.<a id="737c31" class="tk">nbytes</a> <a id="737c38" class="tk">&lt;=</a> 4) <a id="737c44" class="tk">?</a> <span class="ct">/*LINTED E_CAST_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="738" id="738">
<td><a id="l738" class='ln'>738</a></td><td> <a id="738c25" class="tk">matTAG_SIZE</a> <a id="738c37" class="tk">:</a> <a id="738c39" class="tk">matINT64_ALIGN</a>(<a id="738c54" class="tk">matTAG_SIZE</a> <a id="738c66" class="tk">+</a> <a id="738c68" class="tk">item</a>.<a id="738c73" class="tk">nbytes</a>);</td></tr>
<tr name="739" id="739">
<td><a id="l739" class='ln'>739</a></td><td> <span class="br">}</span></td></tr>
<tr name="740" id="740">
<td><a id="l740" class='ln'>740</a></td><td></td></tr>
<tr name="741" id="741">
<td><a id="l741" class='ln'>741</a></td><td> <span class="kw">if</span> (<a id="741c9" class="tk">itemKind</a> <a id="741c18" class="tk">==</a> <a id="741c21" class="tk">MATRIX_ITEM</a>) <span class="br">{</span></td></tr>
<tr name="742" id="742">
<td><a id="l742" class='ln'>742</a></td><td> <span class="kw">const</span> <a id="742c15" class="tk">MatrixData</a> <a id="742c26" class="tk">*</a><a id="742c27" class="tk">var</a> = (<span class="kw">const</span> <a id="742c42" class="tk">MatrixData</a><a id="742c52" class="tk">*</a>) <a id="742c55" class="tk">pItem</a>-&gt;<a id="742c62" class="tk">data</a>;</td></tr>
<tr name="743" id="743">
<td><a id="l743" class='ln'>743</a></td><td> <a id="743c9" class="tk">int_T</a> <a id="743c26" class="tk">matID</a> = <a id="743c35" class="tk">rt_GetMatIdFromMxId</a>(<a id="743c55" class="tk">mxID</a>);</td></tr>
<tr name="744" id="744">
<td><a id="l744" class='ln'>744</a></td><td> <a id="744c9" class="tk">size_t</a> <a id="744c26" class="tk">elSize</a> = <a id="744c35" class="tk">var</a>-&gt;<a id="744c40" class="tk">elSize</a>;</td></tr>
<tr name="745" id="745">
<td><a id="l745" class='ln'>745</a></td><td></td></tr>
<tr name="746" id="746">
<td><a id="l746" class='ln'>746</a></td><td> <span class="ct">/* data */</span></td></tr>
<tr name="747" id="747">
<td><a id="l747" class='ln'>747</a></td><td> <a id="747c9" class="tk">item</a>.<a id="747c14" class="tk">nbytes</a> = (<a id="747c24" class="tk">int32_T</a>)(<a id="747c33" class="tk">var</a>-&gt;<a id="747c38" class="tk">nRows</a> <a id="747c44" class="tk">*</a> <a id="747c46" class="tk">var</a>-&gt;<a id="747c51" class="tk">nCols</a> <a id="747c57" class="tk">*</a> <a id="747c59" class="tk">elSize</a>);</td></tr>
<tr name="748" id="748">
<td><a id="l748" class='ln'>748</a></td><td> <span class="kw">if</span> (<a id="748c13" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="749" id="749">
<td><a id="l749" class='ln'>749</a></td><td> <a id="749c13" class="tk">item</a>.<a id="749c18" class="tk">type</a> = <a id="749c25" class="tk">matID</a>;</td></tr>
<tr name="750" id="750">
<td><a id="l750" class='ln'>750</a></td><td> <a id="750c13" class="tk">item</a>.<a id="750c18" class="tk">data</a> = <a id="750c25" class="tk">var</a>-&gt;<a id="750c30" class="tk">re</a>;</td></tr>
<tr name="751" id="751">
<td><a id="l751" class='ln'>751</a></td><td> <span class="kw">if</span> (<a id="751c17" class="tk">rt_WriteItemToMatFile</a>(<a id="751c39" class="tk">fp</a>, <a id="751c43" class="tk">&amp;</a><a id="751c44" class="tk">item</a>, <a id="751c50" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="752" id="752">
<td><a id="l752" class='ln'>752</a></td><td> <a id="752c17" class="tk">retStat</a> = 1;</td></tr>
<tr name="753" id="753">
<td><a id="l753" class='ln'>753</a></td><td> <span class="kw">goto</span> <a id="753c22" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="754" id="754">
<td><a id="l754" class='ln'>754</a></td><td> <span class="br">}</span></td></tr>
<tr name="755" id="755">
<td><a id="l755" class='ln'>755</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="756" id="756">
<td><a id="l756" class='ln'>756</a></td><td> <a id="756c13" class="tk">nBytesInItem</a> <a id="756c26" class="tk">+=</a> (<a id="756c30" class="tk">item</a>.<a id="756c35" class="tk">nbytes</a> <a id="756c42" class="tk">&lt;=</a> 4) <a id="756c48" class="tk">?</a> <span class="ct">/*LINTED*/</span></td></tr>
<tr name="757" id="757">
<td><a id="l757" class='ln'>757</a></td><td> <a id="757c25" class="tk">matTAG_SIZE</a> <a id="757c37" class="tk">:</a> <a id="757c39" class="tk">matINT64_ALIGN</a>(<a id="757c54" class="tk">matTAG_SIZE</a> <a id="757c66" class="tk">+</a> <a id="757c68" class="tk">item</a>.<a id="757c73" class="tk">nbytes</a>);</td></tr>
<tr name="758" id="758">
<td><a id="l758" class='ln'>758</a></td><td> <span class="br">}</span></td></tr>
<tr name="759" id="759">
<td><a id="l759" class='ln'>759</a></td><td> <span class="ct">/* imaginary part */</span></td></tr>
<tr name="760" id="760">
<td><a id="l760" class='ln'>760</a></td><td> <span class="kw">if</span> (<a id="760c13" class="tk">var</a>-&gt;<a id="760c18" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="761" id="761">
<td><a id="l761" class='ln'>761</a></td><td> <a id="761c13" class="tk">item</a>.<a id="761c18" class="tk">nbytes</a> = (<a id="761c28" class="tk">int32_T</a>)(<a id="761c37" class="tk">var</a>-&gt;<a id="761c42" class="tk">nRows</a> <a id="761c48" class="tk">*</a> <a id="761c50" class="tk">var</a>-&gt;<a id="761c55" class="tk">nCols</a> <a id="761c61" class="tk">*</a> <a id="761c63" class="tk">elSize</a>);</td></tr>
<tr name="762" id="762">
<td><a id="l762" class='ln'>762</a></td><td> <span class="kw">if</span> (<a id="762c17" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="763" id="763">
<td><a id="l763" class='ln'>763</a></td><td> <a id="763c17" class="tk">item</a>.<a id="763c22" class="tk">type</a> = <a id="763c29" class="tk">matID</a>;</td></tr>
<tr name="764" id="764">
<td><a id="l764" class='ln'>764</a></td><td> <a id="764c17" class="tk">item</a>.<a id="764c22" class="tk">data</a> = <a id="764c29" class="tk">var</a>-&gt;<a id="764c34" class="tk">im</a>;</td></tr>
<tr name="765" id="765">
<td><a id="l765" class='ln'>765</a></td><td> <span class="kw">if</span> (<a id="765c21" class="tk">rt_WriteItemToMatFile</a>(<a id="765c43" class="tk">fp</a>, <a id="765c47" class="tk">&amp;</a><a id="765c48" class="tk">item</a>, <a id="765c54" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="766" id="766">
<td><a id="l766" class='ln'>766</a></td><td> <a id="766c21" class="tk">retStat</a> = 1;</td></tr>
<tr name="767" id="767">
<td><a id="l767" class='ln'>767</a></td><td> <span class="kw">goto</span> <a id="767c26" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="768" id="768">
<td><a id="l768" class='ln'>768</a></td><td> <span class="br">}</span></td></tr>
<tr name="769" id="769">
<td><a id="l769" class='ln'>769</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="770" id="770">
<td><a id="l770" class='ln'>770</a></td><td> <a id="770c17" class="tk">nBytesInItem</a> <a id="770c30" class="tk">+=</a> (<a id="770c34" class="tk">item</a>.<a id="770c39" class="tk">nbytes</a> <a id="770c46" class="tk">&lt;=</a> 4) <a id="770c52" class="tk">?</a> <span class="ct">/*LINTED*/</span></td></tr>
<tr name="771" id="771">
<td><a id="l771" class='ln'>771</a></td><td> <a id="771c25" class="tk">matTAG_SIZE</a> <a id="771c37" class="tk">:</a> <a id="771c39" class="tk">matINT64_ALIGN</a>(<a id="771c54" class="tk">matTAG_SIZE</a> <a id="771c66" class="tk">+</a> <a id="771c68" class="tk">item</a>.<a id="771c73" class="tk">nbytes</a>);</td></tr>
<tr name="772" id="772">
<td><a id="l772" class='ln'>772</a></td><td> <span class="br">}</span></td></tr>
<tr name="773" id="773">
<td><a id="l773" class='ln'>773</a></td><td> <span class="br">}</span></td></tr>
<tr name="774" id="774">
<td><a id="l774" class='ln'>774</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* some type of structure item */</span></td></tr>
<tr name="775" id="775">
<td><a id="l775" class='ln'>775</a></td><td> <span class="kw">const</span> <a id="775c15" class="tk">char_T</a> <a id="775c22" class="tk">*</a><a id="775c23" class="tk">fieldNames</a>;</td></tr>
<tr name="776" id="776">
<td><a id="l776" class='ln'>776</a></td><td> <a id="776c9" class="tk">int_T</a> <a id="776c22" class="tk">sizeofFieldNames</a>;</td></tr>
<tr name="777" id="777">
<td><a id="l777" class='ln'>777</a></td><td></td></tr>
<tr name="778" id="778">
<td><a id="l778" class='ln'>778</a></td><td> <span class="ct">/* field names */</span></td></tr>
<tr name="779" id="779">
<td><a id="l779" class='ln'>779</a></td><td> <span class="kw">switch</span> (<a id="779c17" class="tk">itemKind</a>) <span class="br">{</span></td></tr>
<tr name="780" id="780">
<td><a id="l780" class='ln'>780</a></td><td> <span class="kw">case</span> <a id="780c16" class="tk">STRUCT_LOG_VAR_ITEM</a><a id="780c35" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="781" id="781">
<td><a id="l781" class='ln'>781</a></td><td> <span class="kw">const</span> <a id="781c21" class="tk">StructLogVar</a> <a id="781c34" class="tk">*</a><a id="781c35" class="tk">var</a> = (<span class="kw">const</span> <a id="781c48" class="tk">StructLogVar</a> <a id="781c61" class="tk">*</a>) <a id="781c64" class="tk">pItem</a>-&gt;<a id="781c71" class="tk">data</a>;</td></tr>
<tr name="782" id="782">
<td><a id="l782" class='ln'>782</a></td><td> <a id="782c15" class="tk">fieldNames</a> = <a id="782c35" class="tk">rtStructLogVarFieldNames</a>;</td></tr>
<tr name="783" id="783">
<td><a id="l783" class='ln'>783</a></td><td> <a id="783c15" class="tk">sizeofFieldNames</a> = <a id="783c35" class="tk">var</a>-&gt;<a id="783c40" class="tk">numActiveFields</a> <a id="783c56" class="tk">*</a> <a id="783c58" class="tk">mxMAXNAM</a>;</td></tr>
<tr name="784" id="784">
<td><a id="l784" class='ln'>784</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="785" id="785">
<td><a id="l785" class='ln'>785</a></td><td> <span class="br">}</span></td></tr>
<tr name="786" id="786">
<td><a id="l786" class='ln'>786</a></td><td> <span class="kw">case</span> <a id="786c16" class="tk">SIGNALS_STRUCT_ITEM</a><a id="786c35" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="787" id="787">
<td><a id="l787" class='ln'>787</a></td><td> <span class="kw">const</span> <a id="787c21" class="tk">SignalsStruct</a> <a id="787c35" class="tk">*</a><a id="787c36" class="tk">var</a> = (<span class="kw">const</span> <a id="787c49" class="tk">SignalsStruct</a> <a id="787c63" class="tk">*</a>) <a id="787c66" class="tk">pItem</a>-&gt;<a id="787c73" class="tk">data</a>;</td></tr>
<tr name="788" id="788">
<td><a id="l788" class='ln'>788</a></td><td> <a id="788c15" class="tk">fieldNames</a> = <a id="788c35" class="tk">var</a>-&gt;<a id="788c40" class="tk">fieldNames</a>;</td></tr>
<tr name="789" id="789">
<td><a id="l789" class='ln'>789</a></td><td> <a id="789c15" class="tk">sizeofFieldNames</a> = <a id="789c35" class="tk">var</a>-&gt;<a id="789c40" class="tk">numActiveFields</a> <a id="789c56" class="tk">*</a> <a id="789c58" class="tk">mxMAXNAM</a>;</td></tr>
<tr name="790" id="790">
<td><a id="l790" class='ln'>790</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="791" id="791">
<td><a id="l791" class='ln'>791</a></td><td> <span class="br">}</span></td></tr>
<tr name="792" id="792">
<td><a id="l792" class='ln'>792</a></td><td> <span class="kw">default</span><a id="792c18" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="793" id="793">
<td><a id="l793" class='ln'>793</a></td><td><span class="ct"> "Needed to handle an unknown itemKind" */</span></td></tr>
<tr name="794" id="794">
<td><a id="l794" class='ln'>794</a></td><td> (<span class="kw">void</span>)<a id="794c19" class="tk">fprintf</a>(<a id="794c27" class="tk">stderr</a>, "Unexpected itemKind=%d in "</td></tr>
<tr name="795" id="795">
<td><a id="l795" class='ln'>795</a></td><td> "rt_ProcessMatItem @C\n", <a id="795c53" class="tk">itemKind</a>);</td></tr>
<tr name="796" id="796">
<td><a id="l796" class='ln'>796</a></td><td> <a id="796c13" class="tk">retStat</a> = <a id="796c23" class="tk">-</a>1;</td></tr>
<tr name="797" id="797">
<td><a id="l797" class='ln'>797</a></td><td> <span class="kw">goto</span> <a id="797c18" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="798" id="798">
<td><a id="l798" class='ln'>798</a></td><td> <span class="br">}</span></td></tr>
<tr name="799" id="799">
<td><a id="l799" class='ln'>799</a></td><td></td></tr>
<tr name="800" id="800">
<td><a id="l800" class='ln'>800</a></td><td> <span class="ct">/* write field names */</span></td></tr>
<tr name="801" id="801">
<td><a id="l801" class='ln'>801</a></td><td> <span class="kw">if</span> (<a id="801c13" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="802" id="802">
<td><a id="l802" class='ln'>802</a></td><td> <a id="802c13" class="tk">int32_T</a> <a id="802c21" class="tk">tmpInt</a> = <a id="802c30" class="tk">mxMAXNAM</a>;</td></tr>
<tr name="803" id="803">
<td><a id="l803" class='ln'>803</a></td><td></td></tr>
<tr name="804" id="804">
<td><a id="l804" class='ln'>804</a></td><td> <a id="804c13" class="tk">item</a>.<a id="804c18" class="tk">nbytes</a> = <span class="kw">sizeof</span>(<a id="804c34" class="tk">int32_T</a>);</td></tr>
<tr name="805" id="805">
<td><a id="l805" class='ln'>805</a></td><td> <a id="805c13" class="tk">item</a>.<a id="805c18" class="tk">type</a> = <a id="805c27" class="tk">matINT32</a>;</td></tr>
<tr name="806" id="806">
<td><a id="l806" class='ln'>806</a></td><td> <a id="806c13" class="tk">item</a>.<a id="806c18" class="tk">data</a> = <a id="806c27" class="tk">&amp;</a><a id="806c28" class="tk">tmpInt</a>;</td></tr>
<tr name="807" id="807">
<td><a id="l807" class='ln'>807</a></td><td> <span class="kw">if</span> (<a id="807c17" class="tk">rt_WriteItemToMatFile</a>(<a id="807c39" class="tk">fp</a>,<a id="807c42" class="tk">&amp;</a><a id="807c43" class="tk">item</a>, <a id="807c49" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="808" id="808">
<td><a id="l808" class='ln'>808</a></td><td> <a id="808c17" class="tk">retStat</a> = 1;</td></tr>
<tr name="809" id="809">
<td><a id="l809" class='ln'>809</a></td><td> <span class="kw">goto</span> <a id="809c22" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="810" id="810">
<td><a id="l810" class='ln'>810</a></td><td> <span class="br">}</span></td></tr>
<tr name="811" id="811">
<td><a id="l811" class='ln'>811</a></td><td></td></tr>
<tr name="812" id="812">
<td><a id="l812" class='ln'>812</a></td><td> <a id="812c13" class="tk">item</a>.<a id="812c18" class="tk">nbytes</a> = <a id="812c27" class="tk">sizeofFieldNames</a>;</td></tr>
<tr name="813" id="813">
<td><a id="l813" class='ln'>813</a></td><td> <a id="813c13" class="tk">item</a>.<a id="813c18" class="tk">type</a> = <a id="813c27" class="tk">matINT8</a>;</td></tr>
<tr name="814" id="814">
<td><a id="l814" class='ln'>814</a></td><td> <a id="814c13" class="tk">item</a>.<a id="814c18" class="tk">data</a> = (<span class="kw">const</span> <a id="814c34" class="tk">char_T</a><a id="814c40" class="tk">*</a>) <a id="814c43" class="tk">fieldNames</a>;</td></tr>
<tr name="815" id="815">
<td><a id="l815" class='ln'>815</a></td><td> <span class="kw">if</span> (<a id="815c17" class="tk">rt_WriteItemToMatFile</a>(<a id="815c39" class="tk">fp</a>,<a id="815c42" class="tk">&amp;</a><a id="815c43" class="tk">item</a>, <a id="815c49" class="tk">DATA_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="816" id="816">
<td><a id="l816" class='ln'>816</a></td><td> <a id="816c17" class="tk">retStat</a> = 1;</td></tr>
<tr name="817" id="817">
<td><a id="l817" class='ln'>817</a></td><td> <span class="kw">goto</span> <a id="817c22" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="818" id="818">
<td><a id="l818" class='ln'>818</a></td><td> <span class="br">}</span></td></tr>
<tr name="819" id="819">
<td><a id="l819" class='ln'>819</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="820" id="820">
<td><a id="l820" class='ln'>820</a></td><td> <span class="ct">/*LINTED E_CAST_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="821" id="821">
<td><a id="l821" class='ln'>821</a></td><td> <a id="821c13" class="tk">nBytesInItem</a> <a id="821c26" class="tk">+=</a> <a id="821c29" class="tk">matINT64_ALIGN</a>( <a id="821c45" class="tk">matTAG_SIZE</a> <a id="821c57" class="tk">+</a> <a id="821c59" class="tk">matTAG_SIZE</a> <a id="821c71" class="tk">+</a></td></tr>
<tr name="822" id="822">
<td><a id="l822" class='ln'>822</a></td><td> <a id="822c45" class="tk">sizeofFieldNames</a> );</td></tr>
<tr name="823" id="823">
<td><a id="l823" class='ln'>823</a></td><td> <span class="br">}</span></td></tr>
<tr name="824" id="824">
<td><a id="l824" class='ln'>824</a></td><td></td></tr>
<tr name="825" id="825">
<td><a id="l825" class='ln'>825</a></td><td> <span class="ct">/* process each field of the structure */</span></td></tr>
<tr name="826" id="826">
<td><a id="l826" class='ln'>826</a></td><td> <span class="kw">switch</span> (<a id="826c17" class="tk">itemKind</a>) <span class="br">{</span></td></tr>
<tr name="827" id="827">
<td><a id="l827" class='ln'>827</a></td><td> <span class="kw">case</span> <a id="827c16" class="tk">STRUCT_LOG_VAR_ITEM</a><a id="827c35" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="828" id="828">
<td><a id="l828" class='ln'>828</a></td><td> <span class="kw">const</span> <a id="828c21" class="tk">StructLogVar</a> <a id="828c34" class="tk">*</a><a id="828c35" class="tk">var</a> = <a id="828c41" class="tk">pItem</a>-&gt;<a id="828c48" class="tk">data</a>;</td></tr>
<tr name="829" id="829">
<td><a id="l829" class='ln'>829</a></td><td></td></tr>
<tr name="830" id="830">
<td><a id="l830" class='ln'>830</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="831" id="831">
<td><a id="l831" class='ln'>831</a></td><td> <span class="br">{</span></td></tr>
<tr name="832" id="832">
<td><a id="l832" class='ln'>832</a></td><td> <span class="kw">const</span> <span class="kw">void</span> <a id="832c30" class="tk">*</a><a id="832c31" class="tk">data</a> = <a id="832c38" class="tk">var</a>-&gt;<a id="832c43" class="tk">time</a>;</td></tr>
<tr name="833" id="833">
<td><a id="l833" class='ln'>833</a></td><td></td></tr>
<tr name="834" id="834">
<td><a id="l834" class='ln'>834</a></td><td> <span class="kw">if</span> (<a id="834c23" class="tk">var</a>-&gt;<a id="834c28" class="tk">logTime</a>) <span class="br">{</span> <span class="ct">/* time is a LogVar, get the MatrixData */</span></td></tr>
<tr name="835" id="835">
<td><a id="l835" class='ln'>835</a></td><td> <a id="835c23" class="tk">data</a> = <a id="835c30" class="tk">&amp;</a>(((<span class="kw">const</span> <a id="835c40" class="tk">LogVar</a><a id="835c46" class="tk">*</a>) (<a id="835c50" class="tk">var</a>-&gt;<a id="835c55" class="tk">time</a>))-&gt;<a id="835c63" class="tk">data</a>);</td></tr>
<tr name="836" id="836">
<td><a id="l836" class='ln'>836</a></td><td> <span class="br">}</span></td></tr>
<tr name="837" id="837">
<td><a id="l837" class='ln'>837</a></td><td></td></tr>
<tr name="838" id="838">
<td><a id="l838" class='ln'>838</a></td><td> <a id="838c19" class="tk">item</a>.<a id="838c24" class="tk">type</a> = <a id="838c31" class="tk">matMATRIX</a>;</td></tr>
<tr name="839" id="839">
<td><a id="l839" class='ln'>839</a></td><td> <a id="839c19" class="tk">item</a>.<a id="839c24" class="tk">data</a> = <a id="839c31" class="tk">data</a>;</td></tr>
<tr name="840" id="840">
<td><a id="l840" class='ln'>840</a></td><td> <span class="kw">if</span> (<a id="840c23" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="841" id="841">
<td><a id="l841" class='ln'>841</a></td><td> <span class="kw">if</span> (<a id="841c27" class="tk">rt_WriteItemToMatFile</a>(<a id="841c49" class="tk">fp</a>,<a id="841c52" class="tk">&amp;</a><a id="841c53" class="tk">item</a>,<a id="841c58" class="tk">MATRIX_ITEM</a>))<span class="br">{</span></td></tr>
<tr name="842" id="842">
<td><a id="l842" class='ln'>842</a></td><td> <a id="842c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="843" id="843">
<td><a id="l843" class='ln'>843</a></td><td> <span class="kw">goto</span> <a id="843c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="844" id="844">
<td><a id="l844" class='ln'>844</a></td><td> <span class="br">}</span></td></tr>
<tr name="845" id="845">
<td><a id="l845" class='ln'>845</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="846" id="846">
<td><a id="l846" class='ln'>846</a></td><td> <span class="kw">if</span> (<a id="846c27" class="tk">rt_ProcessMatItem</a>(<a id="846c45" class="tk">fp</a>, <a id="846c49" class="tk">&amp;</a><a id="846c50" class="tk">item</a>, <a id="846c56" class="tk">MATRIX_ITEM</a>,0))<span class="br">{</span></td></tr>
<tr name="847" id="847">
<td><a id="l847" class='ln'>847</a></td><td> <a id="847c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="848" id="848">
<td><a id="l848" class='ln'>848</a></td><td> <span class="kw">goto</span> <a id="848c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="849" id="849">
<td><a id="l849" class='ln'>849</a></td><td> <span class="br">}</span></td></tr>
<tr name="850" id="850">
<td><a id="l850" class='ln'>850</a></td><td> <a id="850c23" class="tk">nBytesInItem</a> <a id="850c36" class="tk">+=</a> <a id="850c39" class="tk">item</a>.<a id="850c44" class="tk">nbytes</a> <a id="850c51" class="tk">+</a> <a id="850c53" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="851" id="851">
<td><a id="l851" class='ln'>851</a></td><td> <span class="br">}</span></td></tr>
<tr name="852" id="852">
<td><a id="l852" class='ln'>852</a></td><td> <span class="br">}</span></td></tr>
<tr name="853" id="853">
<td><a id="l853" class='ln'>853</a></td><td></td></tr>
<tr name="854" id="854">
<td><a id="l854" class='ln'>854</a></td><td> <span class="ct">/* signals */</span></td></tr>
<tr name="855" id="855">
<td><a id="l855" class='ln'>855</a></td><td> <a id="855c15" class="tk">item</a>.<a id="855c20" class="tk">type</a> = <a id="855c27" class="tk">matMATRIX</a>;</td></tr>
<tr name="856" id="856">
<td><a id="l856" class='ln'>856</a></td><td> <a id="856c15" class="tk">item</a>.<a id="856c20" class="tk">data</a> = <a id="856c27" class="tk">&amp;</a>(<a id="856c29" class="tk">var</a>-&gt;<a id="856c34" class="tk">signals</a>);</td></tr>
<tr name="857" id="857">
<td><a id="l857" class='ln'>857</a></td><td> <span class="kw">if</span> (<a id="857c19" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="858" id="858">
<td><a id="l858" class='ln'>858</a></td><td> <span class="kw">if</span> (<a id="858c23" class="tk">rt_WriteItemToMatFile</a>(<a id="858c45" class="tk">fp</a>,<a id="858c48" class="tk">&amp;</a><a id="858c49" class="tk">item</a>,<a id="858c54" class="tk">SIGNALS_STRUCT_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="859" id="859">
<td><a id="l859" class='ln'>859</a></td><td> <a id="859c23" class="tk">retStat</a> = 1;</td></tr>
<tr name="860" id="860">
<td><a id="l860" class='ln'>860</a></td><td> <span class="kw">goto</span> <a id="860c28" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="861" id="861">
<td><a id="l861" class='ln'>861</a></td><td> <span class="br">}</span></td></tr>
<tr name="862" id="862">
<td><a id="l862" class='ln'>862</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="863" id="863">
<td><a id="l863" class='ln'>863</a></td><td> <span class="kw">if</span> (<a id="863c23" class="tk">rt_ProcessMatItem</a>(<a id="863c41" class="tk">fp</a>, <a id="863c45" class="tk">&amp;</a><a id="863c46" class="tk">item</a>, <a id="863c52" class="tk">SIGNALS_STRUCT_ITEM</a>,0)) <span class="br">{</span></td></tr>
<tr name="864" id="864">
<td><a id="l864" class='ln'>864</a></td><td> <a id="864c23" class="tk">retStat</a> = 1;</td></tr>
<tr name="865" id="865">
<td><a id="l865" class='ln'>865</a></td><td> <span class="kw">goto</span> <a id="865c28" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="866" id="866">
<td><a id="l866" class='ln'>866</a></td><td> <span class="br">}</span></td></tr>
<tr name="867" id="867">
<td><a id="l867" class='ln'>867</a></td><td> <a id="867c19" class="tk">nBytesInItem</a> <a id="867c32" class="tk">+=</a> <a id="867c35" class="tk">item</a>.<a id="867c40" class="tk">nbytes</a> <a id="867c47" class="tk">+</a> <a id="867c49" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="868" id="868">
<td><a id="l868" class='ln'>868</a></td><td> <span class="br">}</span></td></tr>
<tr name="869" id="869">
<td><a id="l869" class='ln'>869</a></td><td></td></tr>
<tr name="870" id="870">
<td><a id="l870" class='ln'>870</a></td><td> <span class="ct">/* block name */</span></td></tr>
<tr name="871" id="871">
<td><a id="l871" class='ln'>871</a></td><td> <span class="kw">if</span> (<a id="871c19" class="tk">var</a>-&gt;<a id="871c24" class="tk">blockName</a> <a id="871c34" class="tk">!=</a> <a id="871c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="872" id="872">
<td><a id="l872" class='ln'>872</a></td><td> <a id="872c19" class="tk">item</a>.<a id="872c24" class="tk">type</a> = <a id="872c31" class="tk">matMATRIX</a>;</td></tr>
<tr name="873" id="873">
<td><a id="l873" class='ln'>873</a></td><td> <a id="873c19" class="tk">item</a>.<a id="873c24" class="tk">data</a> = <a id="873c31" class="tk">var</a>-&gt;<a id="873c36" class="tk">blockName</a>;</td></tr>
<tr name="874" id="874">
<td><a id="l874" class='ln'>874</a></td><td> <span class="kw">if</span> (<a id="874c23" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="875" id="875">
<td><a id="l875" class='ln'>875</a></td><td> <span class="kw">if</span> (<a id="875c27" class="tk">rt_WriteItemToMatFile</a>(<a id="875c49" class="tk">fp</a>, <a id="875c53" class="tk">&amp;</a><a id="875c54" class="tk">item</a>, <a id="875c60" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="876" id="876">
<td><a id="l876" class='ln'>876</a></td><td> <a id="876c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="877" id="877">
<td><a id="l877" class='ln'>877</a></td><td> <span class="kw">goto</span> <a id="877c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="878" id="878">
<td><a id="l878" class='ln'>878</a></td><td> <span class="br">}</span></td></tr>
<tr name="879" id="879">
<td><a id="l879" class='ln'>879</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="880" id="880">
<td><a id="l880" class='ln'>880</a></td><td> <span class="kw">if</span> (<a id="880c27" class="tk">rt_ProcessMatItem</a>(<a id="880c45" class="tk">fp</a>, <a id="880c49" class="tk">&amp;</a><a id="880c50" class="tk">item</a>, <a id="880c56" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="881" id="881">
<td><a id="l881" class='ln'>881</a></td><td> <a id="881c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="882" id="882">
<td><a id="l882" class='ln'>882</a></td><td> <span class="kw">goto</span> <a id="882c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="883" id="883">
<td><a id="l883" class='ln'>883</a></td><td> <span class="br">}</span></td></tr>
<tr name="884" id="884">
<td><a id="l884" class='ln'>884</a></td><td> <a id="884c23" class="tk">nBytesInItem</a> <a id="884c36" class="tk">+=</a> <a id="884c39" class="tk">item</a>.<a id="884c44" class="tk">nbytes</a> <a id="884c51" class="tk">+</a> <a id="884c53" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="885" id="885">
<td><a id="l885" class='ln'>885</a></td><td> <span class="br">}</span></td></tr>
<tr name="886" id="886">
<td><a id="l886" class='ln'>886</a></td><td> <span class="br">}</span></td></tr>
<tr name="887" id="887">
<td><a id="l887" class='ln'>887</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="888" id="888">
<td><a id="l888" class='ln'>888</a></td><td> <span class="br">}</span></td></tr>
<tr name="889" id="889">
<td><a id="l889" class='ln'>889</a></td><td> <span class="kw">case</span> <a id="889c16" class="tk">SIGNALS_STRUCT_ITEM</a><a id="889c35" class="tk">:</a> <span class="br">{</span></td></tr>
<tr name="890" id="890">
<td><a id="l890" class='ln'>890</a></td><td> <span class="kw">const</span> <a id="890c21" class="tk">SignalsStruct</a> <a id="890c35" class="tk">*</a><a id="890c36" class="tk">var</a> = <a id="890c49" class="tk">pItem</a>-&gt;<a id="890c56" class="tk">data</a>;</td></tr>
<tr name="891" id="891">
<td><a id="l891" class='ln'>891</a></td><td> <span class="kw">const</span> <a id="891c21" class="tk">LogVar</a> <a id="891c35" class="tk">*</a><a id="891c36" class="tk">values</a> = <a id="891c49" class="tk">var</a>-&gt;<a id="891c54" class="tk">values</a>;</td></tr>
<tr name="892" id="892">
<td><a id="l892" class='ln'>892</a></td><td> <span class="kw">const</span> <a id="892c21" class="tk">MatrixData</a> <a id="892c35" class="tk">*</a><a id="892c36" class="tk">dimensions</a> = <a id="892c49" class="tk">var</a>-&gt;<a id="892c54" class="tk">dimensions</a>;</td></tr>
<tr name="893" id="893">
<td><a id="l893" class='ln'>893</a></td><td> <span class="kw">const</span> <a id="893c21" class="tk">MatrixData</a> <a id="893c35" class="tk">*</a><a id="893c36" class="tk">labels</a> = <a id="893c49" class="tk">var</a>-&gt;<a id="893c54" class="tk">labels</a>;</td></tr>
<tr name="894" id="894">
<td><a id="l894" class='ln'>894</a></td><td> <span class="kw">const</span> <a id="894c21" class="tk">MatrixData</a> <a id="894c35" class="tk">*</a><a id="894c36" class="tk">plotStyles</a> = <a id="894c49" class="tk">var</a>-&gt;<a id="894c54" class="tk">plotStyles</a>;</td></tr>
<tr name="895" id="895">
<td><a id="l895" class='ln'>895</a></td><td> <span class="kw">const</span> <a id="895c21" class="tk">MatrixData</a> <a id="895c35" class="tk">*</a><a id="895c36" class="tk">titles</a> = <a id="895c49" class="tk">var</a>-&gt;<a id="895c54" class="tk">titles</a>;</td></tr>
<tr name="896" id="896">
<td><a id="l896" class='ln'>896</a></td><td> <span class="kw">const</span> <a id="896c21" class="tk">MatrixData</a> <a id="896c35" class="tk">*</a><a id="896c36" class="tk">blockNames</a> = <a id="896c49" class="tk">var</a>-&gt;<a id="896c54" class="tk">blockNames</a>;</td></tr>
<tr name="897" id="897">
<td><a id="l897" class='ln'>897</a></td><td> <span class="kw">const</span> <a id="897c21" class="tk">MatrixData</a> <a id="897c35" class="tk">*</a><a id="897c36" class="tk">stateNames</a> = <a id="897c49" class="tk">var</a>-&gt;<a id="897c54" class="tk">stateNames</a>;</td></tr>
<tr name="898" id="898">
<td><a id="l898" class='ln'>898</a></td><td> <span class="kw">const</span> <a id="898c21" class="tk">MatrixData</a> <a id="898c35" class="tk">*</a><a id="898c36" class="tk">crossMdlRef</a> = <a id="898c50" class="tk">var</a>-&gt;<a id="898c55" class="tk">crossMdlRef</a>;</td></tr>
<tr name="899" id="899">
<td><a id="l899" class='ln'>899</a></td><td> <span class="kw">const</span> <a id="899c21" class="tk">boolean_T</a> <a id="899c31" class="tk">logValueDimensions</a> = <a id="899c52" class="tk">var</a>-&gt;<a id="899c57" class="tk">logValueDimensions</a>;</td></tr>
<tr name="900" id="900">
<td><a id="l900" class='ln'>900</a></td><td> <a id="900c15" class="tk">int_T</a> <a id="900c35" class="tk">i</a>;</td></tr>
<tr name="901" id="901">
<td><a id="l901" class='ln'>901</a></td><td></td></tr>
<tr name="902" id="902">
<td><a id="l902" class='ln'>902</a></td><td> <span class="kw">for</span> (<a id="902c20" class="tk">i</a> = 0; <a id="902c27" class="tk">i</a> <a id="902c29" class="tk">&lt;</a> <a id="902c31" class="tk">var</a>-&gt;<a id="902c36" class="tk">numSignals</a>; <a id="902c48" class="tk">i</a><a id="902c49" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="903" id="903">
<td><a id="l903" class='ln'>903</a></td><td> <span class="ct">/* values */</span></td></tr>
<tr name="904" id="904">
<td><a id="l904" class='ln'>904</a></td><td> <a id="904c19" class="tk">item</a>.<a id="904c24" class="tk">type</a> = <a id="904c31" class="tk">matMATRIX</a>;</td></tr>
<tr name="905" id="905">
<td><a id="l905" class='ln'>905</a></td><td> <a id="905c19" class="tk">item</a>.<a id="905c24" class="tk">data</a> = <a id="905c31" class="tk">&amp;</a>(<a id="905c33" class="tk">values</a>-&gt;<a id="905c41" class="tk">data</a>);</td></tr>
<tr name="906" id="906">
<td><a id="l906" class='ln'>906</a></td><td> <span class="kw">if</span> (<a id="906c23" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="907" id="907">
<td><a id="l907" class='ln'>907</a></td><td> <span class="kw">if</span> (<a id="907c27" class="tk">rt_WriteItemToMatFile</a>(<a id="907c49" class="tk">fp</a>, <a id="907c53" class="tk">&amp;</a><a id="907c54" class="tk">item</a>,<a id="907c59" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="908" id="908">
<td><a id="l908" class='ln'>908</a></td><td> <a id="908c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="909" id="909">
<td><a id="l909" class='ln'>909</a></td><td> <span class="kw">goto</span> <a id="909c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="910" id="910">
<td><a id="l910" class='ln'>910</a></td><td> <span class="br">}</span></td></tr>
<tr name="911" id="911">
<td><a id="l911" class='ln'>911</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="912" id="912">
<td><a id="l912" class='ln'>912</a></td><td> <span class="kw">if</span> (<a id="912c27" class="tk">rt_ProcessMatItem</a>(<a id="912c45" class="tk">fp</a>, <a id="912c49" class="tk">&amp;</a><a id="912c50" class="tk">item</a>, <a id="912c56" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="913" id="913">
<td><a id="l913" class='ln'>913</a></td><td> <a id="913c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="914" id="914">
<td><a id="l914" class='ln'>914</a></td><td> <span class="kw">goto</span> <a id="914c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="915" id="915">
<td><a id="l915" class='ln'>915</a></td><td> <span class="br">}</span></td></tr>
<tr name="916" id="916">
<td><a id="l916" class='ln'>916</a></td><td> <a id="916c23" class="tk">nBytesInItem</a> <a id="916c36" class="tk">+=</a> <a id="916c39" class="tk">item</a>.<a id="916c44" class="tk">nbytes</a> <a id="916c51" class="tk">+</a> <a id="916c53" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="917" id="917">
<td><a id="l917" class='ln'>917</a></td><td> <span class="br">}</span></td></tr>
<tr name="918" id="918">
<td><a id="l918" class='ln'>918</a></td><td></td></tr>
<tr name="919" id="919">
<td><a id="l919" class='ln'>919</a></td><td> <span class="kw">if</span>(<a id="919c22" class="tk">logValueDimensions</a>)</td></tr>
<tr name="920" id="920">
<td><a id="l920" class='ln'>920</a></td><td> <span class="br">{</span></td></tr>
<tr name="921" id="921">
<td><a id="l921" class='ln'>921</a></td><td> <span class="ct">/* valueDimensions */</span></td></tr>
<tr name="922" id="922">
<td><a id="l922" class='ln'>922</a></td><td> <span class="ct">/* Since the functions rt_WriteItemToMatFile and </span></td></tr>
<tr name="923" id="923">
<td><a id="l923" class='ln'>923</a></td><td><span class="ct"> rt_ProcessMatItem deal with MatrixData, </span></td></tr>
<tr name="924" id="924">
<td><a id="l924" class='ln'>924</a></td><td><span class="ct"> convert valDims to tempData, and fill up the</span></td></tr>
<tr name="925" id="925">
<td><a id="l925" class='ln'>925</a></td><td><span class="ct"> necessary fields.</span></td></tr>
<tr name="926" id="926">
<td><a id="l926" class='ln'>926</a></td><td><span class="ct"> */</span></td></tr>
<tr name="927" id="927">
<td><a id="l927" class='ln'>927</a></td><td> <a id="927c23" class="tk">MatrixData</a> <a id="927c35" class="tk">tempData</a>;</td></tr>
<tr name="928" id="928">
<td><a id="l928" class='ln'>928</a></td><td> (<span class="kw">void</span>)<a id="928c29" class="tk">memcpy</a>(<a id="928c36" class="tk">tempData</a>.<a id="928c45" class="tk">name</a>, <a id="928c51" class="tk">&amp;</a><a id="928c52" class="tk">VALUEDIMENSIONS_FIELD_NAME</a>, <a id="928c80" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="929" id="929">
<td><a id="l929" class='ln'>929</a></td><td> <a id="929c23" class="tk">tempData</a>.<a id="929c32" class="tk">nRows</a> = <a id="929c40" class="tk">values</a>-&gt;<a id="929c48" class="tk">valDims</a>-&gt;<a id="929c57" class="tk">nRows</a>;</td></tr>
<tr name="930" id="930">
<td><a id="l930" class='ln'>930</a></td><td> <a id="930c23" class="tk">tempData</a>.<a id="930c32" class="tk">nCols</a> = <a id="930c40" class="tk">values</a>-&gt;<a id="930c48" class="tk">valDims</a>-&gt;<a id="930c57" class="tk">nCols</a>;</td></tr>
<tr name="931" id="931">
<td><a id="l931" class='ln'>931</a></td><td> <a id="931c23" class="tk">tempData</a>.<a id="931c32" class="tk">nDims</a> = 1;</td></tr>
<tr name="932" id="932">
<td><a id="l932" class='ln'>932</a></td><td> <a id="932c23" class="tk">tempData</a>.<a id="932c32" class="tk">_dims</a>[0] = <a id="932c43" class="tk">values</a>-&gt;<a id="932c51" class="tk">valDims</a>-&gt;<a id="932c60" class="tk">nCols</a>;</td></tr>
<tr name="933" id="933">
<td><a id="l933" class='ln'>933</a></td><td> <a id="933c23" class="tk">tempData</a>.<a id="933c32" class="tk">re</a> = <a id="933c37" class="tk">values</a>-&gt;<a id="933c45" class="tk">valDims</a>-&gt;<a id="933c54" class="tk">dimsData</a>;</td></tr>
<tr name="934" id="934">
<td><a id="l934" class='ln'>934</a></td><td> <a id="934c23" class="tk">tempData</a>.<a id="934c32" class="tk">im</a> = <a id="934c37" class="tk">NULL</a>;</td></tr>
<tr name="935" id="935">
<td><a id="l935" class='ln'>935</a></td><td> <a id="935c23" class="tk">tempData</a>.<a id="935c32" class="tk">dTypeID</a> = <a id="935c42" class="tk">SS_DOUBLE</a>;</td></tr>
<tr name="936" id="936">
<td><a id="l936" class='ln'>936</a></td><td> <a id="936c23" class="tk">tempData</a>.<a id="936c32" class="tk">elSize</a> = <span class="kw">sizeof</span>(<a id="936c49" class="tk">real_T</a>);</td></tr>
<tr name="937" id="937">
<td><a id="l937" class='ln'>937</a></td><td> <a id="937c23" class="tk">tempData</a>.<a id="937c32" class="tk">mxID</a> = <a id="937c39" class="tk">mxDOUBLE_CLASS</a>;</td></tr>
<tr name="938" id="938">
<td><a id="l938" class='ln'>938</a></td><td> <a id="938c23" class="tk">tempData</a>.<a id="938c32" class="tk">logical</a> = 0;</td></tr>
<tr name="939" id="939">
<td><a id="l939" class='ln'>939</a></td><td> <a id="939c23" class="tk">tempData</a>.<a id="939c32" class="tk">complex</a> = 0;</td></tr>
<tr name="940" id="940">
<td><a id="l940" class='ln'>940</a></td><td> <a id="940c23" class="tk">tempData</a>.<a id="940c32" class="tk">frameData</a> = 0;</td></tr>
<tr name="941" id="941">
<td><a id="l941" class='ln'>941</a></td><td> <a id="941c23" class="tk">tempData</a>.<a id="941c32" class="tk">frameSize</a> = 1;</td></tr>
<tr name="942" id="942">
<td><a id="l942" class='ln'>942</a></td><td></td></tr>
<tr name="943" id="943">
<td><a id="l943" class='ln'>943</a></td><td> <a id="943c23" class="tk">item</a>.<a id="943c28" class="tk">type</a> = <a id="943c35" class="tk">matMATRIX</a>; </td></tr>
<tr name="944" id="944">
<td><a id="l944" class='ln'>944</a></td><td> <a id="944c23" class="tk">item</a>.<a id="944c28" class="tk">data</a> = <a id="944c35" class="tk">&amp;</a><a id="944c36" class="tk">tempData</a>; <span class="ct">/*values-&gt;valDims;*/</span></td></tr>
<tr name="945" id="945">
<td><a id="l945" class='ln'>945</a></td><td></td></tr>
<tr name="946" id="946">
<td><a id="l946" class='ln'>946</a></td><td> <span class="kw">if</span> (<a id="946c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="947" id="947">
<td><a id="l947" class='ln'>947</a></td><td> <span class="kw">if</span> (<a id="947c31" class="tk">rt_WriteItemToMatFile</a>(<a id="947c53" class="tk">fp</a>, <a id="947c57" class="tk">&amp;</a><a id="947c58" class="tk">item</a>,<a id="947c63" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="948" id="948">
<td><a id="l948" class='ln'>948</a></td><td> <a id="948c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="949" id="949">
<td><a id="l949" class='ln'>949</a></td><td> <span class="kw">goto</span> <a id="949c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="950" id="950">
<td><a id="l950" class='ln'>950</a></td><td> <span class="br">}</span></td></tr>
<tr name="951" id="951">
<td><a id="l951" class='ln'>951</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="952" id="952">
<td><a id="l952" class='ln'>952</a></td><td> <span class="kw">if</span> (<a id="952c31" class="tk">rt_ProcessMatItem</a>(<a id="952c49" class="tk">fp</a>, <a id="952c53" class="tk">&amp;</a><a id="952c54" class="tk">item</a>, <a id="952c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="953" id="953">
<td><a id="l953" class='ln'>953</a></td><td> <a id="953c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="954" id="954">
<td><a id="l954" class='ln'>954</a></td><td> <span class="kw">goto</span> <a id="954c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="955" id="955">
<td><a id="l955" class='ln'>955</a></td><td> <span class="br">}</span></td></tr>
<tr name="956" id="956">
<td><a id="l956" class='ln'>956</a></td><td> <a id="956c27" class="tk">nBytesInItem</a> <a id="956c40" class="tk">+=</a> <a id="956c43" class="tk">item</a>.<a id="956c48" class="tk">nbytes</a> <a id="956c55" class="tk">+</a> <a id="956c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="957" id="957">
<td><a id="l957" class='ln'>957</a></td><td> <span class="br">}</span></td></tr>
<tr name="958" id="958">
<td><a id="l958" class='ln'>958</a></td><td> <span class="br">}</span></td></tr>
<tr name="959" id="959">
<td><a id="l959" class='ln'>959</a></td><td> <a id="959c19" class="tk">values</a> = <a id="959c28" class="tk">values</a>-&gt;<a id="959c36" class="tk">next</a>;</td></tr>
<tr name="960" id="960">
<td><a id="l960" class='ln'>960</a></td><td></td></tr>
<tr name="961" id="961">
<td><a id="l961" class='ln'>961</a></td><td> <span class="ct">/* dimensions */</span></td></tr>
<tr name="962" id="962">
<td><a id="l962" class='ln'>962</a></td><td> <span class="kw">if</span> (<a id="962c23" class="tk">dimensions</a> <a id="962c34" class="tk">!=</a> <a id="962c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="963" id="963">
<td><a id="l963" class='ln'>963</a></td><td> <a id="963c23" class="tk">item</a>.<a id="963c28" class="tk">type</a> = <a id="963c35" class="tk">matMATRIX</a>;</td></tr>
<tr name="964" id="964">
<td><a id="l964" class='ln'>964</a></td><td> <a id="964c23" class="tk">item</a>.<a id="964c28" class="tk">data</a> = <a id="964c35" class="tk">&amp;</a>(<a id="964c37" class="tk">dimensions</a>[<a id="964c48" class="tk">i</a>]);</td></tr>
<tr name="965" id="965">
<td><a id="l965" class='ln'>965</a></td><td> <span class="kw">if</span> (<a id="965c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="966" id="966">
<td><a id="l966" class='ln'>966</a></td><td> <span class="kw">if</span> (<a id="966c31" class="tk">rt_WriteItemToMatFile</a>(<a id="966c53" class="tk">fp</a>,<a id="966c56" class="tk">&amp;</a><a id="966c57" class="tk">item</a>, <a id="966c63" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="967" id="967">
<td><a id="l967" class='ln'>967</a></td><td> <a id="967c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="968" id="968">
<td><a id="l968" class='ln'>968</a></td><td> <span class="kw">goto</span> <a id="968c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="969" id="969">
<td><a id="l969" class='ln'>969</a></td><td> <span class="br">}</span></td></tr>
<tr name="970" id="970">
<td><a id="l970" class='ln'>970</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="971" id="971">
<td><a id="l971" class='ln'>971</a></td><td> <span class="kw">if</span> (<a id="971c31" class="tk">rt_ProcessMatItem</a>(<a id="971c49" class="tk">fp</a>, <a id="971c53" class="tk">&amp;</a><a id="971c54" class="tk">item</a>, <a id="971c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="972" id="972">
<td><a id="l972" class='ln'>972</a></td><td> <a id="972c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="973" id="973">
<td><a id="l973" class='ln'>973</a></td><td> <span class="kw">goto</span> <a id="973c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="974" id="974">
<td><a id="l974" class='ln'>974</a></td><td> <span class="br">}</span></td></tr>
<tr name="975" id="975">
<td><a id="l975" class='ln'>975</a></td><td> <a id="975c27" class="tk">nBytesInItem</a> <a id="975c40" class="tk">+=</a> <a id="975c43" class="tk">item</a>.<a id="975c48" class="tk">nbytes</a> <a id="975c55" class="tk">+</a> <a id="975c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="976" id="976">
<td><a id="l976" class='ln'>976</a></td><td> <span class="br">}</span></td></tr>
<tr name="977" id="977">
<td><a id="l977" class='ln'>977</a></td><td> <span class="br">}</span></td></tr>
<tr name="978" id="978">
<td><a id="l978" class='ln'>978</a></td><td></td></tr>
<tr name="979" id="979">
<td><a id="l979" class='ln'>979</a></td><td> <span class="ct">/* label */</span></td></tr>
<tr name="980" id="980">
<td><a id="l980" class='ln'>980</a></td><td> <a id="980c19" class="tk">item</a>.<a id="980c24" class="tk">type</a> = <a id="980c31" class="tk">matMATRIX</a>;</td></tr>
<tr name="981" id="981">
<td><a id="l981" class='ln'>981</a></td><td> <a id="981c19" class="tk">item</a>.<a id="981c24" class="tk">data</a> = <a id="981c31" class="tk">&amp;</a>(<a id="981c33" class="tk">labels</a>[<a id="981c40" class="tk">i</a>]);</td></tr>
<tr name="982" id="982">
<td><a id="l982" class='ln'>982</a></td><td> <span class="kw">if</span> (<a id="982c23" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="983" id="983">
<td><a id="l983" class='ln'>983</a></td><td> <span class="kw">if</span> (<a id="983c27" class="tk">rt_WriteItemToMatFile</a>(<a id="983c49" class="tk">fp</a>, <a id="983c53" class="tk">&amp;</a><a id="983c54" class="tk">item</a>,<a id="983c59" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="984" id="984">
<td><a id="l984" class='ln'>984</a></td><td> <a id="984c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="985" id="985">
<td><a id="l985" class='ln'>985</a></td><td> <span class="kw">goto</span> <a id="985c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="986" id="986">
<td><a id="l986" class='ln'>986</a></td><td> <span class="br">}</span></td></tr>
<tr name="987" id="987">
<td><a id="l987" class='ln'>987</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="988" id="988">
<td><a id="l988" class='ln'>988</a></td><td> <span class="kw">if</span> (<a id="988c27" class="tk">rt_ProcessMatItem</a>(<a id="988c45" class="tk">fp</a>, <a id="988c49" class="tk">&amp;</a><a id="988c50" class="tk">item</a>, <a id="988c56" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="989" id="989">
<td><a id="l989" class='ln'>989</a></td><td> <a id="989c27" class="tk">retStat</a> = 1;</td></tr>
<tr name="990" id="990">
<td><a id="l990" class='ln'>990</a></td><td> <span class="kw">goto</span> <a id="990c32" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="991" id="991">
<td><a id="l991" class='ln'>991</a></td><td> <span class="br">}</span></td></tr>
<tr name="992" id="992">
<td><a id="l992" class='ln'>992</a></td><td> <a id="992c23" class="tk">nBytesInItem</a> <a id="992c36" class="tk">+=</a> <a id="992c39" class="tk">item</a>.<a id="992c44" class="tk">nbytes</a> <a id="992c51" class="tk">+</a> <a id="992c53" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="993" id="993">
<td><a id="l993" class='ln'>993</a></td><td> <span class="br">}</span></td></tr>
<tr name="994" id="994">
<td><a id="l994" class='ln'>994</a></td><td> <span class="ct">/* title */</span></td></tr>
<tr name="995" id="995">
<td><a id="l995" class='ln'>995</a></td><td> <span class="kw">if</span> (<a id="995c23" class="tk">titles</a> <a id="995c30" class="tk">!=</a> <a id="995c33" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="996" id="996">
<td><a id="l996" class='ln'>996</a></td><td> <a id="996c23" class="tk">item</a>.<a id="996c28" class="tk">type</a> = <a id="996c35" class="tk">matMATRIX</a>;</td></tr>
<tr name="997" id="997">
<td><a id="l997" class='ln'>997</a></td><td> <a id="997c23" class="tk">item</a>.<a id="997c28" class="tk">data</a> = <a id="997c35" class="tk">&amp;</a>(<a id="997c37" class="tk">titles</a>[<a id="997c44" class="tk">i</a>]);</td></tr>
<tr name="998" id="998">
<td><a id="l998" class='ln'>998</a></td><td> <span class="kw">if</span> (<a id="998c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="999" id="999">
<td><a id="l999" class='ln'>999</a></td><td> <span class="kw">if</span> (<a id="999c31" class="tk">rt_WriteItemToMatFile</a>(<a id="999c53" class="tk">fp</a>, <a id="999c57" class="tk">&amp;</a><a id="999c58" class="tk">item</a>, <a id="999c64" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="1000" id="1000">
<td><a id="l1000" class='ln'>1000</a></td><td> <a id="1000c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1001" id="1001">
<td><a id="l1001" class='ln'>1001</a></td><td> <span class="kw">goto</span> <a id="1001c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1002" id="1002">
<td><a id="l1002" class='ln'>1002</a></td><td> <span class="br">}</span></td></tr>
<tr name="1003" id="1003">
<td><a id="l1003" class='ln'>1003</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1004" id="1004">
<td><a id="l1004" class='ln'>1004</a></td><td> <span class="kw">if</span> (<a id="1004c31" class="tk">rt_ProcessMatItem</a>(<a id="1004c49" class="tk">fp</a>, <a id="1004c53" class="tk">&amp;</a><a id="1004c54" class="tk">item</a>, <a id="1004c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="1005" id="1005">
<td><a id="l1005" class='ln'>1005</a></td><td> <a id="1005c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1006" id="1006">
<td><a id="l1006" class='ln'>1006</a></td><td> <span class="kw">goto</span> <a id="1006c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1007" id="1007">
<td><a id="l1007" class='ln'>1007</a></td><td> <span class="br">}</span></td></tr>
<tr name="1008" id="1008">
<td><a id="l1008" class='ln'>1008</a></td><td> <a id="1008c27" class="tk">nBytesInItem</a> <a id="1008c40" class="tk">+=</a> <a id="1008c43" class="tk">item</a>.<a id="1008c48" class="tk">nbytes</a> <a id="1008c55" class="tk">+</a> <a id="1008c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="1009" id="1009">
<td><a id="l1009" class='ln'>1009</a></td><td> <span class="br">}</span></td></tr>
<tr name="1010" id="1010">
<td><a id="l1010" class='ln'>1010</a></td><td> <span class="br">}</span></td></tr>
<tr name="1011" id="1011">
<td><a id="l1011" class='ln'>1011</a></td><td> <span class="ct">/* plot style */</span></td></tr>
<tr name="1012" id="1012">
<td><a id="l1012" class='ln'>1012</a></td><td> <span class="kw">if</span> (<a id="1012c23" class="tk">plotStyles</a> <a id="1012c34" class="tk">!=</a> <a id="1012c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1013" id="1013">
<td><a id="l1013" class='ln'>1013</a></td><td> <a id="1013c23" class="tk">item</a>.<a id="1013c28" class="tk">type</a> = <a id="1013c35" class="tk">matMATRIX</a>;</td></tr>
<tr name="1014" id="1014">
<td><a id="l1014" class='ln'>1014</a></td><td> <a id="1014c23" class="tk">item</a>.<a id="1014c28" class="tk">data</a> = <a id="1014c35" class="tk">&amp;</a>(<a id="1014c37" class="tk">plotStyles</a>[<a id="1014c48" class="tk">i</a>]);</td></tr>
<tr name="1015" id="1015">
<td><a id="l1015" class='ln'>1015</a></td><td> <span class="kw">if</span> (<a id="1015c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="1016" id="1016">
<td><a id="l1016" class='ln'>1016</a></td><td> <span class="kw">if</span> (<a id="1016c31" class="tk">rt_WriteItemToMatFile</a>(<a id="1016c53" class="tk">fp</a>,<a id="1016c56" class="tk">&amp;</a><a id="1016c57" class="tk">item</a>, <a id="1016c63" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="1017" id="1017">
<td><a id="l1017" class='ln'>1017</a></td><td> <a id="1017c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1018" id="1018">
<td><a id="l1018" class='ln'>1018</a></td><td> <span class="kw">goto</span> <a id="1018c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1019" id="1019">
<td><a id="l1019" class='ln'>1019</a></td><td> <span class="br">}</span></td></tr>
<tr name="1020" id="1020">
<td><a id="l1020" class='ln'>1020</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1021" id="1021">
<td><a id="l1021" class='ln'>1021</a></td><td> <span class="kw">if</span> (<a id="1021c31" class="tk">rt_ProcessMatItem</a>(<a id="1021c49" class="tk">fp</a>, <a id="1021c53" class="tk">&amp;</a><a id="1021c54" class="tk">item</a>, <a id="1021c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="1022" id="1022">
<td><a id="l1022" class='ln'>1022</a></td><td> <a id="1022c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1023" id="1023">
<td><a id="l1023" class='ln'>1023</a></td><td> <span class="kw">goto</span> <a id="1023c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1024" id="1024">
<td><a id="l1024" class='ln'>1024</a></td><td> <span class="br">}</span></td></tr>
<tr name="1025" id="1025">
<td><a id="l1025" class='ln'>1025</a></td><td> <a id="1025c27" class="tk">nBytesInItem</a> <a id="1025c40" class="tk">+=</a> <a id="1025c43" class="tk">item</a>.<a id="1025c48" class="tk">nbytes</a> <a id="1025c55" class="tk">+</a> <a id="1025c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="1026" id="1026">
<td><a id="l1026" class='ln'>1026</a></td><td> <span class="br">}</span></td></tr>
<tr name="1027" id="1027">
<td><a id="l1027" class='ln'>1027</a></td><td> <span class="br">}</span></td></tr>
<tr name="1028" id="1028">
<td><a id="l1028" class='ln'>1028</a></td><td> <span class="ct">/* block name */</span></td></tr>
<tr name="1029" id="1029">
<td><a id="l1029" class='ln'>1029</a></td><td> <span class="kw">if</span> (<a id="1029c23" class="tk">blockNames</a> <a id="1029c34" class="tk">!=</a> <a id="1029c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1030" id="1030">
<td><a id="l1030" class='ln'>1030</a></td><td> <a id="1030c23" class="tk">item</a>.<a id="1030c28" class="tk">type</a> = <a id="1030c35" class="tk">matMATRIX</a>;</td></tr>
<tr name="1031" id="1031">
<td><a id="l1031" class='ln'>1031</a></td><td> <a id="1031c23" class="tk">item</a>.<a id="1031c28" class="tk">data</a> = <a id="1031c35" class="tk">&amp;</a>(<a id="1031c37" class="tk">blockNames</a>[<a id="1031c48" class="tk">i</a>]);</td></tr>
<tr name="1032" id="1032">
<td><a id="l1032" class='ln'>1032</a></td><td> <span class="kw">if</span> (<a id="1032c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="1033" id="1033">
<td><a id="l1033" class='ln'>1033</a></td><td> <span class="kw">if</span> (<a id="1033c31" class="tk">rt_WriteItemToMatFile</a>(<a id="1033c53" class="tk">fp</a>, <a id="1033c57" class="tk">&amp;</a><a id="1033c58" class="tk">item</a>, <a id="1033c64" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="1034" id="1034">
<td><a id="l1034" class='ln'>1034</a></td><td> <a id="1034c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1035" id="1035">
<td><a id="l1035" class='ln'>1035</a></td><td> <span class="kw">goto</span> <a id="1035c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1036" id="1036">
<td><a id="l1036" class='ln'>1036</a></td><td> <span class="br">}</span></td></tr>
<tr name="1037" id="1037">
<td><a id="l1037" class='ln'>1037</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1038" id="1038">
<td><a id="l1038" class='ln'>1038</a></td><td> <span class="kw">if</span> (<a id="1038c31" class="tk">rt_ProcessMatItem</a>(<a id="1038c49" class="tk">fp</a>, <a id="1038c53" class="tk">&amp;</a><a id="1038c54" class="tk">item</a>, <a id="1038c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="1039" id="1039">
<td><a id="l1039" class='ln'>1039</a></td><td> <a id="1039c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1040" id="1040">
<td><a id="l1040" class='ln'>1040</a></td><td> <span class="kw">goto</span> <a id="1040c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1041" id="1041">
<td><a id="l1041" class='ln'>1041</a></td><td> <span class="br">}</span></td></tr>
<tr name="1042" id="1042">
<td><a id="l1042" class='ln'>1042</a></td><td> <a id="1042c27" class="tk">nBytesInItem</a> <a id="1042c40" class="tk">+=</a> <a id="1042c43" class="tk">item</a>.<a id="1042c48" class="tk">nbytes</a> <a id="1042c55" class="tk">+</a> <a id="1042c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="1043" id="1043">
<td><a id="l1043" class='ln'>1043</a></td><td> <span class="br">}</span></td></tr>
<tr name="1044" id="1044">
<td><a id="l1044" class='ln'>1044</a></td><td> <span class="br">}</span></td></tr>
<tr name="1045" id="1045">
<td><a id="l1045" class='ln'>1045</a></td><td> <span class="ct">/* state name */</span></td></tr>
<tr name="1046" id="1046">
<td><a id="l1046" class='ln'>1046</a></td><td> <span class="kw">if</span> (<a id="1046c23" class="tk">stateNames</a> <a id="1046c34" class="tk">!=</a> <a id="1046c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1047" id="1047">
<td><a id="l1047" class='ln'>1047</a></td><td> <a id="1047c23" class="tk">item</a>.<a id="1047c28" class="tk">type</a> = <a id="1047c35" class="tk">matMATRIX</a>;</td></tr>
<tr name="1048" id="1048">
<td><a id="l1048" class='ln'>1048</a></td><td> <a id="1048c23" class="tk">item</a>.<a id="1048c28" class="tk">data</a> = <a id="1048c35" class="tk">&amp;</a>(<a id="1048c37" class="tk">stateNames</a>[<a id="1048c48" class="tk">i</a>]);</td></tr>
<tr name="1049" id="1049">
<td><a id="l1049" class='ln'>1049</a></td><td> <span class="kw">if</span> (<a id="1049c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="1050" id="1050">
<td><a id="l1050" class='ln'>1050</a></td><td> <span class="kw">if</span> (<a id="1050c31" class="tk">rt_WriteItemToMatFile</a>(<a id="1050c53" class="tk">fp</a>, <a id="1050c57" class="tk">&amp;</a><a id="1050c58" class="tk">item</a>, <a id="1050c64" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="1051" id="1051">
<td><a id="l1051" class='ln'>1051</a></td><td> <a id="1051c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1052" id="1052">
<td><a id="l1052" class='ln'>1052</a></td><td> <span class="kw">goto</span> <a id="1052c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1053" id="1053">
<td><a id="l1053" class='ln'>1053</a></td><td> <span class="br">}</span></td></tr>
<tr name="1054" id="1054">
<td><a id="l1054" class='ln'>1054</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1055" id="1055">
<td><a id="l1055" class='ln'>1055</a></td><td> <span class="kw">if</span> (<a id="1055c31" class="tk">rt_ProcessMatItem</a>(<a id="1055c49" class="tk">fp</a>, <a id="1055c53" class="tk">&amp;</a><a id="1055c54" class="tk">item</a>, <a id="1055c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="1056" id="1056">
<td><a id="l1056" class='ln'>1056</a></td><td> <a id="1056c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1057" id="1057">
<td><a id="l1057" class='ln'>1057</a></td><td> <span class="kw">goto</span> <a id="1057c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1058" id="1058">
<td><a id="l1058" class='ln'>1058</a></td><td> <span class="br">}</span></td></tr>
<tr name="1059" id="1059">
<td><a id="l1059" class='ln'>1059</a></td><td> <a id="1059c27" class="tk">nBytesInItem</a> <a id="1059c40" class="tk">+=</a> <a id="1059c43" class="tk">item</a>.<a id="1059c48" class="tk">nbytes</a> <a id="1059c55" class="tk">+</a> <a id="1059c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="1060" id="1060">
<td><a id="l1060" class='ln'>1060</a></td><td> <span class="br">}</span></td></tr>
<tr name="1061" id="1061">
<td><a id="l1061" class='ln'>1061</a></td><td> <span class="br">}</span></td></tr>
<tr name="1062" id="1062">
<td><a id="l1062" class='ln'>1062</a></td><td> <span class="ct">/* crossMdlRef */</span></td></tr>
<tr name="1063" id="1063">
<td><a id="l1063" class='ln'>1063</a></td><td> <span class="kw">if</span> (<a id="1063c23" class="tk">crossMdlRef</a> <a id="1063c35" class="tk">!=</a> <a id="1063c38" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1064" id="1064">
<td><a id="l1064" class='ln'>1064</a></td><td> <a id="1064c23" class="tk">item</a>.<a id="1064c28" class="tk">type</a> = <a id="1064c35" class="tk">matMATRIX</a>;</td></tr>
<tr name="1065" id="1065">
<td><a id="l1065" class='ln'>1065</a></td><td> <a id="1065c23" class="tk">item</a>.<a id="1065c28" class="tk">data</a> = <a id="1065c35" class="tk">&amp;</a>(<a id="1065c37" class="tk">crossMdlRef</a>[<a id="1065c49" class="tk">i</a>]);</td></tr>
<tr name="1066" id="1066">
<td><a id="l1066" class='ln'>1066</a></td><td> <span class="kw">if</span> (<a id="1066c27" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="1067" id="1067">
<td><a id="l1067" class='ln'>1067</a></td><td> <span class="kw">if</span> (<a id="1067c31" class="tk">rt_WriteItemToMatFile</a>(<a id="1067c53" class="tk">fp</a>, <a id="1067c57" class="tk">&amp;</a><a id="1067c58" class="tk">item</a>, <a id="1067c64" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="1068" id="1068">
<td><a id="l1068" class='ln'>1068</a></td><td> <a id="1068c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1069" id="1069">
<td><a id="l1069" class='ln'>1069</a></td><td> <span class="kw">goto</span> <a id="1069c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1070" id="1070">
<td><a id="l1070" class='ln'>1070</a></td><td> <span class="br">}</span></td></tr>
<tr name="1071" id="1071">
<td><a id="l1071" class='ln'>1071</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1072" id="1072">
<td><a id="l1072" class='ln'>1072</a></td><td> <span class="kw">if</span> (<a id="1072c31" class="tk">rt_ProcessMatItem</a>(<a id="1072c49" class="tk">fp</a>, <a id="1072c53" class="tk">&amp;</a><a id="1072c54" class="tk">item</a>, <a id="1072c60" class="tk">MATRIX_ITEM</a>, 0)) <span class="br">{</span></td></tr>
<tr name="1073" id="1073">
<td><a id="l1073" class='ln'>1073</a></td><td> <a id="1073c31" class="tk">retStat</a> = 1;</td></tr>
<tr name="1074" id="1074">
<td><a id="l1074" class='ln'>1074</a></td><td> <span class="kw">goto</span> <a id="1074c36" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1075" id="1075">
<td><a id="l1075" class='ln'>1075</a></td><td> <span class="br">}</span></td></tr>
<tr name="1076" id="1076">
<td><a id="l1076" class='ln'>1076</a></td><td> <a id="1076c27" class="tk">nBytesInItem</a> <a id="1076c40" class="tk">+=</a> <a id="1076c43" class="tk">item</a>.<a id="1076c48" class="tk">nbytes</a> <a id="1076c55" class="tk">+</a> <a id="1076c57" class="tk">matTAG_SIZE</a>;</td></tr>
<tr name="1077" id="1077">
<td><a id="l1077" class='ln'>1077</a></td><td> <span class="br">}</span></td></tr>
<tr name="1078" id="1078">
<td><a id="l1078" class='ln'>1078</a></td><td> <span class="br">}</span></td></tr>
<tr name="1079" id="1079">
<td><a id="l1079" class='ln'>1079</a></td><td> <span class="br">}</span> <span class="ct">/* for i=1:numSignals */</span></td></tr>
<tr name="1080" id="1080">
<td><a id="l1080" class='ln'>1080</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="1081" id="1081">
<td><a id="l1081" class='ln'>1081</a></td><td> <span class="br">}</span></td></tr>
<tr name="1082" id="1082">
<td><a id="l1082" class='ln'>1082</a></td><td> <span class="kw">default</span><a id="1082c18" class="tk">:</a> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1083" id="1083">
<td><a id="l1083" class='ln'>1083</a></td><td><span class="ct"> "Needed to handle an unknown itemKind" */</span></td></tr>
<tr name="1084" id="1084">
<td><a id="l1084" class='ln'>1084</a></td><td> (<span class="kw">void</span>)<a id="1084c19" class="tk">fprintf</a>(<a id="1084c27" class="tk">stderr</a>, "Unexpected itemKind=%d in "</td></tr>
<tr name="1085" id="1085">
<td><a id="l1085" class='ln'>1085</a></td><td> "rt_ProcessMatItem @D\n", <a id="1085c53" class="tk">itemKind</a>);</td></tr>
<tr name="1086" id="1086">
<td><a id="l1086" class='ln'>1086</a></td><td> <a id="1086c13" class="tk">retStat</a> = <a id="1086c23" class="tk">-</a>1;</td></tr>
<tr name="1087" id="1087">
<td><a id="l1087" class='ln'>1087</a></td><td> <span class="kw">goto</span> <a id="1087c18" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="1088" id="1088">
<td><a id="l1088" class='ln'>1088</a></td><td> <span class="br">}</span></td></tr>
<tr name="1089" id="1089">
<td><a id="l1089" class='ln'>1089</a></td><td> <span class="br">}</span> <span class="ct">/* end struct item */</span></td></tr>
<tr name="1090" id="1090">
<td><a id="l1090" class='ln'>1090</a></td><td></td></tr>
<tr name="1091" id="1091">
<td><a id="l1091" class='ln'>1091</a></td><td> <span class="kw">if</span> (<a id="1091c9" class="tk">!</a><a id="1091c10" class="tk">cmd</a>) <span class="br">{</span></td></tr>
<tr name="1092" id="1092">
<td><a id="l1092" class='ln'>1092</a></td><td> <a id="1092c9" class="tk">pItem</a>-&gt;<a id="1092c16" class="tk">nbytes</a> = <a id="1092c25" class="tk">nBytesInItem</a>;</td></tr>
<tr name="1093" id="1093">
<td><a id="l1093" class='ln'>1093</a></td><td> <span class="br">}</span></td></tr>
<tr name="1094" id="1094">
<td><a id="l1094" class='ln'>1094</a></td><td></td></tr>
<tr name="1095" id="1095">
<td><a id="l1095" class='ln'>1095</a></td><td> <a id="1095c3" class="tk">EXIT_POINT</a><a id="1095c13" class="tk">:</a></td></tr>
<tr name="1096" id="1096">
<td><a id="l1096" class='ln'>1096</a></td><td> <span class="kw">if</span> (<a id="1096c9" class="tk">dims</a> <a id="1096c14" class="tk">!=</a> <a id="1096c17" class="tk">_dims</a>) <span class="br">{</span></td></tr>
<tr name="1097" id="1097">
<td><a id="l1097" class='ln'>1097</a></td><td> <a id="1097c9" class="tk">FREE</a>(<a id="1097c14" class="tk">dims</a>);</td></tr>
<tr name="1098" id="1098">
<td><a id="l1098" class='ln'>1098</a></td><td> <span class="br">}</span></td></tr>
<tr name="1099" id="1099">
<td><a id="l1099" class='ln'>1099</a></td><td> <span class="kw">return</span>(<a id="1099c12" class="tk">retStat</a>);</td></tr>
<tr name="1100" id="1100">
<td><a id="l1100" class='ln'>1100</a></td><td></td></tr>
<tr name="1101" id="1101">
<td><a id="l1101" class='ln'>1101</a></td><td><span class="br">}</span> <span class="ct">/* end rt_ProcessMatItem */</span></td></tr>
<tr name="1102" id="1102">
<td><a id="l1102" class='ln'>1102</a></td><td></td></tr>
<tr name="1103" id="1103">
<td><a id="l1103" class='ln'>1103</a></td><td></td></tr>
<tr name="1104" id="1104">
<td><a id="l1104" class='ln'>1104</a></td><td><span class="ct">/* Function: rt_WriteItemToMatFile =============================================</span></td></tr>
<tr name="1105" id="1105">
<td><a id="l1105" class='ln'>1105</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1106" id="1106">
<td><a id="l1106" class='ln'>1106</a></td><td><span class="ct"> * Entry function for writing out a mat item to the mat file.</span></td></tr>
<tr name="1107" id="1107">
<td><a id="l1107" class='ln'>1107</a></td><td><span class="ct"> *</span></td></tr>
<tr name="1108" id="1108">
<td><a id="l1108" class='ln'>1108</a></td><td><span class="ct"> * Return values is</span></td></tr>
<tr name="1109" id="1109">
<td><a id="l1109" class='ln'>1109</a></td><td><span class="ct"> * == 0 : upon success</span></td></tr>
<tr name="1110" id="1110">
<td><a id="l1110" class='ln'>1110</a></td><td><span class="ct"> * &lt;&gt; 0 : upon failure</span></td></tr>
<tr name="1111" id="1111">
<td><a id="l1111" class='ln'>1111</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1112" id="1112">
<td><a id="l1112" class='ln'>1112</a></td><td><span class="kw">static</span> <a id="1112c8" class="tk">int_T</a> <a id="1112c14" class="tk">rt_WriteItemToMatFile</a>(<a id="1112c36" class="tk">FILE</a> <a id="1112c49" class="tk">*</a><a id="1112c50" class="tk">fp</a>,</td></tr>
<tr name="1113" id="1113">
<td><a id="l1113" class='ln'>1113</a></td><td> <a id="1113c36" class="tk">MatItem</a> <a id="1113c49" class="tk">*</a><a id="1113c50" class="tk">pItem</a>,</td></tr>
<tr name="1114" id="1114">
<td><a id="l1114" class='ln'>1114</a></td><td> <a id="1114c36" class="tk">ItemDataKind</a> <a id="1114c49" class="tk">itemKind</a>)</td></tr>
<tr name="1115" id="1115">
<td><a id="l1115" class='ln'>1115</a></td><td><span class="br">{</span></td></tr>
<tr name="1116" id="1116">
<td><a id="l1116" class='ln'>1116</a></td><td> <span class="ct">/* Determine the item size */</span></td></tr>
<tr name="1117" id="1117">
<td><a id="l1117" class='ln'>1117</a></td><td> <span class="kw">if</span> (<a id="1117c9" class="tk">pItem</a>-&gt;<a id="1117c16" class="tk">type</a> <a id="1117c21" class="tk">==</a> <a id="1117c24" class="tk">matMATRIX</a>) <span class="br">{</span></td></tr>
<tr name="1118" id="1118">
<td><a id="l1118" class='ln'>1118</a></td><td> <span class="kw">if</span> (<a id="1118c13" class="tk">rt_ProcessMatItem</a>(<a id="1118c31" class="tk">fp</a>, <a id="1118c35" class="tk">pItem</a>, <a id="1118c42" class="tk">itemKind</a>, 0)) <span class="kw">return</span>(1);</td></tr>
<tr name="1119" id="1119">
<td><a id="l1119" class='ln'>1119</a></td><td> <span class="br">}</span></td></tr>
<tr name="1120" id="1120">
<td><a id="l1120" class='ln'>1120</a></td><td></td></tr>
<tr name="1121" id="1121">
<td><a id="l1121" class='ln'>1121</a></td><td> <span class="ct">/* Write the item tag and data */</span></td></tr>
<tr name="1122" id="1122">
<td><a id="l1122" class='ln'>1122</a></td><td> <span class="kw">if</span> (<a id="1122c9" class="tk">pItem</a>-&gt;<a id="1122c16" class="tk">nbytes</a> <a id="1122c23" class="tk">&gt;</a> 4) <span class="br">{</span></td></tr>
<tr name="1123" id="1123">
<td><a id="l1123" class='ln'>1123</a></td><td> <a id="1123c9" class="tk">int32_T</a> <a id="1123c17" class="tk">nAlignBytes</a>;</td></tr>
<tr name="1124" id="1124">
<td><a id="l1124" class='ln'>1124</a></td><td></td></tr>
<tr name="1125" id="1125">
<td><a id="l1125" class='ln'>1125</a></td><td> <span class="kw">if</span> (<a id="1125c13" class="tk">fwrite</a>(<a id="1125c20" class="tk">pItem</a>, 1, <a id="1125c30" class="tk">matTAG_SIZE</a>, <a id="1125c43" class="tk">fp</a>) <a id="1125c47" class="tk">!=</a> <a id="1125c50" class="tk">matTAG_SIZE</a>) <span class="kw">return</span>(1);</td></tr>
<tr name="1126" id="1126">
<td><a id="l1126" class='ln'>1126</a></td><td></td></tr>
<tr name="1127" id="1127">
<td><a id="l1127" class='ln'>1127</a></td><td> <span class="kw">if</span> (<a id="1127c13" class="tk">pItem</a>-&gt;<a id="1127c20" class="tk">type</a> <a id="1127c25" class="tk">==</a> <a id="1127c28" class="tk">matMATRIX</a>) <span class="br">{</span></td></tr>
<tr name="1128" id="1128">
<td><a id="l1128" class='ln'>1128</a></td><td> <span class="kw">if</span> (<a id="1128c17" class="tk">rt_ProcessMatItem</a>(<a id="1128c35" class="tk">fp</a>, <a id="1128c39" class="tk">pItem</a>, <a id="1128c46" class="tk">itemKind</a>, 1)) <span class="kw">return</span>(1);</td></tr>
<tr name="1129" id="1129">
<td><a id="l1129" class='ln'>1129</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1130" id="1130">
<td><a id="l1130" class='ln'>1130</a></td><td> <span class="kw">if</span> ( <a id="1130c18" class="tk">fwrite</a>(<a id="1130c25" class="tk">pItem</a>-&gt;<a id="1130c32" class="tk">data</a>, 1, <a id="1130c41" class="tk">pItem</a>-&gt;<a id="1130c48" class="tk">nbytes</a>, <a id="1130c56" class="tk">fp</a>) <a id="1130c60" class="tk">!=</a></td></tr>
<tr name="1131" id="1131">
<td><a id="l1131" class='ln'>1131</a></td><td> ((<a id="1131c55" class="tk">size_t</a>) <a id="1131c63" class="tk">pItem</a>-&gt;<a id="1131c70" class="tk">nbytes</a>) ) <span class="br">{</span></td></tr>
<tr name="1132" id="1132">
<td><a id="l1132" class='ln'>1132</a></td><td> <span class="kw">return</span>(1);</td></tr>
<tr name="1133" id="1133">
<td><a id="l1133" class='ln'>1133</a></td><td> <span class="br">}</span></td></tr>
<tr name="1134" id="1134">
<td><a id="l1134" class='ln'>1134</a></td><td> <span class="br">}</span></td></tr>
<tr name="1135" id="1135">
<td><a id="l1135" class='ln'>1135</a></td><td></td></tr>
<tr name="1136" id="1136">
<td><a id="l1136" class='ln'>1136</a></td><td> <span class="ct">/* Add offset for 8-byte alignment */</span></td></tr>
<tr name="1137" id="1137">
<td><a id="l1137" class='ln'>1137</a></td><td> <a id="1137c9" class="tk">nAlignBytes</a> = <a id="1137c23" class="tk">matINT64_ALIGN</a>(<a id="1137c38" class="tk">pItem</a>-&gt;<a id="1137c45" class="tk">nbytes</a>) <a id="1137c53" class="tk">-</a> <a id="1137c55" class="tk">pItem</a>-&gt;<a id="1137c62" class="tk">nbytes</a>;</td></tr>
<tr name="1138" id="1138">
<td><a id="l1138" class='ln'>1138</a></td><td> <span class="kw">if</span> (<a id="1138c13" class="tk">nAlignBytes</a> <a id="1138c25" class="tk">&gt;</a> 0) <span class="br">{</span></td></tr>
<tr name="1139" id="1139">
<td><a id="l1139" class='ln'>1139</a></td><td> <span class="kw">int</span> <a id="1139c17" class="tk">pad</a>[2] = <span class="br">{</span>0, 0<span class="br">}</span>;</td></tr>
<tr name="1140" id="1140">
<td><a id="l1140" class='ln'>1140</a></td><td> <span class="kw">if</span> ( <a id="1140c18" class="tk">fwrite</a>(<a id="1140c25" class="tk">pad</a>,1,<a id="1140c31" class="tk">nAlignBytes</a>,<a id="1140c43" class="tk">fp</a>) <a id="1140c47" class="tk">!=</a> ((<a id="1140c52" class="tk">size_t</a>) <a id="1140c60" class="tk">nAlignBytes</a>) ) <span class="br">{</span></td></tr>
<tr name="1141" id="1141">
<td><a id="l1141" class='ln'>1141</a></td><td> <span class="kw">return</span>(1);</td></tr>
<tr name="1142" id="1142">
<td><a id="l1142" class='ln'>1142</a></td><td> <span class="br">}</span></td></tr>
<tr name="1143" id="1143">
<td><a id="l1143" class='ln'>1143</a></td><td> <span class="br">}</span></td></tr>
<tr name="1144" id="1144">
<td><a id="l1144" class='ln'>1144</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1145" id="1145">
<td><a id="l1145" class='ln'>1145</a></td><td> <a id="1145c9" class="tk">MatItem</a> <a id="1145c17" class="tk">item</a> = <span class="br">{</span>0, 0, <a id="1145c31" class="tk">NULL</a><span class="br">}</span>;</td></tr>
<tr name="1146" id="1146">
<td><a id="l1146" class='ln'>1146</a></td><td> <a id="1146c9" class="tk">item</a>.<a id="1146c14" class="tk">type</a> = ((<a id="1146c23" class="tk">uint32_T</a>)(<a id="1146c33" class="tk">pItem</a>-&gt;<a id="1146c40" class="tk">type</a>))<a id="1146c46" class="tk">|</a>(((<a id="1146c50" class="tk">uint32_T</a>)(<a id="1146c60" class="tk">pItem</a>-&gt;<a id="1146c67" class="tk">nbytes</a>))<a id="1146c75" class="tk">&lt;&lt;</a>16);</td></tr>
<tr name="1147" id="1147">
<td><a id="l1147" class='ln'>1147</a></td><td> (<span class="kw">void</span>)<a id="1147c15" class="tk">memcpy</a>(<a id="1147c22" class="tk">&amp;</a><a id="1147c23" class="tk">item</a>.<a id="1147c28" class="tk">nbytes</a>, <a id="1147c36" class="tk">pItem</a>-&gt;<a id="1147c43" class="tk">data</a>, <a id="1147c49" class="tk">pItem</a>-&gt;<a id="1147c56" class="tk">nbytes</a>);</td></tr>
<tr name="1148" id="1148">
<td><a id="l1148" class='ln'>1148</a></td><td> <span class="kw">if</span> (<a id="1148c13" class="tk">fwrite</a>(<a id="1148c20" class="tk">&amp;</a><a id="1148c21" class="tk">item</a>, 1, <a id="1148c30" class="tk">matTAG_SIZE</a>, <a id="1148c43" class="tk">fp</a>) <a id="1148c47" class="tk">!=</a> <a id="1148c50" class="tk">matTAG_SIZE</a>) <span class="kw">return</span>(1);</td></tr>
<tr name="1149" id="1149">
<td><a id="l1149" class='ln'>1149</a></td><td> <span class="br">}</span></td></tr>
<tr name="1150" id="1150">
<td><a id="l1150" class='ln'>1150</a></td><td></td></tr>
<tr name="1151" id="1151">
<td><a id="l1151" class='ln'>1151</a></td><td> <span class="kw">return</span>(0);</td></tr>
<tr name="1152" id="1152">
<td><a id="l1152" class='ln'>1152</a></td><td></td></tr>
<tr name="1153" id="1153">
<td><a id="l1153" class='ln'>1153</a></td><td><span class="br">}</span> <span class="ct">/* end rt_WriteItemToMatFile */</span></td></tr>
<tr name="1154" id="1154">
<td><a id="l1154" class='ln'>1154</a></td><td></td></tr>
<tr name="1155" id="1155">
<td><a id="l1155" class='ln'>1155</a></td><td></td></tr>
<tr name="1156" id="1156">
<td><a id="l1156" class='ln'>1156</a></td><td><span class="ct">/* Function: rt_WriteMat5FileHeader ============================================</span></td></tr>
<tr name="1157" id="1157">
<td><a id="l1157" class='ln'>1157</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1158" id="1158">
<td><a id="l1158" class='ln'>1158</a></td><td><span class="ct"> * Function to write the mat file header.</span></td></tr>
<tr name="1159" id="1159">
<td><a id="l1159" class='ln'>1159</a></td><td><span class="ct"> * Return values is</span></td></tr>
<tr name="1160" id="1160">
<td><a id="l1160" class='ln'>1160</a></td><td><span class="ct"> * == 0 : upon success</span></td></tr>
<tr name="1161" id="1161">
<td><a id="l1161" class='ln'>1161</a></td><td><span class="ct"> * &lt;&gt; 0 : upon failure</span></td></tr>
<tr name="1162" id="1162">
<td><a id="l1162" class='ln'>1162</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1163" id="1163">
<td><a id="l1163" class='ln'>1163</a></td><td><span class="kw">static</span> <a id="1163c8" class="tk">int_T</a> <a id="1163c14" class="tk">rt_WriteMat5FileHeader</a>(<a id="1163c37" class="tk">FILE</a> <a id="1163c42" class="tk">*</a><a id="1163c43" class="tk">fp</a>)</td></tr>
<tr name="1164" id="1164">
<td><a id="l1164" class='ln'>1164</a></td><td><span class="br">{</span></td></tr>
<tr name="1165" id="1165">
<td><a id="l1165" class='ln'>1165</a></td><td> <a id="1165c5" class="tk">int_T</a> <a id="1165c18" class="tk">nbytes</a>;</td></tr>
<tr name="1166" id="1166">
<td><a id="l1166" class='ln'>1166</a></td><td> <a id="1166c5" class="tk">int_T</a> <a id="1166c18" class="tk">nspaces</a>;</td></tr>
<tr name="1167" id="1167">
<td><a id="l1167" class='ln'>1167</a></td><td> <a id="1167c5" class="tk">int_T</a> <a id="1167c18" class="tk">i</a>, <a id="1167c21" class="tk">n</a>;</td></tr>
<tr name="1168" id="1168">
<td><a id="l1168" class='ln'>1168</a></td><td> <span class="kw">unsigned</span> <span class="kw">short</span> <a id="1168c20" class="tk">ver</a>[2];</td></tr>
<tr name="1169" id="1169">
<td><a id="l1169" class='ln'>1169</a></td><td> <a id="1169c5" class="tk">char_T</a> <a id="1169c18" class="tk">spaces</a>[16];</td></tr>
<tr name="1170" id="1170">
<td><a id="l1170" class='ln'>1170</a></td><td> <span class="kw">const</span> <a id="1170c11" class="tk">char_T</a> <a id="1170c18" class="tk">*</a><a id="1170c19" class="tk">matversion</a> = "MATLAB 5.0 MAT-file";</td></tr>
<tr name="1171" id="1171">
<td><a id="l1171" class='ln'>1171</a></td><td></td></tr>
<tr name="1172" id="1172">
<td><a id="l1172" class='ln'>1172</a></td><td> (<span class="kw">void</span>)<a id="1172c11" class="tk">memset</a>(<a id="1172c18" class="tk">spaces</a>, ' ', <span class="kw">sizeof</span>(<a id="1172c38" class="tk">spaces</a>));</td></tr>
<tr name="1173" id="1173">
<td><a id="l1173" class='ln'>1173</a></td><td></td></tr>
<tr name="1174" id="1174">
<td><a id="l1174" class='ln'>1174</a></td><td> <a id="1174c5" class="tk">n</a> = (<a id="1174c10" class="tk">int_T</a>)<a id="1174c16" class="tk">strlen</a>(<a id="1174c23" class="tk">matversion</a>);</td></tr>
<tr name="1175" id="1175">
<td><a id="l1175" class='ln'>1175</a></td><td> <a id="1175c5" class="tk">nbytes</a> = (<a id="1175c15" class="tk">int_T</a>)<a id="1175c21" class="tk">fwrite</a>(<a id="1175c28" class="tk">matversion</a>, 1, <a id="1175c43" class="tk">n</a>, <a id="1175c46" class="tk">fp</a>);</td></tr>
<tr name="1176" id="1176">
<td><a id="l1176" class='ln'>1176</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1177" id="1177">
<td><a id="l1177" class='ln'>1177</a></td><td> <a id="1177c5" class="tk">nspaces</a> = <a id="1177c15" class="tk">matVERSION_INFO_OFFSET</a> <a id="1177c38" class="tk">-</a> <a id="1177c40" class="tk">nbytes</a>;</td></tr>
<tr name="1178" id="1178">
<td><a id="l1178" class='ln'>1178</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1179" id="1179">
<td><a id="l1179" class='ln'>1179</a></td><td> <a id="1179c5" class="tk">n</a> = <a id="1179c9" class="tk">nspaces</a> <a id="1179c17" class="tk">%</a> <span class="kw">sizeof</span>(<a id="1179c26" class="tk">spaces</a>);</td></tr>
<tr name="1180" id="1180">
<td><a id="l1180" class='ln'>1180</a></td><td> <a id="1180c5" class="tk">nbytes</a> <a id="1180c12" class="tk">+=</a> (<a id="1180c16" class="tk">int_T</a>)<a id="1180c22" class="tk">fwrite</a>(<a id="1180c29" class="tk">spaces</a>, 1, <a id="1180c40" class="tk">n</a>, <a id="1180c43" class="tk">fp</a>);</td></tr>
<tr name="1181" id="1181">
<td><a id="l1181" class='ln'>1181</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1182" id="1182">
<td><a id="l1182" class='ln'>1182</a></td><td> <a id="1182c5" class="tk">n</a> = <a id="1182c9" class="tk">nspaces</a> <a id="1182c17" class="tk">/</a> <span class="kw">sizeof</span>(<a id="1182c26" class="tk">spaces</a>);</td></tr>
<tr name="1183" id="1183">
<td><a id="l1183" class='ln'>1183</a></td><td> <span class="kw">for</span> (<a id="1183c10" class="tk">i</a> = 0; <a id="1183c17" class="tk">i</a> <a id="1183c19" class="tk">&lt;</a> <a id="1183c21" class="tk">n</a>; <a id="1183c24" class="tk">++</a><a id="1183c26" class="tk">i</a>) <span class="br">{</span></td></tr>
<tr name="1184" id="1184">
<td><a id="l1184" class='ln'>1184</a></td><td> <a id="1184c9" class="tk">nbytes</a> <a id="1184c16" class="tk">+=</a> (<a id="1184c20" class="tk">int_T</a>)<a id="1184c26" class="tk">fwrite</a>(<a id="1184c33" class="tk">spaces</a>, 1, <span class="kw">sizeof</span>(<a id="1184c51" class="tk">spaces</a>), <a id="1184c60" class="tk">fp</a>);</td></tr>
<tr name="1185" id="1185">
<td><a id="l1185" class='ln'>1185</a></td><td> <span class="br">}</span></td></tr>
<tr name="1186" id="1186">
<td><a id="l1186" class='ln'>1186</a></td><td> <span class="kw">if</span> (<a id="1186c9" class="tk">nbytes</a> <a id="1186c16" class="tk">==</a> <a id="1186c19" class="tk">matVERSION_INFO_OFFSET</a>) <span class="br">{</span></td></tr>
<tr name="1187" id="1187">
<td><a id="l1187" class='ln'>1187</a></td><td> <a id="1187c9" class="tk">ver</a>[0] = <a id="1187c18" class="tk">matVERSION</a>;</td></tr>
<tr name="1188" id="1188">
<td><a id="l1188" class='ln'>1188</a></td><td> <a id="1188c9" class="tk">ver</a>[1] = <a id="1188c18" class="tk">matKEY</a>;</td></tr>
<tr name="1189" id="1189">
<td><a id="l1189" class='ln'>1189</a></td><td> <a id="1189c9" class="tk">nbytes</a> <a id="1189c16" class="tk">+=</a> (<a id="1189c20" class="tk">int_T</a>)<a id="1189c26" class="tk">fwrite</a>(<a id="1189c33" class="tk">ver</a>, 1, <span class="kw">sizeof</span>(<a id="1189c48" class="tk">ver</a>), <a id="1189c54" class="tk">fp</a>);</td></tr>
<tr name="1190" id="1190">
<td><a id="l1190" class='ln'>1190</a></td><td> <span class="br">}</span></td></tr>
<tr name="1191" id="1191">
<td><a id="l1191" class='ln'>1191</a></td><td> <span class="kw">return</span>(<a id="1191c12" class="tk">nbytes</a> <a id="1191c19" class="tk">!=</a> <a id="1191c22" class="tk">matVERSION_INFO_OFFSET</a> <a id="1191c45" class="tk">+</a> <span class="kw">sizeof</span>(<a id="1191c54" class="tk">ver</a>));</td></tr>
<tr name="1192" id="1192">
<td><a id="l1192" class='ln'>1192</a></td><td></td></tr>
<tr name="1193" id="1193">
<td><a id="l1193" class='ln'>1193</a></td><td><span class="br">}</span> <span class="ct">/* end rt_WriteMat5FileHeader */</span></td></tr>
<tr name="1194" id="1194">
<td><a id="l1194" class='ln'>1194</a></td><td></td></tr>
<tr name="1195" id="1195">
<td><a id="l1195" class='ln'>1195</a></td><td></td></tr>
<tr name="1196" id="1196">
<td><a id="l1196" class='ln'>1196</a></td><td><span class="ct">/* Function: rt_FixupLogVar ====================================================</span></td></tr>
<tr name="1197" id="1197">
<td><a id="l1197" class='ln'>1197</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1198" id="1198">
<td><a id="l1198" class='ln'>1198</a></td><td><span class="ct"> * Make the logged variable suitable for MATLAB.</span></td></tr>
<tr name="1199" id="1199">
<td><a id="l1199" class='ln'>1199</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1200" id="1200">
<td><a id="l1200" class='ln'>1200</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="1200c14" class="tk">char_T</a> <a id="1200c21" class="tk">*</a><a id="1200c22" class="tk">rt_FixupLogVar</a>(<a id="1200c37" class="tk">LogVar</a> <a id="1200c44" class="tk">*</a><a id="1200c45" class="tk">var</a>,<span class="kw">int</span> <a id="1200c53" class="tk">verbose</a>)</td></tr>
<tr name="1201" id="1201">
<td><a id="l1201" class='ln'>1201</a></td><td><span class="br">{</span></td></tr>
<tr name="1202" id="1202">
<td><a id="l1202" class='ln'>1202</a></td><td> <a id="1202c5" class="tk">int_T</a> <a id="1202c12" class="tk">nCols</a> = <a id="1202c22" class="tk">var</a>-&gt;<a id="1202c27" class="tk">data</a>.<a id="1202c32" class="tk">nCols</a>;</td></tr>
<tr name="1203" id="1203">
<td><a id="l1203" class='ln'>1203</a></td><td> <a id="1203c5" class="tk">int_T</a> <a id="1203c12" class="tk">maxRows</a> = <a id="1203c22" class="tk">var</a>-&gt;<a id="1203c27" class="tk">data</a>.<a id="1203c32" class="tk">nRows</a>;</td></tr>
<tr name="1204" id="1204">
<td><a id="l1204" class='ln'>1204</a></td><td> <a id="1204c5" class="tk">int_T</a> <a id="1204c12" class="tk">nDims</a> = <a id="1204c22" class="tk">var</a>-&gt;<a id="1204c27" class="tk">data</a>.<a id="1204c32" class="tk">nDims</a>;</td></tr>
<tr name="1205" id="1205">
<td><a id="l1205" class='ln'>1205</a></td><td> <a id="1205c5" class="tk">size_t</a> <a id="1205c12" class="tk">elSize</a> = <a id="1205c22" class="tk">var</a>-&gt;<a id="1205c27" class="tk">data</a>.<a id="1205c32" class="tk">elSize</a>;</td></tr>
<tr name="1206" id="1206">
<td><a id="l1206" class='ln'>1206</a></td><td> <a id="1206c5" class="tk">int_T</a> <a id="1206c12" class="tk">nRows</a> = (<a id="1206c23" class="tk">var</a>-&gt;<a id="1206c28" class="tk">wrapped</a> <a id="1206c36" class="tk">?</a> <a id="1206c39" class="tk">maxRows</a> <a id="1206c47" class="tk">:</a> <a id="1206c49" class="tk">var</a>-&gt;<a id="1206c54" class="tk">rowIdx</a>);</td></tr>
<tr name="1207" id="1207">
<td><a id="l1207" class='ln'>1207</a></td><td></td></tr>
<tr name="1208" id="1208">
<td><a id="l1208" class='ln'>1208</a></td><td> <a id="1208c5" class="tk">var</a>-&gt;<a id="1208c10" class="tk">nDataPoints</a> = <a id="1208c24" class="tk">var</a>-&gt;<a id="1208c29" class="tk">rowIdx</a> <a id="1208c36" class="tk">+</a> <a id="1208c38" class="tk">var</a>-&gt;<a id="1208c43" class="tk">wrapped</a> <a id="1208c51" class="tk">*</a> <a id="1208c53" class="tk">maxRows</a>;</td></tr>
<tr name="1209" id="1209">
<td><a id="l1209" class='ln'>1209</a></td><td></td></tr>
<tr name="1210" id="1210">
<td><a id="l1210" class='ln'>1210</a></td><td> <span class="kw">if</span> (<a id="1210c9" class="tk">var</a>-&gt;<a id="1210c14" class="tk">wrapped</a> <a id="1210c22" class="tk">&gt;</a> 1 <a id="1210c26" class="tk">||</a> (<a id="1210c30" class="tk">var</a>-&gt;<a id="1210c35" class="tk">wrapped</a> <a id="1210c43" class="tk">==</a> 1 <a id="1210c48" class="tk">&amp;&amp;</a> <a id="1210c51" class="tk">var</a>-&gt;<a id="1210c56" class="tk">rowIdx</a> <a id="1210c63" class="tk">!=</a> 0)) <span class="br">{</span></td></tr>
<tr name="1211" id="1211">
<td><a id="l1211" class='ln'>1211</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="1212" id="1212">
<td><a id="l1212" class='ln'>1212</a></td><td><span class="ct"> * Warn the user the circular buffer has wrapped, implying that</span></td></tr>
<tr name="1213" id="1213">
<td><a id="l1213" class='ln'>1213</a></td><td><span class="ct"> * some data has been lost.</span></td></tr>
<tr name="1214" id="1214">
<td><a id="l1214" class='ln'>1214</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1215" id="1215">
<td><a id="l1215" class='ln'>1215</a></td><td> <span class="kw">if</span>( <a id="1215c13" class="tk">verbose</a>) <span class="br">{</span></td></tr>
<tr name="1216" id="1216">
<td><a id="l1216" class='ln'>1216</a></td><td> (<span class="kw">void</span>)<a id="1216c19" class="tk">fprintf</a>(<a id="1216c27" class="tk">stdout</a>,</td></tr>
<tr name="1217" id="1217">
<td><a id="l1217" class='ln'>1217</a></td><td> "*** Log variable %s has wrapped %d times\n"</td></tr>
<tr name="1218" id="1218">
<td><a id="l1218" class='ln'>1218</a></td><td> " using a circular buffer of size %d\n",</td></tr>
<tr name="1219" id="1219">
<td><a id="l1219" class='ln'>1219</a></td><td> <a id="1219c27" class="tk">var</a>-&gt;<a id="1219c32" class="tk">data</a>.<a id="1219c37" class="tk">name</a>, <a id="1219c43" class="tk">var</a>-&gt;<a id="1219c48" class="tk">wrapped</a>, <a id="1219c57" class="tk">var</a>-&gt;<a id="1219c62" class="tk">data</a>.<a id="1219c67" class="tk">nRows</a>);</td></tr>
<tr name="1220" id="1220">
<td><a id="l1220" class='ln'>1220</a></td><td> <span class="br">}</span></td></tr>
<tr name="1221" id="1221">
<td><a id="l1221" class='ln'>1221</a></td><td> <span class="kw">if</span> (<a id="1221c13" class="tk">var</a>-&gt;<a id="1221c18" class="tk">usingDefaultBufSize</a>) <span class="br">{</span></td></tr>
<tr name="1222" id="1222">
<td><a id="l1222" class='ln'>1222</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="1223" id="1223">
<td><a id="l1223" class='ln'>1223</a></td><td><span class="ct"> * If wrapping occurred using the default buffer size,</span></td></tr>
<tr name="1224" id="1224">
<td><a id="l1224" class='ln'>1224</a></td><td><span class="ct"> * let the user know what size buffer to use in the</span></td></tr>
<tr name="1225" id="1225">
<td><a id="l1225" class='ln'>1225</a></td><td><span class="ct"> * future to avoid wrapping. If the default buffer</span></td></tr>
<tr name="1226" id="1226">
<td><a id="l1226" class='ln'>1226</a></td><td><span class="ct"> * size was not used, the user has no control to specify</span></td></tr>
<tr name="1227" id="1227">
<td><a id="l1227" class='ln'>1227</a></td><td><span class="ct"> * the correct value. Wrapping may occur when not using</span></td></tr>
<tr name="1228" id="1228">
<td><a id="l1228" class='ln'>1228</a></td><td><span class="ct"> * the default buffer if we allocated too small a buffer</span></td></tr>
<tr name="1229" id="1229">
<td><a id="l1229" class='ln'>1229</a></td><td><span class="ct"> * size for this logvar. One common case is a toWorkspace</span></td></tr>
<tr name="1230" id="1230">
<td><a id="l1230" class='ln'>1230</a></td><td><span class="ct"> * block inside of an iterative subsystem - we can not take</span></td></tr>
<tr name="1231" id="1231">
<td><a id="l1231" class='ln'>1231</a></td><td><span class="ct"> * the number of iterations into account (they may be</span></td></tr>
<tr name="1232" id="1232">
<td><a id="l1232" class='ln'>1232</a></td><td><span class="ct"> * variable) when allocating the buffer. In this case,</span></td></tr>
<tr name="1233" id="1233">
<td><a id="l1233" class='ln'>1233</a></td><td><span class="ct"> * just warn the buffer wrapped and don't tell user they</span></td></tr>
<tr name="1234" id="1234">
<td><a id="l1234" class='ln'>1234</a></td><td><span class="ct"> * can override the buffer size.</span></td></tr>
<tr name="1235" id="1235">
<td><a id="l1235" class='ln'>1235</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1236" id="1236">
<td><a id="l1236" class='ln'>1236</a></td><td> <span class="kw">if</span>( <a id="1236c17" class="tk">verbose</a> ) <span class="br">{</span></td></tr>
<tr name="1237" id="1237">
<td><a id="l1237" class='ln'>1237</a></td><td> (<span class="kw">void</span>)<a id="1237c23" class="tk">fprintf</a>(<a id="1237c31" class="tk">stdout</a>,</td></tr>
<tr name="1238" id="1238">
<td><a id="l1238" class='ln'>1238</a></td><td> "*** To avoid wrapping, explicitly specify a\n"</td></tr>
<tr name="1239" id="1239">
<td><a id="l1239" class='ln'>1239</a></td><td> " buffer size of %d in your Simulink model\n"</td></tr>
<tr name="1240" id="1240">
<td><a id="l1240" class='ln'>1240</a></td><td> " by adding OPTS=\"-DDEFAULT_BUFFER_SIZE=%d\"\n"</td></tr>
<tr name="1241" id="1241">
<td><a id="l1241" class='ln'>1241</a></td><td> " as an argument to the ConfigSet MakeCommand\n"</td></tr>
<tr name="1242" id="1242">
<td><a id="l1242" class='ln'>1242</a></td><td> " parameter\n",</td></tr>
<tr name="1243" id="1243">
<td><a id="l1243" class='ln'>1243</a></td><td> <a id="1243c31" class="tk">var</a>-&gt;<a id="1243c36" class="tk">nDataPoints</a>, <a id="1243c49" class="tk">var</a>-&gt;<a id="1243c54" class="tk">nDataPoints</a>);</td></tr>
<tr name="1244" id="1244">
<td><a id="l1244" class='ln'>1244</a></td><td> <span class="br">}</span></td></tr>
<tr name="1245" id="1245">
<td><a id="l1245" class='ln'>1245</a></td><td> <span class="br">}</span></td></tr>
<tr name="1246" id="1246">
<td><a id="l1246" class='ln'>1246</a></td><td> <span class="br">}</span></td></tr>
<tr name="1247" id="1247">
<td><a id="l1247" class='ln'>1247</a></td><td></td></tr>
<tr name="1248" id="1248">
<td><a id="l1248" class='ln'>1248</a></td><td> <span class="kw">if</span> (<a id="1248c9" class="tk">nDims</a> <a id="1248c15" class="tk">&lt;</a> 2 <a id="1248c19" class="tk">&amp;&amp;</a> <a id="1248c22" class="tk">nCols</a> <a id="1248c28" class="tk">&gt;</a> 1) <span class="br">{</span> <span class="ct">/* Transpose? */</span></td></tr>
<tr name="1249" id="1249">
<td><a id="l1249" class='ln'>1249</a></td><td> <span class="ct">/* Don't need to transpose valueDimensions */</span></td></tr>
<tr name="1250" id="1250">
<td><a id="l1250" class='ln'>1250</a></td><td> <a id="1250c9" class="tk">int_T</a> <a id="1250c16" class="tk">nEl</a> = <a id="1250c25" class="tk">nRows</a><a id="1250c30" class="tk">*</a><a id="1250c31" class="tk">nCols</a>;</td></tr>
<tr name="1251" id="1251">
<td><a id="l1251" class='ln'>1251</a></td><td> <span class="kw">char</span> <a id="1251c16" class="tk">*</a><a id="1251c17" class="tk">src</a> = <a id="1251c25" class="tk">var</a>-&gt;<a id="1251c30" class="tk">data</a>.<a id="1251c35" class="tk">re</a>;</td></tr>
<tr name="1252" id="1252">
<td><a id="l1252" class='ln'>1252</a></td><td> <span class="kw">char</span> <a id="1252c16" class="tk">*</a><a id="1252c17" class="tk">pmT</a>;</td></tr>
<tr name="1253" id="1253">
<td><a id="l1253" class='ln'>1253</a></td><td> <a id="1253c9" class="tk">int_T</a> <a id="1253c16" class="tk">k</a>;</td></tr>
<tr name="1254" id="1254">
<td><a id="l1254" class='ln'>1254</a></td><td></td></tr>
<tr name="1255" id="1255">
<td><a id="l1255" class='ln'>1255</a></td><td> <span class="ct">/**********************************</span></td></tr>
<tr name="1256" id="1256">
<td><a id="l1256" class='ln'>1256</a></td><td><span class="ct"> * If memory cannot be allocated, *</span></td></tr>
<tr name="1257" id="1257">
<td><a id="l1257" class='ln'>1257</a></td><td><span class="ct"> * write to a temporary buffer *</span></td></tr>
<tr name="1258" id="1258">
<td><a id="l1258" class='ln'>1258</a></td><td><span class="ct"> **********************************/</span></td></tr>
<tr name="1259" id="1259">
<td><a id="l1259" class='ln'>1259</a></td><td> <span class="kw">if</span> ((<a id="1259c14" class="tk">pmT</a> = <a id="1259c20" class="tk">malloc</a>(<a id="1259c27" class="tk">nEl</a><a id="1259c30" class="tk">*</a><a id="1259c31" class="tk">elSize</a>)) <a id="1259c40" class="tk">==</a> <a id="1259c43" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1260" id="1260">
<td><a id="l1260" class='ln'>1260</a></td><td> <a id="1260c13" class="tk">FILE</a> <a id="1260c19" class="tk">*</a><a id="1260c20" class="tk">fptr</a>;</td></tr>
<tr name="1261" id="1261">
<td><a id="l1261" class='ln'>1261</a></td><td> <span class="kw">char</span> <a id="1261c19" class="tk">fName</a>[<a id="1261c25" class="tk">mxMAXNAM</a><a id="1261c33" class="tk">+</a>13];</td></tr>
<tr name="1262" id="1262">
<td><a id="l1262" class='ln'>1262</a></td><td></td></tr>
<tr name="1263" id="1263">
<td><a id="l1263" class='ln'>1263</a></td><td> (<span class="kw">void</span>)<a id="1263c19" class="tk">sprintf</a>(<a id="1263c27" class="tk">fName</a>, "%s%s", <a id="1263c42" class="tk">var</a>-&gt;<a id="1263c47" class="tk">data</a>.<a id="1263c52" class="tk">name</a>, "_rtw_tmw.tmw");</td></tr>
<tr name="1264" id="1264">
<td><a id="l1264" class='ln'>1264</a></td><td> <span class="kw">if</span> ((<a id="1264c18" class="tk">fptr</a>=<a id="1264c23" class="tk">fopen</a>(<a id="1264c29" class="tk">fName</a>,"w+b")) <a id="1264c43" class="tk">==</a> <a id="1264c46" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1265" id="1265">
<td><a id="l1265" class='ln'>1265</a></td><td> (<span class="kw">void</span>)<a id="1265c23" class="tk">fprintf</a>(<a id="1265c31" class="tk">stderr</a>,"*** Error opening %s",<a id="1265c61" class="tk">fName</a>);</td></tr>
<tr name="1266" id="1266">
<td><a id="l1266" class='ln'>1266</a></td><td> <span class="kw">return</span>("unable to open data file\n");</td></tr>
<tr name="1267" id="1267">
<td><a id="l1267" class='ln'>1267</a></td><td> <span class="br">}</span></td></tr>
<tr name="1268" id="1268">
<td><a id="l1268" class='ln'>1268</a></td><td></td></tr>
<tr name="1269" id="1269">
<td><a id="l1269" class='ln'>1269</a></td><td> <span class="ct">/****************************</span></td></tr>
<tr name="1270" id="1270">
<td><a id="l1270" class='ln'>1270</a></td><td><span class="ct"> * Write the data to a file *</span></td></tr>
<tr name="1271" id="1271">
<td><a id="l1271" class='ln'>1271</a></td><td><span class="ct"> ****************************/</span></td></tr>
<tr name="1272" id="1272">
<td><a id="l1272" class='ln'>1272</a></td><td> <span class="kw">for</span> (<a id="1272c18" class="tk">k</a>=0; <a id="1272c23" class="tk">k</a><a id="1272c24" class="tk">&lt;</a><a id="1272c25" class="tk">nEl</a>; <a id="1272c30" class="tk">k</a><a id="1272c31" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1273" id="1273">
<td><a id="l1273" class='ln'>1273</a></td><td> <a id="1273c17" class="tk">int_T</a> <a id="1273c23" class="tk">kT</a> = <a id="1273c30" class="tk">nCols</a><a id="1273c35" class="tk">*</a>(<a id="1273c37" class="tk">k</a><a id="1273c38" class="tk">%</a><a id="1273c39" class="tk">nRows</a>) <a id="1273c46" class="tk">+</a> (<a id="1273c49" class="tk">k</a><a id="1273c50" class="tk">/</a><a id="1273c51" class="tk">nRows</a>);</td></tr>
<tr name="1274" id="1274">
<td><a id="l1274" class='ln'>1274</a></td><td> <span class="kw">char</span> <a id="1274c23" class="tk">*</a><a id="1274c24" class="tk">dst</a> = <a id="1274c30" class="tk">src</a> <a id="1274c34" class="tk">+</a> <a id="1274c36" class="tk">kT</a><a id="1274c38" class="tk">*</a><a id="1274c39" class="tk">elSize</a>;</td></tr>
<tr name="1275" id="1275">
<td><a id="l1275" class='ln'>1275</a></td><td> (<span class="kw">void</span>)<a id="1275c23" class="tk">fwrite</a>(<a id="1275c30" class="tk">dst</a>, <a id="1275c35" class="tk">elSize</a>, 1, <a id="1275c46" class="tk">fptr</a>);</td></tr>
<tr name="1276" id="1276">
<td><a id="l1276" class='ln'>1276</a></td><td> <span class="br">}</span></td></tr>
<tr name="1277" id="1277">
<td><a id="l1277" class='ln'>1277</a></td><td> <span class="kw">if</span> (<a id="1277c17" class="tk">var</a>-&gt;<a id="1277c22" class="tk">data</a>.<a id="1277c27" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="1278" id="1278">
<td><a id="l1278" class='ln'>1278</a></td><td> <span class="kw">char</span> <a id="1278c22" class="tk">*</a><a id="1278c23" class="tk">pmiT</a> = <a id="1278c30" class="tk">var</a>-&gt;<a id="1278c35" class="tk">data</a>.<a id="1278c40" class="tk">re</a>;</td></tr>
<tr name="1279" id="1279">
<td><a id="l1279" class='ln'>1279</a></td><td> <a id="1279c17" class="tk">src</a> = <a id="1279c24" class="tk">var</a>-&gt;<a id="1279c29" class="tk">data</a>.<a id="1279c34" class="tk">im</a>;</td></tr>
<tr name="1280" id="1280">
<td><a id="l1280" class='ln'>1280</a></td><td> <span class="kw">for</span> (<a id="1280c22" class="tk">k</a>=0; <a id="1280c27" class="tk">k</a><a id="1280c28" class="tk">&lt;</a><a id="1280c29" class="tk">nEl</a>; <a id="1280c34" class="tk">k</a><a id="1280c35" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1281" id="1281">
<td><a id="l1281" class='ln'>1281</a></td><td> <a id="1281c21" class="tk">int_T</a> <a id="1281c27" class="tk">kT</a> = <a id="1281c34" class="tk">nRows</a><a id="1281c39" class="tk">*</a>(<a id="1281c41" class="tk">k</a><a id="1281c42" class="tk">%</a><a id="1281c43" class="tk">nCols</a>) <a id="1281c50" class="tk">+</a> (<a id="1281c53" class="tk">k</a><a id="1281c54" class="tk">/</a><a id="1281c55" class="tk">nCols</a>);</td></tr>
<tr name="1282" id="1282">
<td><a id="l1282" class='ln'>1282</a></td><td> <span class="kw">char</span> <a id="1282c27" class="tk">*</a><a id="1282c28" class="tk">dst</a> = <a id="1282c34" class="tk">pmiT</a> <a id="1282c39" class="tk">+</a> <a id="1282c41" class="tk">kT</a><a id="1282c43" class="tk">*</a><a id="1282c44" class="tk">elSize</a>;</td></tr>
<tr name="1283" id="1283">
<td><a id="l1283" class='ln'>1283</a></td><td> (<span class="kw">void</span>)<a id="1283c27" class="tk">memcpy</a>(<a id="1283c34" class="tk">dst</a>, <a id="1283c39" class="tk">src</a>, <a id="1283c44" class="tk">elSize</a>);</td></tr>
<tr name="1284" id="1284">
<td><a id="l1284" class='ln'>1284</a></td><td> <a id="1284c21" class="tk">src</a> <a id="1284c25" class="tk">+=</a> <a id="1284c28" class="tk">elSize</a>;</td></tr>
<tr name="1285" id="1285">
<td><a id="l1285" class='ln'>1285</a></td><td> <span class="br">}</span></td></tr>
<tr name="1286" id="1286">
<td><a id="l1286" class='ln'>1286</a></td><td> <a id="1286c17" class="tk">var</a>-&gt;<a id="1286c22" class="tk">data</a>.<a id="1286c27" class="tk">re</a> = <a id="1286c32" class="tk">var</a>-&gt;<a id="1286c37" class="tk">data</a>.<a id="1286c42" class="tk">im</a>;</td></tr>
<tr name="1287" id="1287">
<td><a id="l1287" class='ln'>1287</a></td><td> <a id="1287c17" class="tk">var</a>-&gt;<a id="1287c22" class="tk">data</a>.<a id="1287c27" class="tk">im</a> = <a id="1287c32" class="tk">pmiT</a>;</td></tr>
<tr name="1288" id="1288">
<td><a id="l1288" class='ln'>1288</a></td><td> <span class="br">}</span></td></tr>
<tr name="1289" id="1289">
<td><a id="l1289" class='ln'>1289</a></td><td></td></tr>
<tr name="1290" id="1290">
<td><a id="l1290" class='ln'>1290</a></td><td> <span class="ct">/*******************************</span></td></tr>
<tr name="1291" id="1291">
<td><a id="l1291" class='ln'>1291</a></td><td><span class="ct"> * Read the data from the file *</span></td></tr>
<tr name="1292" id="1292">
<td><a id="l1292" class='ln'>1292</a></td><td><span class="ct"> *******************************/</span></td></tr>
<tr name="1293" id="1293">
<td><a id="l1293" class='ln'>1293</a></td><td> (<span class="kw">void</span>)<a id="1293c19" class="tk">rewind</a>(<a id="1293c26" class="tk">fptr</a>);</td></tr>
<tr name="1294" id="1294">
<td><a id="l1294" class='ln'>1294</a></td><td> (<span class="kw">void</span>)<a id="1294c19" class="tk">fread</a>(<a id="1294c25" class="tk">var</a>-&gt;<a id="1294c30" class="tk">data</a>.<a id="1294c35" class="tk">re</a>, <a id="1294c39" class="tk">elSize</a>, <a id="1294c47" class="tk">nEl</a>, <a id="1294c52" class="tk">fptr</a>);</td></tr>
<tr name="1295" id="1295">
<td><a id="l1295" class='ln'>1295</a></td><td> (<span class="kw">void</span>)<a id="1295c19" class="tk">fclose</a>(<a id="1295c26" class="tk">fptr</a>);</td></tr>
<tr name="1296" id="1296">
<td><a id="l1296" class='ln'>1296</a></td><td> (<span class="kw">void</span>)<a id="1296c19" class="tk">remove</a>(<a id="1296c26" class="tk">fName</a>);</td></tr>
<tr name="1297" id="1297">
<td><a id="l1297" class='ln'>1297</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1298" id="1298">
<td><a id="l1298" class='ln'>1298</a></td><td> <span class="kw">for</span> (<a id="1298c18" class="tk">k</a>=0; <a id="1298c23" class="tk">k</a><a id="1298c24" class="tk">&lt;</a><a id="1298c25" class="tk">nEl</a>; <a id="1298c30" class="tk">k</a><a id="1298c31" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1299" id="1299">
<td><a id="l1299" class='ln'>1299</a></td><td> <a id="1299c17" class="tk">int_T</a> <a id="1299c23" class="tk">kT</a> = <a id="1299c30" class="tk">nRows</a><a id="1299c35" class="tk">*</a>(<a id="1299c37" class="tk">k</a><a id="1299c38" class="tk">%</a><a id="1299c39" class="tk">nCols</a>) <a id="1299c46" class="tk">+</a> (<a id="1299c49" class="tk">k</a><a id="1299c50" class="tk">/</a><a id="1299c51" class="tk">nCols</a>);</td></tr>
<tr name="1300" id="1300">
<td><a id="l1300" class='ln'>1300</a></td><td> <span class="kw">char</span> <a id="1300c23" class="tk">*</a><a id="1300c24" class="tk">dst</a> = <a id="1300c30" class="tk">pmT</a> <a id="1300c34" class="tk">+</a> <a id="1300c36" class="tk">kT</a><a id="1300c38" class="tk">*</a><a id="1300c39" class="tk">elSize</a>;</td></tr>
<tr name="1301" id="1301">
<td><a id="l1301" class='ln'>1301</a></td><td> (<span class="kw">void</span>)<a id="1301c23" class="tk">memcpy</a>(<a id="1301c30" class="tk">dst</a>, <a id="1301c35" class="tk">src</a>, <a id="1301c40" class="tk">elSize</a>);</td></tr>
<tr name="1302" id="1302">
<td><a id="l1302" class='ln'>1302</a></td><td> <a id="1302c17" class="tk">src</a> <a id="1302c21" class="tk">+=</a> <a id="1302c24" class="tk">elSize</a>;</td></tr>
<tr name="1303" id="1303">
<td><a id="l1303" class='ln'>1303</a></td><td> <span class="br">}</span></td></tr>
<tr name="1304" id="1304">
<td><a id="l1304" class='ln'>1304</a></td><td> <span class="kw">if</span> (<a id="1304c17" class="tk">var</a>-&gt;<a id="1304c22" class="tk">data</a>.<a id="1304c27" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="1305" id="1305">
<td><a id="l1305" class='ln'>1305</a></td><td> <span class="kw">char</span> <a id="1305c22" class="tk">*</a><a id="1305c23" class="tk">pmiT</a> = <a id="1305c30" class="tk">var</a>-&gt;<a id="1305c35" class="tk">data</a>.<a id="1305c40" class="tk">re</a>;</td></tr>
<tr name="1306" id="1306">
<td><a id="l1306" class='ln'>1306</a></td><td> <a id="1306c17" class="tk">src</a> = <a id="1306c24" class="tk">var</a>-&gt;<a id="1306c29" class="tk">data</a>.<a id="1306c34" class="tk">im</a>;</td></tr>
<tr name="1307" id="1307">
<td><a id="l1307" class='ln'>1307</a></td><td> <span class="kw">for</span> (<a id="1307c22" class="tk">k</a>=0; <a id="1307c27" class="tk">k</a><a id="1307c28" class="tk">&lt;</a><a id="1307c29" class="tk">nEl</a>; <a id="1307c34" class="tk">k</a><a id="1307c35" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1308" id="1308">
<td><a id="l1308" class='ln'>1308</a></td><td> <a id="1308c21" class="tk">int_T</a> <a id="1308c27" class="tk">kT</a> = <a id="1308c34" class="tk">nRows</a><a id="1308c39" class="tk">*</a>(<a id="1308c41" class="tk">k</a><a id="1308c42" class="tk">%</a><a id="1308c43" class="tk">nCols</a>) <a id="1308c50" class="tk">+</a> (<a id="1308c53" class="tk">k</a><a id="1308c54" class="tk">/</a><a id="1308c55" class="tk">nCols</a>);</td></tr>
<tr name="1309" id="1309">
<td><a id="l1309" class='ln'>1309</a></td><td> <span class="kw">char</span> <a id="1309c27" class="tk">*</a><a id="1309c28" class="tk">dst</a> = <a id="1309c34" class="tk">pmiT</a> <a id="1309c39" class="tk">+</a> <a id="1309c41" class="tk">kT</a><a id="1309c43" class="tk">*</a><a id="1309c44" class="tk">elSize</a>;</td></tr>
<tr name="1310" id="1310">
<td><a id="l1310" class='ln'>1310</a></td><td> (<span class="kw">void</span>)<a id="1310c27" class="tk">memcpy</a>(<a id="1310c34" class="tk">dst</a>, <a id="1310c39" class="tk">src</a>, <a id="1310c44" class="tk">elSize</a>);</td></tr>
<tr name="1311" id="1311">
<td><a id="l1311" class='ln'>1311</a></td><td> <a id="1311c21" class="tk">src</a> <a id="1311c25" class="tk">+=</a> <a id="1311c28" class="tk">elSize</a>;</td></tr>
<tr name="1312" id="1312">
<td><a id="l1312" class='ln'>1312</a></td><td> <span class="br">}</span></td></tr>
<tr name="1313" id="1313">
<td><a id="l1313" class='ln'>1313</a></td><td> <a id="1313c17" class="tk">var</a>-&gt;<a id="1313c22" class="tk">data</a>.<a id="1313c27" class="tk">re</a> = <a id="1313c32" class="tk">var</a>-&gt;<a id="1313c37" class="tk">data</a>.<a id="1313c42" class="tk">im</a>;</td></tr>
<tr name="1314" id="1314">
<td><a id="l1314" class='ln'>1314</a></td><td> <a id="1314c17" class="tk">var</a>-&gt;<a id="1314c22" class="tk">data</a>.<a id="1314c27" class="tk">im</a> = <a id="1314c32" class="tk">pmiT</a>;</td></tr>
<tr name="1315" id="1315">
<td><a id="l1315" class='ln'>1315</a></td><td> <span class="br">}</span></td></tr>
<tr name="1316" id="1316">
<td><a id="l1316" class='ln'>1316</a></td><td> <a id="1316c13" class="tk">FREE</a>(<a id="1316c18" class="tk">var</a>-&gt;<a id="1316c23" class="tk">data</a>.<a id="1316c28" class="tk">re</a>);</td></tr>
<tr name="1317" id="1317">
<td><a id="l1317" class='ln'>1317</a></td><td> <a id="1317c13" class="tk">var</a>-&gt;<a id="1317c18" class="tk">data</a>.<a id="1317c23" class="tk">re</a> = <a id="1317c28" class="tk">pmT</a>;</td></tr>
<tr name="1318" id="1318">
<td><a id="l1318" class='ln'>1318</a></td><td> <span class="br">}</span></td></tr>
<tr name="1319" id="1319">
<td><a id="l1319" class='ln'>1319</a></td><td> <span class="br">}</span> <span class="ct">/* Transpose? */</span></td></tr>
<tr name="1320" id="1320">
<td><a id="l1320" class='ln'>1320</a></td><td></td></tr>
<tr name="1321" id="1321">
<td><a id="l1321" class='ln'>1321</a></td><td> <span class="kw">if</span> (<a id="1321c9" class="tk">var</a>-&gt;<a id="1321c14" class="tk">wrapped</a> <a id="1321c22" class="tk">&gt;</a> 0 <a id="1321c26" class="tk">&amp;&amp;</a> <a id="1321c29" class="tk">var</a>-&gt;<a id="1321c34" class="tk">rowIdx</a> <a id="1321c41" class="tk">!=</a> 0 ) <span class="br">{</span> <span class="ct">/* Rotate? */</span></td></tr>
<tr name="1322" id="1322">
<td><a id="l1322" class='ln'>1322</a></td><td> <a id="1322c9" class="tk">char_T</a> <a id="1322c16" class="tk">*</a><a id="1322c17" class="tk">buffer</a> = <a id="1322c29" class="tk">var</a>-&gt;<a id="1322c34" class="tk">data</a>.<a id="1322c39" class="tk">re</a>;</td></tr>
<tr name="1323" id="1323">
<td><a id="l1323" class='ln'>1323</a></td><td> <a id="1323c9" class="tk">int_T</a> <a id="1323c16" class="tk">done</a> = 0; <span class="ct">/* done: 0 (1) rotate real (imag) part. */</span></td></tr>
<tr name="1324" id="1324">
<td><a id="l1324" class='ln'>1324</a></td><td></td></tr>
<tr name="1325" id="1325">
<td><a id="l1325" class='ln'>1325</a></td><td> <span class="kw">do</span> <span class="br">{</span></td></tr>
<tr name="1326" id="1326">
<td><a id="l1326" class='ln'>1326</a></td><td> <a id="1326c13" class="tk">char_T</a> <a id="1326c20" class="tk">*</a><a id="1326c21" class="tk">col</a> = <a id="1326c33" class="tk">buffer</a>;</td></tr>
<tr name="1327" id="1327">
<td><a id="l1327" class='ln'>1327</a></td><td> <a id="1327c13" class="tk">int_T</a> <a id="1327c20" class="tk">rowOffset</a> = (<a id="1327c34" class="tk">int_T</a>)((<a id="1327c42" class="tk">nDims</a> <a id="1327c48" class="tk">==</a> 1) <a id="1327c54" class="tk">?</a> (<a id="1327c57" class="tk">elSize</a>) <a id="1327c65" class="tk">:</a> (<a id="1327c68" class="tk">elSize</a> <a id="1327c75" class="tk">*</a> <a id="1327c77" class="tk">nCols</a>));</td></tr>
<tr name="1328" id="1328">
<td><a id="l1328" class='ln'>1328</a></td><td> <a id="1328c13" class="tk">int_T</a> <a id="1328c20" class="tk">colOffset</a> = (<a id="1328c34" class="tk">int_T</a>)((<a id="1328c42" class="tk">nDims</a> <a id="1328c48" class="tk">==</a> 1)<a id="1328c53" class="tk">?</a> (<a id="1328c57" class="tk">nRows</a><a id="1328c62" class="tk">*</a><a id="1328c63" class="tk">elSize</a>) <a id="1328c71" class="tk">:</a> <a id="1328c73" class="tk">elSize</a>);</td></tr>
<tr name="1329" id="1329">
<td><a id="l1329" class='ln'>1329</a></td><td> <a id="1329c13" class="tk">int_T</a> <a id="1329c20" class="tk">zeroIdx</a> = <a id="1329c33" class="tk">var</a>-&gt;<a id="1329c38" class="tk">rowIdx</a>;</td></tr>
<tr name="1330" id="1330">
<td><a id="l1330" class='ln'>1330</a></td><td> <a id="1330c13" class="tk">int_T</a> <a id="1330c20" class="tk">j</a>;</td></tr>
<tr name="1331" id="1331">
<td><a id="l1331" class='ln'>1331</a></td><td></td></tr>
<tr name="1332" id="1332">
<td><a id="l1332" class='ln'>1332</a></td><td> <span class="kw">for</span> (<a id="1332c18" class="tk">j</a> = 0 ; <a id="1332c26" class="tk">j</a> <a id="1332c28" class="tk">&lt;</a> <a id="1332c30" class="tk">nCols</a>; <a id="1332c37" class="tk">++</a><a id="1332c39" class="tk">j</a>, <a id="1332c42" class="tk">col</a> <a id="1332c46" class="tk">+=</a> <a id="1332c49" class="tk">colOffset</a>) <span class="br">{</span></td></tr>
<tr name="1333" id="1333">
<td><a id="l1333" class='ln'>1333</a></td><td> <a id="1333c17" class="tk">int_T</a> <a id="1333c25" class="tk">swapCount</a>;</td></tr>
<tr name="1334" id="1334">
<td><a id="l1334" class='ln'>1334</a></td><td> <a id="1334c17" class="tk">int_T</a> <a id="1334c25" class="tk">srcIdx</a>;</td></tr>
<tr name="1335" id="1335">
<td><a id="l1335" class='ln'>1335</a></td><td> <a id="1335c17" class="tk">int_T</a> <a id="1335c25" class="tk">dstIdx</a>;</td></tr>
<tr name="1336" id="1336">
<td><a id="l1336" class='ln'>1336</a></td><td> <a id="1336c17" class="tk">int_T</a> <a id="1336c25" class="tk">tmpIdx</a>;</td></tr>
<tr name="1337" id="1337">
<td><a id="l1337" class='ln'>1337</a></td><td> <a id="1337c17" class="tk">MatReal</a> <a id="1337c25" class="tk">tmp</a>;</td></tr>
<tr name="1338" id="1338">
<td><a id="l1338" class='ln'>1338</a></td><td></td></tr>
<tr name="1339" id="1339">
<td><a id="l1339" class='ln'>1339</a></td><td> <span class="kw">for</span> (<a id="1339c22" class="tk">tmpIdx</a>=0, <a id="1339c32" class="tk">swapCount</a>=0; <a id="1339c45" class="tk">swapCount</a> <a id="1339c55" class="tk">&lt;</a> <a id="1339c57" class="tk">nRows</a>; <a id="1339c64" class="tk">tmpIdx</a><a id="1339c70" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1340" id="1340">
<td><a id="l1340" class='ln'>1340</a></td><td> (<span class="kw">void</span>)<a id="1340c27" class="tk">memcpy</a>(<a id="1340c34" class="tk">&amp;</a><a id="1340c35" class="tk">tmp</a>, <a id="1340c40" class="tk">col</a> <a id="1340c44" class="tk">+</a> <a id="1340c46" class="tk">tmpIdx</a><a id="1340c52" class="tk">*</a><a id="1340c53" class="tk">rowOffset</a>, <a id="1340c64" class="tk">elSize</a>);</td></tr>
<tr name="1341" id="1341">
<td><a id="l1341" class='ln'>1341</a></td><td></td></tr>
<tr name="1342" id="1342">
<td><a id="l1342" class='ln'>1342</a></td><td> <a id="1342c21" class="tk">dstIdx</a>=<a id="1342c28" class="tk">tmpIdx</a>; </td></tr>
<tr name="1343" id="1343">
<td><a id="l1343" class='ln'>1343</a></td><td> <a id="1343c21" class="tk">srcIdx</a> = ((<a id="1343c32" class="tk">dstIdx</a> <a id="1343c39" class="tk">+</a> <a id="1343c41" class="tk">zeroIdx</a>) <a id="1343c50" class="tk">%</a> <a id="1343c52" class="tk">nRows</a>);</td></tr>
<tr name="1344" id="1344">
<td><a id="l1344" class='ln'>1344</a></td><td> <span class="kw">while</span> (<a id="1344c28" class="tk">srcIdx</a> <a id="1344c35" class="tk">!=</a> <a id="1344c38" class="tk">tmpIdx</a>) <span class="br">{</span></td></tr>
<tr name="1345" id="1345">
<td><a id="l1345" class='ln'>1345</a></td><td> (<span class="kw">void</span>)<a id="1345c31" class="tk">memcpy</a>(<a id="1345c38" class="tk">col</a> <a id="1345c42" class="tk">+</a> <a id="1345c44" class="tk">dstIdx</a><a id="1345c50" class="tk">*</a><a id="1345c51" class="tk">rowOffset</a>,</td></tr>
<tr name="1346" id="1346">
<td><a id="l1346" class='ln'>1346</a></td><td> <a id="1346c38" class="tk">col</a> <a id="1346c42" class="tk">+</a> <a id="1346c44" class="tk">srcIdx</a><a id="1346c50" class="tk">*</a><a id="1346c51" class="tk">rowOffset</a>,</td></tr>
<tr name="1347" id="1347">
<td><a id="l1347" class='ln'>1347</a></td><td> <a id="1347c38" class="tk">elSize</a>);</td></tr>
<tr name="1348" id="1348">
<td><a id="l1348" class='ln'>1348</a></td><td> <a id="1348c25" class="tk">++</a><a id="1348c27" class="tk">swapCount</a>;</td></tr>
<tr name="1349" id="1349">
<td><a id="l1349" class='ln'>1349</a></td><td> <a id="1349c25" class="tk">dstIdx</a> = <a id="1349c34" class="tk">srcIdx</a>;</td></tr>
<tr name="1350" id="1350">
<td><a id="l1350" class='ln'>1350</a></td><td> <a id="1350c25" class="tk">srcIdx</a> = ((<a id="1350c36" class="tk">dstIdx</a> <a id="1350c43" class="tk">+</a> <a id="1350c45" class="tk">zeroIdx</a>) <a id="1350c54" class="tk">%</a> <a id="1350c56" class="tk">nRows</a>);</td></tr>
<tr name="1351" id="1351">
<td><a id="l1351" class='ln'>1351</a></td><td> </td></tr>
<tr name="1352" id="1352">
<td><a id="l1352" class='ln'>1352</a></td><td> <span class="br">}</span></td></tr>
<tr name="1353" id="1353">
<td><a id="l1353" class='ln'>1353</a></td><td> (<span class="kw">void</span>)<a id="1353c27" class="tk">memcpy</a>(<a id="1353c34" class="tk">col</a> <a id="1353c38" class="tk">+</a> <a id="1353c40" class="tk">dstIdx</a><a id="1353c46" class="tk">*</a><a id="1353c47" class="tk">rowOffset</a>, <a id="1353c58" class="tk">&amp;</a><a id="1353c59" class="tk">tmp</a>, <a id="1353c64" class="tk">elSize</a>);</td></tr>
<tr name="1354" id="1354">
<td><a id="l1354" class='ln'>1354</a></td><td> <a id="1354c21" class="tk">++</a><a id="1354c23" class="tk">swapCount</a>;</td></tr>
<tr name="1355" id="1355">
<td><a id="l1355" class='ln'>1355</a></td><td> <span class="br">}</span></td></tr>
<tr name="1356" id="1356">
<td><a id="l1356" class='ln'>1356</a></td><td> <span class="br">}</span></td></tr>
<tr name="1357" id="1357">
<td><a id="l1357" class='ln'>1357</a></td><td> <a id="1357c13" class="tk">done</a> <a id="1357c18" class="tk">++</a>;</td></tr>
<tr name="1358" id="1358">
<td><a id="l1358" class='ln'>1358</a></td><td> <span class="ct">/* need to rotate the imaginary part */</span></td></tr>
<tr name="1359" id="1359">
<td><a id="l1359" class='ln'>1359</a></td><td> <span class="br">}</span> <span class="kw">while</span> ((<a id="1359c19" class="tk">done</a> <a id="1359c24" class="tk">==</a> 1) <a id="1359c30" class="tk">&amp;&amp;</a> ((<a id="1359c35" class="tk">buffer</a> = <a id="1359c44" class="tk">var</a>-&gt;<a id="1359c49" class="tk">data</a>.<a id="1359c54" class="tk">im</a>) <a id="1359c58" class="tk">!=</a> <a id="1359c61" class="tk">NULL</a>));</td></tr>
<tr name="1360" id="1360">
<td><a id="l1360" class='ln'>1360</a></td><td></td></tr>
<tr name="1361" id="1361">
<td><a id="l1361" class='ln'>1361</a></td><td> <a id="1361c9" class="tk">var</a>-&gt;<a id="1361c14" class="tk">rowIdx</a> = 0;</td></tr>
<tr name="1362" id="1362">
<td><a id="l1362" class='ln'>1362</a></td><td> <span class="br">}</span> <span class="ct">/* Rotate? */</span></td></tr>
<tr name="1363" id="1363">
<td><a id="l1363" class='ln'>1363</a></td><td></td></tr>
<tr name="1364" id="1364">
<td><a id="l1364" class='ln'>1364</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="1365" id="1365">
<td><a id="l1365" class='ln'>1365</a></td><td><span class="ct"> * We might have allocated more number of rows than the number of data</span></td></tr>
<tr name="1366" id="1366">
<td><a id="l1366" class='ln'>1366</a></td><td><span class="ct"> * points that have been logged, in which case set nRows to nDataPoints</span></td></tr>
<tr name="1367" id="1367">
<td><a id="l1367" class='ln'>1367</a></td><td><span class="ct"> * so that only these values get saved.</span></td></tr>
<tr name="1368" id="1368">
<td><a id="l1368" class='ln'>1368</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1369" id="1369">
<td><a id="l1369" class='ln'>1369</a></td><td> <span class="kw">if</span> (<a id="1369c9" class="tk">var</a>-&gt;<a id="1369c14" class="tk">nDataPoints</a> <a id="1369c26" class="tk">&lt;</a> <a id="1369c28" class="tk">var</a>-&gt;<a id="1369c33" class="tk">data</a>.<a id="1369c38" class="tk">nRows</a>) <span class="br">{</span></td></tr>
<tr name="1370" id="1370">
<td><a id="l1370" class='ln'>1370</a></td><td> <a id="1370c9" class="tk">var</a>-&gt;<a id="1370c14" class="tk">data</a>.<a id="1370c19" class="tk">nRows</a> = <a id="1370c27" class="tk">var</a>-&gt;<a id="1370c32" class="tk">nDataPoints</a>;</td></tr>
<tr name="1371" id="1371">
<td><a id="l1371" class='ln'>1371</a></td><td> <span class="kw">if</span>(<a id="1371c12" class="tk">var</a>-&gt;<a id="1371c17" class="tk">valDims</a> <a id="1371c25" class="tk">!=</a> <a id="1371c28" class="tk">NULL</a>)<span class="br">{</span></td></tr>
<tr name="1372" id="1372">
<td><a id="l1372" class='ln'>1372</a></td><td> <a id="1372c13" class="tk">size_t</a> <a id="1372c20" class="tk">elSizeValDims</a> = <span class="kw">sizeof</span>(<a id="1372c43" class="tk">real_T</a>);</td></tr>
<tr name="1373" id="1373">
<td><a id="l1373" class='ln'>1373</a></td><td> <a id="1373c13" class="tk">int_T</a> <a id="1373c20" class="tk">k</a>;</td></tr>
<tr name="1374" id="1374">
<td><a id="l1374" class='ln'>1374</a></td><td> <a id="1374c13" class="tk">real_T</a> <a id="1374c20" class="tk">*</a><a id="1374c21" class="tk">dimsData</a> = <a id="1374c32" class="tk">var</a>-&gt;<a id="1374c37" class="tk">valDims</a>-&gt;<a id="1374c46" class="tk">dimsData</a> <a id="1374c55" class="tk">+</a> <a id="1374c57" class="tk">nRows</a>;</td></tr>
<tr name="1375" id="1375">
<td><a id="l1375" class='ln'>1375</a></td><td> <span class="ct">/* </span></td></tr>
<tr name="1376" id="1376">
<td><a id="l1376" class='ln'>1376</a></td><td><span class="ct"> Keep nRows of values and that of valueDimensions consistent </span></td></tr>
<tr name="1377" id="1377">
<td><a id="l1377" class='ln'>1377</a></td><td><span class="ct"> for variable-size signals.</span></td></tr>
<tr name="1378" id="1378">
<td><a id="l1378" class='ln'>1378</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1379" id="1379">
<td><a id="l1379" class='ln'>1379</a></td><td> <a id="1379c13" class="tk">var</a>-&gt;<a id="1379c18" class="tk">valDims</a>-&gt;<a id="1379c27" class="tk">nRows</a> = <a id="1379c35" class="tk">var</a>-&gt;<a id="1379c40" class="tk">data</a>.<a id="1379c45" class="tk">nRows</a>;</td></tr>
<tr name="1380" id="1380">
<td><a id="l1380" class='ln'>1380</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="1381" id="1381">
<td><a id="l1381" class='ln'>1381</a></td><td><span class="ct"> Also need to move data when shrinking the array size,</span></td></tr>
<tr name="1382" id="1382">
<td><a id="l1382" class='ln'>1382</a></td><td><span class="ct"> because valueDimensions data is stored in array format. </span></td></tr>
<tr name="1383" id="1383">
<td><a id="l1383" class='ln'>1383</a></td><td><span class="ct"> e.g. maxRows = 4; nRows = 2; nDims = 3;</span></td></tr>
<tr name="1384" id="1384">
<td><a id="l1384" class='ln'>1384</a></td><td><span class="ct"> Before fixing up the logVar, the locations of data are as below:</span></td></tr>
<tr name="1385" id="1385">
<td><a id="l1385" class='ln'>1385</a></td><td><span class="ct"> (x, y, z -- useful data / o -- junk)</span></td></tr>
<tr name="1386" id="1386">
<td><a id="l1386" class='ln'>1386</a></td><td><span class="ct"> a[0] = x a[4] = y a[8] = z</span></td></tr>
<tr name="1387" id="1387">
<td><a id="l1387" class='ln'>1387</a></td><td><span class="ct"> a[1] = x a[5] = y a[9] = z</span></td></tr>
<tr name="1388" id="1388">
<td><a id="l1388" class='ln'>1388</a></td><td><span class="ct"> a[2] = o a[6] = o a[10]= o</span></td></tr>
<tr name="1389" id="1389">
<td><a id="l1389" class='ln'>1389</a></td><td><span class="ct"> a[3] = o a[7] = o a[11]= o</span></td></tr>
<tr name="1390" id="1390">
<td><a id="l1390" class='ln'>1390</a></td><td><span class="ct"> After fixing up the logVar, we want the data to be stored as:</span></td></tr>
<tr name="1391" id="1391">
<td><a id="l1391" class='ln'>1391</a></td><td><span class="ct"> a[0] = x a[4] = z a[8] = o</span></td></tr>
<tr name="1392" id="1392">
<td><a id="l1392" class='ln'>1392</a></td><td><span class="ct"> a[1] = x a[5] = z a[9] = o</span></td></tr>
<tr name="1393" id="1393">
<td><a id="l1393" class='ln'>1393</a></td><td><span class="ct"> a[2] = y a[6] = o a[10]= o</span></td></tr>
<tr name="1394" id="1394">
<td><a id="l1394" class='ln'>1394</a></td><td><span class="ct"> a[3] = y a[7] = o a[11]= o</span></td></tr>
<tr name="1395" id="1395">
<td><a id="l1395" class='ln'>1395</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1396" id="1396">
<td><a id="l1396" class='ln'>1396</a></td><td> <span class="kw">for</span>(<a id="1396c17" class="tk">k</a> = 1; <a id="1396c24" class="tk">k</a> <a id="1396c26" class="tk">&lt;</a> <a id="1396c28" class="tk">nDims</a>; <a id="1396c35" class="tk">k</a><a id="1396c36" class="tk">++</a>)<span class="br">{</span></td></tr>
<tr name="1397" id="1397">
<td><a id="l1397" class='ln'>1397</a></td><td> (<span class="kw">void</span>) <a id="1397c24" class="tk">memmove</a>(<a id="1397c32" class="tk">dimsData</a>, </td></tr>
<tr name="1398" id="1398">
<td><a id="l1398" class='ln'>1398</a></td><td> <a id="1398c31" class="tk">var</a>-&gt;<a id="1398c36" class="tk">valDims</a>-&gt;<a id="1398c45" class="tk">dimsData</a> <a id="1398c54" class="tk">+</a> <a id="1398c56" class="tk">k</a><a id="1398c57" class="tk">*</a><a id="1398c58" class="tk">maxRows</a>,</td></tr>
<tr name="1399" id="1399">
<td><a id="l1399" class='ln'>1399</a></td><td> <a id="1399c31" class="tk">elSizeValDims</a> <a id="1399c45" class="tk">*</a> <a id="1399c47" class="tk">nRows</a>);</td></tr>
<tr name="1400" id="1400">
<td><a id="l1400" class='ln'>1400</a></td><td> <a id="1400c17" class="tk">dimsData</a> <a id="1400c26" class="tk">+=</a> <a id="1400c29" class="tk">nRows</a>;</td></tr>
<tr name="1401" id="1401">
<td><a id="l1401" class='ln'>1401</a></td><td> <span class="br">}</span></td></tr>
<tr name="1402" id="1402">
<td><a id="l1402" class='ln'>1402</a></td><td> <span class="br">}</span></td></tr>
<tr name="1403" id="1403">
<td><a id="l1403" class='ln'>1403</a></td><td> <span class="br">}</span></td></tr>
<tr name="1404" id="1404">
<td><a id="l1404" class='ln'>1404</a></td><td> <span class="kw">return</span>(<a id="1404c12" class="tk">NULL</a>);</td></tr>
<tr name="1405" id="1405">
<td><a id="l1405" class='ln'>1405</a></td><td></td></tr>
<tr name="1406" id="1406">
<td><a id="l1406" class='ln'>1406</a></td><td><span class="br">}</span> <span class="ct">/* end rt_FixupLogVar */</span></td></tr>
<tr name="1407" id="1407">
<td><a id="l1407" class='ln'>1407</a></td><td></td></tr>
<tr name="1408" id="1408">
<td><a id="l1408" class='ln'>1408</a></td><td></td></tr>
<tr name="1409" id="1409">
<td><a id="l1409" class='ln'>1409</a></td><td><span class="ct">/* Function: rt_LoadModifiedLogVarName =========================================</span></td></tr>
<tr name="1410" id="1410">
<td><a id="l1410" class='ln'>1410</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1411" id="1411">
<td><a id="l1411" class='ln'>1411</a></td><td><span class="ct"> * The name of the logged variable is obtained from the input argument</span></td></tr>
<tr name="1412" id="1412">
<td><a id="l1412" class='ln'>1412</a></td><td><span class="ct"> * varName and the nameModifier which is obtained from the simstruct. If</span></td></tr>
<tr name="1413" id="1413">
<td><a id="l1413" class='ln'>1413</a></td><td><span class="ct"> * the nameModifier begins with an '_', then nameModifier is post-pended to</span></td></tr>
<tr name="1414" id="1414">
<td><a id="l1414" class='ln'>1414</a></td><td><span class="ct"> * varName to obtain the name of the logged variable. If the first</span></td></tr>
<tr name="1415" id="1415">
<td><a id="l1415" class='ln'>1415</a></td><td><span class="ct"> * character does not begin with an '_', then the nameModifier is</span></td></tr>
<tr name="1416" id="1416">
<td><a id="l1416" class='ln'>1416</a></td><td><span class="ct"> * pre-pended to varName.</span></td></tr>
<tr name="1417" id="1417">
<td><a id="l1417" class='ln'>1417</a></td><td><span class="ct"> *</span></td></tr>
<tr name="1418" id="1418">
<td><a id="l1418" class='ln'>1418</a></td><td><span class="ct"> * Examples:</span></td></tr>
<tr name="1419" id="1419">
<td><a id="l1419" class='ln'>1419</a></td><td><span class="ct"> * a) varName = "tout" &amp; nameModifier = "_rt" =&gt; logVarName = "tout_rt"</span></td></tr>
<tr name="1420" id="1420">
<td><a id="l1420" class='ln'>1420</a></td><td><span class="ct"> * b) varName = "tout" &amp; nameModifier = "rt_" =&gt; logVarName = "rt_tout"</span></td></tr>
<tr name="1421" id="1421">
<td><a id="l1421" class='ln'>1421</a></td><td><span class="ct"> * c) varName = "tout" &amp; nameModifier = "none" =&gt; logVarName = "tout"</span></td></tr>
<tr name="1422" id="1422">
<td><a id="l1422" class='ln'>1422</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1423" id="1423">
<td><a id="l1423" class='ln'>1423</a></td><td><span class="kw">static</span> <span class="kw">void</span> <a id="1423c13" class="tk">rt_LoadModifiedLogVarName</a>(<span class="kw">const</span> <a id="1423c45" class="tk">RTWLogInfo</a> <a id="1423c56" class="tk">*</a><a id="1423c57" class="tk">li</a>, <span class="ct">/* in */</span></td></tr>
<tr name="1424" id="1424">
<td><a id="l1424" class='ln'>1424</a></td><td> <span class="kw">const</span> <span class="kw">char</span> <a id="1424c56" class="tk">*</a><a id="1424c57" class="tk">varName</a>, <span class="ct">/* in */</span></td></tr>
<tr name="1425" id="1425">
<td><a id="l1425" class='ln'>1425</a></td><td> <span class="kw">char</span> <a id="1425c56" class="tk">*</a><a id="1425c57" class="tk">logVarName</a>) <span class="ct">/* out */</span></td></tr>
<tr name="1426" id="1426">
<td><a id="l1426" class='ln'>1426</a></td><td><span class="br">{</span></td></tr>
<tr name="1427" id="1427">
<td><a id="l1427" class='ln'>1427</a></td><td> <a id="1427c5" class="tk">int_T</a> <a id="1427c18" class="tk">nameLen</a>;</td></tr>
<tr name="1428" id="1428">
<td><a id="l1428" class='ln'>1428</a></td><td> <span class="kw">const</span> <a id="1428c11" class="tk">char_T</a> <a id="1428c18" class="tk">*</a><a id="1428c19" class="tk">nameModifier</a> = <a id="1428c34" class="tk">rtliGetLogVarNameModifier</a>(<a id="1428c60" class="tk">li</a>);</td></tr>
<tr name="1429" id="1429">
<td><a id="l1429" class='ln'>1429</a></td><td></td></tr>
<tr name="1430" id="1430">
<td><a id="l1430" class='ln'>1430</a></td><td> <span class="kw">if</span> (<a id="1430c9" class="tk">nameModifier</a> <a id="1430c22" class="tk">!=</a> <a id="1430c25" class="tk">NULL</a> <a id="1430c30" class="tk">&amp;&amp;</a> <a id="1430c33" class="tk">strcmp</a>(<a id="1430c40" class="tk">nameModifier</a>,"none")<a id="1430c60" class="tk">==</a>0) <span class="br">{</span></td></tr>
<tr name="1431" id="1431">
<td><a id="l1431" class='ln'>1431</a></td><td> <a id="1431c9" class="tk">nameModifier</a> = <a id="1431c24" class="tk">NULL</a>;</td></tr>
<tr name="1432" id="1432">
<td><a id="l1432" class='ln'>1432</a></td><td> <span class="br">}</span></td></tr>
<tr name="1433" id="1433">
<td><a id="l1433" class='ln'>1433</a></td><td></td></tr>
<tr name="1434" id="1434">
<td><a id="l1434" class='ln'>1434</a></td><td> <a id="1434c5" class="tk">logVarName</a>[<a id="1434c16" class="tk">mxMAXNAM</a><a id="1434c24" class="tk">-</a>1] = '\0';</td></tr>
<tr name="1435" id="1435">
<td><a id="l1435" class='ln'>1435</a></td><td> <span class="kw">if</span> (<a id="1435c9" class="tk">nameModifier</a> <a id="1435c22" class="tk">==</a> <a id="1435c25" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1436" id="1436">
<td><a id="l1436" class='ln'>1436</a></td><td> (<span class="kw">void</span>)<a id="1436c15" class="tk">strncpy</a>(<a id="1436c23" class="tk">logVarName</a>, <a id="1436c35" class="tk">varName</a>, <a id="1436c44" class="tk">mxMAXNAM</a><a id="1436c52" class="tk">-</a>1);</td></tr>
<tr name="1437" id="1437">
<td><a id="l1437" class='ln'>1437</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="1437c16" class="tk">nameModifier</a>[0] <a id="1437c32" class="tk">==</a> '_') <span class="br">{</span></td></tr>
<tr name="1438" id="1438">
<td><a id="l1438" class='ln'>1438</a></td><td> (<span class="kw">void</span>)<a id="1438c15" class="tk">strncpy</a>(<a id="1438c23" class="tk">logVarName</a>, <a id="1438c35" class="tk">varName</a>, <a id="1438c44" class="tk">mxMAXNAM</a><a id="1438c52" class="tk">-</a>1);</td></tr>
<tr name="1439" id="1439">
<td><a id="l1439" class='ln'>1439</a></td><td> <a id="1439c9" class="tk">nameLen</a> = (<a id="1439c20" class="tk">int_T</a>)<a id="1439c26" class="tk">strlen</a>(<a id="1439c33" class="tk">logVarName</a>);</td></tr>
<tr name="1440" id="1440">
<td><a id="l1440" class='ln'>1440</a></td><td> (<span class="kw">void</span>)<a id="1440c15" class="tk">strncat</a>(<a id="1440c23" class="tk">logVarName</a>, <a id="1440c35" class="tk">nameModifier</a>, (<a id="1440c50" class="tk">size_t</a>)<a id="1440c57" class="tk">mxMAXNAM</a><a id="1440c65" class="tk">-</a>1<a id="1440c67" class="tk">-</a><a id="1440c68" class="tk">nameLen</a>);</td></tr>
<tr name="1441" id="1441">
<td><a id="l1441" class='ln'>1441</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1442" id="1442">
<td><a id="l1442" class='ln'>1442</a></td><td> (<span class="kw">void</span>)<a id="1442c15" class="tk">strncpy</a>(<a id="1442c23" class="tk">logVarName</a>, <a id="1442c35" class="tk">nameModifier</a>, <a id="1442c49" class="tk">mxMAXNAM</a><a id="1442c57" class="tk">-</a>1);</td></tr>
<tr name="1443" id="1443">
<td><a id="l1443" class='ln'>1443</a></td><td> <a id="1443c9" class="tk">nameLen</a> = (<a id="1443c20" class="tk">int_T</a>)<a id="1443c26" class="tk">strlen</a>(<a id="1443c33" class="tk">logVarName</a>);</td></tr>
<tr name="1444" id="1444">
<td><a id="l1444" class='ln'>1444</a></td><td> (<span class="kw">void</span>)<a id="1444c15" class="tk">strncat</a>(<a id="1444c23" class="tk">logVarName</a>, <a id="1444c35" class="tk">varName</a>, (<a id="1444c45" class="tk">size_t</a>)<a id="1444c52" class="tk">mxMAXNAM</a><a id="1444c60" class="tk">-</a>1<a id="1444c62" class="tk">-</a><a id="1444c63" class="tk">nameLen</a>);</td></tr>
<tr name="1445" id="1445">
<td><a id="l1445" class='ln'>1445</a></td><td> <span class="br">}</span></td></tr>
<tr name="1446" id="1446">
<td><a id="l1446" class='ln'>1446</a></td><td></td></tr>
<tr name="1447" id="1447">
<td><a id="l1447" class='ln'>1447</a></td><td><span class="br">}</span> <span class="ct">/* end rt_LoadModifiedLogVarName */</span></td></tr>
<tr name="1448" id="1448">
<td><a id="l1448" class='ln'>1448</a></td><td></td></tr>
<tr name="1449" id="1449">
<td><a id="l1449" class='ln'>1449</a></td><td></td></tr>
<tr name="1450" id="1450">
<td><a id="l1450" class='ln'>1450</a></td><td><span class="ct">/* Function: rt_GetActualDTypeID ===============================================</span></td></tr>
<tr name="1451" id="1451">
<td><a id="l1451" class='ln'>1451</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1452" id="1452">
<td><a id="l1452" class='ln'>1452</a></td><td><span class="ct"> * Given a built-in data type id, return the actual data type id.</span></td></tr>
<tr name="1453" id="1453">
<td><a id="l1453" class='ln'>1453</a></td><td><span class="ct"> * The only time these are different is when real_T has been mapped</span></td></tr>
<tr name="1454" id="1454">
<td><a id="l1454" class='ln'>1454</a></td><td><span class="ct"> * to a single.</span></td></tr>
<tr name="1455" id="1455">
<td><a id="l1455" class='ln'>1455</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1456" id="1456">
<td><a id="l1456" class='ln'>1456</a></td><td><span class="pp">#if</span> <a id="1456c5" class="tk">defined</a>(<a id="1456c13" class="tk">_MSC_VER</a>)</td></tr>
<tr name="1457" id="1457">
<td><a id="l1457" class='ln'>1457</a></td><td> <span class="pp">#pragma</span> <a id="1457c10" class="tk">warning</a>(<a id="1457c18" class="tk">push</a>)</td></tr>
<tr name="1458" id="1458">
<td><a id="l1458" class='ln'>1458</a></td><td> <span class="pp">#pragma</span> <a id="1458c10" class="tk">warning</a>(<a id="1458c18" class="tk">disable</a><a id="1458c25" class="tk">:</a> 4127)</td></tr>
<tr name="1459" id="1459">
<td><a id="l1459" class='ln'>1459</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="1460" id="1460">
<td><a id="l1460" class='ln'>1460</a></td><td><span class="kw">static</span> <a id="1460c8" class="tk">BuiltInDTypeId</a> <a id="1460c23" class="tk">rt_GetActualDTypeID</a>(<a id="1460c43" class="tk">BuiltInDTypeId</a> <a id="1460c58" class="tk">dTypeID</a>)</td></tr>
<tr name="1461" id="1461">
<td><a id="l1461" class='ln'>1461</a></td><td><span class="br">{</span></td></tr>
<tr name="1462" id="1462">
<td><a id="l1462" class='ln'>1462</a></td><td> <span class="ct">/*LINTED E_FALSE_LOGICAL_EXPR*/</span></td></tr>
<tr name="1463" id="1463">
<td><a id="l1463" class='ln'>1463</a></td><td> <span class="kw">if</span> (<a id="1463c9" class="tk">dTypeID</a> <a id="1463c17" class="tk">==</a> <a id="1463c20" class="tk">SS_DOUBLE</a> <a id="1463c30" class="tk">&amp;&amp;</a> <span class="kw">sizeof</span>(<a id="1463c40" class="tk">real_T</a>) <a id="1463c48" class="tk">!=</a> 8) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE </span></td></tr>
<tr name="1464" id="1464">
<td><a id="l1464" class='ln'>1464</a></td><td><span class="ct"> [Not a defect:Unset] </span></td></tr>
<tr name="1465" id="1465">
<td><a id="l1465" class='ln'>1465</a></td><td><span class="ct"> "Needed for when real_T has been </span></td></tr>
<tr name="1466" id="1466">
<td><a id="l1466" class='ln'>1466</a></td><td><span class="ct"> mapped to a single" */</span></td></tr>
<tr name="1467" id="1467">
<td><a id="l1467" class='ln'>1467</a></td><td> <span class="kw">return</span>(<a id="1467c16" class="tk">SS_SINGLE</a>);</td></tr>
<tr name="1468" id="1468">
<td><a id="l1468" class='ln'>1468</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1469" id="1469">
<td><a id="l1469" class='ln'>1469</a></td><td> <span class="kw">return</span>(<a id="1469c16" class="tk">dTypeID</a>);</td></tr>
<tr name="1470" id="1470">
<td><a id="l1470" class='ln'>1470</a></td><td> <span class="br">}</span></td></tr>
<tr name="1471" id="1471">
<td><a id="l1471" class='ln'>1471</a></td><td></td></tr>
<tr name="1472" id="1472">
<td><a id="l1472" class='ln'>1472</a></td><td><span class="br">}</span> <span class="ct">/* end rt_GetActualDTypeID */</span></td></tr>
<tr name="1473" id="1473">
<td><a id="l1473" class='ln'>1473</a></td><td><span class="pp">#if</span> <a id="1473c5" class="tk">defined</a>(<a id="1473c13" class="tk">_MSC_VER</a>)</td></tr>
<tr name="1474" id="1474">
<td><a id="l1474" class='ln'>1474</a></td><td> <span class="pp">#pragma</span> <a id="1474c10" class="tk">warning</a>(<a id="1474c18" class="tk">pop</a>)</td></tr>
<tr name="1475" id="1475">
<td><a id="l1475" class='ln'>1475</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="1476" id="1476">
<td><a id="l1476" class='ln'>1476</a></td><td></td></tr>
<tr name="1477" id="1477">
<td><a id="l1477" class='ln'>1477</a></td><td></td></tr>
<tr name="1478" id="1478">
<td><a id="l1478" class='ln'>1478</a></td><td><span class="ct">/* Function: rt_DestroyLogVar ==================================================</span></td></tr>
<tr name="1479" id="1479">
<td><a id="l1479" class='ln'>1479</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1480" id="1480">
<td><a id="l1480" class='ln'>1480</a></td><td><span class="ct"> * Destroy the log var linked list.</span></td></tr>
<tr name="1481" id="1481">
<td><a id="l1481" class='ln'>1481</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1482" id="1482">
<td><a id="l1482" class='ln'>1482</a></td><td><span class="kw">static</span> <span class="kw">void</span> <a id="1482c13" class="tk">rt_DestroyLogVar</a>(<a id="1482c30" class="tk">LogVar</a> <a id="1482c37" class="tk">*</a><a id="1482c38" class="tk">head</a>)</td></tr>
<tr name="1483" id="1483">
<td><a id="l1483" class='ln'>1483</a></td><td><span class="br">{</span></td></tr>
<tr name="1484" id="1484">
<td><a id="l1484" class='ln'>1484</a></td><td> <span class="kw">while</span>(<a id="1484c11" class="tk">head</a>) <span class="br">{</span></td></tr>
<tr name="1485" id="1485">
<td><a id="l1485" class='ln'>1485</a></td><td> <a id="1485c9" class="tk">LogVar</a> <a id="1485c16" class="tk">*</a><a id="1485c17" class="tk">var</a> = <a id="1485c23" class="tk">head</a>;</td></tr>
<tr name="1486" id="1486">
<td><a id="l1486" class='ln'>1486</a></td><td> <a id="1486c9" class="tk">head</a> = <a id="1486c16" class="tk">var</a>-&gt;<a id="1486c21" class="tk">next</a>;</td></tr>
<tr name="1487" id="1487">
<td><a id="l1487" class='ln'>1487</a></td><td> <a id="1487c9" class="tk">FREE</a>(<a id="1487c14" class="tk">var</a>-&gt;<a id="1487c19" class="tk">data</a>.<a id="1487c24" class="tk">re</a>);</td></tr>
<tr name="1488" id="1488">
<td><a id="l1488" class='ln'>1488</a></td><td> <a id="1488c9" class="tk">FREE</a>(<a id="1488c14" class="tk">var</a>-&gt;<a id="1488c19" class="tk">data</a>.<a id="1488c24" class="tk">im</a>);</td></tr>
<tr name="1489" id="1489">
<td><a id="l1489" class='ln'>1489</a></td><td> <span class="kw">if</span> (<a id="1489c13" class="tk">var</a>-&gt;<a id="1489c18" class="tk">data</a>.<a id="1489c23" class="tk">dims</a> <a id="1489c28" class="tk">!=</a> <a id="1489c31" class="tk">var</a>-&gt;<a id="1489c36" class="tk">data</a>.<a id="1489c41" class="tk">_dims</a>) <span class="br">{</span></td></tr>
<tr name="1490" id="1490">
<td><a id="l1490" class='ln'>1490</a></td><td> <a id="1490c13" class="tk">FREE</a>(<a id="1490c18" class="tk">var</a>-&gt;<a id="1490c23" class="tk">data</a>.<a id="1490c28" class="tk">dims</a>);</td></tr>
<tr name="1491" id="1491">
<td><a id="l1491" class='ln'>1491</a></td><td> <span class="br">}</span></td></tr>
<tr name="1492" id="1492">
<td><a id="l1492" class='ln'>1492</a></td><td> <span class="ct">/* free valDims if necessary */</span></td></tr>
<tr name="1493" id="1493">
<td><a id="l1493" class='ln'>1493</a></td><td> <span class="kw">if</span>(<a id="1493c12" class="tk">var</a>-&gt;<a id="1493c17" class="tk">valDims</a> <a id="1493c25" class="tk">!=</a> <a id="1493c28" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1494" id="1494">
<td><a id="l1494" class='ln'>1494</a></td><td> <a id="1494c13" class="tk">FREE</a>(<a id="1494c18" class="tk">var</a>-&gt;<a id="1494c23" class="tk">valDims</a>-&gt;<a id="1494c32" class="tk">dimsData</a>);</td></tr>
<tr name="1495" id="1495">
<td><a id="l1495" class='ln'>1495</a></td><td> <a id="1495c13" class="tk">FREE</a>(<a id="1495c18" class="tk">var</a>-&gt;<a id="1495c23" class="tk">valDims</a>);</td></tr>
<tr name="1496" id="1496">
<td><a id="l1496" class='ln'>1496</a></td><td> <span class="br">}</span></td></tr>
<tr name="1497" id="1497">
<td><a id="l1497" class='ln'>1497</a></td><td> <span class="ct">/* free coords, strides and currStrides if necessary */</span></td></tr>
<tr name="1498" id="1498">
<td><a id="l1498" class='ln'>1498</a></td><td> <a id="1498c9" class="tk">FREE</a>(<a id="1498c14" class="tk">var</a>-&gt;<a id="1498c19" class="tk">coords</a>);</td></tr>
<tr name="1499" id="1499">
<td><a id="l1499" class='ln'>1499</a></td><td> <a id="1499c9" class="tk">FREE</a>(<a id="1499c14" class="tk">var</a>-&gt;<a id="1499c19" class="tk">strides</a>);</td></tr>
<tr name="1500" id="1500">
<td><a id="l1500" class='ln'>1500</a></td><td> <a id="1500c9" class="tk">FREE</a>(<a id="1500c14" class="tk">var</a>-&gt;<a id="1500c19" class="tk">currStrides</a>);</td></tr>
<tr name="1501" id="1501">
<td><a id="l1501" class='ln'>1501</a></td><td></td></tr>
<tr name="1502" id="1502">
<td><a id="l1502" class='ln'>1502</a></td><td> <a id="1502c9" class="tk">FREE</a>(<a id="1502c14" class="tk">var</a>);</td></tr>
<tr name="1503" id="1503">
<td><a id="l1503" class='ln'>1503</a></td><td> <span class="br">}</span></td></tr>
<tr name="1504" id="1504">
<td><a id="l1504" class='ln'>1504</a></td><td></td></tr>
<tr name="1505" id="1505">
<td><a id="l1505" class='ln'>1505</a></td><td><span class="br">}</span> <span class="ct">/* end rt_DestroyLogVar */</span></td></tr>
<tr name="1506" id="1506">
<td><a id="l1506" class='ln'>1506</a></td><td></td></tr>
<tr name="1507" id="1507">
<td><a id="l1507" class='ln'>1507</a></td><td></td></tr>
<tr name="1508" id="1508">
<td><a id="l1508" class='ln'>1508</a></td><td><span class="ct">/* Function: rt_DestroyStructLogVar ============================================</span></td></tr>
<tr name="1509" id="1509">
<td><a id="l1509" class='ln'>1509</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1510" id="1510">
<td><a id="l1510" class='ln'>1510</a></td><td><span class="ct"> * Destroy the struct log var linked list.</span></td></tr>
<tr name="1511" id="1511">
<td><a id="l1511" class='ln'>1511</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1512" id="1512">
<td><a id="l1512" class='ln'>1512</a></td><td><span class="kw">static</span> <span class="kw">void</span> <a id="1512c13" class="tk">rt_DestroyStructLogVar</a>(<a id="1512c36" class="tk">StructLogVar</a> <a id="1512c49" class="tk">*</a><a id="1512c50" class="tk">head</a>)</td></tr>
<tr name="1513" id="1513">
<td><a id="l1513" class='ln'>1513</a></td><td><span class="br">{</span></td></tr>
<tr name="1514" id="1514">
<td><a id="l1514" class='ln'>1514</a></td><td> <span class="kw">while</span>(<a id="1514c11" class="tk">head</a>) <span class="br">{</span></td></tr>
<tr name="1515" id="1515">
<td><a id="l1515" class='ln'>1515</a></td><td> <a id="1515c9" class="tk">StructLogVar</a> <a id="1515c22" class="tk">*</a><a id="1515c23" class="tk">var</a> = <a id="1515c29" class="tk">head</a>;</td></tr>
<tr name="1516" id="1516">
<td><a id="l1516" class='ln'>1516</a></td><td></td></tr>
<tr name="1517" id="1517">
<td><a id="l1517" class='ln'>1517</a></td><td> <a id="1517c9" class="tk">head</a> = <a id="1517c16" class="tk">var</a>-&gt;<a id="1517c21" class="tk">next</a>;</td></tr>
<tr name="1518" id="1518">
<td><a id="l1518" class='ln'>1518</a></td><td></td></tr>
<tr name="1519" id="1519">
<td><a id="l1519" class='ln'>1519</a></td><td> <span class="kw">if</span> (<a id="1519c13" class="tk">var</a>-&gt;<a id="1519c18" class="tk">logTime</a>) <span class="br">{</span> <span class="ct">/* time is LogVar */</span></td></tr>
<tr name="1520" id="1520">
<td><a id="l1520" class='ln'>1520</a></td><td> <a id="1520c13" class="tk">rt_DestroyLogVar</a>(<a id="1520c30" class="tk">var</a>-&gt;<a id="1520c35" class="tk">time</a>);</td></tr>
<tr name="1521" id="1521">
<td><a id="l1521" class='ln'>1521</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* time is MatrixData */</span></td></tr>
<tr name="1522" id="1522">
<td><a id="l1522" class='ln'>1522</a></td><td> <a id="1522c13" class="tk">FREE</a>(<a id="1522c18" class="tk">var</a>-&gt;<a id="1522c23" class="tk">time</a>);</td></tr>
<tr name="1523" id="1523">
<td><a id="l1523" class='ln'>1523</a></td><td> <span class="br">}</span></td></tr>
<tr name="1524" id="1524">
<td><a id="l1524" class='ln'>1524</a></td><td> <a id="1524c9" class="tk">rt_DestroyLogVar</a>(<a id="1524c26" class="tk">var</a>-&gt;<a id="1524c31" class="tk">signals</a>.<a id="1524c39" class="tk">values</a>);</td></tr>
<tr name="1525" id="1525">
<td><a id="l1525" class='ln'>1525</a></td><td> <a id="1525c9" class="tk">FREE</a>(<a id="1525c14" class="tk">var</a>-&gt;<a id="1525c19" class="tk">signals</a>.<a id="1525c27" class="tk">labels</a>);</td></tr>
<tr name="1526" id="1526">
<td><a id="l1526" class='ln'>1526</a></td><td> <a id="1526c9" class="tk">FREE</a>(<a id="1526c14" class="tk">var</a>-&gt;<a id="1526c19" class="tk">signals</a>.<a id="1526c27" class="tk">plotStyles</a>);</td></tr>
<tr name="1527" id="1527">
<td><a id="l1527" class='ln'>1527</a></td><td> <a id="1527c9" class="tk">FREE</a>(<a id="1527c14" class="tk">var</a>-&gt;<a id="1527c19" class="tk">signals</a>.<a id="1527c27" class="tk">dimensions</a>);</td></tr>
<tr name="1528" id="1528">
<td><a id="l1528" class='ln'>1528</a></td><td> <a id="1528c9" class="tk">FREE</a>(<a id="1528c14" class="tk">var</a>-&gt;<a id="1528c19" class="tk">signals</a>.<a id="1528c27" class="tk">titles</a>);</td></tr>
<tr name="1529" id="1529">
<td><a id="l1529" class='ln'>1529</a></td><td> <a id="1529c9" class="tk">FREE</a>(<a id="1529c14" class="tk">var</a>-&gt;<a id="1529c19" class="tk">signals</a>.<a id="1529c27" class="tk">blockNames</a>);</td></tr>
<tr name="1530" id="1530">
<td><a id="l1530" class='ln'>1530</a></td><td> <a id="1530c9" class="tk">FREE</a>(<a id="1530c14" class="tk">var</a>-&gt;<a id="1530c19" class="tk">signals</a>.<a id="1530c27" class="tk">stateNames</a>);</td></tr>
<tr name="1531" id="1531">
<td><a id="l1531" class='ln'>1531</a></td><td> <a id="1531c9" class="tk">FREE</a>(<a id="1531c14" class="tk">var</a>-&gt;<a id="1531c19" class="tk">signals</a>.<a id="1531c27" class="tk">crossMdlRef</a>);</td></tr>
<tr name="1532" id="1532">
<td><a id="l1532" class='ln'>1532</a></td><td> <a id="1532c9" class="tk">FREE</a>(<a id="1532c14" class="tk">var</a>-&gt;<a id="1532c19" class="tk">blockName</a>);</td></tr>
<tr name="1533" id="1533">
<td><a id="l1533" class='ln'>1533</a></td><td> <a id="1533c9" class="tk">FREE</a>(<a id="1533c14" class="tk">var</a>);</td></tr>
<tr name="1534" id="1534">
<td><a id="l1534" class='ln'>1534</a></td><td> <span class="br">}</span></td></tr>
<tr name="1535" id="1535">
<td><a id="l1535" class='ln'>1535</a></td><td></td></tr>
<tr name="1536" id="1536">
<td><a id="l1536" class='ln'>1536</a></td><td><span class="br">}</span> <span class="ct">/* end rt_DestroyStructLogVar */</span></td></tr>
<tr name="1537" id="1537">
<td><a id="l1537" class='ln'>1537</a></td><td></td></tr>
<tr name="1538" id="1538">
<td><a id="l1538" class='ln'>1538</a></td><td></td></tr>
<tr name="1539" id="1539">
<td><a id="l1539" class='ln'>1539</a></td><td><span class="ct">/* Function: rt_InitSignalsStruct ==============================================</span></td></tr>
<tr name="1540" id="1540">
<td><a id="l1540" class='ln'>1540</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="1541" id="1541">
<td><a id="l1541" class='ln'>1541</a></td><td><span class="ct"> * Initialize the signals structure in the struct log variable.</span></td></tr>
<tr name="1542" id="1542">
<td><a id="l1542" class='ln'>1542</a></td><td><span class="ct"> *</span></td></tr>
<tr name="1543" id="1543">
<td><a id="l1543" class='ln'>1543</a></td><td><span class="ct"> * Returns:</span></td></tr>
<tr name="1544" id="1544">
<td><a id="l1544" class='ln'>1544</a></td><td><span class="ct"> * == NULL =&gt; success.</span></td></tr>
<tr name="1545" id="1545">
<td><a id="l1545" class='ln'>1545</a></td><td><span class="ct"> * ~= NULL =&gt; failure, the return value is a pointer to the error</span></td></tr>
<tr name="1546" id="1546">
<td><a id="l1546" class='ln'>1546</a></td><td><span class="ct"> * message, which is also set in the simstruct.</span></td></tr>
<tr name="1547" id="1547">
<td><a id="l1547" class='ln'>1547</a></td><td><span class="ct"> */</span></td></tr>
<tr name="1548" id="1548">
<td><a id="l1548" class='ln'>1548</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="1548c14" class="tk">char_T</a> <a id="1548c21" class="tk">*</a><a id="1548c22" class="tk">rt_InitSignalsStruct</a>(<a id="1548c43" class="tk">RTWLogInfo</a> <a id="1548c66" class="tk">*</a><a id="1548c67" class="tk">li</a>,</td></tr>
<tr name="1549" id="1549">
<td><a id="l1549" class='ln'>1549</a></td><td> <span class="kw">const</span> <a id="1549c49" class="tk">real_T</a> <a id="1549c66" class="tk">startTime</a>,</td></tr>
<tr name="1550" id="1550">
<td><a id="l1550" class='ln'>1550</a></td><td> <span class="kw">const</span> <a id="1550c49" class="tk">real_T</a> <a id="1550c66" class="tk">finalTime</a>,</td></tr>
<tr name="1551" id="1551">
<td><a id="l1551" class='ln'>1551</a></td><td> <span class="kw">const</span> <a id="1551c49" class="tk">real_T</a> <a id="1551c66" class="tk">inStepSize</a>,</td></tr>
<tr name="1552" id="1552">
<td><a id="l1552" class='ln'>1552</a></td><td> <span class="kw">const</span> <a id="1552c49" class="tk">char_T</a> <a id="1552c66" class="tk">*</a><a id="1552c67" class="tk">*</a><a id="1552c68" class="tk">errStatus</a>,</td></tr>
<tr name="1553" id="1553">
<td><a id="l1553" class='ln'>1553</a></td><td> <a id="1553c43" class="tk">StructLogVar</a> <a id="1553c66" class="tk">*</a><a id="1553c67" class="tk">var</a>,</td></tr>
<tr name="1554" id="1554">
<td><a id="l1554" class='ln'>1554</a></td><td> <a id="1554c43" class="tk">int_T</a> <a id="1554c66" class="tk">maxRows</a>,</td></tr>
<tr name="1555" id="1555">
<td><a id="l1555" class='ln'>1555</a></td><td> <a id="1555c43" class="tk">int_T</a> <a id="1555c66" class="tk">decimation</a>,</td></tr>
<tr name="1556" id="1556">
<td><a id="l1556" class='ln'>1556</a></td><td> <a id="1556c43" class="tk">real_T</a> <a id="1556c66" class="tk">sampleTime</a>,</td></tr>
<tr name="1557" id="1557">
<td><a id="l1557" class='ln'>1557</a></td><td> <span class="kw">const</span> <a id="1557c49" class="tk">RTWLogSignalInfo</a> <a id="1557c66" class="tk">*</a><a id="1557c67" class="tk">sigInfo</a>)</td></tr>
<tr name="1558" id="1558">
<td><a id="l1558" class='ln'>1558</a></td><td><span class="br">{</span></td></tr>
<tr name="1559" id="1559">
<td><a id="l1559" class='ln'>1559</a></td><td> <a id="1559c5" class="tk">int_T</a> <a id="1559c26" class="tk">i</a>, <a id="1559c29" class="tk">sigIdx</a>;</td></tr>
<tr name="1560" id="1560">
<td><a id="l1560" class='ln'>1560</a></td><td> <a id="1560c5" class="tk">SignalsStruct</a> <a id="1560c26" class="tk">*</a><a id="1560c27" class="tk">sig</a> = <a id="1560c42" class="tk">&amp;</a>(<a id="1560c44" class="tk">var</a>-&gt;<a id="1560c49" class="tk">signals</a>);</td></tr>
<tr name="1561" id="1561">
<td><a id="l1561" class='ln'>1561</a></td><td> <a id="1561c5" class="tk">int_T</a> <a id="1561c26" class="tk">nSignals</a> = <a id="1561c42" class="tk">sigInfo</a>-&gt;<a id="1561c51" class="tk">numSignals</a>;</td></tr>
<tr name="1562" id="1562">
<td><a id="l1562" class='ln'>1562</a></td><td> <span class="kw">const</span> <a id="1562c11" class="tk">int_T</a> <a id="1562c26" class="tk">*</a><a id="1562c27" class="tk">numCols</a> = <a id="1562c42" class="tk">sigInfo</a>-&gt;<a id="1562c51" class="tk">numCols</a>;</td></tr>
<tr name="1563" id="1563">
<td><a id="l1563" class='ln'>1563</a></td><td> <span class="kw">const</span> <a id="1563c11" class="tk">int_T</a> <a id="1563c26" class="tk">*</a><a id="1563c27" class="tk">numDims</a> = <a id="1563c42" class="tk">sigInfo</a>-&gt;<a id="1563c51" class="tk">numDims</a>;</td></tr>
<tr name="1564" id="1564">
<td><a id="l1564" class='ln'>1564</a></td><td> <span class="kw">const</span> <a id="1564c11" class="tk">int_T</a> <a id="1564c26" class="tk">*</a><a id="1564c27" class="tk">dims</a> = <a id="1564c42" class="tk">sigInfo</a>-&gt;<a id="1564c51" class="tk">dims</a>;</td></tr>
<tr name="1565" id="1565">
<td><a id="l1565" class='ln'>1565</a></td><td> <span class="kw">const</span> <a id="1565c11" class="tk">BuiltInDTypeId</a> <a id="1565c26" class="tk">*</a><a id="1565c27" class="tk">dTypes</a> = <a id="1565c42" class="tk">sigInfo</a>-&gt;<a id="1565c51" class="tk">dataTypes</a>;</td></tr>
<tr name="1566" id="1566">
<td><a id="l1566" class='ln'>1566</a></td><td> <span class="kw">const</span> <a id="1566c11" class="tk">int_T</a> <a id="1566c26" class="tk">*</a><a id="1566c27" class="tk">cSgnls</a> = <a id="1566c42" class="tk">sigInfo</a>-&gt;<a id="1566c51" class="tk">complexSignals</a>;</td></tr>
<tr name="1567" id="1567">
<td><a id="l1567" class='ln'>1567</a></td><td> <span class="kw">const</span> <a id="1567c11" class="tk">int_T</a> <a id="1567c26" class="tk">*</a><a id="1567c27" class="tk">fData</a> = <a id="1567c42" class="tk">sigInfo</a>-&gt;<a id="1567c51" class="tk">frameData</a>;</td></tr>
<tr name="1568" id="1568">
<td><a id="l1568" class='ln'>1568</a></td><td> <span class="kw">const</span> <a id="1568c11" class="tk">char_T</a> <a id="1568c26" class="tk">*</a><a id="1568c27" class="tk">*</a><a id="1568c28" class="tk">labels</a> = <a id="1568c42" class="tk">sigInfo</a>-&gt;<a id="1568c51" class="tk">labels</a>.<a id="1568c58" class="tk">cptr</a>;</td></tr>
<tr name="1569" id="1569">
<td><a id="l1569" class='ln'>1569</a></td><td> <span class="kw">const</span> <a id="1569c11" class="tk">int_T</a> <a id="1569c26" class="tk">*</a><a id="1569c27" class="tk">plotStyles</a> = <a id="1569c42" class="tk">sigInfo</a>-&gt;<a id="1569c51" class="tk">plotStyles</a>;</td></tr>
<tr name="1570" id="1570">
<td><a id="l1570" class='ln'>1570</a></td><td> <span class="kw">const</span> <a id="1570c11" class="tk">char_T</a> <a id="1570c26" class="tk">*</a><a id="1570c27" class="tk">titles</a> = <a id="1570c42" class="tk">sigInfo</a>-&gt;<a id="1570c51" class="tk">titles</a>;</td></tr>
<tr name="1571" id="1571">
<td><a id="l1571" class='ln'>1571</a></td><td> <span class="kw">const</span> <a id="1571c11" class="tk">int_T</a> <a id="1571c26" class="tk">*</a><a id="1571c27" class="tk">titleLen</a> = <a id="1571c42" class="tk">sigInfo</a>-&gt;<a id="1571c51" class="tk">titleLengths</a>;</td></tr>
<tr name="1572" id="1572">
<td><a id="l1572" class='ln'>1572</a></td><td> <span class="kw">const</span> <a id="1572c11" class="tk">char_T</a> <a id="1572c26" class="tk">*</a><a id="1572c27" class="tk">*</a><a id="1572c28" class="tk">blockNames</a> = <a id="1572c42" class="tk">sigInfo</a>-&gt;<a id="1572c51" class="tk">blockNames</a>.<a id="1572c62" class="tk">cptr</a>;</td></tr>
<tr name="1573" id="1573">
<td><a id="l1573" class='ln'>1573</a></td><td> <span class="kw">const</span> <a id="1573c11" class="tk">char_T</a> <a id="1573c26" class="tk">*</a><a id="1573c27" class="tk">*</a><a id="1573c28" class="tk">stateNames</a> = <a id="1573c42" class="tk">sigInfo</a>-&gt;<a id="1573c51" class="tk">stateNames</a>.<a id="1573c62" class="tk">cptr</a>;</td></tr>
<tr name="1574" id="1574">
<td><a id="l1574" class='ln'>1574</a></td><td> <span class="kw">const</span> <a id="1574c11" class="tk">boolean_T</a> <a id="1574c26" class="tk">*</a><a id="1574c27" class="tk">crossMdlRef</a> = <a id="1574c42" class="tk">sigInfo</a>-&gt;<a id="1574c51" class="tk">crossMdlRef</a>;</td></tr>
<tr name="1575" id="1575">
<td><a id="l1575" class='ln'>1575</a></td><td> <span class="kw">void</span> <a id="1575c26" class="tk">*</a><a id="1575c27" class="tk">*</a><a id="1575c28" class="tk">currSigDims</a> = <a id="1575c42" class="tk">sigInfo</a>-&gt;<a id="1575c51" class="tk">currSigDims</a>;</td></tr>
<tr name="1576" id="1576">
<td><a id="l1576" class='ln'>1576</a></td><td> <a id="1576c5" class="tk">int_T</a> <a id="1576c26" class="tk">*</a><a id="1576c27" class="tk">currSigDimsSize</a> = <a id="1576c45" class="tk">sigInfo</a>-&gt;<a id="1576c54" class="tk">currSigDimsSize</a>;</td></tr>
<tr name="1577" id="1577">
<td><a id="l1577" class='ln'>1577</a></td><td> <a id="1577c5" class="tk">LogVar</a> <a id="1577c26" class="tk">*</a><a id="1577c27" class="tk">prevValues</a> = <a id="1577c42" class="tk">NULL</a>;</td></tr>
<tr name="1578" id="1578">
<td><a id="l1578" class='ln'>1578</a></td><td> <a id="1578c5" class="tk">int_T</a> <a id="1578c26" class="tk">dimsOffset</a> = 0;</td></tr>
<tr name="1579" id="1579">
<td><a id="l1579" class='ln'>1579</a></td><td> <a id="1579c5" class="tk">boolean_T</a> <a id="1579c26" class="tk">*</a><a id="1579c27" class="tk">isVarDims</a> = <a id="1579c42" class="tk">sigInfo</a>-&gt;<a id="1579c51" class="tk">isVarDims</a>;</td></tr>
<tr name="1580" id="1580">
<td><a id="l1580" class='ln'>1580</a></td><td> <span class="ct">/* if any signal is variable-size, the field 'valueDimensions' is needed */</span></td></tr>
<tr name="1581" id="1581">
<td><a id="l1581" class='ln'>1581</a></td><td> <a id="1581c5" class="tk">boolean_T</a> <a id="1581c26" class="tk">logValueDimensions</a> = false;</td></tr>
<tr name="1582" id="1582">
<td><a id="l1582" class='ln'>1582</a></td><td> <span class="kw">const</span> <a id="1582c11" class="tk">RTWLogDataTypeConvert</a> <a id="1582c33" class="tk">*</a><a id="1582c34" class="tk">pDTConvInfo</a> = <a id="1582c48" class="tk">sigInfo</a>-&gt;<a id="1582c57" class="tk">dataTypeConvert</a>;</td></tr>
<tr name="1583" id="1583">
<td><a id="l1583" class='ln'>1583</a></td><td></td></tr>
<tr name="1584" id="1584">
<td><a id="l1584" class='ln'>1584</a></td><td> <span class="ct">/* reset error status */</span></td></tr>
<tr name="1585" id="1585">
<td><a id="l1585" class='ln'>1585</a></td><td> <a id="1585c5" class="tk">*</a><a id="1585c6" class="tk">errStatus</a> = <a id="1585c18" class="tk">NULL</a>;</td></tr>
<tr name="1586" id="1586">
<td><a id="l1586" class='ln'>1586</a></td><td></td></tr>
<tr name="1587" id="1587">
<td><a id="l1587" class='ln'>1587</a></td><td> <a id="1587c5" class="tk">sig</a>-&gt;<a id="1587c10" class="tk">numActiveFields</a> = 1;</td></tr>
<tr name="1588" id="1588">
<td><a id="l1588" class='ln'>1588</a></td><td> <a id="1588c5" class="tk">sig</a>-&gt;<a id="1588c10" class="tk">numSignals</a> = <a id="1588c28" class="tk">nSignals</a>;</td></tr>
<tr name="1589" id="1589">
<td><a id="l1589" class='ln'>1589</a></td><td></td></tr>
<tr name="1590" id="1590">
<td><a id="l1590" class='ln'>1590</a></td><td> <a id="1590c5" class="tk">sig</a>-&gt;<a id="1590c10" class="tk">isVarDims</a> = <a id="1590c22" class="tk">isVarDims</a>;</td></tr>
<tr name="1591" id="1591">
<td><a id="l1591" class='ln'>1591</a></td><td> <span class="ct">/* check whether we need valueDimensions field*/</span></td></tr>
<tr name="1592" id="1592">
<td><a id="l1592" class='ln'>1592</a></td><td> <span class="kw">for</span> (<a id="1592c10" class="tk">i</a>=0; <a id="1592c15" class="tk">i</a><a id="1592c16" class="tk">&lt;</a><a id="1592c17" class="tk">nSignals</a>; <a id="1592c27" class="tk">i</a><a id="1592c28" class="tk">++</a>)<span class="br">{</span></td></tr>
<tr name="1593" id="1593">
<td><a id="l1593" class='ln'>1593</a></td><td> <span class="kw">if</span>(<a id="1593c12" class="tk">isVarDims</a>[<a id="1593c22" class="tk">i</a>])<span class="br">{</span></td></tr>
<tr name="1594" id="1594">
<td><a id="l1594" class='ln'>1594</a></td><td> <a id="1594c13" class="tk">logValueDimensions</a> = true;</td></tr>
<tr name="1595" id="1595">
<td><a id="l1595" class='ln'>1595</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="1596" id="1596">
<td><a id="l1596" class='ln'>1596</a></td><td> <span class="br">}</span></td></tr>
<tr name="1597" id="1597">
<td><a id="l1597" class='ln'>1597</a></td><td> <span class="br">}</span></td></tr>
<tr name="1598" id="1598">
<td><a id="l1598" class='ln'>1598</a></td><td></td></tr>
<tr name="1599" id="1599">
<td><a id="l1599" class='ln'>1599</a></td><td> <span class="ct">/* values */</span></td></tr>
<tr name="1600" id="1600">
<td><a id="l1600" class='ln'>1600</a></td><td> <a id="1600c5" class="tk">dimsOffset</a> = 0;</td></tr>
<tr name="1601" id="1601">
<td><a id="l1601" class='ln'>1601</a></td><td> <span class="kw">for</span> (<a id="1601c10" class="tk">i</a> = 0; <a id="1601c17" class="tk">i</a> <a id="1601c19" class="tk">&lt;</a> <a id="1601c21" class="tk">nSignals</a>; <a id="1601c31" class="tk">i</a><a id="1601c32" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1602" id="1602">
<td><a id="l1602" class='ln'>1602</a></td><td> <a id="1602c9" class="tk">BuiltInDTypeId</a> <a id="1602c24" class="tk">dt</a> = (<a id="1602c30" class="tk">dTypes</a>) <a id="1602c38" class="tk">?</a> <a id="1602c40" class="tk">dTypes</a>[<a id="1602c47" class="tk">i</a>] <a id="1602c50" class="tk">:</a> <a id="1602c52" class="tk">SS_DOUBLE</a>;</td></tr>
<tr name="1603" id="1603">
<td><a id="l1603" class='ln'>1603</a></td><td> <a id="1603c9" class="tk">int_T</a> <a id="1603c24" class="tk">cs</a> = (<a id="1603c30" class="tk">cSgnls</a>) <a id="1603c38" class="tk">?</a> <a id="1603c40" class="tk">cSgnls</a>[<a id="1603c47" class="tk">i</a>] <a id="1603c50" class="tk">:</a> 0;</td></tr>
<tr name="1604" id="1604">
<td><a id="l1604" class='ln'>1604</a></td><td> <a id="1604c9" class="tk">int_T</a> <a id="1604c24" class="tk">fd</a> = (<a id="1604c30" class="tk">fData</a>) <a id="1604c38" class="tk">?</a> <a id="1604c40" class="tk">fData</a>[<a id="1604c46" class="tk">i</a>] <a id="1604c50" class="tk">:</a> 0;</td></tr>
<tr name="1605" id="1605">
<td><a id="l1605" class='ln'>1605</a></td><td> <a id="1605c9" class="tk">int_T</a> <a id="1605c24" class="tk">nd</a> = (<a id="1605c30" class="tk">numDims</a>) <a id="1605c39" class="tk">?</a> <a id="1605c41" class="tk">numDims</a>[<a id="1605c49" class="tk">i</a>] <a id="1605c52" class="tk">:</a> 1;</td></tr>
<tr name="1606" id="1606">
<td><a id="l1606" class='ln'>1606</a></td><td></td></tr>
<tr name="1607" id="1607">
<td><a id="l1607" class='ln'>1607</a></td><td> <span class="kw">const</span> <a id="1607c15" class="tk">RTWLogDataTypeConvert</a> <a id="1607c37" class="tk">*</a><a id="1607c38" class="tk">pDTConvInfoCur</a> =</td></tr>
<tr name="1608" id="1608">
<td><a id="l1608" class='ln'>1608</a></td><td> (<a id="1608c25" class="tk">pDTConvInfo</a>) <a id="1608c39" class="tk">?</a> (<a id="1608c42" class="tk">pDTConvInfo</a><a id="1608c53" class="tk">+</a><a id="1608c54" class="tk">i</a>) <a id="1608c58" class="tk">:</a> 0;</td></tr>
<tr name="1609" id="1609">
<td><a id="l1609" class='ln'>1609</a></td><td></td></tr>
<tr name="1610" id="1610">
<td><a id="l1610" class='ln'>1610</a></td><td> <a id="1610c9" class="tk">LogVar</a> <a id="1610c16" class="tk">*</a><a id="1610c17" class="tk">values</a> = <a id="1610c26" class="tk">NULL</a>;</td></tr>
<tr name="1611" id="1611">
<td><a id="l1611" class='ln'>1611</a></td><td> <a id="1611c9" class="tk">LogValDimsStat</a> <a id="1611c24" class="tk">logValDimsStat</a>;</td></tr>
<tr name="1612" id="1612">
<td><a id="l1612" class='ln'>1612</a></td><td></td></tr>
<tr name="1613" id="1613">
<td><a id="l1613" class='ln'>1613</a></td><td> <span class="kw">if</span>(<a id="1613c12" class="tk">!</a><a id="1613c13" class="tk">logValueDimensions</a>)<span class="br">{</span></td></tr>
<tr name="1614" id="1614">
<td><a id="l1614" class='ln'>1614</a></td><td> <a id="1614c13" class="tk">logValDimsStat</a> = <a id="1614c30" class="tk">NO_LOGVALDIMS</a>;</td></tr>
<tr name="1615" id="1615">
<td><a id="l1615" class='ln'>1615</a></td><td> <span class="br">}</span></td></tr>
<tr name="1616" id="1616">
<td><a id="l1616" class='ln'>1616</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="1617" id="1617">
<td><a id="l1617" class='ln'>1617</a></td><td> <a id="1617c13" class="tk">logValDimsStat</a> = <a id="1617c30" class="tk">isVarDims</a>[<a id="1617c40" class="tk">i</a>] <a id="1617c43" class="tk">?</a> <a id="1617c45" class="tk">LOGVALDIMS_VARDIMS</a> <a id="1617c64" class="tk">:</a> </td></tr>
<tr name="1618" id="1618">
<td><a id="l1618" class='ln'>1618</a></td><td> <a id="1618c45" class="tk">LOGVALDIMS_EMPTYMX</a>;</td></tr>
<tr name="1619" id="1619">
<td><a id="l1619" class='ln'>1619</a></td><td> <span class="br">}</span></td></tr>
<tr name="1620" id="1620">
<td><a id="l1620" class='ln'>1620</a></td><td></td></tr>
<tr name="1621" id="1621">
<td><a id="l1621" class='ln'>1621</a></td><td> <a id="1621c9" class="tk">values</a> = <a id="1621c18" class="tk">rt_CreateLogVarWithConvert</a>(<a id="1621c45" class="tk">li</a>, <a id="1621c49" class="tk">startTime</a>, <a id="1621c60" class="tk">finalTime</a>,</td></tr>
<tr name="1622" id="1622">
<td><a id="l1622" class='ln'>1622</a></td><td> <a id="1622c45" class="tk">inStepSize</a>, <a id="1622c57" class="tk">errStatus</a>,</td></tr>
<tr name="1623" id="1623">
<td><a id="l1623" class='ln'>1623</a></td><td> <a id="1623c45" class="tk">&amp;</a><a id="1623c46" class="tk">VALUES_FIELD_NAME</a>,</td></tr>
<tr name="1624" id="1624">
<td><a id="l1624" class='ln'>1624</a></td><td> <a id="1624c45" class="tk">dt</a>, </td></tr>
<tr name="1625" id="1625">
<td><a id="l1625" class='ln'>1625</a></td><td> <a id="1625c45" class="tk">pDTConvInfoCur</a>,</td></tr>
<tr name="1626" id="1626">
<td><a id="l1626" class='ln'>1626</a></td><td> 0, <a id="1626c48" class="tk">cs</a>, <a id="1626c52" class="tk">fd</a>,</td></tr>
<tr name="1627" id="1627">
<td><a id="l1627" class='ln'>1627</a></td><td> <a id="1627c45" class="tk">numCols</a>[<a id="1627c53" class="tk">i</a>],<a id="1627c56" class="tk">nd</a>,</td></tr>
<tr name="1628" id="1628">
<td><a id="l1628" class='ln'>1628</a></td><td> <a id="1628c45" class="tk">dims</a> <a id="1628c50" class="tk">+</a> <a id="1628c52" class="tk">dimsOffset</a>,</td></tr>
<tr name="1629" id="1629">
<td><a id="l1629" class='ln'>1629</a></td><td> <a id="1629c45" class="tk">logValDimsStat</a>,</td></tr>
<tr name="1630" id="1630">
<td><a id="l1630" class='ln'>1630</a></td><td> <a id="1630c45" class="tk">currSigDims</a> <a id="1630c57" class="tk">+</a> <a id="1630c59" class="tk">dimsOffset</a>,</td></tr>
<tr name="1631" id="1631">
<td><a id="l1631" class='ln'>1631</a></td><td> <a id="1631c45" class="tk">currSigDimsSize</a> <a id="1631c61" class="tk">+</a> <a id="1631c63" class="tk">dimsOffset</a>,</td></tr>
<tr name="1632" id="1632">
<td><a id="l1632" class='ln'>1632</a></td><td> <a id="1632c45" class="tk">maxRows</a>,<a id="1632c53" class="tk">decimation</a>,<a id="1632c64" class="tk">sampleTime</a>, 0);</td></tr>
<tr name="1633" id="1633">
<td><a id="l1633" class='ln'>1633</a></td><td></td></tr>
<tr name="1634" id="1634">
<td><a id="l1634" class='ln'>1634</a></td><td> <span class="kw">if</span> (<a id="1634c13" class="tk">values</a> <a id="1634c20" class="tk">==</a> <a id="1634c23" class="tk">NULL</a>) <span class="kw">goto</span> <a id="1634c34" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1635" id="1635">
<td><a id="l1635" class='ln'>1635</a></td><td></td></tr>
<tr name="1636" id="1636">
<td><a id="l1636" class='ln'>1636</a></td><td> <span class="kw">if</span> (<a id="1636c13" class="tk">sig</a>-&gt;<a id="1636c18" class="tk">values</a> <a id="1636c25" class="tk">==</a> <a id="1636c28" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1637" id="1637">
<td><a id="l1637" class='ln'>1637</a></td><td> <a id="1637c13" class="tk">sig</a>-&gt;<a id="1637c18" class="tk">values</a> = <a id="1637c27" class="tk">values</a>;</td></tr>
<tr name="1638" id="1638">
<td><a id="l1638" class='ln'>1638</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1639" id="1639">
<td><a id="l1639" class='ln'>1639</a></td><td> <span class="kw">if</span> (<a id="1639c17" class="tk">prevValues</a> <a id="1639c28" class="tk">==</a> <a id="1639c31" class="tk">NULL</a>) <span class="kw">goto</span> <a id="1639c42" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1640" id="1640">
<td><a id="l1640" class='ln'>1640</a></td><td> <a id="1640c13" class="tk">prevValues</a>-&gt;<a id="1640c25" class="tk">next</a> = <a id="1640c32" class="tk">values</a>;</td></tr>
<tr name="1641" id="1641">
<td><a id="l1641" class='ln'>1641</a></td><td> <span class="br">}</span></td></tr>
<tr name="1642" id="1642">
<td><a id="l1642" class='ln'>1642</a></td><td> <a id="1642c9" class="tk">prevValues</a> = <a id="1642c22" class="tk">values</a>;</td></tr>
<tr name="1643" id="1643">
<td><a id="l1643" class='ln'>1643</a></td><td> <a id="1643c9" class="tk">dimsOffset</a> <a id="1643c20" class="tk">+=</a> <a id="1643c23" class="tk">nd</a>;</td></tr>
<tr name="1644" id="1644">
<td><a id="l1644" class='ln'>1644</a></td><td> <span class="br">}</span></td></tr>
<tr name="1645" id="1645">
<td><a id="l1645" class='ln'>1645</a></td><td></td></tr>
<tr name="1646" id="1646">
<td><a id="l1646" class='ln'>1646</a></td><td> <span class="kw">if</span>(<a id="1646c8" class="tk">logValueDimensions</a>)<span class="br">{</span></td></tr>
<tr name="1647" id="1647">
<td><a id="l1647" class='ln'>1647</a></td><td> <a id="1647c9" class="tk">++</a><a id="1647c11" class="tk">sig</a>-&gt;<a id="1647c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="1648" id="1648">
<td><a id="l1648" class='ln'>1648</a></td><td> <a id="1648c9" class="tk">sig</a>-&gt;<a id="1648c14" class="tk">logValueDimensions</a> = true;</td></tr>
<tr name="1649" id="1649">
<td><a id="l1649" class='ln'>1649</a></td><td> <span class="br">}</span></td></tr>
<tr name="1650" id="1650">
<td><a id="l1650" class='ln'>1650</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="1651" id="1651">
<td><a id="l1651" class='ln'>1651</a></td><td> <a id="1651c9" class="tk">sig</a>-&gt;<a id="1651c14" class="tk">logValueDimensions</a> = false;</td></tr>
<tr name="1652" id="1652">
<td><a id="l1652" class='ln'>1652</a></td><td> <span class="br">}</span></td></tr>
<tr name="1653" id="1653">
<td><a id="l1653" class='ln'>1653</a></td><td></td></tr>
<tr name="1654" id="1654">
<td><a id="l1654" class='ln'>1654</a></td><td> <span class="ct">/* Dimensions */</span></td></tr>
<tr name="1655" id="1655">
<td><a id="l1655" class='ln'>1655</a></td><td> <span class="br">{</span></td></tr>
<tr name="1656" id="1656">
<td><a id="l1656" class='ln'>1656</a></td><td> <a id="1656c9" class="tk">real_T</a> <a id="1656c24" class="tk">*</a><a id="1656c25" class="tk">data</a>;</td></tr>
<tr name="1657" id="1657">
<td><a id="l1657" class='ln'>1657</a></td><td> <a id="1657c9" class="tk">size_t</a> <a id="1657c23" class="tk">nbytes</a>;</td></tr>
<tr name="1658" id="1658">
<td><a id="l1658" class='ln'>1658</a></td><td> <a id="1658c9" class="tk">int_T</a> <a id="1658c24" class="tk">dataLen</a> = 0;</td></tr>
<tr name="1659" id="1659">
<td><a id="l1659" class='ln'>1659</a></td><td> <a id="1659c9" class="tk">BuiltInDTypeId</a> <a id="1659c24" class="tk">dTypeId</a> = <a id="1659c37" class="tk">rt_GetActualDTypeID</a>(<a id="1659c57" class="tk">SS_DOUBLE</a>);</td></tr>
<tr name="1660" id="1660">
<td><a id="l1660" class='ln'>1660</a></td><td> <a id="1660c9" class="tk">size_t</a> <a id="1660c24" class="tk">dataOffset</a> = <a id="1660c37" class="tk">nSignals</a><a id="1660c45" class="tk">*</a><span class="kw">sizeof</span>(<a id="1660c53" class="tk">MatrixData</a>);</td></tr>
<tr name="1661" id="1661">
<td><a id="l1661" class='ln'>1661</a></td><td> <a id="1661c9" class="tk">uint_T</a> <a id="1661c24" class="tk">overhang</a> = (<a id="1661c38" class="tk">uint_T</a>)(<a id="1661c46" class="tk">dataOffset</a> <a id="1661c57" class="tk">%</a> <span class="kw">sizeof</span>(<a id="1661c66" class="tk">real_T</a>));</td></tr>
<tr name="1662" id="1662">
<td><a id="l1662" class='ln'>1662</a></td><td></td></tr>
<tr name="1663" id="1663">
<td><a id="l1663" class='ln'>1663</a></td><td> <span class="kw">if</span> (<a id="1663c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1664" id="1664">
<td><a id="l1664" class='ln'>1664</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="1665" id="1665">
<td><a id="l1665" class='ln'>1665</a></td><td> <a id="1665c13" class="tk">dataOffset</a> <a id="1665c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<a id="1665c35" class="tk">real_T</a>) <a id="1665c43" class="tk">-</a> <a id="1665c45" class="tk">overhang</a>);</td></tr>
<tr name="1666" id="1666">
<td><a id="l1666" class='ln'>1666</a></td><td> <span class="br">}</span></td></tr>
<tr name="1667" id="1667">
<td><a id="l1667" class='ln'>1667</a></td><td> <span class="kw">for</span> (<a id="1667c14" class="tk">i</a>=0; <a id="1667c19" class="tk">i</a><a id="1667c20" class="tk">&lt;</a> <a id="1667c22" class="tk">nSignals</a>; <a id="1667c32" class="tk">i</a><a id="1667c33" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1668" id="1668">
<td><a id="l1668" class='ln'>1668</a></td><td> <a id="1668c13" class="tk">int_T</a> <a id="1668c19" class="tk">nd</a> = (<a id="1668c25" class="tk">numDims</a>) <a id="1668c34" class="tk">?</a> <a id="1668c36" class="tk">numDims</a>[<a id="1668c44" class="tk">i</a>] <a id="1668c47" class="tk">:</a> 1;</td></tr>
<tr name="1669" id="1669">
<td><a id="l1669" class='ln'>1669</a></td><td> <a id="1669c13" class="tk">dataLen</a> <a id="1669c21" class="tk">+=</a> <a id="1669c24" class="tk">nd</a>;</td></tr>
<tr name="1670" id="1670">
<td><a id="l1670" class='ln'>1670</a></td><td> <span class="br">}</span></td></tr>
<tr name="1671" id="1671">
<td><a id="l1671" class='ln'>1671</a></td><td> <a id="1671c9" class="tk">nbytes</a> = <a id="1671c18" class="tk">dataOffset</a> <a id="1671c29" class="tk">+</a> <a id="1671c31" class="tk">dataLen</a><a id="1671c38" class="tk">*</a><span class="kw">sizeof</span>(<a id="1671c46" class="tk">real_T</a>);</td></tr>
<tr name="1672" id="1672">
<td><a id="l1672" class='ln'>1672</a></td><td></td></tr>
<tr name="1673" id="1673">
<td><a id="l1673" class='ln'>1673</a></td><td> <span class="kw">if</span> ( (<a id="1673c15" class="tk">sig</a>-&gt;<a id="1673c20" class="tk">dimensions</a> = <a id="1673c33" class="tk">calloc</a>(<a id="1673c40" class="tk">nbytes</a>, 1)) <a id="1673c52" class="tk">==</a> <a id="1673c55" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="1673c67" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1674" id="1674">
<td><a id="l1674" class='ln'>1674</a></td><td></td></tr>
<tr name="1675" id="1675">
<td><a id="l1675" class='ln'>1675</a></td><td> <a id="1675c9" class="tk">data</a> = (<a id="1675c17" class="tk">real_T</a><a id="1675c23" class="tk">*</a>) (((<a id="1675c29" class="tk">char_T</a><a id="1675c35" class="tk">*</a>) (<a id="1675c39" class="tk">sig</a>-&gt;<a id="1675c44" class="tk">dimensions</a>)) <a id="1675c57" class="tk">+</a> <a id="1675c59" class="tk">dataOffset</a>);</td></tr>
<tr name="1676" id="1676">
<td><a id="l1676" class='ln'>1676</a></td><td></td></tr>
<tr name="1677" id="1677">
<td><a id="l1677" class='ln'>1677</a></td><td> <span class="kw">for</span> (<a id="1677c14" class="tk">i</a> = 0; <a id="1677c21" class="tk">i</a> <a id="1677c23" class="tk">&lt;</a> <a id="1677c25" class="tk">dataLen</a>; <a id="1677c34" class="tk">i</a><a id="1677c35" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1678" id="1678">
<td><a id="l1678" class='ln'>1678</a></td><td> <a id="1678c11" class="tk">data</a>[<a id="1678c16" class="tk">i</a>] = <a id="1678c21" class="tk">dims</a>[<a id="1678c26" class="tk">i</a>]; <span class="ct">/* cannot memcpy double &lt;- int */</span></td></tr>
<tr name="1679" id="1679">
<td><a id="l1679" class='ln'>1679</a></td><td> <span class="br">}</span></td></tr>
<tr name="1680" id="1680">
<td><a id="l1680" class='ln'>1680</a></td><td></td></tr>
<tr name="1681" id="1681">
<td><a id="l1681" class='ln'>1681</a></td><td> <span class="kw">for</span> (<a id="1681c14" class="tk">i</a> = 0; <a id="1681c21" class="tk">i</a> <a id="1681c23" class="tk">&lt;</a> <a id="1681c25" class="tk">nSignals</a>; <a id="1681c35" class="tk">i</a><a id="1681c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1682" id="1682">
<td><a id="l1682" class='ln'>1682</a></td><td> <a id="1682c13" class="tk">MatrixData</a> <a id="1682c24" class="tk">*</a><a id="1682c25" class="tk">mtxData</a> = <a id="1682c35" class="tk">&amp;</a>(<a id="1682c37" class="tk">sig</a>-&gt;<a id="1682c42" class="tk">dimensions</a>[<a id="1682c53" class="tk">i</a>]);</td></tr>
<tr name="1683" id="1683">
<td><a id="l1683" class='ln'>1683</a></td><td> <a id="1683c13" class="tk">int_T</a> <a id="1683c19" class="tk">nd</a> = (<a id="1683c25" class="tk">numDims</a>) <a id="1683c34" class="tk">?</a> <a id="1683c36" class="tk">numDims</a>[<a id="1683c44" class="tk">i</a>] <a id="1683c47" class="tk">:</a> 1;</td></tr>
<tr name="1684" id="1684">
<td><a id="l1684" class='ln'>1684</a></td><td></td></tr>
<tr name="1685" id="1685">
<td><a id="l1685" class='ln'>1685</a></td><td> (<span class="kw">void</span>)<a id="1685c19" class="tk">memcpy</a>(<a id="1685c26" class="tk">mtxData</a>-&gt;<a id="1685c35" class="tk">name</a>, <a id="1685c41" class="tk">&amp;</a><a id="1685c42" class="tk">DIMENSION_FIELD_NAME</a>, <a id="1685c64" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="1686" id="1686">
<td><a id="l1686" class='ln'>1686</a></td><td></td></tr>
<tr name="1687" id="1687">
<td><a id="l1687" class='ln'>1687</a></td><td> <a id="1687c13" class="tk">mtxData</a>-&gt;<a id="1687c22" class="tk">nRows</a> = 1;</td></tr>
<tr name="1688" id="1688">
<td><a id="l1688" class='ln'>1688</a></td><td> <a id="1688c13" class="tk">mtxData</a>-&gt;<a id="1688c22" class="tk">nCols</a> = <a id="1688c32" class="tk">nd</a>;</td></tr>
<tr name="1689" id="1689">
<td><a id="l1689" class='ln'>1689</a></td><td></td></tr>
<tr name="1690" id="1690">
<td><a id="l1690" class='ln'>1690</a></td><td> <a id="1690c13" class="tk">mtxData</a>-&gt;<a id="1690c22" class="tk">nDims</a> = 1; <span class="ct">/* assume */</span></td></tr>
<tr name="1691" id="1691">
<td><a id="l1691" class='ln'>1691</a></td><td> <a id="1691c13" class="tk">mtxData</a>-&gt;<a id="1691c22" class="tk">dims</a> = <a id="1691c32" class="tk">mtxData</a>-&gt;<a id="1691c41" class="tk">_dims</a>;</td></tr>
<tr name="1692" id="1692">
<td><a id="l1692" class='ln'>1692</a></td><td> <a id="1692c13" class="tk">mtxData</a>-&gt;<a id="1692c22" class="tk">dims</a>[0] = <a id="1692c32" class="tk">mtxData</a>-&gt;<a id="1692c41" class="tk">nCols</a>;</td></tr>
<tr name="1693" id="1693">
<td><a id="l1693" class='ln'>1693</a></td><td></td></tr>
<tr name="1694" id="1694">
<td><a id="l1694" class='ln'>1694</a></td><td> <a id="1694c13" class="tk">mtxData</a>-&gt;<a id="1694c22" class="tk">re</a> = <a id="1694c32" class="tk">data</a>;</td></tr>
<tr name="1695" id="1695">
<td><a id="l1695" class='ln'>1695</a></td><td> <a id="1695c13" class="tk">mtxData</a>-&gt;<a id="1695c22" class="tk">im</a> = <a id="1695c32" class="tk">NULL</a>;</td></tr>
<tr name="1696" id="1696">
<td><a id="l1696" class='ln'>1696</a></td><td> <a id="1696c13" class="tk">mtxData</a>-&gt;<a id="1696c22" class="tk">dTypeID</a> = <a id="1696c32" class="tk">dTypeId</a>;</td></tr>
<tr name="1697" id="1697">
<td><a id="l1697" class='ln'>1697</a></td><td> <a id="1697c13" class="tk">mtxData</a>-&gt;<a id="1697c22" class="tk">mxID</a> = <a id="1697c32" class="tk">rt_GetMxIdFromDTypeId</a>(<a id="1697c54" class="tk">dTypeId</a>);</td></tr>
<tr name="1698" id="1698">
<td><a id="l1698" class='ln'>1698</a></td><td> <a id="1698c13" class="tk">mtxData</a>-&gt;<a id="1698c22" class="tk">elSize</a> = <a id="1698c32" class="tk">rt_GetSizeofDataType</a>(<a id="1698c53" class="tk">dTypeId</a>);</td></tr>
<tr name="1699" id="1699">
<td><a id="l1699" class='ln'>1699</a></td><td> <a id="1699c13" class="tk">mtxData</a>-&gt;<a id="1699c22" class="tk">logical</a> = 0U;</td></tr>
<tr name="1700" id="1700">
<td><a id="l1700" class='ln'>1700</a></td><td> <a id="1700c13" class="tk">mtxData</a>-&gt;<a id="1700c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="1701" id="1701">
<td><a id="l1701" class='ln'>1701</a></td><td></td></tr>
<tr name="1702" id="1702">
<td><a id="l1702" class='ln'>1702</a></td><td> <a id="1702c13" class="tk">data</a> <a id="1702c18" class="tk">+=</a> <a id="1702c21" class="tk">nd</a>;</td></tr>
<tr name="1703" id="1703">
<td><a id="l1703" class='ln'>1703</a></td><td> <span class="br">}</span></td></tr>
<tr name="1704" id="1704">
<td><a id="l1704" class='ln'>1704</a></td><td> <a id="1704c9" class="tk">++</a><a id="1704c11" class="tk">sig</a>-&gt;<a id="1704c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="1705" id="1705">
<td><a id="l1705" class='ln'>1705</a></td><td> <span class="br">}</span></td></tr>
<tr name="1706" id="1706">
<td><a id="l1706" class='ln'>1706</a></td><td></td></tr>
<tr name="1707" id="1707">
<td><a id="l1707" class='ln'>1707</a></td><td> <span class="ct">/* labels */</span></td></tr>
<tr name="1708" id="1708">
<td><a id="l1708" class='ln'>1708</a></td><td> <span class="kw">if</span> (<a id="1708c9" class="tk">labels</a> <a id="1708c16" class="tk">!=</a> <a id="1708c19" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1709" id="1709">
<td><a id="l1709" class='ln'>1709</a></td><td> <span class="kw">unsigned</span> <span class="kw">short</span> <a id="1709c26" class="tk">*</a><a id="1709c27" class="tk">data</a>;</td></tr>
<tr name="1710" id="1710">
<td><a id="l1710" class='ln'>1710</a></td><td> <a id="1710c9" class="tk">size_t</a> <a id="1710c17" class="tk">nbytes</a>;</td></tr>
<tr name="1711" id="1711">
<td><a id="l1711" class='ln'>1711</a></td><td> <a id="1711c9" class="tk">int_T</a> <a id="1711c17" class="tk">dataLen</a> = 0;</td></tr>
<tr name="1712" id="1712">
<td><a id="l1712" class='ln'>1712</a></td><td> <a id="1712c9" class="tk">size_t</a> <a id="1712c17" class="tk">dataOffset</a> = <a id="1712c30" class="tk">nSignals</a> <a id="1712c39" class="tk">*</a> <span class="kw">sizeof</span>(<a id="1712c48" class="tk">MatrixData</a>);</td></tr>
<tr name="1713" id="1713">
<td><a id="l1713" class='ln'>1713</a></td><td> <a id="1713c9" class="tk">uint_T</a> <a id="1713c17" class="tk">overhang</a> = (<a id="1713c31" class="tk">uint_T</a>)(<a id="1713c39" class="tk">dataOffset</a> <a id="1713c50" class="tk">%</a> <span class="kw">sizeof</span>(<span class="kw">short</span>));</td></tr>
<tr name="1714" id="1714">
<td><a id="l1714" class='ln'>1714</a></td><td> <a id="1714c9" class="tk">int_T</a> <a id="1714c15" class="tk">dataIdx</a> = 0;</td></tr>
<tr name="1715" id="1715">
<td><a id="l1715" class='ln'>1715</a></td><td></td></tr>
<tr name="1716" id="1716">
<td><a id="l1716" class='ln'>1716</a></td><td> <span class="kw">for</span> (<a id="1716c14" class="tk">i</a>=0;<a id="1716c18" class="tk">i</a><a id="1716c19" class="tk">&lt;</a><a id="1716c20" class="tk">nSignals</a>;<a id="1716c29" class="tk">i</a><a id="1716c30" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1717" id="1717">
<td><a id="l1717" class='ln'>1717</a></td><td> <span class="kw">if</span> (<a id="1717c17" class="tk">labels</a>[<a id="1717c24" class="tk">i</a>] <a id="1717c27" class="tk">!=</a> <a id="1717c30" class="tk">NULL</a>)<span class="br">{</span></td></tr>
<tr name="1718" id="1718">
<td><a id="l1718" class='ln'>1718</a></td><td> <a id="1718c17" class="tk">dataLen</a> = <a id="1718c27" class="tk">dataLen</a> <a id="1718c35" class="tk">+</a> (<a id="1718c38" class="tk">int_T</a>)<a id="1718c44" class="tk">strlen</a>(<a id="1718c51" class="tk">labels</a>[<a id="1718c58" class="tk">i</a>]);</td></tr>
<tr name="1719" id="1719">
<td><a id="l1719" class='ln'>1719</a></td><td> <span class="br">}</span></td></tr>
<tr name="1720" id="1720">
<td><a id="l1720" class='ln'>1720</a></td><td> <span class="br">}</span></td></tr>
<tr name="1721" id="1721">
<td><a id="l1721" class='ln'>1721</a></td><td></td></tr>
<tr name="1722" id="1722">
<td><a id="l1722" class='ln'>1722</a></td><td> <span class="kw">if</span> (<a id="1722c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1723" id="1723">
<td><a id="l1723" class='ln'>1723</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="1724" id="1724">
<td><a id="l1724" class='ln'>1724</a></td><td> <a id="1724c13" class="tk">dataOffset</a> <a id="1724c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<span class="kw">short</span>) <a id="1724c42" class="tk">-</a> <a id="1724c44" class="tk">overhang</a>);</td></tr>
<tr name="1725" id="1725">
<td><a id="l1725" class='ln'>1725</a></td><td> <span class="br">}</span></td></tr>
<tr name="1726" id="1726">
<td><a id="l1726" class='ln'>1726</a></td><td> <a id="1726c9" class="tk">nbytes</a> = <a id="1726c18" class="tk">dataOffset</a> <a id="1726c29" class="tk">+</a> <a id="1726c31" class="tk">dataLen</a><a id="1726c38" class="tk">*</a><span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1727" id="1727">
<td><a id="l1727" class='ln'>1727</a></td><td></td></tr>
<tr name="1728" id="1728">
<td><a id="l1728" class='ln'>1728</a></td><td> <span class="kw">if</span> ( (<a id="1728c15" class="tk">sig</a>-&gt;<a id="1728c20" class="tk">labels</a> = <a id="1728c29" class="tk">calloc</a>(<a id="1728c36" class="tk">nbytes</a>, 1)) <a id="1728c48" class="tk">==</a> <a id="1728c51" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="1728c63" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1729" id="1729">
<td><a id="l1729" class='ln'>1729</a></td><td></td></tr>
<tr name="1730" id="1730">
<td><a id="l1730" class='ln'>1730</a></td><td> <a id="1730c9" class="tk">data</a> = (<span class="kw">unsigned</span> <span class="kw">short</span><a id="1730c31" class="tk">*</a>) (((<a id="1730c37" class="tk">char_T</a><a id="1730c43" class="tk">*</a>) (<a id="1730c47" class="tk">sig</a>-&gt;<a id="1730c52" class="tk">labels</a>)) <a id="1730c61" class="tk">+</a> <a id="1730c63" class="tk">dataOffset</a>);</td></tr>
<tr name="1731" id="1731">
<td><a id="l1731" class='ln'>1731</a></td><td> <span class="kw">for</span>(<a id="1731c13" class="tk">sigIdx</a>=0;<a id="1731c22" class="tk">sigIdx</a><a id="1731c28" class="tk">&lt;</a><a id="1731c29" class="tk">nSignals</a>;<a id="1731c38" class="tk">sigIdx</a><a id="1731c44" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1732" id="1732">
<td><a id="l1732" class='ln'>1732</a></td><td> <a id="1732c13" class="tk">int_T</a> <a id="1732c19" class="tk">labelLen</a> = (<a id="1732c31" class="tk">labels</a>[<a id="1732c38" class="tk">sigIdx</a>]<a id="1732c45" class="tk">==</a><a id="1732c47" class="tk">NULL</a>) <a id="1732c53" class="tk">?</a> 0 <a id="1732c57" class="tk">:</a> (<a id="1732c60" class="tk">int_T</a>)<a id="1732c66" class="tk">strlen</a>(<a id="1732c73" class="tk">labels</a>[<a id="1732c80" class="tk">sigIdx</a>]);</td></tr>
<tr name="1733" id="1733">
<td><a id="l1733" class='ln'>1733</a></td><td> <span class="kw">for</span> (<a id="1733c18" class="tk">i</a> = 0; <a id="1733c25" class="tk">i</a> <a id="1733c27" class="tk">&lt;</a> <a id="1733c29" class="tk">labelLen</a>; <a id="1733c39" class="tk">i</a><a id="1733c40" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1734" id="1734">
<td><a id="l1734" class='ln'>1734</a></td><td> <a id="1734c17" class="tk">data</a>[<a id="1734c22" class="tk">dataIdx</a><a id="1734c29" class="tk">++</a>] = (<a id="1734c36" class="tk">uint8_T</a>)<a id="1734c44" class="tk">labels</a>[<a id="1734c51" class="tk">sigIdx</a>][<a id="1734c59" class="tk">i</a>];</td></tr>
<tr name="1735" id="1735">
<td><a id="l1735" class='ln'>1735</a></td><td> <span class="br">}</span></td></tr>
<tr name="1736" id="1736">
<td><a id="l1736" class='ln'>1736</a></td><td> <span class="br">}</span></td></tr>
<tr name="1737" id="1737">
<td><a id="l1737" class='ln'>1737</a></td><td></td></tr>
<tr name="1738" id="1738">
<td><a id="l1738" class='ln'>1738</a></td><td> <span class="kw">for</span> (<a id="1738c14" class="tk">i</a> = 0; <a id="1738c21" class="tk">i</a> <a id="1738c23" class="tk">&lt;</a> <a id="1738c25" class="tk">nSignals</a>; <a id="1738c35" class="tk">i</a><a id="1738c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1739" id="1739">
<td><a id="l1739" class='ln'>1739</a></td><td> <a id="1739c13" class="tk">MatrixData</a> <a id="1739c24" class="tk">*</a><a id="1739c25" class="tk">mtxData</a> = <a id="1739c35" class="tk">&amp;</a>(<a id="1739c37" class="tk">sig</a>-&gt;<a id="1739c42" class="tk">labels</a>[<a id="1739c49" class="tk">i</a>]);</td></tr>
<tr name="1740" id="1740">
<td><a id="l1740" class='ln'>1740</a></td><td> <a id="1740c13" class="tk">int_T</a> <a id="1740c19" class="tk">labelLen</a> = (<a id="1740c31" class="tk">int_T</a>)<a id="1740c37" class="tk">strlen</a>(<a id="1740c44" class="tk">labels</a>[<a id="1740c51" class="tk">i</a>]);</td></tr>
<tr name="1741" id="1741">
<td><a id="l1741" class='ln'>1741</a></td><td></td></tr>
<tr name="1742" id="1742">
<td><a id="l1742" class='ln'>1742</a></td><td> (<span class="kw">void</span>)<a id="1742c19" class="tk">memcpy</a>(<a id="1742c26" class="tk">mtxData</a>-&gt;<a id="1742c35" class="tk">name</a>, <a id="1742c41" class="tk">&amp;</a><a id="1742c42" class="tk">LABEL_FIELD_NAME</a>, <a id="1742c60" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="1743" id="1743">
<td><a id="l1743" class='ln'>1743</a></td><td> <a id="1743c13" class="tk">mtxData</a>-&gt;<a id="1743c22" class="tk">nRows</a> = (<a id="1743c33" class="tk">labelLen</a>) <a id="1743c43" class="tk">?</a> 1 <a id="1743c47" class="tk">:</a> 0;</td></tr>
<tr name="1744" id="1744">
<td><a id="l1744" class='ln'>1744</a></td><td> <a id="1744c13" class="tk">mtxData</a>-&gt;<a id="1744c22" class="tk">nCols</a> = <a id="1744c32" class="tk">labelLen</a>;</td></tr>
<tr name="1745" id="1745">
<td><a id="l1745" class='ln'>1745</a></td><td></td></tr>
<tr name="1746" id="1746">
<td><a id="l1746" class='ln'>1746</a></td><td> <a id="1746c13" class="tk">mtxData</a>-&gt;<a id="1746c22" class="tk">re</a> = <a id="1746c32" class="tk">data</a>;</td></tr>
<tr name="1747" id="1747">
<td><a id="l1747" class='ln'>1747</a></td><td> <a id="1747c13" class="tk">mtxData</a>-&gt;<a id="1747c22" class="tk">im</a> = <a id="1747c32" class="tk">NULL</a>;</td></tr>
<tr name="1748" id="1748">
<td><a id="l1748" class='ln'>1748</a></td><td></td></tr>
<tr name="1749" id="1749">
<td><a id="l1749" class='ln'>1749</a></td><td> <a id="1749c13" class="tk">mtxData</a>-&gt;<a id="1749c22" class="tk">nDims</a> = 1; <span class="ct">/* assume */</span></td></tr>
<tr name="1750" id="1750">
<td><a id="l1750" class='ln'>1750</a></td><td> <a id="1750c13" class="tk">mtxData</a>-&gt;<a id="1750c22" class="tk">dims</a> = <a id="1750c32" class="tk">mtxData</a>-&gt;<a id="1750c41" class="tk">_dims</a>;</td></tr>
<tr name="1751" id="1751">
<td><a id="l1751" class='ln'>1751</a></td><td> <a id="1751c13" class="tk">mtxData</a>-&gt;<a id="1751c22" class="tk">dims</a>[0] = <a id="1751c32" class="tk">mtxData</a>-&gt;<a id="1751c41" class="tk">nCols</a>;</td></tr>
<tr name="1752" id="1752">
<td><a id="l1752" class='ln'>1752</a></td><td></td></tr>
<tr name="1753" id="1753">
<td><a id="l1753" class='ln'>1753</a></td><td> <a id="1753c13" class="tk">mtxData</a>-&gt;<a id="1753c22" class="tk">dTypeID</a> = <a id="1753c32" class="tk">SS_INT16</a>;</td></tr>
<tr name="1754" id="1754">
<td><a id="l1754" class='ln'>1754</a></td><td> <a id="1754c13" class="tk">mtxData</a>-&gt;<a id="1754c22" class="tk">mxID</a> = <a id="1754c32" class="tk">mxCHAR_CLASS</a>;</td></tr>
<tr name="1755" id="1755">
<td><a id="l1755" class='ln'>1755</a></td><td> <a id="1755c13" class="tk">mtxData</a>-&gt;<a id="1755c22" class="tk">elSize</a> = <span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1756" id="1756">
<td><a id="l1756" class='ln'>1756</a></td><td> <a id="1756c13" class="tk">mtxData</a>-&gt;<a id="1756c22" class="tk">logical</a> = 0U;</td></tr>
<tr name="1757" id="1757">
<td><a id="l1757" class='ln'>1757</a></td><td> <a id="1757c13" class="tk">mtxData</a>-&gt;<a id="1757c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="1758" id="1758">
<td><a id="l1758" class='ln'>1758</a></td><td></td></tr>
<tr name="1759" id="1759">
<td><a id="l1759" class='ln'>1759</a></td><td> <a id="1759c13" class="tk">data</a> <a id="1759c18" class="tk">+=</a> <a id="1759c21" class="tk">labelLen</a>;</td></tr>
<tr name="1760" id="1760">
<td><a id="l1760" class='ln'>1760</a></td><td> <span class="br">}</span></td></tr>
<tr name="1761" id="1761">
<td><a id="l1761" class='ln'>1761</a></td><td> <a id="1761c9" class="tk">++</a><a id="1761c11" class="tk">sig</a>-&gt;<a id="1761c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="1762" id="1762">
<td><a id="l1762" class='ln'>1762</a></td><td> <span class="br">}</span></td></tr>
<tr name="1763" id="1763">
<td><a id="l1763" class='ln'>1763</a></td><td></td></tr>
<tr name="1764" id="1764">
<td><a id="l1764" class='ln'>1764</a></td><td> <span class="ct">/* plot styles */</span></td></tr>
<tr name="1765" id="1765">
<td><a id="l1765" class='ln'>1765</a></td><td> <span class="kw">if</span> (<a id="1765c9" class="tk">plotStyles</a> <a id="1765c20" class="tk">!=</a> <a id="1765c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1766" id="1766">
<td><a id="l1766" class='ln'>1766</a></td><td> <a id="1766c9" class="tk">real_T</a> <a id="1766c24" class="tk">*</a><a id="1766c25" class="tk">data</a>;</td></tr>
<tr name="1767" id="1767">
<td><a id="l1767" class='ln'>1767</a></td><td> <a id="1767c9" class="tk">size_t</a> <a id="1767c23" class="tk">nbytes</a>;</td></tr>
<tr name="1768" id="1768">
<td><a id="l1768" class='ln'>1768</a></td><td> <a id="1768c9" class="tk">int_T</a> <a id="1768c24" class="tk">dataLen</a> = 0;</td></tr>
<tr name="1769" id="1769">
<td><a id="l1769" class='ln'>1769</a></td><td> <a id="1769c9" class="tk">BuiltInDTypeId</a> <a id="1769c24" class="tk">dTypeId</a> = <a id="1769c37" class="tk">rt_GetActualDTypeID</a>(<a id="1769c57" class="tk">SS_DOUBLE</a>);</td></tr>
<tr name="1770" id="1770">
<td><a id="l1770" class='ln'>1770</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1771" id="1771">
<td><a id="l1771" class='ln'>1771</a></td><td> <a id="1771c9" class="tk">size_t</a> <a id="1771c24" class="tk">dataOffset</a> = <a id="1771c37" class="tk">nSignals</a><a id="1771c45" class="tk">*</a><span class="kw">sizeof</span>(<a id="1771c53" class="tk">MatrixData</a>);</td></tr>
<tr name="1772" id="1772">
<td><a id="l1772" class='ln'>1772</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1773" id="1773">
<td><a id="l1773" class='ln'>1773</a></td><td> <a id="1773c9" class="tk">uint_T</a> <a id="1773c24" class="tk">overhang</a> = (<a id="1773c38" class="tk">uint_T</a>)(<a id="1773c46" class="tk">dataOffset</a> <a id="1773c57" class="tk">%</a> <span class="kw">sizeof</span>(<a id="1773c66" class="tk">real_T</a>));</td></tr>
<tr name="1774" id="1774">
<td><a id="l1774" class='ln'>1774</a></td><td></td></tr>
<tr name="1775" id="1775">
<td><a id="l1775" class='ln'>1775</a></td><td> <span class="kw">if</span> (<a id="1775c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1776" id="1776">
<td><a id="l1776" class='ln'>1776</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="1777" id="1777">
<td><a id="l1777" class='ln'>1777</a></td><td> <a id="1777c13" class="tk">dataOffset</a> <a id="1777c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<a id="1777c35" class="tk">real_T</a>) <a id="1777c43" class="tk">-</a> <a id="1777c45" class="tk">overhang</a>);</td></tr>
<tr name="1778" id="1778">
<td><a id="l1778" class='ln'>1778</a></td><td> <span class="br">}</span></td></tr>
<tr name="1779" id="1779">
<td><a id="l1779" class='ln'>1779</a></td><td> <span class="kw">for</span> (<a id="1779c14" class="tk">i</a>=0; <a id="1779c19" class="tk">i</a><a id="1779c20" class="tk">&lt;</a> <a id="1779c22" class="tk">nSignals</a>; <a id="1779c32" class="tk">i</a><a id="1779c33" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1780" id="1780">
<td><a id="l1780" class='ln'>1780</a></td><td> <a id="1780c13" class="tk">dataLen</a> <a id="1780c21" class="tk">+=</a> <a id="1780c24" class="tk">numCols</a>[<a id="1780c32" class="tk">i</a>];</td></tr>
<tr name="1781" id="1781">
<td><a id="l1781" class='ln'>1781</a></td><td> <span class="br">}</span></td></tr>
<tr name="1782" id="1782">
<td><a id="l1782" class='ln'>1782</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1783" id="1783">
<td><a id="l1783" class='ln'>1783</a></td><td> <a id="1783c9" class="tk">nbytes</a> = <a id="1783c18" class="tk">dataOffset</a> <a id="1783c29" class="tk">+</a> <a id="1783c31" class="tk">dataLen</a><a id="1783c38" class="tk">*</a><span class="kw">sizeof</span>(<a id="1783c46" class="tk">real_T</a>);</td></tr>
<tr name="1784" id="1784">
<td><a id="l1784" class='ln'>1784</a></td><td></td></tr>
<tr name="1785" id="1785">
<td><a id="l1785" class='ln'>1785</a></td><td> <span class="kw">if</span> ( (<a id="1785c15" class="tk">sig</a>-&gt;<a id="1785c20" class="tk">plotStyles</a> = <a id="1785c33" class="tk">calloc</a>(<a id="1785c40" class="tk">nbytes</a>, 1)) <a id="1785c52" class="tk">==</a> <a id="1785c55" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="1785c67" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1786" id="1786">
<td><a id="l1786" class='ln'>1786</a></td><td></td></tr>
<tr name="1787" id="1787">
<td><a id="l1787" class='ln'>1787</a></td><td> <span class="ct">/*LINTED E_BAD_PTR_CAST_ALIGN*/</span></td></tr>
<tr name="1788" id="1788">
<td><a id="l1788" class='ln'>1788</a></td><td> <a id="1788c9" class="tk">data</a> = (<a id="1788c17" class="tk">real_T</a><a id="1788c23" class="tk">*</a>) (((<a id="1788c29" class="tk">char_T</a><a id="1788c35" class="tk">*</a>) (<a id="1788c39" class="tk">sig</a>-&gt;<a id="1788c44" class="tk">plotStyles</a>)) <a id="1788c57" class="tk">+</a> <a id="1788c59" class="tk">dataOffset</a>);</td></tr>
<tr name="1789" id="1789">
<td><a id="l1789" class='ln'>1789</a></td><td></td></tr>
<tr name="1790" id="1790">
<td><a id="l1790" class='ln'>1790</a></td><td> <span class="kw">for</span> (<a id="1790c14" class="tk">i</a> = 0; <a id="1790c21" class="tk">i</a> <a id="1790c23" class="tk">&lt;</a> <a id="1790c25" class="tk">dataLen</a>; <a id="1790c34" class="tk">i</a><a id="1790c35" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1791" id="1791">
<td><a id="l1791" class='ln'>1791</a></td><td> <a id="1791c13" class="tk">data</a>[<a id="1791c18" class="tk">i</a>] = <a id="1791c23" class="tk">plotStyles</a>[<a id="1791c34" class="tk">i</a>];</td></tr>
<tr name="1792" id="1792">
<td><a id="l1792" class='ln'>1792</a></td><td> <span class="br">}</span></td></tr>
<tr name="1793" id="1793">
<td><a id="l1793" class='ln'>1793</a></td><td></td></tr>
<tr name="1794" id="1794">
<td><a id="l1794" class='ln'>1794</a></td><td> <a id="1794c9" class="tk">dimsOffset</a> = 0;</td></tr>
<tr name="1795" id="1795">
<td><a id="l1795" class='ln'>1795</a></td><td> <span class="kw">for</span> (<a id="1795c14" class="tk">i</a> = 0; <a id="1795c21" class="tk">i</a> <a id="1795c23" class="tk">&lt;</a> <a id="1795c25" class="tk">nSignals</a>; <a id="1795c35" class="tk">i</a><a id="1795c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1796" id="1796">
<td><a id="l1796" class='ln'>1796</a></td><td> <a id="1796c13" class="tk">MatrixData</a> <a id="1796c24" class="tk">*</a><a id="1796c25" class="tk">mtxData</a> = <a id="1796c35" class="tk">&amp;</a>(<a id="1796c37" class="tk">sig</a>-&gt;<a id="1796c42" class="tk">plotStyles</a>[<a id="1796c53" class="tk">i</a>]);</td></tr>
<tr name="1797" id="1797">
<td><a id="l1797" class='ln'>1797</a></td><td> </td></tr>
<tr name="1798" id="1798">
<td><a id="l1798" class='ln'>1798</a></td><td> (<span class="kw">void</span>)<a id="1798c19" class="tk">memcpy</a>(<a id="1798c26" class="tk">mtxData</a>-&gt;<a id="1798c35" class="tk">name</a>, <a id="1798c41" class="tk">&amp;</a><a id="1798c42" class="tk">PLOTSTYLE_FIELD_NAME</a>, <a id="1798c64" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="1799" id="1799">
<td><a id="l1799" class='ln'>1799</a></td><td></td></tr>
<tr name="1800" id="1800">
<td><a id="l1800" class='ln'>1800</a></td><td> <a id="1800c13" class="tk">mtxData</a>-&gt;<a id="1800c22" class="tk">nRows</a> = (<a id="1800c33" class="tk">numCols</a>[<a id="1800c41" class="tk">i</a>]) <a id="1800c45" class="tk">?</a> 1 <a id="1800c49" class="tk">:</a> 0;</td></tr>
<tr name="1801" id="1801">
<td><a id="l1801" class='ln'>1801</a></td><td> <a id="1801c13" class="tk">mtxData</a>-&gt;<a id="1801c22" class="tk">nCols</a> = <a id="1801c32" class="tk">numCols</a>[<a id="1801c40" class="tk">i</a>];</td></tr>
<tr name="1802" id="1802">
<td><a id="l1802" class='ln'>1802</a></td><td></td></tr>
<tr name="1803" id="1803">
<td><a id="l1803" class='ln'>1803</a></td><td> <a id="1803c13" class="tk">mtxData</a>-&gt;<a id="1803c22" class="tk">nDims</a> = <a id="1803c32" class="tk">numDims</a>[<a id="1803c40" class="tk">i</a>];</td></tr>
<tr name="1804" id="1804">
<td><a id="l1804" class='ln'>1804</a></td><td> </td></tr>
<tr name="1805" id="1805">
<td><a id="l1805" class='ln'>1805</a></td><td> <span class="kw">if</span>(<a id="1805c16" class="tk">mtxData</a>-&gt;<a id="1805c25" class="tk">nDims</a> <a id="1805c31" class="tk">&gt;</a> 2) <span class="br">{</span></td></tr>
<tr name="1806" id="1806">
<td><a id="l1806" class='ln'>1806</a></td><td> <span class="kw">if</span> ((<a id="1806c22" class="tk">mtxData</a>-&gt;<a id="1806c31" class="tk">dims</a> = <a id="1806c38" class="tk">calloc</a>(<a id="1806c45" class="tk">mtxData</a>-&gt;<a id="1806c54" class="tk">nDims</a>, <span class="kw">sizeof</span>(<a id="1806c68" class="tk">int_T</a>))) <a id="1806c77" class="tk">==</a> <a id="1806c80" class="tk">NULL</a>) <span class="kw">goto</span> <a id="1806c91" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1807" id="1807">
<td><a id="l1807" class='ln'>1807</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1808" id="1808">
<td><a id="l1808" class='ln'>1808</a></td><td> <a id="1808c17" class="tk">mtxData</a>-&gt;<a id="1808c26" class="tk">dims</a> = <a id="1808c36" class="tk">mtxData</a>-&gt;<a id="1808c45" class="tk">_dims</a>;</td></tr>
<tr name="1809" id="1809">
<td><a id="l1809" class='ln'>1809</a></td><td> <span class="br">}</span></td></tr>
<tr name="1810" id="1810">
<td><a id="l1810" class='ln'>1810</a></td><td> </td></tr>
<tr name="1811" id="1811">
<td><a id="l1811" class='ln'>1811</a></td><td> <a id="1811c13" class="tk">mtxData</a>-&gt;<a id="1811c22" class="tk">dims</a>[0] = <a id="1811c32" class="tk">*</a>(<a id="1811c34" class="tk">dims</a> <a id="1811c39" class="tk">+</a> <a id="1811c41" class="tk">dimsOffset</a>);</td></tr>
<tr name="1812" id="1812">
<td><a id="l1812" class='ln'>1812</a></td><td> <span class="kw">if</span>(<a id="1812c16" class="tk">mtxData</a>-&gt;<a id="1812c25" class="tk">nDims</a> <a id="1812c31" class="tk">&gt;=</a> 2) <span class="br">{</span></td></tr>
<tr name="1813" id="1813">
<td><a id="l1813" class='ln'>1813</a></td><td> <a id="1813c17" class="tk">int32_T</a> <a id="1813c25" class="tk">j</a>;</td></tr>
<tr name="1814" id="1814">
<td><a id="l1814" class='ln'>1814</a></td><td> <span class="kw">for</span> (<a id="1814c22" class="tk">j</a>=1; <a id="1814c27" class="tk">j</a><a id="1814c28" class="tk">&lt;</a><a id="1814c29" class="tk">mtxData</a>-&gt;<a id="1814c38" class="tk">nDims</a>; <a id="1814c45" class="tk">j</a><a id="1814c46" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1815" id="1815">
<td><a id="l1815" class='ln'>1815</a></td><td> <a id="1815c21" class="tk">mtxData</a>-&gt;<a id="1815c30" class="tk">dims</a>[<a id="1815c35" class="tk">j</a>] = <a id="1815c40" class="tk">*</a>(<a id="1815c42" class="tk">dims</a> <a id="1815c47" class="tk">+</a> <a id="1815c49" class="tk">dimsOffset</a> <a id="1815c60" class="tk">+</a> <a id="1815c62" class="tk">j</a>);</td></tr>
<tr name="1816" id="1816">
<td><a id="l1816" class='ln'>1816</a></td><td> <span class="br">}</span></td></tr>
<tr name="1817" id="1817">
<td><a id="l1817" class='ln'>1817</a></td><td> <span class="br">}</span></td></tr>
<tr name="1818" id="1818">
<td><a id="l1818" class='ln'>1818</a></td><td></td></tr>
<tr name="1819" id="1819">
<td><a id="l1819" class='ln'>1819</a></td><td> <a id="1819c13" class="tk">mtxData</a>-&gt;<a id="1819c22" class="tk">re</a> = <a id="1819c32" class="tk">data</a>;</td></tr>
<tr name="1820" id="1820">
<td><a id="l1820" class='ln'>1820</a></td><td> <a id="1820c13" class="tk">mtxData</a>-&gt;<a id="1820c22" class="tk">im</a> = <a id="1820c32" class="tk">NULL</a>;</td></tr>
<tr name="1821" id="1821">
<td><a id="l1821" class='ln'>1821</a></td><td> <a id="1821c13" class="tk">mtxData</a>-&gt;<a id="1821c22" class="tk">dTypeID</a> = <a id="1821c32" class="tk">dTypeId</a>;</td></tr>
<tr name="1822" id="1822">
<td><a id="l1822" class='ln'>1822</a></td><td> <a id="1822c13" class="tk">mtxData</a>-&gt;<a id="1822c22" class="tk">mxID</a> = <a id="1822c32" class="tk">rt_GetMxIdFromDTypeId</a>(<a id="1822c54" class="tk">dTypeId</a>);</td></tr>
<tr name="1823" id="1823">
<td><a id="l1823" class='ln'>1823</a></td><td> <a id="1823c13" class="tk">mtxData</a>-&gt;<a id="1823c22" class="tk">elSize</a> = <a id="1823c32" class="tk">rt_GetSizeofDataType</a>(<a id="1823c53" class="tk">dTypeId</a>);</td></tr>
<tr name="1824" id="1824">
<td><a id="l1824" class='ln'>1824</a></td><td> <a id="1824c13" class="tk">mtxData</a>-&gt;<a id="1824c22" class="tk">logical</a> = 0U;</td></tr>
<tr name="1825" id="1825">
<td><a id="l1825" class='ln'>1825</a></td><td> <a id="1825c13" class="tk">mtxData</a>-&gt;<a id="1825c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="1826" id="1826">
<td><a id="l1826" class='ln'>1826</a></td><td></td></tr>
<tr name="1827" id="1827">
<td><a id="l1827" class='ln'>1827</a></td><td> <a id="1827c13" class="tk">data</a> <a id="1827c24" class="tk">+=</a> <a id="1827c27" class="tk">numCols</a>[<a id="1827c35" class="tk">i</a>];</td></tr>
<tr name="1828" id="1828">
<td><a id="l1828" class='ln'>1828</a></td><td> <a id="1828c13" class="tk">dimsOffset</a> <a id="1828c24" class="tk">+=</a> <a id="1828c27" class="tk">numDims</a>[<a id="1828c35" class="tk">i</a>];</td></tr>
<tr name="1829" id="1829">
<td><a id="l1829" class='ln'>1829</a></td><td> <span class="br">}</span></td></tr>
<tr name="1830" id="1830">
<td><a id="l1830" class='ln'>1830</a></td><td> <a id="1830c9" class="tk">++</a><a id="1830c11" class="tk">sig</a>-&gt;<a id="1830c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="1831" id="1831">
<td><a id="l1831" class='ln'>1831</a></td><td> <span class="br">}</span></td></tr>
<tr name="1832" id="1832">
<td><a id="l1832" class='ln'>1832</a></td><td></td></tr>
<tr name="1833" id="1833">
<td><a id="l1833" class='ln'>1833</a></td><td> <span class="ct">/* titles */</span></td></tr>
<tr name="1834" id="1834">
<td><a id="l1834" class='ln'>1834</a></td><td> <span class="kw">if</span> (<a id="1834c9" class="tk">titles</a> <a id="1834c16" class="tk">!=</a> <a id="1834c19" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1835" id="1835">
<td><a id="l1835" class='ln'>1835</a></td><td> <span class="kw">unsigned</span> <span class="kw">short</span> <a id="1835c25" class="tk">*</a><a id="1835c26" class="tk">data</a>;</td></tr>
<tr name="1836" id="1836">
<td><a id="l1836" class='ln'>1836</a></td><td> <a id="1836c9" class="tk">size_t</a> <a id="1836c16" class="tk">nbytes</a>;</td></tr>
<tr name="1837" id="1837">
<td><a id="l1837" class='ln'>1837</a></td><td> <a id="1837c9" class="tk">int_T</a> <a id="1837c16" class="tk">dataLen</a> = (<a id="1837c30" class="tk">int_T</a>)<a id="1837c36" class="tk">strlen</a>(<a id="1837c43" class="tk">titles</a>);</td></tr>
<tr name="1838" id="1838">
<td><a id="l1838" class='ln'>1838</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1839" id="1839">
<td><a id="l1839" class='ln'>1839</a></td><td> <a id="1839c9" class="tk">size_t</a> <a id="1839c17" class="tk">dataOffset</a> = <a id="1839c30" class="tk">nSignals</a> <a id="1839c39" class="tk">*</a> <span class="kw">sizeof</span>(<a id="1839c48" class="tk">MatrixData</a>);</td></tr>
<tr name="1840" id="1840">
<td><a id="l1840" class='ln'>1840</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1841" id="1841">
<td><a id="l1841" class='ln'>1841</a></td><td> <a id="1841c9" class="tk">uint_T</a> <a id="1841c17" class="tk">overhang</a> = (<a id="1841c31" class="tk">uint_T</a>)(<a id="1841c39" class="tk">dataOffset</a> <a id="1841c50" class="tk">%</a> <span class="kw">sizeof</span>(<span class="kw">short</span>));</td></tr>
<tr name="1842" id="1842">
<td><a id="l1842" class='ln'>1842</a></td><td></td></tr>
<tr name="1843" id="1843">
<td><a id="l1843" class='ln'>1843</a></td><td> <span class="kw">if</span> (<a id="1843c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1844" id="1844">
<td><a id="l1844" class='ln'>1844</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="1845" id="1845">
<td><a id="l1845" class='ln'>1845</a></td><td> <a id="1845c13" class="tk">dataOffset</a> <a id="1845c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<span class="kw">short</span>) <a id="1845c42" class="tk">-</a> <a id="1845c44" class="tk">overhang</a>);</td></tr>
<tr name="1846" id="1846">
<td><a id="l1846" class='ln'>1846</a></td><td> <span class="br">}</span></td></tr>
<tr name="1847" id="1847">
<td><a id="l1847" class='ln'>1847</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="1848" id="1848">
<td><a id="l1848" class='ln'>1848</a></td><td> <a id="1848c9" class="tk">nbytes</a> = <a id="1848c18" class="tk">dataOffset</a> <a id="1848c29" class="tk">+</a> <a id="1848c31" class="tk">dataLen</a><a id="1848c38" class="tk">*</a><span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1849" id="1849">
<td><a id="l1849" class='ln'>1849</a></td><td></td></tr>
<tr name="1850" id="1850">
<td><a id="l1850" class='ln'>1850</a></td><td> <span class="kw">if</span> ( (<a id="1850c15" class="tk">sig</a>-&gt;<a id="1850c20" class="tk">titles</a> = <a id="1850c29" class="tk">calloc</a>(<a id="1850c36" class="tk">nbytes</a>, 1)) <a id="1850c48" class="tk">==</a> <a id="1850c51" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="1850c63" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1851" id="1851">
<td><a id="l1851" class='ln'>1851</a></td><td></td></tr>
<tr name="1852" id="1852">
<td><a id="l1852" class='ln'>1852</a></td><td> <span class="ct">/*LINTED E_BAD_PTR_CAST_ALIGN*/</span></td></tr>
<tr name="1853" id="1853">
<td><a id="l1853" class='ln'>1853</a></td><td> <a id="1853c9" class="tk">data</a> = (<span class="kw">unsigned</span> <span class="kw">short</span><a id="1853c31" class="tk">*</a>) (((<a id="1853c37" class="tk">char_T</a><a id="1853c43" class="tk">*</a>) (<a id="1853c47" class="tk">sig</a>-&gt;<a id="1853c52" class="tk">titles</a>)) <a id="1853c61" class="tk">+</a> <a id="1853c63" class="tk">dataOffset</a>);</td></tr>
<tr name="1854" id="1854">
<td><a id="l1854" class='ln'>1854</a></td><td> <span class="kw">for</span> (<a id="1854c14" class="tk">i</a> = 0; <a id="1854c21" class="tk">i</a> <a id="1854c23" class="tk">&lt;</a> <a id="1854c25" class="tk">dataLen</a>; <a id="1854c34" class="tk">i</a><a id="1854c35" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1855" id="1855">
<td><a id="l1855" class='ln'>1855</a></td><td> <a id="1855c13" class="tk">data</a>[<a id="1855c18" class="tk">i</a>] = <a id="1855c23" class="tk">titles</a>[<a id="1855c30" class="tk">i</a>];</td></tr>
<tr name="1856" id="1856">
<td><a id="l1856" class='ln'>1856</a></td><td> <span class="br">}</span></td></tr>
<tr name="1857" id="1857">
<td><a id="l1857" class='ln'>1857</a></td><td></td></tr>
<tr name="1858" id="1858">
<td><a id="l1858" class='ln'>1858</a></td><td> <span class="kw">for</span> (<a id="1858c14" class="tk">i</a> = 0; <a id="1858c21" class="tk">i</a> <a id="1858c23" class="tk">&lt;</a> <a id="1858c25" class="tk">nSignals</a>; <a id="1858c35" class="tk">i</a><a id="1858c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1859" id="1859">
<td><a id="l1859" class='ln'>1859</a></td><td> <a id="1859c13" class="tk">MatrixData</a> <a id="1859c24" class="tk">*</a><a id="1859c25" class="tk">mtxData</a> = <a id="1859c35" class="tk">&amp;</a>(<a id="1859c37" class="tk">sig</a>-&gt;<a id="1859c42" class="tk">titles</a>[<a id="1859c49" class="tk">i</a>]);</td></tr>
<tr name="1860" id="1860">
<td><a id="l1860" class='ln'>1860</a></td><td></td></tr>
<tr name="1861" id="1861">
<td><a id="l1861" class='ln'>1861</a></td><td> (<span class="kw">void</span>)<a id="1861c19" class="tk">memcpy</a>(<a id="1861c26" class="tk">mtxData</a>-&gt;<a id="1861c35" class="tk">name</a>, <a id="1861c41" class="tk">&amp;</a><a id="1861c42" class="tk">TITLE_FIELD_NAME</a>, <a id="1861c60" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="1862" id="1862">
<td><a id="l1862" class='ln'>1862</a></td><td> <span class="kw">if</span> (<a id="1862c17" class="tk">titleLen</a>) <span class="br">{</span></td></tr>
<tr name="1863" id="1863">
<td><a id="l1863" class='ln'>1863</a></td><td> <a id="1863c17" class="tk">mtxData</a>-&gt;<a id="1863c26" class="tk">nRows</a> = (<a id="1863c37" class="tk">titleLen</a>[<a id="1863c46" class="tk">i</a>]) <a id="1863c50" class="tk">?</a> 1 <a id="1863c54" class="tk">:</a> 0;</td></tr>
<tr name="1864" id="1864">
<td><a id="l1864" class='ln'>1864</a></td><td> <a id="1864c17" class="tk">mtxData</a>-&gt;<a id="1864c26" class="tk">nCols</a> = <a id="1864c36" class="tk">titleLen</a>[<a id="1864c45" class="tk">i</a>];</td></tr>
<tr name="1865" id="1865">
<td><a id="l1865" class='ln'>1865</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1866" id="1866">
<td><a id="l1866" class='ln'>1866</a></td><td> <a id="1866c17" class="tk">mtxData</a>-&gt;<a id="1866c26" class="tk">nRows</a> = (<a id="1866c37" class="tk">dataLen</a>) <a id="1866c46" class="tk">?</a> 1 <a id="1866c50" class="tk">:</a> 0;</td></tr>
<tr name="1867" id="1867">
<td><a id="l1867" class='ln'>1867</a></td><td> <a id="1867c17" class="tk">mtxData</a>-&gt;<a id="1867c26" class="tk">nCols</a> = <a id="1867c36" class="tk">dataLen</a>;</td></tr>
<tr name="1868" id="1868">
<td><a id="l1868" class='ln'>1868</a></td><td> <span class="br">}</span></td></tr>
<tr name="1869" id="1869">
<td><a id="l1869" class='ln'>1869</a></td><td></td></tr>
<tr name="1870" id="1870">
<td><a id="l1870" class='ln'>1870</a></td><td> <a id="1870c13" class="tk">mtxData</a>-&gt;<a id="1870c22" class="tk">nDims</a> = 1; <span class="ct">/* assume */</span></td></tr>
<tr name="1871" id="1871">
<td><a id="l1871" class='ln'>1871</a></td><td> <a id="1871c13" class="tk">mtxData</a>-&gt;<a id="1871c22" class="tk">dims</a> = <a id="1871c32" class="tk">mtxData</a>-&gt;<a id="1871c41" class="tk">_dims</a>;</td></tr>
<tr name="1872" id="1872">
<td><a id="l1872" class='ln'>1872</a></td><td> <a id="1872c13" class="tk">mtxData</a>-&gt;<a id="1872c22" class="tk">dims</a>[0] = <a id="1872c32" class="tk">mtxData</a>-&gt;<a id="1872c41" class="tk">nCols</a>;</td></tr>
<tr name="1873" id="1873">
<td><a id="l1873" class='ln'>1873</a></td><td></td></tr>
<tr name="1874" id="1874">
<td><a id="l1874" class='ln'>1874</a></td><td> <a id="1874c13" class="tk">mtxData</a>-&gt;<a id="1874c22" class="tk">re</a> = <a id="1874c32" class="tk">data</a>;</td></tr>
<tr name="1875" id="1875">
<td><a id="l1875" class='ln'>1875</a></td><td> <a id="1875c13" class="tk">mtxData</a>-&gt;<a id="1875c22" class="tk">im</a> = <a id="1875c32" class="tk">NULL</a>;</td></tr>
<tr name="1876" id="1876">
<td><a id="l1876" class='ln'>1876</a></td><td> <a id="1876c13" class="tk">mtxData</a>-&gt;<a id="1876c22" class="tk">dTypeID</a> = <a id="1876c32" class="tk">SS_INT16</a>;</td></tr>
<tr name="1877" id="1877">
<td><a id="l1877" class='ln'>1877</a></td><td> <a id="1877c13" class="tk">mtxData</a>-&gt;<a id="1877c22" class="tk">mxID</a> = <a id="1877c32" class="tk">mxCHAR_CLASS</a>;</td></tr>
<tr name="1878" id="1878">
<td><a id="l1878" class='ln'>1878</a></td><td> <a id="1878c13" class="tk">mtxData</a>-&gt;<a id="1878c22" class="tk">elSize</a> = <span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1879" id="1879">
<td><a id="l1879" class='ln'>1879</a></td><td> <a id="1879c13" class="tk">mtxData</a>-&gt;<a id="1879c22" class="tk">logical</a> = 0U;</td></tr>
<tr name="1880" id="1880">
<td><a id="l1880" class='ln'>1880</a></td><td> <a id="1880c13" class="tk">mtxData</a>-&gt;<a id="1880c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="1881" id="1881">
<td><a id="l1881" class='ln'>1881</a></td><td></td></tr>
<tr name="1882" id="1882">
<td><a id="l1882" class='ln'>1882</a></td><td> <a id="1882c13" class="tk">data</a> <a id="1882c18" class="tk">+=</a> ((<a id="1882c23" class="tk">titleLen</a>) <a id="1882c33" class="tk">?</a> <a id="1882c35" class="tk">titleLen</a>[<a id="1882c44" class="tk">i</a>] <a id="1882c47" class="tk">:</a> <a id="1882c49" class="tk">dataLen</a>);</td></tr>
<tr name="1883" id="1883">
<td><a id="l1883" class='ln'>1883</a></td><td> <span class="br">}</span></td></tr>
<tr name="1884" id="1884">
<td><a id="l1884" class='ln'>1884</a></td><td> <a id="1884c9" class="tk">++</a><a id="1884c11" class="tk">sig</a>-&gt;<a id="1884c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="1885" id="1885">
<td><a id="l1885" class='ln'>1885</a></td><td> <span class="br">}</span></td></tr>
<tr name="1886" id="1886">
<td><a id="l1886" class='ln'>1886</a></td><td></td></tr>
<tr name="1887" id="1887">
<td><a id="l1887" class='ln'>1887</a></td><td> <span class="ct">/* block names */</span></td></tr>
<tr name="1888" id="1888">
<td><a id="l1888" class='ln'>1888</a></td><td> <span class="kw">if</span> (<a id="1888c9" class="tk">blockNames</a> <a id="1888c20" class="tk">!=</a> <a id="1888c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1889" id="1889">
<td><a id="l1889" class='ln'>1889</a></td><td> <span class="kw">unsigned</span> <span class="kw">short</span> <a id="1889c25" class="tk">*</a><a id="1889c26" class="tk">data</a>;</td></tr>
<tr name="1890" id="1890">
<td><a id="l1890" class='ln'>1890</a></td><td> <a id="1890c9" class="tk">size_t</a> <a id="1890c16" class="tk">nbytes</a>;</td></tr>
<tr name="1891" id="1891">
<td><a id="l1891" class='ln'>1891</a></td><td> <a id="1891c9" class="tk">int_T</a> <a id="1891c16" class="tk">dataLen</a> = 0;</td></tr>
<tr name="1892" id="1892">
<td><a id="l1892" class='ln'>1892</a></td><td> <a id="1892c9" class="tk">size_t</a> <a id="1892c16" class="tk">dataOffset</a> = <a id="1892c29" class="tk">nSignals</a> <a id="1892c38" class="tk">*</a> <span class="kw">sizeof</span>(<a id="1892c47" class="tk">MatrixData</a>);</td></tr>
<tr name="1893" id="1893">
<td><a id="l1893" class='ln'>1893</a></td><td> <a id="1893c9" class="tk">uint_T</a> <a id="1893c16" class="tk">overhang</a> = (<a id="1893c30" class="tk">uint_T</a>)(<a id="1893c38" class="tk">dataOffset</a> <a id="1893c49" class="tk">%</a> <span class="kw">sizeof</span>(<span class="kw">short</span>));</td></tr>
<tr name="1894" id="1894">
<td><a id="l1894" class='ln'>1894</a></td><td> <a id="1894c9" class="tk">int_T</a> <a id="1894c16" class="tk">dataIdx</a> = 0;</td></tr>
<tr name="1895" id="1895">
<td><a id="l1895" class='ln'>1895</a></td><td></td></tr>
<tr name="1896" id="1896">
<td><a id="l1896" class='ln'>1896</a></td><td> <span class="kw">for</span> (<a id="1896c14" class="tk">i</a>=0;<a id="1896c18" class="tk">i</a><a id="1896c19" class="tk">&lt;</a><a id="1896c20" class="tk">nSignals</a>;<a id="1896c29" class="tk">i</a><a id="1896c30" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1897" id="1897">
<td><a id="l1897" class='ln'>1897</a></td><td> <span class="kw">if</span> (<a id="1897c17" class="tk">blockNames</a>[<a id="1897c28" class="tk">i</a>] <a id="1897c31" class="tk">!=</a> <a id="1897c34" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1898" id="1898">
<td><a id="l1898" class='ln'>1898</a></td><td> <a id="1898c17" class="tk">dataLen</a> = <a id="1898c27" class="tk">dataLen</a> <a id="1898c35" class="tk">+</a> (<a id="1898c38" class="tk">int_T</a>)<a id="1898c44" class="tk">strlen</a>(<a id="1898c51" class="tk">blockNames</a>[<a id="1898c62" class="tk">i</a>]);</td></tr>
<tr name="1899" id="1899">
<td><a id="l1899" class='ln'>1899</a></td><td> <span class="br">}</span></td></tr>
<tr name="1900" id="1900">
<td><a id="l1900" class='ln'>1900</a></td><td> <span class="br">}</span></td></tr>
<tr name="1901" id="1901">
<td><a id="l1901" class='ln'>1901</a></td><td></td></tr>
<tr name="1902" id="1902">
<td><a id="l1902" class='ln'>1902</a></td><td> <span class="kw">if</span> (<a id="1902c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1903" id="1903">
<td><a id="l1903" class='ln'>1903</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="1904" id="1904">
<td><a id="l1904" class='ln'>1904</a></td><td> <a id="1904c13" class="tk">dataOffset</a> <a id="1904c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<span class="kw">short</span>) <a id="1904c42" class="tk">-</a> <a id="1904c44" class="tk">overhang</a>);</td></tr>
<tr name="1905" id="1905">
<td><a id="l1905" class='ln'>1905</a></td><td> <span class="br">}</span></td></tr>
<tr name="1906" id="1906">
<td><a id="l1906" class='ln'>1906</a></td><td></td></tr>
<tr name="1907" id="1907">
<td><a id="l1907" class='ln'>1907</a></td><td> <a id="1907c9" class="tk">nbytes</a> = <a id="1907c18" class="tk">dataOffset</a> <a id="1907c29" class="tk">+</a> <a id="1907c31" class="tk">dataLen</a><a id="1907c38" class="tk">*</a><span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1908" id="1908">
<td><a id="l1908" class='ln'>1908</a></td><td></td></tr>
<tr name="1909" id="1909">
<td><a id="l1909" class='ln'>1909</a></td><td> <span class="kw">if</span> ( (<a id="1909c15" class="tk">sig</a>-&gt;<a id="1909c20" class="tk">blockNames</a> = <a id="1909c33" class="tk">calloc</a>(<a id="1909c40" class="tk">nbytes</a>, 1)) <a id="1909c52" class="tk">==</a> <a id="1909c55" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="1909c67" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1910" id="1910">
<td><a id="l1910" class='ln'>1910</a></td><td></td></tr>
<tr name="1911" id="1911">
<td><a id="l1911" class='ln'>1911</a></td><td> <a id="1911c9" class="tk">data</a> = (<span class="kw">unsigned</span> <span class="kw">short</span><a id="1911c31" class="tk">*</a>) (((<a id="1911c37" class="tk">char_T</a><a id="1911c43" class="tk">*</a>) (<a id="1911c47" class="tk">sig</a>-&gt;<a id="1911c52" class="tk">blockNames</a>)) <a id="1911c65" class="tk">+</a> <a id="1911c67" class="tk">dataOffset</a>);</td></tr>
<tr name="1912" id="1912">
<td><a id="l1912" class='ln'>1912</a></td><td></td></tr>
<tr name="1913" id="1913">
<td><a id="l1913" class='ln'>1913</a></td><td> <span class="kw">for</span>(<a id="1913c13" class="tk">sigIdx</a>=0;<a id="1913c22" class="tk">sigIdx</a><a id="1913c28" class="tk">&lt;</a><a id="1913c29" class="tk">nSignals</a>;<a id="1913c38" class="tk">sigIdx</a><a id="1913c44" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1914" id="1914">
<td><a id="l1914" class='ln'>1914</a></td><td> <a id="1914c13" class="tk">int_T</a> <a id="1914c19" class="tk">nameLen</a> = (<a id="1914c30" class="tk">blockNames</a>[<a id="1914c41" class="tk">sigIdx</a>]<a id="1914c48" class="tk">==</a><a id="1914c50" class="tk">NULL</a>) <a id="1914c56" class="tk">?</a> 0 <a id="1914c60" class="tk">:</a> </td></tr>
<tr name="1915" id="1915">
<td><a id="l1915" class='ln'>1915</a></td><td> (<a id="1915c18" class="tk">int_T</a>)<a id="1915c24" class="tk">strlen</a>(<a id="1915c31" class="tk">blockNames</a>[<a id="1915c42" class="tk">sigIdx</a>]);</td></tr>
<tr name="1916" id="1916">
<td><a id="l1916" class='ln'>1916</a></td><td> <span class="kw">for</span> (<a id="1916c18" class="tk">i</a> = 0; <a id="1916c25" class="tk">i</a> <a id="1916c27" class="tk">&lt;</a> <a id="1916c29" class="tk">nameLen</a>; <a id="1916c38" class="tk">i</a><a id="1916c39" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1917" id="1917">
<td><a id="l1917" class='ln'>1917</a></td><td> <a id="1917c17" class="tk">data</a>[<a id="1917c22" class="tk">dataIdx</a><a id="1917c29" class="tk">++</a>] = (<a id="1917c36" class="tk">uint8_T</a>)<a id="1917c44" class="tk">blockNames</a>[<a id="1917c55" class="tk">sigIdx</a>][<a id="1917c63" class="tk">i</a>];</td></tr>
<tr name="1918" id="1918">
<td><a id="l1918" class='ln'>1918</a></td><td> <span class="br">}</span></td></tr>
<tr name="1919" id="1919">
<td><a id="l1919" class='ln'>1919</a></td><td> <span class="br">}</span></td></tr>
<tr name="1920" id="1920">
<td><a id="l1920" class='ln'>1920</a></td><td></td></tr>
<tr name="1921" id="1921">
<td><a id="l1921" class='ln'>1921</a></td><td> <span class="kw">for</span> (<a id="1921c14" class="tk">i</a> = 0; <a id="1921c21" class="tk">i</a> <a id="1921c23" class="tk">&lt;</a> <a id="1921c25" class="tk">nSignals</a>; <a id="1921c35" class="tk">i</a><a id="1921c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1922" id="1922">
<td><a id="l1922" class='ln'>1922</a></td><td> <a id="1922c13" class="tk">MatrixData</a> <a id="1922c24" class="tk">*</a><a id="1922c25" class="tk">mtxData</a> = <a id="1922c35" class="tk">&amp;</a>(<a id="1922c37" class="tk">sig</a>-&gt;<a id="1922c42" class="tk">blockNames</a>[<a id="1922c53" class="tk">i</a>]);</td></tr>
<tr name="1923" id="1923">
<td><a id="l1923" class='ln'>1923</a></td><td> <a id="1923c13" class="tk">int_T</a> <a id="1923c19" class="tk">blockNameLen</a> = (<a id="1923c35" class="tk">int_T</a>)<a id="1923c41" class="tk">strlen</a>(<a id="1923c48" class="tk">blockNames</a>[<a id="1923c59" class="tk">i</a>]);</td></tr>
<tr name="1924" id="1924">
<td><a id="l1924" class='ln'>1924</a></td><td></td></tr>
<tr name="1925" id="1925">
<td><a id="l1925" class='ln'>1925</a></td><td> (<span class="kw">void</span>)<a id="1925c19" class="tk">memcpy</a>(<a id="1925c26" class="tk">mtxData</a>-&gt;<a id="1925c35" class="tk">name</a>, <a id="1925c41" class="tk">&amp;</a><a id="1925c42" class="tk">BLOCKNAME_FIELD_NAME</a>, <a id="1925c64" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="1926" id="1926">
<td><a id="l1926" class='ln'>1926</a></td><td> <a id="1926c13" class="tk">mtxData</a>-&gt;<a id="1926c22" class="tk">nRows</a> = (<a id="1926c33" class="tk">blockNameLen</a>) <a id="1926c47" class="tk">?</a> 1 <a id="1926c51" class="tk">:</a> 0;</td></tr>
<tr name="1927" id="1927">
<td><a id="l1927" class='ln'>1927</a></td><td> <a id="1927c13" class="tk">mtxData</a>-&gt;<a id="1927c22" class="tk">nCols</a> = <a id="1927c32" class="tk">blockNameLen</a>;</td></tr>
<tr name="1928" id="1928">
<td><a id="l1928" class='ln'>1928</a></td><td></td></tr>
<tr name="1929" id="1929">
<td><a id="l1929" class='ln'>1929</a></td><td> <a id="1929c13" class="tk">mtxData</a>-&gt;<a id="1929c22" class="tk">nDims</a> = 1; <span class="ct">/* assume */</span></td></tr>
<tr name="1930" id="1930">
<td><a id="l1930" class='ln'>1930</a></td><td> <a id="1930c13" class="tk">mtxData</a>-&gt;<a id="1930c22" class="tk">dims</a> = <a id="1930c32" class="tk">mtxData</a>-&gt;<a id="1930c41" class="tk">_dims</a>;</td></tr>
<tr name="1931" id="1931">
<td><a id="l1931" class='ln'>1931</a></td><td> <a id="1931c13" class="tk">mtxData</a>-&gt;<a id="1931c22" class="tk">dims</a>[0] = <a id="1931c32" class="tk">mtxData</a>-&gt;<a id="1931c41" class="tk">nCols</a>;</td></tr>
<tr name="1932" id="1932">
<td><a id="l1932" class='ln'>1932</a></td><td></td></tr>
<tr name="1933" id="1933">
<td><a id="l1933" class='ln'>1933</a></td><td> <a id="1933c13" class="tk">mtxData</a>-&gt;<a id="1933c22" class="tk">re</a> = <a id="1933c32" class="tk">data</a>;</td></tr>
<tr name="1934" id="1934">
<td><a id="l1934" class='ln'>1934</a></td><td> <a id="1934c13" class="tk">mtxData</a>-&gt;<a id="1934c22" class="tk">im</a> = <a id="1934c32" class="tk">NULL</a>;</td></tr>
<tr name="1935" id="1935">
<td><a id="l1935" class='ln'>1935</a></td><td> <a id="1935c13" class="tk">mtxData</a>-&gt;<a id="1935c22" class="tk">dTypeID</a> = <a id="1935c32" class="tk">SS_INT16</a>;</td></tr>
<tr name="1936" id="1936">
<td><a id="l1936" class='ln'>1936</a></td><td> <a id="1936c13" class="tk">mtxData</a>-&gt;<a id="1936c22" class="tk">mxID</a> = <a id="1936c32" class="tk">mxCHAR_CLASS</a>;</td></tr>
<tr name="1937" id="1937">
<td><a id="l1937" class='ln'>1937</a></td><td> <a id="1937c13" class="tk">mtxData</a>-&gt;<a id="1937c22" class="tk">elSize</a> = <span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1938" id="1938">
<td><a id="l1938" class='ln'>1938</a></td><td> <a id="1938c13" class="tk">mtxData</a>-&gt;<a id="1938c22" class="tk">logical</a> = 0U;</td></tr>
<tr name="1939" id="1939">
<td><a id="l1939" class='ln'>1939</a></td><td> <a id="1939c13" class="tk">mtxData</a>-&gt;<a id="1939c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="1940" id="1940">
<td><a id="l1940" class='ln'>1940</a></td><td></td></tr>
<tr name="1941" id="1941">
<td><a id="l1941" class='ln'>1941</a></td><td> <a id="1941c13" class="tk">data</a> <a id="1941c18" class="tk">+=</a> <a id="1941c21" class="tk">blockNameLen</a>;</td></tr>
<tr name="1942" id="1942">
<td><a id="l1942" class='ln'>1942</a></td><td> <span class="br">}</span></td></tr>
<tr name="1943" id="1943">
<td><a id="l1943" class='ln'>1943</a></td><td> <a id="1943c9" class="tk">++</a><a id="1943c11" class="tk">sig</a>-&gt;<a id="1943c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="1944" id="1944">
<td><a id="l1944" class='ln'>1944</a></td><td> <span class="kw">if</span>(<a id="1944c12" class="tk">logValueDimensions</a>)<span class="br">{</span></td></tr>
<tr name="1945" id="1945">
<td><a id="l1945" class='ln'>1945</a></td><td> <a id="1945c13" class="tk">sig</a>-&gt;<a id="1945c18" class="tk">fieldNames</a> = <a id="1945c31" class="tk">rtGlobalLoggingSignalsStructFieldNames</a>;</td></tr>
<tr name="1946" id="1946">
<td><a id="l1946" class='ln'>1946</a></td><td> <span class="br">}</span></td></tr>
<tr name="1947" id="1947">
<td><a id="l1947" class='ln'>1947</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="1948" id="1948">
<td><a id="l1948" class='ln'>1948</a></td><td> <a id="1948c13" class="tk">sig</a>-&gt;<a id="1948c18" class="tk">fieldNames</a> = <a id="1948c31" class="tk">rtGlobalLoggingSignalsStructFieldNames_noValDims</a>;</td></tr>
<tr name="1949" id="1949">
<td><a id="l1949" class='ln'>1949</a></td><td> <span class="br">}</span></td></tr>
<tr name="1950" id="1950">
<td><a id="l1950" class='ln'>1950</a></td><td></td></tr>
<tr name="1951" id="1951">
<td><a id="l1951" class='ln'>1951</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="1952" id="1952">
<td><a id="l1952" class='ln'>1952</a></td><td> <span class="kw">if</span>(<a id="1952c12" class="tk">logValueDimensions</a>)<span class="br">{</span></td></tr>
<tr name="1953" id="1953">
<td><a id="l1953" class='ln'>1953</a></td><td> <a id="1953c13" class="tk">sig</a>-&gt;<a id="1953c18" class="tk">fieldNames</a> = <a id="1953c31" class="tk">rtLocalLoggingSignalsStructFieldNames</a>;</td></tr>
<tr name="1954" id="1954">
<td><a id="l1954" class='ln'>1954</a></td><td> <span class="br">}</span></td></tr>
<tr name="1955" id="1955">
<td><a id="l1955" class='ln'>1955</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="1956" id="1956">
<td><a id="l1956" class='ln'>1956</a></td><td> <a id="1956c13" class="tk">sig</a>-&gt;<a id="1956c18" class="tk">fieldNames</a> = <a id="1956c31" class="tk">rtLocalLoggingSignalsStructFieldNames_noValDims</a>;</td></tr>
<tr name="1957" id="1957">
<td><a id="l1957" class='ln'>1957</a></td><td> <span class="br">}</span></td></tr>
<tr name="1958" id="1958">
<td><a id="l1958" class='ln'>1958</a></td><td></td></tr>
<tr name="1959" id="1959">
<td><a id="l1959" class='ln'>1959</a></td><td> <span class="br">}</span></td></tr>
<tr name="1960" id="1960">
<td><a id="l1960" class='ln'>1960</a></td><td></td></tr>
<tr name="1961" id="1961">
<td><a id="l1961" class='ln'>1961</a></td><td> <span class="ct">/* state names */</span></td></tr>
<tr name="1962" id="1962">
<td><a id="l1962" class='ln'>1962</a></td><td> <span class="kw">if</span> (<a id="1962c9" class="tk">stateNames</a> <a id="1962c20" class="tk">!=</a> <a id="1962c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1963" id="1963">
<td><a id="l1963" class='ln'>1963</a></td><td> <span class="kw">unsigned</span> <span class="kw">short</span> <a id="1963c25" class="tk">*</a><a id="1963c26" class="tk">data</a>;</td></tr>
<tr name="1964" id="1964">
<td><a id="l1964" class='ln'>1964</a></td><td> <a id="1964c9" class="tk">size_t</a> <a id="1964c16" class="tk">nbytes</a>;</td></tr>
<tr name="1965" id="1965">
<td><a id="l1965" class='ln'>1965</a></td><td> <a id="1965c9" class="tk">int_T</a> <a id="1965c16" class="tk">dataLen</a> = 0;</td></tr>
<tr name="1966" id="1966">
<td><a id="l1966" class='ln'>1966</a></td><td> <a id="1966c9" class="tk">size_t</a> <a id="1966c16" class="tk">dataOffset</a> = <a id="1966c29" class="tk">nSignals</a> <a id="1966c38" class="tk">*</a> <span class="kw">sizeof</span>(<a id="1966c47" class="tk">MatrixData</a>);</td></tr>
<tr name="1967" id="1967">
<td><a id="l1967" class='ln'>1967</a></td><td> <a id="1967c9" class="tk">uint_T</a> <a id="1967c16" class="tk">overhang</a> = (<a id="1967c30" class="tk">uint_T</a>)(<a id="1967c38" class="tk">dataOffset</a> <a id="1967c49" class="tk">%</a> <span class="kw">sizeof</span>(<span class="kw">short</span>));</td></tr>
<tr name="1968" id="1968">
<td><a id="l1968" class='ln'>1968</a></td><td> <a id="1968c9" class="tk">int_T</a> <a id="1968c16" class="tk">dataIdx</a> = 0;</td></tr>
<tr name="1969" id="1969">
<td><a id="l1969" class='ln'>1969</a></td><td></td></tr>
<tr name="1970" id="1970">
<td><a id="l1970" class='ln'>1970</a></td><td> <span class="kw">for</span> (<a id="1970c14" class="tk">i</a>=0;<a id="1970c18" class="tk">i</a><a id="1970c19" class="tk">&lt;</a><a id="1970c20" class="tk">nSignals</a>;<a id="1970c29" class="tk">i</a><a id="1970c30" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1971" id="1971">
<td><a id="l1971" class='ln'>1971</a></td><td> <span class="kw">if</span> (<a id="1971c17" class="tk">stateNames</a>[<a id="1971c28" class="tk">i</a>] <a id="1971c31" class="tk">!=</a> <a id="1971c34" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="1972" id="1972">
<td><a id="l1972" class='ln'>1972</a></td><td> <a id="1972c17" class="tk">dataLen</a> = <a id="1972c27" class="tk">dataLen</a> <a id="1972c35" class="tk">+</a> (<a id="1972c38" class="tk">int_T</a>)<a id="1972c44" class="tk">strlen</a>(<a id="1972c51" class="tk">stateNames</a>[<a id="1972c62" class="tk">i</a>]);</td></tr>
<tr name="1973" id="1973">
<td><a id="l1973" class='ln'>1973</a></td><td> <span class="br">}</span></td></tr>
<tr name="1974" id="1974">
<td><a id="l1974" class='ln'>1974</a></td><td> <span class="br">}</span></td></tr>
<tr name="1975" id="1975">
<td><a id="l1975" class='ln'>1975</a></td><td></td></tr>
<tr name="1976" id="1976">
<td><a id="l1976" class='ln'>1976</a></td><td> <span class="kw">if</span> (<a id="1976c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="1977" id="1977">
<td><a id="l1977" class='ln'>1977</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="1978" id="1978">
<td><a id="l1978" class='ln'>1978</a></td><td> <a id="1978c13" class="tk">dataOffset</a> <a id="1978c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<span class="kw">short</span>) <a id="1978c42" class="tk">-</a> <a id="1978c44" class="tk">overhang</a>);</td></tr>
<tr name="1979" id="1979">
<td><a id="l1979" class='ln'>1979</a></td><td> <span class="br">}</span></td></tr>
<tr name="1980" id="1980">
<td><a id="l1980" class='ln'>1980</a></td><td></td></tr>
<tr name="1981" id="1981">
<td><a id="l1981" class='ln'>1981</a></td><td> <a id="1981c9" class="tk">nbytes</a> = <a id="1981c18" class="tk">dataOffset</a> <a id="1981c29" class="tk">+</a> <a id="1981c31" class="tk">dataLen</a><a id="1981c38" class="tk">*</a><span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="1982" id="1982">
<td><a id="l1982" class='ln'>1982</a></td><td></td></tr>
<tr name="1983" id="1983">
<td><a id="l1983" class='ln'>1983</a></td><td> <span class="kw">if</span> ( (<a id="1983c15" class="tk">sig</a>-&gt;<a id="1983c20" class="tk">stateNames</a> = <a id="1983c33" class="tk">calloc</a>(<a id="1983c40" class="tk">nbytes</a>, 1)) <a id="1983c52" class="tk">==</a> <a id="1983c55" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="1983c67" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="1984" id="1984">
<td><a id="l1984" class='ln'>1984</a></td><td></td></tr>
<tr name="1985" id="1985">
<td><a id="l1985" class='ln'>1985</a></td><td> <a id="1985c9" class="tk">data</a> = (<span class="kw">unsigned</span> <span class="kw">short</span><a id="1985c31" class="tk">*</a>) (((<a id="1985c37" class="tk">char_T</a><a id="1985c43" class="tk">*</a>) (<a id="1985c47" class="tk">sig</a>-&gt;<a id="1985c52" class="tk">stateNames</a>)) <a id="1985c65" class="tk">+</a> <a id="1985c67" class="tk">dataOffset</a>);</td></tr>
<tr name="1986" id="1986">
<td><a id="l1986" class='ln'>1986</a></td><td></td></tr>
<tr name="1987" id="1987">
<td><a id="l1987" class='ln'>1987</a></td><td> <span class="kw">for</span>(<a id="1987c13" class="tk">sigIdx</a>=0;<a id="1987c22" class="tk">sigIdx</a><a id="1987c28" class="tk">&lt;</a><a id="1987c29" class="tk">nSignals</a>;<a id="1987c38" class="tk">sigIdx</a><a id="1987c44" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1988" id="1988">
<td><a id="l1988" class='ln'>1988</a></td><td> <a id="1988c13" class="tk">int_T</a> <a id="1988c19" class="tk">nameLen</a> = (<a id="1988c30" class="tk">stateNames</a>[<a id="1988c41" class="tk">sigIdx</a>]<a id="1988c48" class="tk">==</a><a id="1988c50" class="tk">NULL</a>) <a id="1988c56" class="tk">?</a> 0 <a id="1988c60" class="tk">:</a> </td></tr>
<tr name="1989" id="1989">
<td><a id="l1989" class='ln'>1989</a></td><td> (<a id="1989c18" class="tk">int_T</a>)<a id="1989c24" class="tk">strlen</a>(<a id="1989c31" class="tk">stateNames</a>[<a id="1989c42" class="tk">sigIdx</a>]);</td></tr>
<tr name="1990" id="1990">
<td><a id="l1990" class='ln'>1990</a></td><td> <span class="kw">for</span> (<a id="1990c18" class="tk">i</a> = 0; <a id="1990c25" class="tk">i</a> <a id="1990c27" class="tk">&lt;</a> <a id="1990c29" class="tk">nameLen</a>; <a id="1990c38" class="tk">i</a><a id="1990c39" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1991" id="1991">
<td><a id="l1991" class='ln'>1991</a></td><td> <a id="1991c17" class="tk">data</a>[<a id="1991c22" class="tk">dataIdx</a><a id="1991c29" class="tk">++</a>] = (<a id="1991c36" class="tk">uint8_T</a>)<a id="1991c44" class="tk">stateNames</a>[<a id="1991c55" class="tk">sigIdx</a>][<a id="1991c63" class="tk">i</a>];</td></tr>
<tr name="1992" id="1992">
<td><a id="l1992" class='ln'>1992</a></td><td> <span class="br">}</span></td></tr>
<tr name="1993" id="1993">
<td><a id="l1993" class='ln'>1993</a></td><td> <span class="br">}</span></td></tr>
<tr name="1994" id="1994">
<td><a id="l1994" class='ln'>1994</a></td><td></td></tr>
<tr name="1995" id="1995">
<td><a id="l1995" class='ln'>1995</a></td><td> <span class="kw">for</span> (<a id="1995c14" class="tk">i</a> = 0; <a id="1995c21" class="tk">i</a> <a id="1995c23" class="tk">&lt;</a> <a id="1995c25" class="tk">nSignals</a>; <a id="1995c35" class="tk">i</a><a id="1995c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="1996" id="1996">
<td><a id="l1996" class='ln'>1996</a></td><td> <a id="1996c13" class="tk">MatrixData</a> <a id="1996c24" class="tk">*</a><a id="1996c25" class="tk">mtxData</a> = <a id="1996c35" class="tk">&amp;</a>(<a id="1996c37" class="tk">sig</a>-&gt;<a id="1996c42" class="tk">stateNames</a>[<a id="1996c53" class="tk">i</a>]);</td></tr>
<tr name="1997" id="1997">
<td><a id="l1997" class='ln'>1997</a></td><td> <a id="1997c13" class="tk">int_T</a> <a id="1997c19" class="tk">stateNameLen</a> = (<a id="1997c35" class="tk">int_T</a>)<a id="1997c41" class="tk">strlen</a>(<a id="1997c48" class="tk">stateNames</a>[<a id="1997c59" class="tk">i</a>]);</td></tr>
<tr name="1998" id="1998">
<td><a id="l1998" class='ln'>1998</a></td><td></td></tr>
<tr name="1999" id="1999">
<td><a id="l1999" class='ln'>1999</a></td><td> (<span class="kw">void</span>)<a id="1999c19" class="tk">memcpy</a>(<a id="1999c26" class="tk">mtxData</a>-&gt;<a id="1999c35" class="tk">name</a>, <a id="1999c41" class="tk">&amp;</a><a id="1999c42" class="tk">STATENAME_FIELD_NAME</a>, <a id="1999c64" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="2000" id="2000">
<td><a id="l2000" class='ln'>2000</a></td><td> <a id="2000c13" class="tk">mtxData</a>-&gt;<a id="2000c22" class="tk">nRows</a> = (<a id="2000c33" class="tk">stateNameLen</a>) <a id="2000c47" class="tk">?</a> 1 <a id="2000c51" class="tk">:</a> 0;</td></tr>
<tr name="2001" id="2001">
<td><a id="l2001" class='ln'>2001</a></td><td> <a id="2001c13" class="tk">mtxData</a>-&gt;<a id="2001c22" class="tk">nCols</a> = <a id="2001c32" class="tk">stateNameLen</a>;</td></tr>
<tr name="2002" id="2002">
<td><a id="l2002" class='ln'>2002</a></td><td></td></tr>
<tr name="2003" id="2003">
<td><a id="l2003" class='ln'>2003</a></td><td> <a id="2003c13" class="tk">mtxData</a>-&gt;<a id="2003c22" class="tk">nDims</a> = 1; <span class="ct">/* assume */</span></td></tr>
<tr name="2004" id="2004">
<td><a id="l2004" class='ln'>2004</a></td><td> <a id="2004c13" class="tk">mtxData</a>-&gt;<a id="2004c22" class="tk">dims</a> = <a id="2004c32" class="tk">mtxData</a>-&gt;<a id="2004c41" class="tk">_dims</a>;</td></tr>
<tr name="2005" id="2005">
<td><a id="l2005" class='ln'>2005</a></td><td> <a id="2005c13" class="tk">mtxData</a>-&gt;<a id="2005c22" class="tk">dims</a>[0] = <a id="2005c32" class="tk">mtxData</a>-&gt;<a id="2005c41" class="tk">nCols</a>;</td></tr>
<tr name="2006" id="2006">
<td><a id="l2006" class='ln'>2006</a></td><td></td></tr>
<tr name="2007" id="2007">
<td><a id="l2007" class='ln'>2007</a></td><td> <a id="2007c13" class="tk">mtxData</a>-&gt;<a id="2007c22" class="tk">re</a> = <a id="2007c32" class="tk">data</a>;</td></tr>
<tr name="2008" id="2008">
<td><a id="l2008" class='ln'>2008</a></td><td> <a id="2008c13" class="tk">mtxData</a>-&gt;<a id="2008c22" class="tk">im</a> = <a id="2008c32" class="tk">NULL</a>;</td></tr>
<tr name="2009" id="2009">
<td><a id="l2009" class='ln'>2009</a></td><td> <a id="2009c13" class="tk">mtxData</a>-&gt;<a id="2009c22" class="tk">dTypeID</a> = <a id="2009c32" class="tk">SS_INT16</a>;</td></tr>
<tr name="2010" id="2010">
<td><a id="l2010" class='ln'>2010</a></td><td> <a id="2010c13" class="tk">mtxData</a>-&gt;<a id="2010c22" class="tk">mxID</a> = <a id="2010c32" class="tk">mxCHAR_CLASS</a>;</td></tr>
<tr name="2011" id="2011">
<td><a id="l2011" class='ln'>2011</a></td><td> <a id="2011c13" class="tk">mtxData</a>-&gt;<a id="2011c22" class="tk">elSize</a> = <span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="2012" id="2012">
<td><a id="l2012" class='ln'>2012</a></td><td> <a id="2012c13" class="tk">mtxData</a>-&gt;<a id="2012c22" class="tk">logical</a> = 0U;</td></tr>
<tr name="2013" id="2013">
<td><a id="l2013" class='ln'>2013</a></td><td> <a id="2013c13" class="tk">mtxData</a>-&gt;<a id="2013c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="2014" id="2014">
<td><a id="l2014" class='ln'>2014</a></td><td></td></tr>
<tr name="2015" id="2015">
<td><a id="l2015" class='ln'>2015</a></td><td> <a id="2015c13" class="tk">data</a> <a id="2015c18" class="tk">+=</a> <a id="2015c21" class="tk">stateNameLen</a>;</td></tr>
<tr name="2016" id="2016">
<td><a id="l2016" class='ln'>2016</a></td><td> <span class="br">}</span></td></tr>
<tr name="2017" id="2017">
<td><a id="l2017" class='ln'>2017</a></td><td> <a id="2017c9" class="tk">++</a><a id="2017c11" class="tk">sig</a>-&gt;<a id="2017c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="2018" id="2018">
<td><a id="l2018" class='ln'>2018</a></td><td></td></tr>
<tr name="2019" id="2019">
<td><a id="l2019" class='ln'>2019</a></td><td> <span class="kw">if</span>(<a id="2019c12" class="tk">logValueDimensions</a>)<span class="br">{</span></td></tr>
<tr name="2020" id="2020">
<td><a id="l2020" class='ln'>2020</a></td><td> <a id="2020c13" class="tk">sig</a>-&gt;<a id="2020c18" class="tk">fieldNames</a> = <a id="2020c31" class="tk">rtGlobalLoggingSignalsStructFieldNames</a>;</td></tr>
<tr name="2021" id="2021">
<td><a id="l2021" class='ln'>2021</a></td><td> <span class="br">}</span></td></tr>
<tr name="2022" id="2022">
<td><a id="l2022" class='ln'>2022</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="2023" id="2023">
<td><a id="l2023" class='ln'>2023</a></td><td> <a id="2023c13" class="tk">sig</a>-&gt;<a id="2023c18" class="tk">fieldNames</a> = <a id="2023c31" class="tk">rtGlobalLoggingSignalsStructFieldNames_noValDims</a>;</td></tr>
<tr name="2024" id="2024">
<td><a id="l2024" class='ln'>2024</a></td><td> <span class="br">}</span></td></tr>
<tr name="2025" id="2025">
<td><a id="l2025" class='ln'>2025</a></td><td></td></tr>
<tr name="2026" id="2026">
<td><a id="l2026" class='ln'>2026</a></td><td> <span class="br">}</span></td></tr>
<tr name="2027" id="2027">
<td><a id="l2027" class='ln'>2027</a></td><td></td></tr>
<tr name="2028" id="2028">
<td><a id="l2028" class='ln'>2028</a></td><td> <span class="ct">/* CrossMdlRef */</span></td></tr>
<tr name="2029" id="2029">
<td><a id="l2029" class='ln'>2029</a></td><td> <span class="kw">if</span> (<a id="2029c9" class="tk">crossMdlRef</a> <a id="2029c21" class="tk">!=</a> <a id="2029c24" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2030" id="2030">
<td><a id="l2030" class='ln'>2030</a></td><td> <a id="2030c9" class="tk">real_T</a> <a id="2030c17" class="tk">*</a><a id="2030c18" class="tk">data</a>;</td></tr>
<tr name="2031" id="2031">
<td><a id="l2031" class='ln'>2031</a></td><td> <a id="2031c9" class="tk">size_t</a> <a id="2031c16" class="tk">nbytes</a>;</td></tr>
<tr name="2032" id="2032">
<td><a id="l2032" class='ln'>2032</a></td><td> <a id="2032c9" class="tk">size_t</a> <a id="2032c16" class="tk">dataOffset</a> = <a id="2032c29" class="tk">nSignals</a> <a id="2032c38" class="tk">*</a> <span class="kw">sizeof</span>(<a id="2032c47" class="tk">MatrixData</a>);</td></tr>
<tr name="2033" id="2033">
<td><a id="l2033" class='ln'>2033</a></td><td> <a id="2033c9" class="tk">uint_T</a> <a id="2033c16" class="tk">overhang</a> = (<a id="2033c30" class="tk">uint_T</a>)(<a id="2033c38" class="tk">dataOffset</a> <a id="2033c49" class="tk">%</a> <span class="kw">sizeof</span>(<a id="2033c58" class="tk">real_T</a>));</td></tr>
<tr name="2034" id="2034">
<td><a id="l2034" class='ln'>2034</a></td><td></td></tr>
<tr name="2035" id="2035">
<td><a id="l2035" class='ln'>2035</a></td><td> <span class="kw">if</span> (<a id="2035c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="2036" id="2036">
<td><a id="l2036" class='ln'>2036</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="2037" id="2037">
<td><a id="l2037" class='ln'>2037</a></td><td> <a id="2037c13" class="tk">dataOffset</a> <a id="2037c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<a id="2037c35" class="tk">real_T</a>) <a id="2037c43" class="tk">-</a> <a id="2037c45" class="tk">overhang</a>);</td></tr>
<tr name="2038" id="2038">
<td><a id="l2038" class='ln'>2038</a></td><td> <span class="br">}</span></td></tr>
<tr name="2039" id="2039">
<td><a id="l2039" class='ln'>2039</a></td><td></td></tr>
<tr name="2040" id="2040">
<td><a id="l2040" class='ln'>2040</a></td><td> <a id="2040c9" class="tk">nbytes</a> = <a id="2040c18" class="tk">dataOffset</a> <a id="2040c29" class="tk">+</a> <a id="2040c31" class="tk">nSignals</a><a id="2040c39" class="tk">*</a><span class="kw">sizeof</span>(<a id="2040c47" class="tk">real_T</a>);</td></tr>
<tr name="2041" id="2041">
<td><a id="l2041" class='ln'>2041</a></td><td></td></tr>
<tr name="2042" id="2042">
<td><a id="l2042" class='ln'>2042</a></td><td> <span class="kw">if</span> ( (<a id="2042c15" class="tk">sig</a>-&gt;<a id="2042c20" class="tk">crossMdlRef</a> = <a id="2042c34" class="tk">calloc</a>(<a id="2042c41" class="tk">nbytes</a>, 1)) <a id="2042c53" class="tk">==</a> <a id="2042c56" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="2042c68" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2043" id="2043">
<td><a id="l2043" class='ln'>2043</a></td><td></td></tr>
<tr name="2044" id="2044">
<td><a id="l2044" class='ln'>2044</a></td><td> <a id="2044c9" class="tk">data</a> = (<a id="2044c17" class="tk">real_T</a><a id="2044c23" class="tk">*</a>) (((<a id="2044c29" class="tk">char_T</a><a id="2044c35" class="tk">*</a>) (<a id="2044c39" class="tk">sig</a>-&gt;<a id="2044c44" class="tk">crossMdlRef</a>)) <a id="2044c58" class="tk">+</a> <a id="2044c60" class="tk">dataOffset</a>);</td></tr>
<tr name="2045" id="2045">
<td><a id="l2045" class='ln'>2045</a></td><td></td></tr>
<tr name="2046" id="2046">
<td><a id="l2046" class='ln'>2046</a></td><td> <span class="kw">for</span>(<a id="2046c13" class="tk">sigIdx</a>=0;<a id="2046c22" class="tk">sigIdx</a><a id="2046c28" class="tk">&lt;</a><a id="2046c29" class="tk">nSignals</a>;<a id="2046c38" class="tk">sigIdx</a><a id="2046c44" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2047" id="2047">
<td><a id="l2047" class='ln'>2047</a></td><td> <a id="2047c13" class="tk">data</a>[<a id="2047c18" class="tk">sigIdx</a>] = <a id="2047c28" class="tk">crossMdlRef</a>[<a id="2047c40" class="tk">sigIdx</a>];</td></tr>
<tr name="2048" id="2048">
<td><a id="l2048" class='ln'>2048</a></td><td> <span class="br">}</span></td></tr>
<tr name="2049" id="2049">
<td><a id="l2049" class='ln'>2049</a></td><td></td></tr>
<tr name="2050" id="2050">
<td><a id="l2050" class='ln'>2050</a></td><td> <span class="kw">for</span> (<a id="2050c14" class="tk">i</a> = 0; <a id="2050c21" class="tk">i</a> <a id="2050c23" class="tk">&lt;</a> <a id="2050c25" class="tk">nSignals</a>; <a id="2050c35" class="tk">i</a><a id="2050c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2051" id="2051">
<td><a id="l2051" class='ln'>2051</a></td><td> <a id="2051c13" class="tk">MatrixData</a> <a id="2051c24" class="tk">*</a><a id="2051c25" class="tk">mtxData</a> = <a id="2051c35" class="tk">&amp;</a>(<a id="2051c37" class="tk">sig</a>-&gt;<a id="2051c42" class="tk">crossMdlRef</a>[<a id="2051c54" class="tk">i</a>]);</td></tr>
<tr name="2052" id="2052">
<td><a id="l2052" class='ln'>2052</a></td><td></td></tr>
<tr name="2053" id="2053">
<td><a id="l2053" class='ln'>2053</a></td><td> (<span class="kw">void</span>)<a id="2053c19" class="tk">memcpy</a>(<a id="2053c26" class="tk">mtxData</a>-&gt;<a id="2053c35" class="tk">name</a>, <a id="2053c41" class="tk">&amp;</a><a id="2053c42" class="tk">CROSS_MDL_REF_FIELD_NAME</a>, <a id="2053c68" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="2054" id="2054">
<td><a id="l2054" class='ln'>2054</a></td><td> <a id="2054c13" class="tk">mtxData</a>-&gt;<a id="2054c22" class="tk">nRows</a> = 1;</td></tr>
<tr name="2055" id="2055">
<td><a id="l2055" class='ln'>2055</a></td><td> <a id="2055c13" class="tk">mtxData</a>-&gt;<a id="2055c22" class="tk">nCols</a> = 1;</td></tr>
<tr name="2056" id="2056">
<td><a id="l2056" class='ln'>2056</a></td><td> <a id="2056c13" class="tk">mtxData</a>-&gt;<a id="2056c22" class="tk">nDims</a> = 1; <span class="ct">/* =&gt; matlab scalar */</span></td></tr>
<tr name="2057" id="2057">
<td><a id="l2057" class='ln'>2057</a></td><td></td></tr>
<tr name="2058" id="2058">
<td><a id="l2058" class='ln'>2058</a></td><td> <a id="2058c13" class="tk">mtxData</a>-&gt;<a id="2058c22" class="tk">re</a> = <a id="2058c32" class="tk">&amp;</a><a id="2058c33" class="tk">data</a>[<a id="2058c38" class="tk">i</a>];</td></tr>
<tr name="2059" id="2059">
<td><a id="l2059" class='ln'>2059</a></td><td> <a id="2059c13" class="tk">mtxData</a>-&gt;<a id="2059c22" class="tk">im</a> = <a id="2059c32" class="tk">NULL</a>;</td></tr>
<tr name="2060" id="2060">
<td><a id="l2060" class='ln'>2060</a></td><td> <a id="2060c13" class="tk">mtxData</a>-&gt;<a id="2060c22" class="tk">dTypeID</a> = <a id="2060c32" class="tk">SS_DOUBLE</a>;</td></tr>
<tr name="2061" id="2061">
<td><a id="l2061" class='ln'>2061</a></td><td> <a id="2061c13" class="tk">mtxData</a>-&gt;<a id="2061c22" class="tk">mxID</a> = <a id="2061c32" class="tk">rt_GetMxIdFromDTypeId</a>(<a id="2061c54" class="tk">SS_DOUBLE</a>);</td></tr>
<tr name="2062" id="2062">
<td><a id="l2062" class='ln'>2062</a></td><td> <a id="2062c13" class="tk">mtxData</a>-&gt;<a id="2062c22" class="tk">elSize</a> = <span class="kw">sizeof</span>(<a id="2062c39" class="tk">real_T</a>);</td></tr>
<tr name="2063" id="2063">
<td><a id="l2063" class='ln'>2063</a></td><td> <a id="2063c13" class="tk">mtxData</a>-&gt;<a id="2063c22" class="tk">logical</a> = <a id="2063c32" class="tk">matLOGICAL_BIT</a>;</td></tr>
<tr name="2064" id="2064">
<td><a id="l2064" class='ln'>2064</a></td><td> <a id="2064c13" class="tk">mtxData</a>-&gt;<a id="2064c22" class="tk">complex</a> = 0U;</td></tr>
<tr name="2065" id="2065">
<td><a id="l2065" class='ln'>2065</a></td><td> <a id="2065c13" class="tk">mtxData</a>-&gt;<a id="2065c22" class="tk">frameData</a> = 0;</td></tr>
<tr name="2066" id="2066">
<td><a id="l2066" class='ln'>2066</a></td><td> <a id="2066c13" class="tk">mtxData</a>-&gt;<a id="2066c22" class="tk">frameSize</a> = 1;</td></tr>
<tr name="2067" id="2067">
<td><a id="l2067" class='ln'>2067</a></td><td> <span class="br">}</span></td></tr>
<tr name="2068" id="2068">
<td><a id="l2068" class='ln'>2068</a></td><td> <a id="2068c9" class="tk">++</a><a id="2068c11" class="tk">sig</a>-&gt;<a id="2068c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="2069" id="2069">
<td><a id="l2069" class='ln'>2069</a></td><td> <span class="br">}</span></td></tr>
<tr name="2070" id="2070">
<td><a id="l2070" class='ln'>2070</a></td><td> </td></tr>
<tr name="2071" id="2071">
<td><a id="l2071" class='ln'>2071</a></td><td> <span class="kw">return</span>(<a id="2071c12" class="tk">NULL</a>); <span class="ct">/* NORMAL_EXIT */</span></td></tr>
<tr name="2072" id="2072">
<td><a id="l2072" class='ln'>2072</a></td><td></td></tr>
<tr name="2073" id="2073">
<td><a id="l2073" class='ln'>2073</a></td><td> <a id="2073c3" class="tk">ERROR_EXIT</a><a id="2073c13" class="tk">:</a></td></tr>
<tr name="2074" id="2074">
<td><a id="l2074" class='ln'>2074</a></td><td></td></tr>
<tr name="2075" id="2075">
<td><a id="l2075" class='ln'>2075</a></td><td> (<span class="kw">void</span>)<a id="2075c11" class="tk">fprintf</a>(<a id="2075c19" class="tk">stderr</a>, "*** Error creating signals structure "</td></tr>
<tr name="2076" id="2076">
<td><a id="l2076" class='ln'>2076</a></td><td> "in the struct log variable %s\n", <a id="2076c54" class="tk">var</a>-&gt;<a id="2076c59" class="tk">name</a>);</td></tr>
<tr name="2077" id="2077">
<td><a id="l2077" class='ln'>2077</a></td><td> <span class="kw">if</span> (<a id="2077c9" class="tk">*</a><a id="2077c10" class="tk">errStatus</a> <a id="2077c20" class="tk">==</a> <a id="2077c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2078" id="2078">
<td><a id="l2078" class='ln'>2078</a></td><td> <a id="2078c9" class="tk">*</a><a id="2078c10" class="tk">errStatus</a> = <a id="2078c22" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="2079" id="2079">
<td><a id="l2079" class='ln'>2079</a></td><td> <span class="br">}</span></td></tr>
<tr name="2080" id="2080">
<td><a id="l2080" class='ln'>2080</a></td><td> <a id="2080c5" class="tk">rt_DestroyLogVar</a>(<a id="2080c22" class="tk">sig</a>-&gt;<a id="2080c27" class="tk">values</a>);</td></tr>
<tr name="2081" id="2081">
<td><a id="l2081" class='ln'>2081</a></td><td> <a id="2081c5" class="tk">FREE</a>(<a id="2081c10" class="tk">sig</a>-&gt;<a id="2081c15" class="tk">labels</a>);</td></tr>
<tr name="2082" id="2082">
<td><a id="l2082" class='ln'>2082</a></td><td> <a id="2082c5" class="tk">FREE</a>(<a id="2082c10" class="tk">sig</a>-&gt;<a id="2082c15" class="tk">plotStyles</a>);</td></tr>
<tr name="2083" id="2083">
<td><a id="l2083" class='ln'>2083</a></td><td> <a id="2083c5" class="tk">FREE</a>(<a id="2083c10" class="tk">sig</a>-&gt;<a id="2083c15" class="tk">dimensions</a>);</td></tr>
<tr name="2084" id="2084">
<td><a id="l2084" class='ln'>2084</a></td><td> <a id="2084c5" class="tk">FREE</a>(<a id="2084c10" class="tk">sig</a>-&gt;<a id="2084c15" class="tk">titles</a>);</td></tr>
<tr name="2085" id="2085">
<td><a id="l2085" class='ln'>2085</a></td><td> <a id="2085c5" class="tk">FREE</a>(<a id="2085c10" class="tk">sig</a>-&gt;<a id="2085c15" class="tk">blockNames</a>);</td></tr>
<tr name="2086" id="2086">
<td><a id="l2086" class='ln'>2086</a></td><td> <a id="2086c5" class="tk">FREE</a>(<a id="2086c10" class="tk">sig</a>-&gt;<a id="2086c15" class="tk">stateNames</a>);</td></tr>
<tr name="2087" id="2087">
<td><a id="l2087" class='ln'>2087</a></td><td> <a id="2087c5" class="tk">FREE</a>(<a id="2087c10" class="tk">sig</a>-&gt;<a id="2087c15" class="tk">crossMdlRef</a>);</td></tr>
<tr name="2088" id="2088">
<td><a id="l2088" class='ln'>2088</a></td><td> <span class="kw">return</span>(<a id="2088c12" class="tk">*</a><a id="2088c13" class="tk">errStatus</a>);</td></tr>
<tr name="2089" id="2089">
<td><a id="l2089" class='ln'>2089</a></td><td></td></tr>
<tr name="2090" id="2090">
<td><a id="l2090" class='ln'>2090</a></td><td><span class="br">}</span> <span class="ct">/* end rt_InitSignalsStruct */</span></td></tr>
<tr name="2091" id="2091">
<td><a id="l2091" class='ln'>2091</a></td><td></td></tr>
<tr name="2092" id="2092">
<td><a id="l2092" class='ln'>2092</a></td><td></td></tr>
<tr name="2093" id="2093">
<td><a id="l2093" class='ln'>2093</a></td><td><span class="ct">/* Function: local_CreateStructLogVar ==========================================</span></td></tr>
<tr name="2094" id="2094">
<td><a id="l2094" class='ln'>2094</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="2095" id="2095">
<td><a id="l2095" class='ln'>2095</a></td><td><span class="ct"> * Create a logging variable in the structure format.</span></td></tr>
<tr name="2096" id="2096">
<td><a id="l2096" class='ln'>2096</a></td><td><span class="ct"> *</span></td></tr>
<tr name="2097" id="2097">
<td><a id="l2097" class='ln'>2097</a></td><td><span class="ct"> * Returns:</span></td></tr>
<tr name="2098" id="2098">
<td><a id="l2098" class='ln'>2098</a></td><td><span class="ct"> * ~= NULL =&gt; success, returns the log variable created.</span></td></tr>
<tr name="2099" id="2099">
<td><a id="l2099" class='ln'>2099</a></td><td><span class="ct"> * == NULL =&gt; failure, error message set in the simstruct.</span></td></tr>
<tr name="2100" id="2100">
<td><a id="l2100" class='ln'>2100</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2101" id="2101">
<td><a id="l2101" class='ln'>2101</a></td><td><span class="kw">static</span> <a id="2101c8" class="tk">StructLogVar</a> <a id="2101c21" class="tk">*</a><a id="2101c22" class="tk">local_CreateStructLogVar</a>(</td></tr>
<tr name="2102" id="2102">
<td><a id="l2102" class='ln'>2102</a></td><td> <a id="2102c5" class="tk">RTWLogInfo</a> <a id="2102c29" class="tk">*</a><a id="2102c30" class="tk">li</a>,</td></tr>
<tr name="2103" id="2103">
<td><a id="l2103" class='ln'>2103</a></td><td> <span class="kw">const</span> <a id="2103c11" class="tk">real_T</a> <a id="2103c29" class="tk">startTime</a>,</td></tr>
<tr name="2104" id="2104">
<td><a id="l2104" class='ln'>2104</a></td><td> <span class="kw">const</span> <a id="2104c11" class="tk">real_T</a> <a id="2104c29" class="tk">finalTime</a>,</td></tr>
<tr name="2105" id="2105">
<td><a id="l2105" class='ln'>2105</a></td><td> <span class="kw">const</span> <a id="2105c11" class="tk">real_T</a> <a id="2105c29" class="tk">inStepSize</a>,</td></tr>
<tr name="2106" id="2106">
<td><a id="l2106" class='ln'>2106</a></td><td> <span class="kw">const</span> <a id="2106c11" class="tk">char_T</a> <a id="2106c29" class="tk">*</a><a id="2106c30" class="tk">*</a><a id="2106c31" class="tk">errStatus</a>,</td></tr>
<tr name="2107" id="2107">
<td><a id="l2107" class='ln'>2107</a></td><td> <span class="kw">const</span> <a id="2107c11" class="tk">char_T</a> <a id="2107c29" class="tk">*</a><a id="2107c30" class="tk">varName</a>,</td></tr>
<tr name="2108" id="2108">
<td><a id="l2108" class='ln'>2108</a></td><td> <a id="2108c5" class="tk">boolean_T</a> <a id="2108c29" class="tk">logTime</a>,</td></tr>
<tr name="2109" id="2109">
<td><a id="l2109" class='ln'>2109</a></td><td> <a id="2109c5" class="tk">int_T</a> <a id="2109c29" class="tk">maxRows</a>,</td></tr>
<tr name="2110" id="2110">
<td><a id="l2110" class='ln'>2110</a></td><td> <a id="2110c5" class="tk">int_T</a> <a id="2110c29" class="tk">decimation</a>,</td></tr>
<tr name="2111" id="2111">
<td><a id="l2111" class='ln'>2111</a></td><td> <a id="2111c5" class="tk">real_T</a> <a id="2111c29" class="tk">sampleTime</a>,</td></tr>
<tr name="2112" id="2112">
<td><a id="l2112" class='ln'>2112</a></td><td> <span class="kw">const</span> <a id="2112c11" class="tk">RTWLogSignalInfo</a> <a id="2112c29" class="tk">*</a><a id="2112c30" class="tk">sigInfo</a>,</td></tr>
<tr name="2113" id="2113">
<td><a id="l2113" class='ln'>2113</a></td><td> <span class="kw">const</span> <a id="2113c11" class="tk">char_T</a> <a id="2113c29" class="tk">*</a><a id="2113c30" class="tk">blockName</a>)</td></tr>
<tr name="2114" id="2114">
<td><a id="l2114" class='ln'>2114</a></td><td><span class="br">{</span></td></tr>
<tr name="2115" id="2115">
<td><a id="l2115" class='ln'>2115</a></td><td> <a id="2115c5" class="tk">StructLogVar</a> <a id="2115c18" class="tk">*</a><a id="2115c19" class="tk">var</a>;</td></tr>
<tr name="2116" id="2116">
<td><a id="l2116" class='ln'>2116</a></td><td> <a id="2116c5" class="tk">LogInfo</a> <a id="2116c18" class="tk">*</a><a id="2116c19" class="tk">logInfo</a> = <a id="2116c29" class="tk">rtliGetLogInfo</a>(<a id="2116c44" class="tk">li</a>);</td></tr>
<tr name="2117" id="2117">
<td><a id="l2117" class='ln'>2117</a></td><td></td></tr>
<tr name="2118" id="2118">
<td><a id="l2118" class='ln'>2118</a></td><td> <span class="ct">/* reset error status */</span></td></tr>
<tr name="2119" id="2119">
<td><a id="l2119" class='ln'>2119</a></td><td> <a id="2119c5" class="tk">*</a><a id="2119c6" class="tk">errStatus</a> = <a id="2119c18" class="tk">NULL</a>;</td></tr>
<tr name="2120" id="2120">
<td><a id="l2120" class='ln'>2120</a></td><td></td></tr>
<tr name="2121" id="2121">
<td><a id="l2121" class='ln'>2121</a></td><td> <span class="kw">if</span> ( (<a id="2121c11" class="tk">var</a> = <a id="2121c17" class="tk">calloc</a>(1, <span class="kw">sizeof</span>(<a id="2121c34" class="tk">StructLogVar</a>))) <a id="2121c50" class="tk">==</a> <a id="2121c53" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="2121c65" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2122" id="2122">
<td><a id="l2122" class='ln'>2122</a></td><td></td></tr>
<tr name="2123" id="2123">
<td><a id="l2123" class='ln'>2123</a></td><td> <a id="2123c5" class="tk">var</a>-&gt;<a id="2123c10" class="tk">numActiveFields</a> = 2;</td></tr>
<tr name="2124" id="2124">
<td><a id="l2124" class='ln'>2124</a></td><td></td></tr>
<tr name="2125" id="2125">
<td><a id="l2125" class='ln'>2125</a></td><td> <span class="ct">/* Setup the structure name using varName and nameModifier */</span></td></tr>
<tr name="2126" id="2126">
<td><a id="l2126" class='ln'>2126</a></td><td> <a id="2126c5" class="tk">rt_LoadModifiedLogVarName</a>(<a id="2126c31" class="tk">li</a>,<a id="2126c34" class="tk">varName</a>,<a id="2126c42" class="tk">var</a>-&gt;<a id="2126c47" class="tk">name</a>);</td></tr>
<tr name="2127" id="2127">
<td><a id="l2127" class='ln'>2127</a></td><td></td></tr>
<tr name="2128" id="2128">
<td><a id="l2128" class='ln'>2128</a></td><td> <span class="ct">/* time field */</span></td></tr>
<tr name="2129" id="2129">
<td><a id="l2129" class='ln'>2129</a></td><td> <span class="kw">if</span> (<a id="2129c9" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="2130" id="2130">
<td><a id="l2130" class='ln'>2130</a></td><td> <span class="ct">/* need to create a LogVar to log time */</span></td></tr>
<tr name="2131" id="2131">
<td><a id="l2131" class='ln'>2131</a></td><td> <a id="2131c9" class="tk">int_T</a> <a id="2131c15" class="tk">dims</a> = 1;</td></tr>
<tr name="2132" id="2132">
<td><a id="l2132" class='ln'>2132</a></td><td> <a id="2132c9" class="tk">var</a>-&gt;<a id="2132c14" class="tk">time</a> = <a id="2132c21" class="tk">rt_CreateLogVarWithConvert</a>(<a id="2132c48" class="tk">li</a>, <a id="2132c52" class="tk">startTime</a>, <a id="2132c63" class="tk">finalTime</a>,</td></tr>
<tr name="2133" id="2133">
<td><a id="l2133" class='ln'>2133</a></td><td> <a id="2133c48" class="tk">inStepSize</a>, <a id="2133c60" class="tk">errStatus</a>,</td></tr>
<tr name="2134" id="2134">
<td><a id="l2134" class='ln'>2134</a></td><td> <a id="2134c48" class="tk">&amp;</a><a id="2134c49" class="tk">TIME_FIELD_NAME</a>, <a id="2134c66" class="tk">SS_DOUBLE</a>, </td></tr>
<tr name="2135" id="2135">
<td><a id="l2135" class='ln'>2135</a></td><td> <a id="2135c48" class="tk">NULL</a>,</td></tr>
<tr name="2136" id="2136">
<td><a id="l2136" class='ln'>2136</a></td><td> 0, 0, 0, 1,</td></tr>
<tr name="2137" id="2137">
<td><a id="l2137" class='ln'>2137</a></td><td> 1, <a id="2137c51" class="tk">&amp;</a><a id="2137c52" class="tk">dims</a>, <a id="2137c58" class="tk">NO_LOGVALDIMS</a>, </td></tr>
<tr name="2138" id="2138">
<td><a id="l2138" class='ln'>2138</a></td><td> <a id="2138c48" class="tk">NULL</a>, <a id="2138c54" class="tk">NULL</a>, <a id="2138c60" class="tk">maxRows</a>,</td></tr>
<tr name="2139" id="2139">
<td><a id="l2139" class='ln'>2139</a></td><td> <a id="2139c48" class="tk">decimation</a>, <a id="2139c60" class="tk">sampleTime</a>, 0);</td></tr>
<tr name="2140" id="2140">
<td><a id="l2140" class='ln'>2140</a></td><td> <span class="kw">if</span> (<a id="2140c13" class="tk">var</a>-&gt;<a id="2140c18" class="tk">time</a> <a id="2140c23" class="tk">==</a> <a id="2140c26" class="tk">NULL</a>) <span class="kw">goto</span> <a id="2140c37" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2141" id="2141">
<td><a id="l2141" class='ln'>2141</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2142" id="2142">
<td><a id="l2142" class='ln'>2142</a></td><td> <span class="ct">/* create a dummy MatrixData to write out time as an empty matrix */</span></td></tr>
<tr name="2143" id="2143">
<td><a id="l2143" class='ln'>2143</a></td><td> <a id="2143c9" class="tk">BuiltInDTypeId</a> <a id="2143c24" class="tk">dt</a> = <a id="2143c33" class="tk">rt_GetActualDTypeID</a>(<a id="2143c53" class="tk">SS_DOUBLE</a>);</td></tr>
<tr name="2144" id="2144">
<td><a id="l2144" class='ln'>2144</a></td><td> <a id="2144c9" class="tk">size_t</a> <a id="2144c24" class="tk">nbytes</a> = <span class="kw">sizeof</span>(<a id="2144c40" class="tk">MatrixData</a>);</td></tr>
<tr name="2145" id="2145">
<td><a id="l2145" class='ln'>2145</a></td><td> <a id="2145c9" class="tk">MatrixData</a> <a id="2145c24" class="tk">*</a><a id="2145c25" class="tk">time</a>;</td></tr>
<tr name="2146" id="2146">
<td><a id="l2146" class='ln'>2146</a></td><td></td></tr>
<tr name="2147" id="2147">
<td><a id="l2147" class='ln'>2147</a></td><td> <span class="kw">if</span> ( (<a id="2147c15" class="tk">var</a>-&gt;<a id="2147c20" class="tk">time</a> = <a id="2147c27" class="tk">calloc</a>(<a id="2147c34" class="tk">nbytes</a>, 1)) <a id="2147c46" class="tk">==</a> <a id="2147c49" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="2147c61" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2148" id="2148">
<td><a id="l2148" class='ln'>2148</a></td><td> <a id="2148c9" class="tk">time</a> = <a id="2148c16" class="tk">var</a>-&gt;<a id="2148c21" class="tk">time</a>;</td></tr>
<tr name="2149" id="2149">
<td><a id="l2149" class='ln'>2149</a></td><td></td></tr>
<tr name="2150" id="2150">
<td><a id="l2150" class='ln'>2150</a></td><td> (<span class="kw">void</span>)<a id="2150c15" class="tk">memcpy</a>(<a id="2150c22" class="tk">time</a>-&gt;<a id="2150c28" class="tk">name</a>, <a id="2150c34" class="tk">&amp;</a><a id="2150c35" class="tk">TIME_FIELD_NAME</a>, <a id="2150c52" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="2151" id="2151">
<td><a id="l2151" class='ln'>2151</a></td><td> <a id="2151c9" class="tk">time</a>-&gt;<a id="2151c15" class="tk">nRows</a> = 0;</td></tr>
<tr name="2152" id="2152">
<td><a id="l2152" class='ln'>2152</a></td><td> <a id="2152c9" class="tk">time</a>-&gt;<a id="2152c15" class="tk">nCols</a> = 0;</td></tr>
<tr name="2153" id="2153">
<td><a id="l2153" class='ln'>2153</a></td><td> <a id="2153c9" class="tk">time</a>-&gt;<a id="2153c15" class="tk">nDims</a> = 0;</td></tr>
<tr name="2154" id="2154">
<td><a id="l2154" class='ln'>2154</a></td><td> <a id="2154c9" class="tk">time</a>-&gt;<a id="2154c15" class="tk">re</a> = <a id="2154c25" class="tk">NULL</a>;</td></tr>
<tr name="2155" id="2155">
<td><a id="l2155" class='ln'>2155</a></td><td> <a id="2155c9" class="tk">time</a>-&gt;<a id="2155c15" class="tk">im</a> = <a id="2155c25" class="tk">NULL</a>;</td></tr>
<tr name="2156" id="2156">
<td><a id="l2156" class='ln'>2156</a></td><td> <a id="2156c9" class="tk">time</a>-&gt;<a id="2156c15" class="tk">dTypeID</a> = <a id="2156c25" class="tk">dt</a>;</td></tr>
<tr name="2157" id="2157">
<td><a id="l2157" class='ln'>2157</a></td><td> <a id="2157c9" class="tk">time</a>-&gt;<a id="2157c15" class="tk">mxID</a> = <a id="2157c25" class="tk">rt_GetMxIdFromDTypeId</a>(<a id="2157c47" class="tk">dt</a>);</td></tr>
<tr name="2158" id="2158">
<td><a id="l2158" class='ln'>2158</a></td><td> <a id="2158c9" class="tk">time</a>-&gt;<a id="2158c15" class="tk">elSize</a> = <a id="2158c25" class="tk">rt_GetSizeofDataType</a>(<a id="2158c46" class="tk">dt</a>);</td></tr>
<tr name="2159" id="2159">
<td><a id="l2159" class='ln'>2159</a></td><td> <a id="2159c9" class="tk">time</a>-&gt;<a id="2159c15" class="tk">logical</a> = 0U;</td></tr>
<tr name="2160" id="2160">
<td><a id="l2160" class='ln'>2160</a></td><td> <a id="2160c9" class="tk">time</a>-&gt;<a id="2160c15" class="tk">complex</a> = 0U;</td></tr>
<tr name="2161" id="2161">
<td><a id="l2161" class='ln'>2161</a></td><td> <span class="br">}</span></td></tr>
<tr name="2162" id="2162">
<td><a id="l2162" class='ln'>2162</a></td><td> <a id="2162c5" class="tk">var</a>-&gt;<a id="2162c10" class="tk">logTime</a> = <a id="2162c20" class="tk">logTime</a>;</td></tr>
<tr name="2163" id="2163">
<td><a id="l2163" class='ln'>2163</a></td><td></td></tr>
<tr name="2164" id="2164">
<td><a id="l2164" class='ln'>2164</a></td><td> <span class="ct">/* signals field */</span></td></tr>
<tr name="2165" id="2165">
<td><a id="l2165" class='ln'>2165</a></td><td> <span class="kw">if</span> (<a id="2165c9" class="tk">sigInfo</a>) <span class="br">{</span></td></tr>
<tr name="2166" id="2166">
<td><a id="l2166" class='ln'>2166</a></td><td> <span class="kw">if</span> (<a id="2166c13" class="tk">rt_InitSignalsStruct</a>(<a id="2166c34" class="tk">li</a>,<a id="2166c37" class="tk">startTime</a>,<a id="2166c47" class="tk">finalTime</a>,<a id="2166c57" class="tk">inStepSize</a>,<a id="2166c68" class="tk">errStatus</a>,</td></tr>
<tr name="2167" id="2167">
<td><a id="l2167" class='ln'>2167</a></td><td> <a id="2167c34" class="tk">var</a>,<a id="2167c38" class="tk">maxRows</a>,<a id="2167c46" class="tk">decimation</a>,<a id="2167c57" class="tk">sampleTime</a>,<a id="2167c68" class="tk">sigInfo</a>)) <span class="br">{</span></td></tr>
<tr name="2168" id="2168">
<td><a id="l2168" class='ln'>2168</a></td><td> <span class="kw">goto</span> <a id="2168c18" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2169" id="2169">
<td><a id="l2169" class='ln'>2169</a></td><td> <span class="br">}</span></td></tr>
<tr name="2170" id="2170">
<td><a id="l2170" class='ln'>2170</a></td><td> <span class="br">}</span></td></tr>
<tr name="2171" id="2171">
<td><a id="l2171" class='ln'>2171</a></td><td></td></tr>
<tr name="2172" id="2172">
<td><a id="l2172" class='ln'>2172</a></td><td> <span class="ct">/* blockName Field */</span></td></tr>
<tr name="2173" id="2173">
<td><a id="l2173" class='ln'>2173</a></td><td> <span class="kw">if</span> (<a id="2173c9" class="tk">blockName</a> <a id="2173c19" class="tk">!=</a> <a id="2173c22" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2174" id="2174">
<td><a id="l2174" class='ln'>2174</a></td><td> <a id="2174c9" class="tk">int_T</a> <a id="2174c16" class="tk">dataLen</a> = (<a id="2174c27" class="tk">int_T</a>)<a id="2174c33" class="tk">strlen</a>(<a id="2174c40" class="tk">blockName</a>);</td></tr>
<tr name="2175" id="2175">
<td><a id="l2175" class='ln'>2175</a></td><td> <a id="2175c9" class="tk">size_t</a> <a id="2175c16" class="tk">nbytes</a>;</td></tr>
<tr name="2176" id="2176">
<td><a id="l2176" class='ln'>2176</a></td><td> <a id="2176c9" class="tk">size_t</a> <a id="2176c16" class="tk">dataOffset</a> = <span class="kw">sizeof</span>(<a id="2176c36" class="tk">MatrixData</a>);</td></tr>
<tr name="2177" id="2177">
<td><a id="l2177" class='ln'>2177</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="2178" id="2178">
<td><a id="l2178" class='ln'>2178</a></td><td> <a id="2178c9" class="tk">uint_T</a> <a id="2178c16" class="tk">overhang</a> = (<a id="2178c30" class="tk">uint_T</a>)(<a id="2178c38" class="tk">dataOffset</a> <a id="2178c49" class="tk">%</a> <span class="kw">sizeof</span>(<span class="kw">short</span>));</td></tr>
<tr name="2179" id="2179">
<td><a id="l2179" class='ln'>2179</a></td><td></td></tr>
<tr name="2180" id="2180">
<td><a id="l2180" class='ln'>2180</a></td><td> <span class="kw">if</span> (<a id="2180c13" class="tk">overhang</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:DEAD_CODE [Not a defect:Unset] </span></td></tr>
<tr name="2181" id="2181">
<td><a id="l2181" class='ln'>2181</a></td><td><span class="ct"> "Needed for possible padding determination. */</span></td></tr>
<tr name="2182" id="2182">
<td><a id="l2182" class='ln'>2182</a></td><td> <a id="2182c13" class="tk">dataOffset</a> <a id="2182c24" class="tk">+=</a> (<span class="kw">sizeof</span>(<span class="kw">short</span>) <a id="2182c42" class="tk">-</a> <a id="2182c44" class="tk">overhang</a>);</td></tr>
<tr name="2183" id="2183">
<td><a id="l2183" class='ln'>2183</a></td><td> <span class="br">}</span></td></tr>
<tr name="2184" id="2184">
<td><a id="l2184" class='ln'>2184</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="2185" id="2185">
<td><a id="l2185" class='ln'>2185</a></td><td> <a id="2185c9" class="tk">nbytes</a> = <a id="2185c18" class="tk">dataOffset</a> <a id="2185c29" class="tk">+</a> <a id="2185c31" class="tk">dataLen</a><a id="2185c38" class="tk">*</a><span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="2186" id="2186">
<td><a id="l2186" class='ln'>2186</a></td><td></td></tr>
<tr name="2187" id="2187">
<td><a id="l2187" class='ln'>2187</a></td><td> <span class="kw">if</span> ( (<a id="2187c15" class="tk">var</a>-&gt;<a id="2187c20" class="tk">blockName</a> = <a id="2187c32" class="tk">calloc</a>(<a id="2187c39" class="tk">nbytes</a>, 1)) <a id="2187c51" class="tk">==</a> <a id="2187c54" class="tk">NULL</a> ) <span class="kw">goto</span> <a id="2187c66" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2188" id="2188">
<td><a id="l2188" class='ln'>2188</a></td><td></td></tr>
<tr name="2189" id="2189">
<td><a id="l2189" class='ln'>2189</a></td><td> (<span class="kw">void</span>)<a id="2189c15" class="tk">memcpy</a>(<a id="2189c22" class="tk">var</a>-&gt;<a id="2189c27" class="tk">blockName</a>-&gt;<a id="2189c38" class="tk">name</a>, <a id="2189c44" class="tk">&amp;</a><a id="2189c45" class="tk">BLOCKNAME_FIELD_NAME</a>, <a id="2189c67" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="2190" id="2190">
<td><a id="l2190" class='ln'>2190</a></td><td> <a id="2190c9" class="tk">var</a>-&gt;<a id="2190c14" class="tk">blockName</a>-&gt;<a id="2190c25" class="tk">nRows</a> = (<a id="2190c36" class="tk">dataLen</a>) <a id="2190c45" class="tk">?</a> 1 <a id="2190c49" class="tk">:</a> 0;</td></tr>
<tr name="2191" id="2191">
<td><a id="l2191" class='ln'>2191</a></td><td> <a id="2191c9" class="tk">var</a>-&gt;<a id="2191c14" class="tk">blockName</a>-&gt;<a id="2191c25" class="tk">nCols</a> = <a id="2191c35" class="tk">dataLen</a>;</td></tr>
<tr name="2192" id="2192">
<td><a id="l2192" class='ln'>2192</a></td><td></td></tr>
<tr name="2193" id="2193">
<td><a id="l2193" class='ln'>2193</a></td><td> <a id="2193c9" class="tk">var</a>-&gt;<a id="2193c14" class="tk">blockName</a>-&gt;<a id="2193c25" class="tk">nDims</a> = 1;</td></tr>
<tr name="2194" id="2194">
<td><a id="l2194" class='ln'>2194</a></td><td> <a id="2194c9" class="tk">var</a>-&gt;<a id="2194c14" class="tk">blockName</a>-&gt;<a id="2194c25" class="tk">dims</a> = <a id="2194c35" class="tk">var</a>-&gt;<a id="2194c40" class="tk">blockName</a>-&gt;<a id="2194c51" class="tk">_dims</a>;</td></tr>
<tr name="2195" id="2195">
<td><a id="l2195" class='ln'>2195</a></td><td> <a id="2195c9" class="tk">var</a>-&gt;<a id="2195c14" class="tk">blockName</a>-&gt;<a id="2195c25" class="tk">dims</a>[0] = <a id="2195c35" class="tk">dataLen</a>;</td></tr>
<tr name="2196" id="2196">
<td><a id="l2196" class='ln'>2196</a></td><td> <span class="br">{</span></td></tr>
<tr name="2197" id="2197">
<td><a id="l2197" class='ln'>2197</a></td><td> <span class="ct">/*LINTED E_BAD_PTR_CAST_ALIGN*/</span></td></tr>
<tr name="2198" id="2198">
<td><a id="l2198" class='ln'>2198</a></td><td> <span class="kw">unsigned</span> <span class="kw">short</span> <a id="2198c28" class="tk">*</a><a id="2198c29" class="tk">data</a> = (<span class="kw">unsigned</span> <span class="kw">short</span><a id="2198c51" class="tk">*</a>)(((<a id="2198c56" class="tk">char_T</a><a id="2198c62" class="tk">*</a>) (<a id="2198c66" class="tk">var</a>-&gt;<a id="2198c71" class="tk">blockName</a>))<a id="2198c82" class="tk">+</a><a id="2198c83" class="tk">dataOffset</a>);</td></tr>
<tr name="2199" id="2199">
<td><a id="l2199" class='ln'>2199</a></td><td> <a id="2199c13" class="tk">int_T</a> <a id="2199c21" class="tk">i</a>;</td></tr>
<tr name="2200" id="2200">
<td><a id="l2200" class='ln'>2200</a></td><td></td></tr>
<tr name="2201" id="2201">
<td><a id="l2201" class='ln'>2201</a></td><td> <span class="kw">for</span> (<a id="2201c18" class="tk">i</a>=0; <a id="2201c23" class="tk">i</a><a id="2201c24" class="tk">&lt;</a><a id="2201c25" class="tk">dataLen</a>; <a id="2201c34" class="tk">i</a><a id="2201c35" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2202" id="2202">
<td><a id="l2202" class='ln'>2202</a></td><td> <a id="2202c17" class="tk">data</a>[<a id="2202c22" class="tk">i</a>] = (<a id="2202c28" class="tk">uint8_T</a>)<a id="2202c36" class="tk">blockName</a>[<a id="2202c46" class="tk">i</a>];</td></tr>
<tr name="2203" id="2203">
<td><a id="l2203" class='ln'>2203</a></td><td> <span class="br">}</span></td></tr>
<tr name="2204" id="2204">
<td><a id="l2204" class='ln'>2204</a></td><td> <a id="2204c13" class="tk">var</a>-&gt;<a id="2204c18" class="tk">blockName</a>-&gt;<a id="2204c29" class="tk">re</a> = <a id="2204c35" class="tk">data</a>;</td></tr>
<tr name="2205" id="2205">
<td><a id="l2205" class='ln'>2205</a></td><td> <span class="br">}</span></td></tr>
<tr name="2206" id="2206">
<td><a id="l2206" class='ln'>2206</a></td><td> <a id="2206c9" class="tk">var</a>-&gt;<a id="2206c14" class="tk">blockName</a>-&gt;<a id="2206c25" class="tk">im</a> = <a id="2206c35" class="tk">NULL</a>;</td></tr>
<tr name="2207" id="2207">
<td><a id="l2207" class='ln'>2207</a></td><td> <a id="2207c9" class="tk">var</a>-&gt;<a id="2207c14" class="tk">blockName</a>-&gt;<a id="2207c25" class="tk">dTypeID</a> = <a id="2207c35" class="tk">SS_INT16</a>;</td></tr>
<tr name="2208" id="2208">
<td><a id="l2208" class='ln'>2208</a></td><td> <a id="2208c9" class="tk">var</a>-&gt;<a id="2208c14" class="tk">blockName</a>-&gt;<a id="2208c25" class="tk">mxID</a> = <a id="2208c35" class="tk">mxCHAR_CLASS</a>;</td></tr>
<tr name="2209" id="2209">
<td><a id="l2209" class='ln'>2209</a></td><td> <a id="2209c9" class="tk">var</a>-&gt;<a id="2209c14" class="tk">blockName</a>-&gt;<a id="2209c25" class="tk">elSize</a> = <span class="kw">sizeof</span>(<span class="kw">short</span>);</td></tr>
<tr name="2210" id="2210">
<td><a id="l2210" class='ln'>2210</a></td><td> <a id="2210c9" class="tk">var</a>-&gt;<a id="2210c14" class="tk">blockName</a>-&gt;<a id="2210c25" class="tk">logical</a> = 0U;</td></tr>
<tr name="2211" id="2211">
<td><a id="l2211" class='ln'>2211</a></td><td> <a id="2211c9" class="tk">var</a>-&gt;<a id="2211c14" class="tk">blockName</a>-&gt;<a id="2211c25" class="tk">complex</a> = 0U;</td></tr>
<tr name="2212" id="2212">
<td><a id="l2212" class='ln'>2212</a></td><td></td></tr>
<tr name="2213" id="2213">
<td><a id="l2213" class='ln'>2213</a></td><td> <a id="2213c9" class="tk">++</a><a id="2213c11" class="tk">var</a>-&gt;<a id="2213c16" class="tk">numActiveFields</a>;</td></tr>
<tr name="2214" id="2214">
<td><a id="l2214" class='ln'>2214</a></td><td> <span class="br">}</span></td></tr>
<tr name="2215" id="2215">
<td><a id="l2215" class='ln'>2215</a></td><td></td></tr>
<tr name="2216" id="2216">
<td><a id="l2216" class='ln'>2216</a></td><td> <span class="ct">/* Add this struct log var to the linked list in log info */</span></td></tr>
<tr name="2217" id="2217">
<td><a id="l2217" class='ln'>2217</a></td><td> <span class="br">{</span></td></tr>
<tr name="2218" id="2218">
<td><a id="l2218" class='ln'>2218</a></td><td> <a id="2218c9" class="tk">StructLogVar</a> <a id="2218c22" class="tk">*</a><a id="2218c23" class="tk">list</a> = <a id="2218c30" class="tk">logInfo</a>-&gt;<a id="2218c39" class="tk">structLogVarsList</a>;</td></tr>
<tr name="2219" id="2219">
<td><a id="l2219" class='ln'>2219</a></td><td></td></tr>
<tr name="2220" id="2220">
<td><a id="l2220" class='ln'>2220</a></td><td> <span class="kw">if</span> (<a id="2220c13" class="tk">list</a> <a id="2220c18" class="tk">!=</a> <a id="2220c21" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2221" id="2221">
<td><a id="l2221" class='ln'>2221</a></td><td> <span class="kw">while</span> (<a id="2221c20" class="tk">list</a>-&gt;<a id="2221c26" class="tk">next</a> <a id="2221c31" class="tk">!=</a> <a id="2221c34" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2222" id="2222">
<td><a id="l2222" class='ln'>2222</a></td><td> <a id="2222c17" class="tk">list</a> = <a id="2222c24" class="tk">list</a>-&gt;<a id="2222c30" class="tk">next</a>;</td></tr>
<tr name="2223" id="2223">
<td><a id="l2223" class='ln'>2223</a></td><td> <span class="br">}</span></td></tr>
<tr name="2224" id="2224">
<td><a id="l2224" class='ln'>2224</a></td><td> <a id="2224c13" class="tk">list</a>-&gt;<a id="2224c19" class="tk">next</a> = <a id="2224c26" class="tk">var</a>;</td></tr>
<tr name="2225" id="2225">
<td><a id="l2225" class='ln'>2225</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2226" id="2226">
<td><a id="l2226" class='ln'>2226</a></td><td> <a id="2226c13" class="tk">logInfo</a>-&gt;<a id="2226c22" class="tk">structLogVarsList</a> = <a id="2226c42" class="tk">var</a>;</td></tr>
<tr name="2227" id="2227">
<td><a id="l2227" class='ln'>2227</a></td><td> <span class="br">}</span></td></tr>
<tr name="2228" id="2228">
<td><a id="l2228" class='ln'>2228</a></td><td> <span class="br">}</span></td></tr>
<tr name="2229" id="2229">
<td><a id="l2229" class='ln'>2229</a></td><td></td></tr>
<tr name="2230" id="2230">
<td><a id="l2230" class='ln'>2230</a></td><td> <span class="kw">return</span>(<a id="2230c12" class="tk">var</a>); <span class="ct">/* NORMAL_EXIT */</span></td></tr>
<tr name="2231" id="2231">
<td><a id="l2231" class='ln'>2231</a></td><td></td></tr>
<tr name="2232" id="2232">
<td><a id="l2232" class='ln'>2232</a></td><td> <a id="2232c2" class="tk">ERROR_EXIT</a><a id="2232c12" class="tk">:</a></td></tr>
<tr name="2233" id="2233">
<td><a id="l2233" class='ln'>2233</a></td><td> (<span class="kw">void</span>)<a id="2233c11" class="tk">fprintf</a>(<a id="2233c19" class="tk">stderr</a>, "*** Error creating log variable %s\n", <a id="2233c67" class="tk">varName</a>);</td></tr>
<tr name="2234" id="2234">
<td><a id="l2234" class='ln'>2234</a></td><td> <span class="kw">if</span> (<a id="2234c9" class="tk">*</a><a id="2234c10" class="tk">errStatus</a> <a id="2234c20" class="tk">==</a> <a id="2234c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2235" id="2235">
<td><a id="l2235" class='ln'>2235</a></td><td> <a id="2235c9" class="tk">*</a><a id="2235c10" class="tk">errStatus</a> = <a id="2235c22" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="2236" id="2236">
<td><a id="l2236" class='ln'>2236</a></td><td> <span class="br">}</span></td></tr>
<tr name="2237" id="2237">
<td><a id="l2237" class='ln'>2237</a></td><td> <a id="2237c5" class="tk">rt_DestroyStructLogVar</a>(<a id="2237c28" class="tk">var</a>);</td></tr>
<tr name="2238" id="2238">
<td><a id="l2238" class='ln'>2238</a></td><td> <span class="kw">return</span>(<a id="2238c12" class="tk">NULL</a>);</td></tr>
<tr name="2239" id="2239">
<td><a id="l2239" class='ln'>2239</a></td><td></td></tr>
<tr name="2240" id="2240">
<td><a id="l2240" class='ln'>2240</a></td><td><span class="br">}</span> <span class="ct">/* end local_CreateStructLogVar */</span></td></tr>
<tr name="2241" id="2241">
<td><a id="l2241" class='ln'>2241</a></td><td></td></tr>
<tr name="2242" id="2242">
<td><a id="l2242" class='ln'>2242</a></td><td></td></tr>
<tr name="2243" id="2243">
<td><a id="l2243" class='ln'>2243</a></td><td><span class="ct">/* Function: rt_StartDataLoggingForOutput ======================================</span></td></tr>
<tr name="2244" id="2244">
<td><a id="l2244" class='ln'>2244</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="2245" id="2245">
<td><a id="l2245" class='ln'>2245</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2246" id="2246">
<td><a id="l2246" class='ln'>2246</a></td><td><span class="kw">static</span> <span class="kw">const</span> <a id="2246c14" class="tk">char_T</a> <a id="2246c21" class="tk">*</a><a id="2246c22" class="tk">rt_StartDataLoggingForOutput</a>(<a id="2246c51" class="tk">RTWLogInfo</a> <a id="2246c64" class="tk">*</a><a id="2246c65" class="tk">li</a>,</td></tr>
<tr name="2247" id="2247">
<td><a id="l2247" class='ln'>2247</a></td><td> <span class="kw">const</span> <a id="2247c57" class="tk">real_T</a> <a id="2247c64" class="tk">startTime</a>,</td></tr>
<tr name="2248" id="2248">
<td><a id="l2248" class='ln'>2248</a></td><td> <span class="kw">const</span> <a id="2248c57" class="tk">real_T</a> <a id="2248c64" class="tk">finalTime</a>,</td></tr>
<tr name="2249" id="2249">
<td><a id="l2249" class='ln'>2249</a></td><td> <span class="kw">const</span> <a id="2249c57" class="tk">real_T</a> <a id="2249c64" class="tk">stepSize</a>,</td></tr>
<tr name="2250" id="2250">
<td><a id="l2250" class='ln'>2250</a></td><td> <span class="kw">const</span> <a id="2250c57" class="tk">char_T</a> <a id="2250c64" class="tk">*</a><a id="2250c65" class="tk">*</a><a id="2250c66" class="tk">errStatus</a>)</td></tr>
<tr name="2251" id="2251">
<td><a id="l2251" class='ln'>2251</a></td><td><span class="br">{</span></td></tr>
<tr name="2252" id="2252">
<td><a id="l2252" class='ln'>2252</a></td><td> <span class="kw">const</span> <a id="2252c11" class="tk">char_T</a> <a id="2252c20" class="tk">*</a><a id="2252c21" class="tk">varName</a>;</td></tr>
<tr name="2253" id="2253">
<td><a id="l2253" class='ln'>2253</a></td><td> <a id="2253c5" class="tk">real_T</a> <a id="2253c20" class="tk">sampleTime</a> = <a id="2253c33" class="tk">stepSize</a>;</td></tr>
<tr name="2254" id="2254">
<td><a id="l2254" class='ln'>2254</a></td><td> <a id="2254c5" class="tk">int_T</a> <a id="2254c20" class="tk">maxRows</a> = <a id="2254c33" class="tk">rtliGetLogMaxRows</a>(<a id="2254c51" class="tk">li</a>);</td></tr>
<tr name="2255" id="2255">
<td><a id="l2255" class='ln'>2255</a></td><td> <a id="2255c5" class="tk">int_T</a> <a id="2255c20" class="tk">decimation</a> = <a id="2255c33" class="tk">rtliGetLogDecimation</a>(<a id="2255c54" class="tk">li</a>);</td></tr>
<tr name="2256" id="2256">
<td><a id="l2256" class='ln'>2256</a></td><td> <a id="2256c5" class="tk">int_T</a> <a id="2256c20" class="tk">logFormat</a> = <a id="2256c33" class="tk">rtliGetLogFormat</a>(<a id="2256c50" class="tk">li</a>);</td></tr>
<tr name="2257" id="2257">
<td><a id="l2257" class='ln'>2257</a></td><td> <a id="2257c5" class="tk">boolean_T</a> <a id="2257c20" class="tk">logTime</a> = (<a id="2257c34" class="tk">logFormat</a><a id="2257c43" class="tk">==</a>2) <a id="2257c48" class="tk">?</a> 1 <a id="2257c52" class="tk">:</a> 0;</td></tr>
<tr name="2258" id="2258">
<td><a id="l2258" class='ln'>2258</a></td><td></td></tr>
<tr name="2259" id="2259">
<td><a id="l2259" class='ln'>2259</a></td><td> <a id="2259c5" class="tk">LogInfo</a> <a id="2259c13" class="tk">*</a> <a id="2259c21" class="tk">logInfo</a>;</td></tr>
<tr name="2260" id="2260">
<td><a id="l2260" class='ln'>2260</a></td><td> <a id="2260c5" class="tk">logInfo</a> = <a id="2260c15" class="tk">rtliGetLogInfo</a>(<a id="2260c30" class="tk">li</a>);</td></tr>
<tr name="2261" id="2261">
<td><a id="l2261" class='ln'>2261</a></td><td></td></tr>
<tr name="2262" id="2262">
<td><a id="l2262" class='ln'>2262</a></td><td> <span class="ct">/* reset error status */</span></td></tr>
<tr name="2263" id="2263">
<td><a id="l2263" class='ln'>2263</a></td><td> <a id="2263c5" class="tk">*</a><a id="2263c6" class="tk">errStatus</a> = <a id="2263c18" class="tk">NULL</a>;</td></tr>
<tr name="2264" id="2264">
<td><a id="l2264" class='ln'>2264</a></td><td></td></tr>
<tr name="2265" id="2265">
<td><a id="l2265" class='ln'>2265</a></td><td> <span class="ct">/* outputs */</span></td></tr>
<tr name="2266" id="2266">
<td><a id="l2266" class='ln'>2266</a></td><td> <a id="2266c5" class="tk">varName</a> = <a id="2266c15" class="tk">rtliGetLogY</a>(<a id="2266c27" class="tk">li</a>);</td></tr>
<tr name="2267" id="2267">
<td><a id="l2267" class='ln'>2267</a></td><td> <span class="kw">if</span> (<a id="2267c9" class="tk">varName</a>[0] <a id="2267c20" class="tk">!=</a> '\0') <span class="br">{</span></td></tr>
<tr name="2268" id="2268">
<td><a id="l2268" class='ln'>2268</a></td><td> <a id="2268c9" class="tk">int_T</a> <a id="2268c32" class="tk">i</a>;</td></tr>
<tr name="2269" id="2269">
<td><a id="l2269" class='ln'>2269</a></td><td> <a id="2269c9" class="tk">int_T</a> <a id="2269c32" class="tk">ny</a>;</td></tr>
<tr name="2270" id="2270">
<td><a id="l2270" class='ln'>2270</a></td><td> <a id="2270c9" class="tk">int_T</a> <a id="2270c32" class="tk">yIdx</a>;</td></tr>
<tr name="2271" id="2271">
<td><a id="l2271" class='ln'>2271</a></td><td> <a id="2271c9" class="tk">char_T</a> <a id="2271c32" class="tk">name</a>[<a id="2271c37" class="tk">mxMAXNAM</a>];</td></tr>
<tr name="2272" id="2272">
<td><a id="l2272" class='ln'>2272</a></td><td> <span class="kw">const</span> <a id="2272c15" class="tk">char_T</a> <a id="2272c32" class="tk">*</a><a id="2272c33" class="tk">cp</a> = <a id="2272c45" class="tk">strchr</a>(<a id="2272c52" class="tk">varName</a>,',');</td></tr>
<tr name="2273" id="2273">
<td><a id="l2273" class='ln'>2273</a></td><td> <a id="2273c9" class="tk">LogSignalPtrsType</a> <a id="2273c32" class="tk">ySigPtrs</a> = <a id="2273c45" class="tk">rtliGetLogYSignalPtrs</a>(<a id="2273c67" class="tk">li</a>);</td></tr>
<tr name="2274" id="2274">
<td><a id="l2274" class='ln'>2274</a></td><td> <span class="kw">const</span> <a id="2274c15" class="tk">RTWLogSignalInfo</a> <a id="2274c32" class="tk">*</a><a id="2274c33" class="tk">yInfo</a> = <a id="2274c45" class="tk">rtliGetLogYSignalInfo</a>(<a id="2274c67" class="tk">li</a>);</td></tr>
<tr name="2275" id="2275">
<td><a id="l2275" class='ln'>2275</a></td><td></td></tr>
<tr name="2276" id="2276">
<td><a id="l2276" class='ln'>2276</a></td><td> <span class="ct">/* count the number of variables (matrices or structures) to create */</span></td></tr>
<tr name="2277" id="2277">
<td><a id="l2277" class='ln'>2277</a></td><td> <span class="kw">for</span> (<a id="2277c14" class="tk">ny</a>=1; <a id="2277c20" class="tk">cp</a> <a id="2277c23" class="tk">!=</a> <a id="2277c26" class="tk">NULL</a>; <a id="2277c32" class="tk">ny</a><a id="2277c34" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2278" id="2278">
<td><a id="l2278" class='ln'>2278</a></td><td> <a id="2278c13" class="tk">cp</a> = <a id="2278c18" class="tk">strchr</a>(<a id="2278c25" class="tk">cp</a><a id="2278c27" class="tk">+</a>1,',');</td></tr>
<tr name="2279" id="2279">
<td><a id="l2279" class='ln'>2279</a></td><td> <span class="br">}</span></td></tr>
<tr name="2280" id="2280">
<td><a id="l2280" class='ln'>2280</a></td><td> <a id="2280c9" class="tk">logInfo</a>-&gt;<a id="2280c18" class="tk">ny</a> = <a id="2280c23" class="tk">ny</a>;</td></tr>
<tr name="2281" id="2281">
<td><a id="l2281" class='ln'>2281</a></td><td></td></tr>
<tr name="2282" id="2282">
<td><a id="l2282" class='ln'>2282</a></td><td> <span class="kw">if</span> (<a id="2282c13" class="tk">logFormat</a><a id="2282c22" class="tk">==</a>0) <span class="br">{</span></td></tr>
<tr name="2283" id="2283">
<td><a id="l2283" class='ln'>2283</a></td><td> <span class="kw">if</span> ( (<a id="2283c19" class="tk">logInfo</a>-&gt;<a id="2283c28" class="tk">y</a> = <a id="2283c32" class="tk">calloc</a>(<a id="2283c39" class="tk">ny</a>,<span class="kw">sizeof</span>(<a id="2283c49" class="tk">LogVar</a><a id="2283c55" class="tk">*</a>))) <a id="2283c60" class="tk">==</a> <a id="2283c63" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2284" id="2284">
<td><a id="l2284" class='ln'>2284</a></td><td> <a id="2284c17" class="tk">*</a><a id="2284c18" class="tk">errStatus</a> = <a id="2284c30" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="2285" id="2285">
<td><a id="l2285" class='ln'>2285</a></td><td> <span class="kw">goto</span> <a id="2285c22" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2286" id="2286">
<td><a id="l2286" class='ln'>2286</a></td><td> <span class="br">}</span></td></tr>
<tr name="2287" id="2287">
<td><a id="l2287" class='ln'>2287</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2288" id="2288">
<td><a id="l2288" class='ln'>2288</a></td><td> <span class="kw">if</span> ( (<a id="2288c19" class="tk">logInfo</a>-&gt;<a id="2288c28" class="tk">y</a> = <a id="2288c32" class="tk">calloc</a>(<a id="2288c39" class="tk">ny</a>,<span class="kw">sizeof</span>(<a id="2288c49" class="tk">StructLogVar</a><a id="2288c61" class="tk">*</a>))) <a id="2288c66" class="tk">==</a> <a id="2288c69" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2289" id="2289">
<td><a id="l2289" class='ln'>2289</a></td><td> <a id="2289c17" class="tk">*</a><a id="2289c18" class="tk">errStatus</a> = <a id="2289c30" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="2290" id="2290">
<td><a id="l2290" class='ln'>2290</a></td><td> <span class="kw">goto</span> <a id="2290c22" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2291" id="2291">
<td><a id="l2291" class='ln'>2291</a></td><td> <span class="br">}</span></td></tr>
<tr name="2292" id="2292">
<td><a id="l2292" class='ln'>2292</a></td><td> <span class="br">}</span></td></tr>
<tr name="2293" id="2293">
<td><a id="l2293" class='ln'>2293</a></td><td></td></tr>
<tr name="2294" id="2294">
<td><a id="l2294" class='ln'>2294</a></td><td> <span class="kw">for</span> (<a id="2294c14" class="tk">i</a> = <a id="2294c18" class="tk">yIdx</a> = 0, <a id="2294c28" class="tk">cp</a> = <a id="2294c33" class="tk">varName</a>; <a id="2294c42" class="tk">i</a> <a id="2294c44" class="tk">&lt;</a> <a id="2294c46" class="tk">ny</a>; <a id="2294c50" class="tk">i</a><a id="2294c51" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2295" id="2295">
<td><a id="l2295" class='ln'>2295</a></td><td> <a id="2295c13" class="tk">int_T</a> <a id="2295c26" class="tk">len</a>;</td></tr>
<tr name="2296" id="2296">
<td><a id="l2296" class='ln'>2296</a></td><td> <span class="kw">const</span> <a id="2296c19" class="tk">char_T</a> <a id="2296c26" class="tk">*</a><a id="2296c27" class="tk">cp1</a> = <a id="2296c33" class="tk">strchr</a>(<a id="2296c40" class="tk">cp</a><a id="2296c42" class="tk">+</a>1,',');</td></tr>
<tr name="2297" id="2297">
<td><a id="l2297" class='ln'>2297</a></td><td></td></tr>
<tr name="2298" id="2298">
<td><a id="l2298" class='ln'>2298</a></td><td> <span class="kw">if</span> (<a id="2298c17" class="tk">cp1</a> <a id="2298c21" class="tk">!=</a> <a id="2298c24" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2299" id="2299">
<td><a id="l2299" class='ln'>2299</a></td><td> <span class="ct">/*LINTED E_ASSIGN_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="2300" id="2300">
<td><a id="l2300" class='ln'>2300</a></td><td> <a id="2300c17" class="tk">len</a> = (<a id="2300c24" class="tk">int_T</a>)(<a id="2300c31" class="tk">cp1</a> <a id="2300c35" class="tk">-</a> <a id="2300c37" class="tk">cp</a>);</td></tr>
<tr name="2301" id="2301">
<td><a id="l2301" class='ln'>2301</a></td><td> <span class="kw">if</span> (<a id="2301c21" class="tk">len</a> <a id="2301c25" class="tk">&gt;=</a> <a id="2301c28" class="tk">mxMAXNAM</a>) <a id="2301c38" class="tk">len</a> = <a id="2301c44" class="tk">mxMAXNAM</a> <a id="2301c53" class="tk">-</a> 1;</td></tr>
<tr name="2302" id="2302">
<td><a id="l2302" class='ln'>2302</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2303" id="2303">
<td><a id="l2303" class='ln'>2303</a></td><td> <a id="2303c17" class="tk">len</a> = <a id="2303c23" class="tk">mxMAXNAM</a> <a id="2303c32" class="tk">-</a> 1;</td></tr>
<tr name="2304" id="2304">
<td><a id="l2304" class='ln'>2304</a></td><td> <span class="br">}</span></td></tr>
<tr name="2305" id="2305">
<td><a id="l2305" class='ln'>2305</a></td><td> (<span class="kw">void</span>)<a id="2305c19" class="tk">strncpy</a>(<a id="2305c27" class="tk">name</a>, <a id="2305c33" class="tk">cp</a>, <a id="2305c37" class="tk">len</a>);</td></tr>
<tr name="2306" id="2306">
<td><a id="l2306" class='ln'>2306</a></td><td> <a id="2306c13" class="tk">name</a>[<a id="2306c18" class="tk">len</a>] = '\0';</td></tr>
<tr name="2307" id="2307">
<td><a id="l2307" class='ln'>2307</a></td><td></td></tr>
<tr name="2308" id="2308">
<td><a id="l2308" class='ln'>2308</a></td><td> <span class="kw">if</span> (<a id="2308c17" class="tk">ny</a> <a id="2308c20" class="tk">&gt;</a> 1 <a id="2308c24" class="tk">&amp;&amp;</a> <a id="2308c27" class="tk">ySigPtrs</a>[<a id="2308c36" class="tk">i</a>] <a id="2308c39" class="tk">==</a> <a id="2308c42" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2309" id="2309">
<td><a id="l2309" class='ln'>2309</a></td><td> <span class="kw">goto</span> <a id="2309c22" class="tk">NEXT_NAME</a>;</td></tr>
<tr name="2310" id="2310">
<td><a id="l2310" class='ln'>2310</a></td><td> <span class="br">}</span></td></tr>
<tr name="2311" id="2311">
<td><a id="l2311" class='ln'>2311</a></td><td></td></tr>
<tr name="2312" id="2312">
<td><a id="l2312" class='ln'>2312</a></td><td> <span class="kw">if</span> (<a id="2312c17" class="tk">logFormat</a> <a id="2312c27" class="tk">==</a> 0) <span class="br">{</span></td></tr>
<tr name="2313" id="2313">
<td><a id="l2313" class='ln'>2313</a></td><td> <span class="kw">int</span> <a id="2313c32" class="tk">numCols</a>;</td></tr>
<tr name="2314" id="2314">
<td><a id="l2314" class='ln'>2314</a></td><td> <span class="kw">int</span> <a id="2314c32" class="tk">nDims</a>;</td></tr>
<tr name="2315" id="2315">
<td><a id="l2315" class='ln'>2315</a></td><td> <span class="kw">const</span> <span class="kw">int</span> <a id="2315c32" class="tk">*</a><a id="2315c33" class="tk">dims</a>;</td></tr>
<tr name="2316" id="2316">
<td><a id="l2316" class='ln'>2316</a></td><td> <a id="2316c17" class="tk">BuiltInDTypeId</a> <a id="2316c32" class="tk">dataType</a>;</td></tr>
<tr name="2317" id="2317">
<td><a id="l2317" class='ln'>2317</a></td><td> <span class="kw">int</span> <a id="2317c32" class="tk">isComplex</a>;</td></tr>
<tr name="2318" id="2318">
<td><a id="l2318" class='ln'>2318</a></td><td></td></tr>
<tr name="2319" id="2319">
<td><a id="l2319" class='ln'>2319</a></td><td> <span class="kw">if</span> (<a id="2319c21" class="tk">ny</a> <a id="2319c24" class="tk">==</a> 1) <span class="br">{</span></td></tr>
<tr name="2320" id="2320">
<td><a id="l2320" class='ln'>2320</a></td><td> <a id="2320c21" class="tk">int_T</a> <a id="2320c27" class="tk">op</a>;</td></tr>
<tr name="2321" id="2321">
<td><a id="l2321" class='ln'>2321</a></td><td></td></tr>
<tr name="2322" id="2322">
<td><a id="l2322" class='ln'>2322</a></td><td> <a id="2322c21" class="tk">numCols</a> = <a id="2322c31" class="tk">yInfo</a>[0].<a id="2322c40" class="tk">numCols</a>[0];</td></tr>
<tr name="2323" id="2323">
<td><a id="l2323" class='ln'>2323</a></td><td> <span class="kw">for</span> (<a id="2323c26" class="tk">op</a> = 1; <a id="2323c34" class="tk">op</a> <a id="2323c37" class="tk">&lt;</a> <a id="2323c39" class="tk">yInfo</a>[0].<a id="2323c48" class="tk">numSignals</a>; <a id="2323c60" class="tk">op</a><a id="2323c62" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2324" id="2324">
<td><a id="l2324" class='ln'>2324</a></td><td> <a id="2324c25" class="tk">numCols</a> <a id="2324c33" class="tk">+=</a> <a id="2324c36" class="tk">yInfo</a>[0].<a id="2324c45" class="tk">numCols</a>[<a id="2324c53" class="tk">op</a>];</td></tr>
<tr name="2325" id="2325">
<td><a id="l2325" class='ln'>2325</a></td><td> <span class="br">}</span></td></tr>
<tr name="2326" id="2326">
<td><a id="l2326" class='ln'>2326</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2327" id="2327">
<td><a id="l2327" class='ln'>2327</a></td><td><span class="ct"> * If we have only one "matrix" outport,</span></td></tr>
<tr name="2328" id="2328">
<td><a id="l2328" class='ln'>2328</a></td><td><span class="ct"> * we can still log it as a matrix</span></td></tr>
<tr name="2329" id="2329">
<td><a id="l2329" class='ln'>2329</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2330" id="2330">
<td><a id="l2330" class='ln'>2330</a></td><td> <span class="kw">if</span> (<a id="2330c25" class="tk">yInfo</a>[0].<a id="2330c34" class="tk">numSignals</a> <a id="2330c45" class="tk">==</a> 1) <span class="br">{</span></td></tr>
<tr name="2331" id="2331">
<td><a id="l2331" class='ln'>2331</a></td><td> <a id="2331c25" class="tk">nDims</a> = <a id="2331c33" class="tk">yInfo</a>[0].<a id="2331c42" class="tk">numDims</a> <a id="2331c50" class="tk">?</a> <a id="2331c52" class="tk">yInfo</a>[0].<a id="2331c61" class="tk">numDims</a>[0] <a id="2331c72" class="tk">:</a> 1;</td></tr>
<tr name="2332" id="2332">
<td><a id="l2332" class='ln'>2332</a></td><td> <a id="2332c25" class="tk">dims</a> = <a id="2332c33" class="tk">yInfo</a>[0].<a id="2332c42" class="tk">dims</a>;</td></tr>
<tr name="2333" id="2333">
<td><a id="l2333" class='ln'>2333</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2334" id="2334">
<td><a id="l2334" class='ln'>2334</a></td><td> <a id="2334c25" class="tk">nDims</a> = 1;</td></tr>
<tr name="2335" id="2335">
<td><a id="l2335" class='ln'>2335</a></td><td> <a id="2335c25" class="tk">dims</a> = <a id="2335c33" class="tk">&amp;</a><a id="2335c34" class="tk">numCols</a>;</td></tr>
<tr name="2336" id="2336">
<td><a id="l2336" class='ln'>2336</a></td><td> <span class="br">}</span></td></tr>
<tr name="2337" id="2337">
<td><a id="l2337" class='ln'>2337</a></td><td></td></tr>
<tr name="2338" id="2338">
<td><a id="l2338" class='ln'>2338</a></td><td> <a id="2338c21" class="tk">dataType</a> = <a id="2338c33" class="tk">yInfo</a>[0].<a id="2338c42" class="tk">dataTypes</a>[0];</td></tr>
<tr name="2339" id="2339">
<td><a id="l2339" class='ln'>2339</a></td><td> <a id="2339c21" class="tk">isComplex</a> = <a id="2339c33" class="tk">yInfo</a>[0].<a id="2339c42" class="tk">complexSignals</a>[0];</td></tr>
<tr name="2340" id="2340">
<td><a id="l2340" class='ln'>2340</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2341" id="2341">
<td><a id="l2341" class='ln'>2341</a></td><td> <a id="2341c21" class="tk">numCols</a> = <a id="2341c33" class="tk">yInfo</a>[<a id="2341c39" class="tk">yIdx</a>].<a id="2341c45" class="tk">numCols</a>[0];</td></tr>
<tr name="2342" id="2342">
<td><a id="l2342" class='ln'>2342</a></td><td> <a id="2342c21" class="tk">nDims</a> = <a id="2342c33" class="tk">yInfo</a>[<a id="2342c39" class="tk">yIdx</a>].<a id="2342c45" class="tk">numDims</a> <a id="2342c53" class="tk">?</a> <a id="2342c55" class="tk">yInfo</a>[<a id="2342c61" class="tk">yIdx</a>].<a id="2342c67" class="tk">numDims</a>[0] <a id="2342c78" class="tk">:</a> 1;</td></tr>
<tr name="2343" id="2343">
<td><a id="l2343" class='ln'>2343</a></td><td> <a id="2343c21" class="tk">dims</a> = <a id="2343c33" class="tk">yInfo</a>[<a id="2343c39" class="tk">yIdx</a>].<a id="2343c45" class="tk">dims</a>;</td></tr>
<tr name="2344" id="2344">
<td><a id="l2344" class='ln'>2344</a></td><td> <a id="2344c21" class="tk">dataType</a> = <a id="2344c33" class="tk">yInfo</a>[<a id="2344c39" class="tk">yIdx</a>].<a id="2344c45" class="tk">dataTypes</a>[0];</td></tr>
<tr name="2345" id="2345">
<td><a id="l2345" class='ln'>2345</a></td><td> <a id="2345c21" class="tk">isComplex</a> = <a id="2345c33" class="tk">yInfo</a>[<a id="2345c39" class="tk">yIdx</a>].<a id="2345c45" class="tk">complexSignals</a>[0];</td></tr>
<tr name="2346" id="2346">
<td><a id="l2346" class='ln'>2346</a></td><td> <span class="br">}</span></td></tr>
<tr name="2347" id="2347">
<td><a id="l2347" class='ln'>2347</a></td><td></td></tr>
<tr name="2348" id="2348">
<td><a id="l2348" class='ln'>2348</a></td><td> <a id="2348c17" class="tk">logInfo</a>-&gt;<a id="2348c26" class="tk">y</a>[<a id="2348c28" class="tk">yIdx</a>] = <a id="2348c36" class="tk">rt_CreateLogVarWithConvert</a>(</td></tr>
<tr name="2349" id="2349">
<td><a id="l2349" class='ln'>2349</a></td><td> <a id="2349c21" class="tk">li</a>, <a id="2349c25" class="tk">startTime</a>, <a id="2349c36" class="tk">finalTime</a>,</td></tr>
<tr name="2350" id="2350">
<td><a id="l2350" class='ln'>2350</a></td><td> <a id="2350c21" class="tk">stepSize</a>, <a id="2350c31" class="tk">errStatus</a>,</td></tr>
<tr name="2351" id="2351">
<td><a id="l2351" class='ln'>2351</a></td><td> <a id="2351c21" class="tk">name</a>,</td></tr>
<tr name="2352" id="2352">
<td><a id="l2352" class='ln'>2352</a></td><td> <a id="2352c21" class="tk">dataType</a>,</td></tr>
<tr name="2353" id="2353">
<td><a id="l2353" class='ln'>2353</a></td><td> <a id="2353c21" class="tk">yInfo</a>[<a id="2353c27" class="tk">yIdx</a>].<a id="2353c33" class="tk">dataTypeConvert</a>,</td></tr>
<tr name="2354" id="2354">
<td><a id="l2354" class='ln'>2354</a></td><td> 0,<a id="2354c23" class="tk">isComplex</a>,</td></tr>
<tr name="2355" id="2355">
<td><a id="l2355" class='ln'>2355</a></td><td> 0,<a id="2355c23" class="tk">numCols</a>,<a id="2355c31" class="tk">nDims</a>,<a id="2355c37" class="tk">dims</a>,</td></tr>
<tr name="2356" id="2356">
<td><a id="l2356" class='ln'>2356</a></td><td> <a id="2356c21" class="tk">NO_LOGVALDIMS</a>, <a id="2356c36" class="tk">NULL</a>, <a id="2356c42" class="tk">NULL</a>,</td></tr>
<tr name="2357" id="2357">
<td><a id="l2357" class='ln'>2357</a></td><td> <a id="2357c21" class="tk">maxRows</a>,<a id="2357c29" class="tk">decimation</a>,</td></tr>
<tr name="2358" id="2358">
<td><a id="l2358" class='ln'>2358</a></td><td> <a id="2358c21" class="tk">sampleTime</a>,1);</td></tr>
<tr name="2359" id="2359">
<td><a id="l2359" class='ln'>2359</a></td><td> <span class="kw">if</span> (<a id="2359c21" class="tk">logInfo</a>-&gt;<a id="2359c30" class="tk">y</a>[<a id="2359c32" class="tk">yIdx</a>] <a id="2359c38" class="tk">==</a> <a id="2359c41" class="tk">NULL</a>) <span class="kw">goto</span> <a id="2359c53" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2360" id="2360">
<td><a id="l2360" class='ln'>2360</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2361" id="2361">
<td><a id="l2361" class='ln'>2361</a></td><td> <a id="2361c17" class="tk">logInfo</a>-&gt;<a id="2361c26" class="tk">y</a>[<a id="2361c28" class="tk">yIdx</a>] = <a id="2361c36" class="tk">local_CreateStructLogVar</a>(<a id="2361c61" class="tk">li</a>, <a id="2361c65" class="tk">startTime</a>,</td></tr>
<tr name="2362" id="2362">
<td><a id="l2362" class='ln'>2362</a></td><td> <a id="2362c61" class="tk">finalTime</a>, <a id="2362c72" class="tk">stepSize</a>,</td></tr>
<tr name="2363" id="2363">
<td><a id="l2363" class='ln'>2363</a></td><td> <a id="2363c61" class="tk">errStatus</a>, <a id="2363c72" class="tk">name</a>,</td></tr>
<tr name="2364" id="2364">
<td><a id="l2364" class='ln'>2364</a></td><td> <a id="2364c61" class="tk">logTime</a>, <a id="2364c70" class="tk">maxRows</a>,</td></tr>
<tr name="2365" id="2365">
<td><a id="l2365" class='ln'>2365</a></td><td> <a id="2365c61" class="tk">decimation</a>, <a id="2365c73" class="tk">sampleTime</a>,</td></tr>
<tr name="2366" id="2366">
<td><a id="l2366" class='ln'>2366</a></td><td> <a id="2366c61" class="tk">&amp;</a><a id="2366c62" class="tk">yInfo</a>[<a id="2366c68" class="tk">yIdx</a>], <a id="2366c75" class="tk">NULL</a>);</td></tr>
<tr name="2367" id="2367">
<td><a id="l2367" class='ln'>2367</a></td><td> <span class="kw">if</span> (<a id="2367c21" class="tk">logInfo</a>-&gt;<a id="2367c30" class="tk">y</a>[<a id="2367c32" class="tk">yIdx</a>] <a id="2367c38" class="tk">==</a> <a id="2367c41" class="tk">NULL</a>) <span class="kw">goto</span> <a id="2367c52" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2368" id="2368">
<td><a id="l2368" class='ln'>2368</a></td><td> <span class="br">}</span></td></tr>
<tr name="2369" id="2369">
<td><a id="l2369" class='ln'>2369</a></td><td> <a id="2369c13" class="tk">++</a><a id="2369c15" class="tk">yIdx</a>;</td></tr>
<tr name="2370" id="2370">
<td><a id="l2370" class='ln'>2370</a></td><td> <a id="2370c9" class="tk">NEXT_NAME</a><a id="2370c18" class="tk">:</a></td></tr>
<tr name="2371" id="2371">
<td><a id="l2371" class='ln'>2371</a></td><td> <a id="2371c13" class="tk">cp</a> = <a id="2371c18" class="tk">cp1</a>;</td></tr>
<tr name="2372" id="2372">
<td><a id="l2372" class='ln'>2372</a></td><td> <span class="kw">if</span> (<a id="2372c17" class="tk">cp</a> <a id="2372c20" class="tk">!=</a> <a id="2372c23" class="tk">NULL</a> <a id="2372c28" class="tk">&amp;&amp;</a> <a id="2372c31" class="tk">*</a><a id="2372c32" class="tk">cp</a> <a id="2372c35" class="tk">==</a> ',') <a id="2372c43" class="tk">cp</a><a id="2372c45" class="tk">++</a>;</td></tr>
<tr name="2373" id="2373">
<td><a id="l2373" class='ln'>2373</a></td><td> <span class="br">}</span></td></tr>
<tr name="2374" id="2374">
<td><a id="l2374" class='ln'>2374</a></td><td> <span class="br">}</span></td></tr>
<tr name="2375" id="2375">
<td><a id="l2375" class='ln'>2375</a></td><td></td></tr>
<tr name="2376" id="2376">
<td><a id="l2376" class='ln'>2376</a></td><td> <span class="kw">return</span>(<a id="2376c12" class="tk">NULL</a>); <span class="ct">/* NORMAL_EXIT */</span></td></tr>
<tr name="2377" id="2377">
<td><a id="l2377" class='ln'>2377</a></td><td></td></tr>
<tr name="2378" id="2378">
<td><a id="l2378" class='ln'>2378</a></td><td> <a id="2378c2" class="tk">ERROR_EXIT</a><a id="2378c12" class="tk">:</a></td></tr>
<tr name="2379" id="2379">
<td><a id="l2379" class='ln'>2379</a></td><td> (<span class="kw">void</span>)<a id="2379c11" class="tk">fprintf</a>(<a id="2379c19" class="tk">stderr</a>, "*** Errors occurred when starting data logging.\n");</td></tr>
<tr name="2380" id="2380">
<td><a id="l2380" class='ln'>2380</a></td><td> <span class="kw">if</span> (<a id="2380c9" class="tk">*</a><a id="2380c10" class="tk">errStatus</a> <a id="2380c20" class="tk">==</a> <a id="2380c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2381" id="2381">
<td><a id="l2381" class='ln'>2381</a></td><td> <a id="2381c9" class="tk">*</a><a id="2381c10" class="tk">errStatus</a> = <a id="2381c22" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="2382" id="2382">
<td><a id="l2382" class='ln'>2382</a></td><td> <span class="br">}</span></td></tr>
<tr name="2383" id="2383">
<td><a id="l2383" class='ln'>2383</a></td><td> <span class="kw">if</span> (<a id="2383c9" class="tk">logInfo</a>) <span class="br">{</span> <span class="ct">/* polyspace DEFECT:USELESS_IF [No action planned:Unset] </span></td></tr>
<tr name="2384" id="2384">
<td><a id="l2384" class='ln'>2384</a></td><td><span class="ct"> "Defense coding." */</span></td></tr>
<tr name="2385" id="2385">
<td><a id="l2385" class='ln'>2385</a></td><td> <a id="2385c9" class="tk">rt_DestroyLogVar</a>(<a id="2385c26" class="tk">logInfo</a>-&gt;<a id="2385c35" class="tk">logVarsList</a>);</td></tr>
<tr name="2386" id="2386">
<td><a id="l2386" class='ln'>2386</a></td><td> <a id="2386c9" class="tk">logInfo</a>-&gt;<a id="2386c18" class="tk">logVarsList</a> = <a id="2386c32" class="tk">NULL</a>;</td></tr>
<tr name="2387" id="2387">
<td><a id="l2387" class='ln'>2387</a></td><td> <a id="2387c9" class="tk">rt_DestroyStructLogVar</a>(<a id="2387c32" class="tk">logInfo</a>-&gt;<a id="2387c41" class="tk">structLogVarsList</a>);</td></tr>
<tr name="2388" id="2388">
<td><a id="l2388" class='ln'>2388</a></td><td> <a id="2388c9" class="tk">logInfo</a>-&gt;<a id="2388c18" class="tk">structLogVarsList</a> = <a id="2388c38" class="tk">NULL</a>;</td></tr>
<tr name="2389" id="2389">
<td><a id="l2389" class='ln'>2389</a></td><td> <a id="2389c9" class="tk">FREE</a>(<a id="2389c14" class="tk">logInfo</a>-&gt;<a id="2389c23" class="tk">y</a>);</td></tr>
<tr name="2390" id="2390">
<td><a id="l2390" class='ln'>2390</a></td><td> <a id="2390c9" class="tk">logInfo</a>-&gt;<a id="2390c18" class="tk">y</a> = <a id="2390c22" class="tk">NULL</a>;</td></tr>
<tr name="2391" id="2391">
<td><a id="l2391" class='ln'>2391</a></td><td> <span class="br">}</span></td></tr>
<tr name="2392" id="2392">
<td><a id="l2392" class='ln'>2392</a></td><td> <span class="kw">return</span>(<a id="2392c12" class="tk">*</a><a id="2392c13" class="tk">errStatus</a>);</td></tr>
<tr name="2393" id="2393">
<td><a id="l2393" class='ln'>2393</a></td><td></td></tr>
<tr name="2394" id="2394">
<td><a id="l2394" class='ln'>2394</a></td><td><span class="br">}</span> <span class="ct">/* end rt_StartDataLoggingForOutput */</span></td></tr>
<tr name="2395" id="2395">
<td><a id="l2395" class='ln'>2395</a></td><td></td></tr>
<tr name="2396" id="2396">
<td><a id="l2396" class='ln'>2396</a></td><td></td></tr>
<tr name="2397" id="2397">
<td><a id="l2397" class='ln'>2397</a></td><td><span class="ct">/* Function: rt_ReallocLogVar ==================================================</span></td></tr>
<tr name="2398" id="2398">
<td><a id="l2398" class='ln'>2398</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="2399" id="2399">
<td><a id="l2399" class='ln'>2399</a></td><td><span class="ct"> * Allocate more memory for the data buffers in the log variable.</span></td></tr>
<tr name="2400" id="2400">
<td><a id="l2400" class='ln'>2400</a></td><td><span class="ct"> * Exit if unable to allocate more memory.</span></td></tr>
<tr name="2401" id="2401">
<td><a id="l2401" class='ln'>2401</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2402" id="2402">
<td><a id="l2402" class='ln'>2402</a></td><td><span class="kw">static</span> <span class="kw">void</span> <a id="2402c13" class="tk">rt_ReallocLogVar</a>(<a id="2402c30" class="tk">LogVar</a> <a id="2402c37" class="tk">*</a><a id="2402c38" class="tk">var</a>, <a id="2402c43" class="tk">boolean_T</a> <a id="2402c53" class="tk">isVarDims</a>)</td></tr>
<tr name="2403" id="2403">
<td><a id="l2403" class='ln'>2403</a></td><td><span class="br">{</span></td></tr>
<tr name="2404" id="2404">
<td><a id="l2404" class='ln'>2404</a></td><td> <span class="kw">void</span> <a id="2404c10" class="tk">*</a><a id="2404c11" class="tk">tmp</a>;</td></tr>
<tr name="2405" id="2405">
<td><a id="l2405" class='ln'>2405</a></td><td> <a id="2405c5" class="tk">int_T</a> <a id="2405c11" class="tk">nCols</a> = <a id="2405c19" class="tk">var</a>-&gt;<a id="2405c24" class="tk">data</a>.<a id="2405c29" class="tk">nCols</a>;</td></tr>
<tr name="2406" id="2406">
<td><a id="l2406" class='ln'>2406</a></td><td> <a id="2406c5" class="tk">int_T</a> <a id="2406c11" class="tk">nRows</a>;</td></tr>
<tr name="2407" id="2407">
<td><a id="l2407" class='ln'>2407</a></td><td> <a id="2407c5" class="tk">size_t</a> <a id="2407c12" class="tk">elSize</a> = <a id="2407c21" class="tk">var</a>-&gt;<a id="2407c26" class="tk">data</a>.<a id="2407c31" class="tk">elSize</a>;</td></tr>
<tr name="2408" id="2408">
<td><a id="l2408" class='ln'>2408</a></td><td></td></tr>
<tr name="2409" id="2409">
<td><a id="l2409" class='ln'>2409</a></td><td> <span class="kw">if</span> (<a id="2409c9" class="tk">isVarDims</a>)</td></tr>
<tr name="2410" id="2410">
<td><a id="l2410" class='ln'>2410</a></td><td> <span class="br">{</span></td></tr>
<tr name="2411" id="2411">
<td><a id="l2411" class='ln'>2411</a></td><td> <a id="2411c9" class="tk">nRows</a> = <a id="2411c17" class="tk">var</a>-&gt;<a id="2411c22" class="tk">data</a>.<a id="2411c27" class="tk">nRows</a> <a id="2411c33" class="tk">+</a> <a id="2411c35" class="tk">DEFAULT_BUFFER_SIZE</a>;</td></tr>
<tr name="2412" id="2412">
<td><a id="l2412" class='ln'>2412</a></td><td> <span class="br">}</span></td></tr>
<tr name="2413" id="2413">
<td><a id="l2413" class='ln'>2413</a></td><td> <span class="kw">else</span></td></tr>
<tr name="2414" id="2414">
<td><a id="l2414" class='ln'>2414</a></td><td> <span class="br">{</span></td></tr>
<tr name="2415" id="2415">
<td><a id="l2415" class='ln'>2415</a></td><td> <a id="2415c9" class="tk">nRows</a> = <a id="2415c17" class="tk">var</a>-&gt;<a id="2415c22" class="tk">data</a>.<a id="2415c27" class="tk">nRows</a> <a id="2415c33" class="tk">==</a> 0 <a id="2415c38" class="tk">?</a> 1 <a id="2415c42" class="tk">:</a> 2<a id="2415c45" class="tk">*</a><a id="2415c46" class="tk">var</a>-&gt;<a id="2415c51" class="tk">data</a>.<a id="2415c56" class="tk">nRows</a>;</td></tr>
<tr name="2416" id="2416">
<td><a id="l2416" class='ln'>2416</a></td><td> <span class="br">}</span></td></tr>
<tr name="2417" id="2417">
<td><a id="l2417" class='ln'>2417</a></td><td> </td></tr>
<tr name="2418" id="2418">
<td><a id="l2418" class='ln'>2418</a></td><td> <a id="2418c5" class="tk">tmp</a> = <a id="2418c11" class="tk">realloc</a>(<a id="2418c19" class="tk">var</a>-&gt;<a id="2418c24" class="tk">data</a>.<a id="2418c29" class="tk">re</a>, <a id="2418c33" class="tk">nRows</a><a id="2418c38" class="tk">*</a><a id="2418c39" class="tk">nCols</a><a id="2418c44" class="tk">*</a><a id="2418c45" class="tk">elSize</a>);</td></tr>
<tr name="2419" id="2419">
<td><a id="l2419" class='ln'>2419</a></td><td> <span class="kw">if</span> (<a id="2419c9" class="tk">tmp</a> <a id="2419c13" class="tk">==</a> <a id="2419c16" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2420" id="2420">
<td><a id="l2420" class='ln'>2420</a></td><td> (<span class="kw">void</span>)<a id="2420c15" class="tk">fprintf</a>(<a id="2420c23" class="tk">stderr</a>,</td></tr>
<tr name="2421" id="2421">
<td><a id="l2421" class='ln'>2421</a></td><td> "*** Memory allocation error.\n");</td></tr>
<tr name="2422" id="2422">
<td><a id="l2422" class='ln'>2422</a></td><td> (<span class="kw">void</span>)<a id="2422c15" class="tk">fprintf</a>(<a id="2422c23" class="tk">stderr</a>, ""</td></tr>
<tr name="2423" id="2423">
<td><a id="l2423" class='ln'>2423</a></td><td> " varName = %s%s\n"</td></tr>
<tr name="2424" id="2424">
<td><a id="l2424" class='ln'>2424</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2425" id="2425">
<td><a id="l2425" class='ln'>2425</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2426" id="2426">
<td><a id="l2426" class='ln'>2426</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2427" id="2427">
<td><a id="l2427" class='ln'>2427</a></td><td> " Current Size = %.16g\n"</td></tr>
<tr name="2428" id="2428">
<td><a id="l2428" class='ln'>2428</a></td><td> " Failed resize = %.16g\n\n",</td></tr>
<tr name="2429" id="2429">
<td><a id="l2429" class='ln'>2429</a></td><td> <a id="2429c23" class="tk">var</a>-&gt;<a id="2429c28" class="tk">data</a>.<a id="2429c33" class="tk">name</a>,</td></tr>
<tr name="2430" id="2430">
<td><a id="l2430" class='ln'>2430</a></td><td> <a id="2430c23" class="tk">var</a>-&gt;<a id="2430c28" class="tk">data</a>.<a id="2430c33" class="tk">complex</a> <a id="2430c41" class="tk">?</a> " (real part)" <a id="2430c58" class="tk">:</a> "",</td></tr>
<tr name="2431" id="2431">
<td><a id="l2431" class='ln'>2431</a></td><td> <a id="2431c23" class="tk">var</a>-&gt;<a id="2431c28" class="tk">data</a>.<a id="2431c33" class="tk">nRows</a>,</td></tr>
<tr name="2432" id="2432">
<td><a id="l2432" class='ln'>2432</a></td><td> <a id="2432c23" class="tk">var</a>-&gt;<a id="2432c28" class="tk">data</a>.<a id="2432c33" class="tk">nCols</a>,</td></tr>
<tr name="2433" id="2433">
<td><a id="l2433" class='ln'>2433</a></td><td> (<span class="kw">unsigned</span> <span class="kw">long</span>) <a id="2433c40" class="tk">var</a>-&gt;<a id="2433c45" class="tk">data</a>.<a id="2433c50" class="tk">elSize</a>,</td></tr>
<tr name="2434" id="2434">
<td><a id="l2434" class='ln'>2434</a></td><td> (<span class="kw">double</span>)<a id="2434c31" class="tk">nRows</a><a id="2434c36" class="tk">*</a><a id="2434c37" class="tk">nCols</a><a id="2434c42" class="tk">*</a><a id="2434c43" class="tk">elSize</a>,</td></tr>
<tr name="2435" id="2435">
<td><a id="l2435" class='ln'>2435</a></td><td> (<span class="kw">double</span>)(<a id="2435c32" class="tk">nRows</a><a id="2435c37" class="tk">+</a><a id="2435c38" class="tk">DEFAULT_BUFFER_SIZE</a>)<a id="2435c58" class="tk">*</a><a id="2435c59" class="tk">nCols</a><a id="2435c64" class="tk">*</a><a id="2435c65" class="tk">elSize</a>);</td></tr>
<tr name="2436" id="2436">
<td><a id="l2436" class='ln'>2436</a></td><td> <a id="2436c9" class="tk">exit</a>(1);</td></tr>
<tr name="2437" id="2437">
<td><a id="l2437" class='ln'>2437</a></td><td> <span class="br">}</span></td></tr>
<tr name="2438" id="2438">
<td><a id="l2438" class='ln'>2438</a></td><td> <a id="2438c5" class="tk">var</a>-&gt;<a id="2438c10" class="tk">data</a>.<a id="2438c15" class="tk">re</a> = <a id="2438c20" class="tk">tmp</a>;</td></tr>
<tr name="2439" id="2439">
<td><a id="l2439" class='ln'>2439</a></td><td></td></tr>
<tr name="2440" id="2440">
<td><a id="l2440" class='ln'>2440</a></td><td> <span class="kw">if</span> (<a id="2440c9" class="tk">var</a>-&gt;<a id="2440c14" class="tk">data</a>.<a id="2440c19" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="2441" id="2441">
<td><a id="l2441" class='ln'>2441</a></td><td> <a id="2441c9" class="tk">tmp</a> = <a id="2441c15" class="tk">realloc</a>(<a id="2441c23" class="tk">var</a>-&gt;<a id="2441c28" class="tk">data</a>.<a id="2441c33" class="tk">im</a>, <a id="2441c37" class="tk">nRows</a><a id="2441c42" class="tk">*</a><a id="2441c43" class="tk">nCols</a><a id="2441c48" class="tk">*</a><a id="2441c49" class="tk">elSize</a>);</td></tr>
<tr name="2442" id="2442">
<td><a id="l2442" class='ln'>2442</a></td><td> <span class="kw">if</span> (<a id="2442c13" class="tk">tmp</a> <a id="2442c17" class="tk">==</a> <a id="2442c20" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2443" id="2443">
<td><a id="l2443" class='ln'>2443</a></td><td> (<span class="kw">void</span>)<a id="2443c19" class="tk">fprintf</a>(<a id="2443c27" class="tk">stderr</a>,</td></tr>
<tr name="2444" id="2444">
<td><a id="l2444" class='ln'>2444</a></td><td> "*** Memory allocation error.\n");</td></tr>
<tr name="2445" id="2445">
<td><a id="l2445" class='ln'>2445</a></td><td> (<span class="kw">void</span>)<a id="2445c19" class="tk">fprintf</a>(<a id="2445c27" class="tk">stderr</a>, ""</td></tr>
<tr name="2446" id="2446">
<td><a id="l2446" class='ln'>2446</a></td><td> " varName = %s (complex part)\n"</td></tr>
<tr name="2447" id="2447">
<td><a id="l2447" class='ln'>2447</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2448" id="2448">
<td><a id="l2448" class='ln'>2448</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2449" id="2449">
<td><a id="l2449" class='ln'>2449</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2450" id="2450">
<td><a id="l2450" class='ln'>2450</a></td><td> " Current Size = %.16g\n"</td></tr>
<tr name="2451" id="2451">
<td><a id="l2451" class='ln'>2451</a></td><td> " Failed resize = %.16g\n\n",</td></tr>
<tr name="2452" id="2452">
<td><a id="l2452" class='ln'>2452</a></td><td> <a id="2452c27" class="tk">var</a>-&gt;<a id="2452c32" class="tk">data</a>.<a id="2452c37" class="tk">name</a>,</td></tr>
<tr name="2453" id="2453">
<td><a id="l2453" class='ln'>2453</a></td><td> <a id="2453c27" class="tk">var</a>-&gt;<a id="2453c32" class="tk">data</a>.<a id="2453c37" class="tk">nRows</a>,</td></tr>
<tr name="2454" id="2454">
<td><a id="l2454" class='ln'>2454</a></td><td> <a id="2454c27" class="tk">var</a>-&gt;<a id="2454c32" class="tk">data</a>.<a id="2454c37" class="tk">nCols</a>,</td></tr>
<tr name="2455" id="2455">
<td><a id="l2455" class='ln'>2455</a></td><td> (<span class="kw">unsigned</span> <span class="kw">long</span>) <a id="2455c44" class="tk">var</a>-&gt;<a id="2455c49" class="tk">data</a>.<a id="2455c54" class="tk">elSize</a>,</td></tr>
<tr name="2456" id="2456">
<td><a id="l2456" class='ln'>2456</a></td><td> (<span class="kw">double</span>)<a id="2456c35" class="tk">nRows</a><a id="2456c40" class="tk">*</a><a id="2456c41" class="tk">nCols</a><a id="2456c46" class="tk">*</a><a id="2456c47" class="tk">elSize</a>,</td></tr>
<tr name="2457" id="2457">
<td><a id="l2457" class='ln'>2457</a></td><td> (<span class="kw">double</span>)(<a id="2457c36" class="tk">nRows</a><a id="2457c41" class="tk">+</a><a id="2457c42" class="tk">DEFAULT_BUFFER_SIZE</a>)<a id="2457c62" class="tk">*</a><a id="2457c63" class="tk">nCols</a><a id="2457c68" class="tk">*</a><a id="2457c69" class="tk">elSize</a>);</td></tr>
<tr name="2458" id="2458">
<td><a id="l2458" class='ln'>2458</a></td><td> <a id="2458c13" class="tk">exit</a>(1);</td></tr>
<tr name="2459" id="2459">
<td><a id="l2459" class='ln'>2459</a></td><td> <span class="br">}</span></td></tr>
<tr name="2460" id="2460">
<td><a id="l2460" class='ln'>2460</a></td><td> <a id="2460c9" class="tk">var</a>-&gt;<a id="2460c14" class="tk">data</a>.<a id="2460c19" class="tk">im</a> = <a id="2460c24" class="tk">tmp</a>;</td></tr>
<tr name="2461" id="2461">
<td><a id="l2461" class='ln'>2461</a></td><td> <span class="br">}</span></td></tr>
<tr name="2462" id="2462">
<td><a id="l2462" class='ln'>2462</a></td><td> <a id="2462c5" class="tk">var</a>-&gt;<a id="2462c10" class="tk">data</a>.<a id="2462c15" class="tk">nRows</a> = <a id="2462c23" class="tk">nRows</a>;</td></tr>
<tr name="2463" id="2463">
<td><a id="l2463" class='ln'>2463</a></td><td></td></tr>
<tr name="2464" id="2464">
<td><a id="l2464" class='ln'>2464</a></td><td> <span class="ct">/* Also reallocate memory for "valueDimensions" </span></td></tr>
<tr name="2465" id="2465">
<td><a id="l2465" class='ln'>2465</a></td><td><span class="ct"> when logging the variable-size signal</span></td></tr>
<tr name="2466" id="2466">
<td><a id="l2466" class='ln'>2466</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2467" id="2467">
<td><a id="l2467" class='ln'>2467</a></td><td> <span class="kw">if</span>(<a id="2467c8" class="tk">isVarDims</a>)<span class="br">{</span></td></tr>
<tr name="2468" id="2468">
<td><a id="l2468" class='ln'>2468</a></td><td> <a id="2468c9" class="tk">int_T</a> <a id="2468c15" class="tk">k</a>;</td></tr>
<tr name="2469" id="2469">
<td><a id="l2469" class='ln'>2469</a></td><td> </td></tr>
<tr name="2470" id="2470">
<td><a id="l2470" class='ln'>2470</a></td><td> <a id="2470c9" class="tk">nCols</a> = <a id="2470c17" class="tk">var</a>-&gt;<a id="2470c22" class="tk">valDims</a>-&gt;<a id="2470c31" class="tk">nCols</a>;</td></tr>
<tr name="2471" id="2471">
<td><a id="l2471" class='ln'>2471</a></td><td> <a id="2471c9" class="tk">nRows</a> = <a id="2471c17" class="tk">var</a>-&gt;<a id="2471c22" class="tk">valDims</a>-&gt;<a id="2471c31" class="tk">nRows</a> <a id="2471c37" class="tk">+</a> <a id="2471c39" class="tk">DEFAULT_BUFFER_SIZE</a>;</td></tr>
<tr name="2472" id="2472">
<td><a id="l2472" class='ln'>2472</a></td><td> <a id="2472c9" class="tk">elSize</a> = <span class="kw">sizeof</span>(<a id="2472c25" class="tk">real_T</a>);</td></tr>
<tr name="2473" id="2473">
<td><a id="l2473" class='ln'>2473</a></td><td> <a id="2473c9" class="tk">tmp</a> = <a id="2473c15" class="tk">realloc</a>(<a id="2473c23" class="tk">var</a>-&gt;<a id="2473c28" class="tk">valDims</a>-&gt;<a id="2473c37" class="tk">dimsData</a>, <a id="2473c47" class="tk">nRows</a><a id="2473c52" class="tk">*</a><a id="2473c53" class="tk">nCols</a><a id="2473c58" class="tk">*</a><a id="2473c59" class="tk">elSize</a>);</td></tr>
<tr name="2474" id="2474">
<td><a id="l2474" class='ln'>2474</a></td><td> <span class="kw">if</span> (<a id="2474c13" class="tk">tmp</a> <a id="2474c17" class="tk">==</a> <a id="2474c20" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2475" id="2475">
<td><a id="l2475" class='ln'>2475</a></td><td> (<span class="kw">void</span>)<a id="2475c19" class="tk">fprintf</a>(<a id="2475c27" class="tk">stderr</a>,</td></tr>
<tr name="2476" id="2476">
<td><a id="l2476" class='ln'>2476</a></td><td> "*** Memory allocation error.\n");</td></tr>
<tr name="2477" id="2477">
<td><a id="l2477" class='ln'>2477</a></td><td> (<span class="kw">void</span>)<a id="2477c19" class="tk">fprintf</a>(<a id="2477c27" class="tk">stderr</a>, ""</td></tr>
<tr name="2478" id="2478">
<td><a id="l2478" class='ln'>2478</a></td><td> " varName = %s\n"</td></tr>
<tr name="2479" id="2479">
<td><a id="l2479" class='ln'>2479</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2480" id="2480">
<td><a id="l2480" class='ln'>2480</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2481" id="2481">
<td><a id="l2481" class='ln'>2481</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2482" id="2482">
<td><a id="l2482" class='ln'>2482</a></td><td> " Current Size = %.16g\n"</td></tr>
<tr name="2483" id="2483">
<td><a id="l2483" class='ln'>2483</a></td><td> " Failed resize = %.16g\n\n",</td></tr>
<tr name="2484" id="2484">
<td><a id="l2484" class='ln'>2484</a></td><td> <a id="2484c27" class="tk">var</a>-&gt;<a id="2484c32" class="tk">valDims</a>-&gt;<a id="2484c41" class="tk">name</a>,</td></tr>
<tr name="2485" id="2485">
<td><a id="l2485" class='ln'>2485</a></td><td> <a id="2485c27" class="tk">var</a>-&gt;<a id="2485c32" class="tk">valDims</a>-&gt;<a id="2485c41" class="tk">nRows</a>,</td></tr>
<tr name="2486" id="2486">
<td><a id="l2486" class='ln'>2486</a></td><td> <a id="2486c27" class="tk">var</a>-&gt;<a id="2486c32" class="tk">valDims</a>-&gt;<a id="2486c41" class="tk">nCols</a>,</td></tr>
<tr name="2487" id="2487">
<td><a id="l2487" class='ln'>2487</a></td><td> (<span class="kw">unsigned</span> <span class="kw">long</span>) <a id="2487c44" class="tk">elSize</a>,</td></tr>
<tr name="2488" id="2488">
<td><a id="l2488" class='ln'>2488</a></td><td> (<span class="kw">double</span>)<a id="2488c35" class="tk">nRows</a><a id="2488c40" class="tk">*</a><a id="2488c41" class="tk">nCols</a><a id="2488c46" class="tk">*</a><a id="2488c47" class="tk">elSize</a>,</td></tr>
<tr name="2489" id="2489">
<td><a id="l2489" class='ln'>2489</a></td><td> (<span class="kw">double</span>)(<a id="2489c36" class="tk">nRows</a><a id="2489c41" class="tk">+</a><a id="2489c42" class="tk">DEFAULT_BUFFER_SIZE</a>)<a id="2489c62" class="tk">*</a><a id="2489c63" class="tk">nCols</a><a id="2489c68" class="tk">*</a><a id="2489c69" class="tk">elSize</a>);</td></tr>
<tr name="2490" id="2490">
<td><a id="l2490" class='ln'>2490</a></td><td> <a id="2490c13" class="tk">exit</a>(1);</td></tr>
<tr name="2491" id="2491">
<td><a id="l2491" class='ln'>2491</a></td><td> <span class="br">}</span></td></tr>
<tr name="2492" id="2492">
<td><a id="l2492" class='ln'>2492</a></td><td></td></tr>
<tr name="2493" id="2493">
<td><a id="l2493" class='ln'>2493</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2494" id="2494">
<td><a id="l2494" class='ln'>2494</a></td><td><span class="ct"> * valueDimensions data is stored in array format and must be</span></td></tr>
<tr name="2495" id="2495">
<td><a id="l2495" class='ln'>2495</a></td><td><span class="ct"> * adjusted after reallocation (see also rt_FixupLogVar())</span></td></tr>
<tr name="2496" id="2496">
<td><a id="l2496" class='ln'>2496</a></td><td><span class="ct"> *</span></td></tr>
<tr name="2497" id="2497">
<td><a id="l2497" class='ln'>2497</a></td><td><span class="ct"> * Example: maxRows = 4; nRows = 4; nDims = 3;</span></td></tr>
<tr name="2498" id="2498">
<td><a id="l2498" class='ln'>2498</a></td><td><span class="ct"> * Before realloc of the logVar, the locations of data are as below:</span></td></tr>
<tr name="2499" id="2499">
<td><a id="l2499" class='ln'>2499</a></td><td><span class="ct"> * (x, y, z -- useful data / o -- junk, don't care)</span></td></tr>
<tr name="2500" id="2500">
<td><a id="l2500" class='ln'>2500</a></td><td><span class="ct"> * a[0] = x a[4] = y a[8] = z</span></td></tr>
<tr name="2501" id="2501">
<td><a id="l2501" class='ln'>2501</a></td><td><span class="ct"> * a[1] = x a[5] = y a[9] = z</span></td></tr>
<tr name="2502" id="2502">
<td><a id="l2502" class='ln'>2502</a></td><td><span class="ct"> * a[2] = x a[6] = y a[10]= z</span></td></tr>
<tr name="2503" id="2503">
<td><a id="l2503" class='ln'>2503</a></td><td><span class="ct"> * a[3] = x a[7] = y a[11]= z</span></td></tr>
<tr name="2504" id="2504">
<td><a id="l2504" class='ln'>2504</a></td><td><span class="ct"> *</span></td></tr>
<tr name="2505" id="2505">
<td><a id="l2505" class='ln'>2505</a></td><td><span class="ct"> * After realloc of the logVar (suppose 2 extra rows are added),</span></td></tr>
<tr name="2506" id="2506">
<td><a id="l2506" class='ln'>2506</a></td><td><span class="ct"> * the locations of data are as below:</span></td></tr>
<tr name="2507" id="2507">
<td><a id="l2507" class='ln'>2507</a></td><td><span class="ct"> * a[0] = x a[6] = y a[12]= o</span></td></tr>
<tr name="2508" id="2508">
<td><a id="l2508" class='ln'>2508</a></td><td><span class="ct"> * a[1] = x a[7] = y a[13]= o</span></td></tr>
<tr name="2509" id="2509">
<td><a id="l2509" class='ln'>2509</a></td><td><span class="ct"> * a[2] = x a[8] = z a[14]= o</span></td></tr>
<tr name="2510" id="2510">
<td><a id="l2510" class='ln'>2510</a></td><td><span class="ct"> * a[3] = x a[9] = z a[15]= o</span></td></tr>
<tr name="2511" id="2511">
<td><a id="l2511" class='ln'>2511</a></td><td><span class="ct"> * a[4] = y a[10]= z a[16]= o</span></td></tr>
<tr name="2512" id="2512">
<td><a id="l2512" class='ln'>2512</a></td><td><span class="ct"> * a[5] = y a[11]= z a[17]= o</span></td></tr>
<tr name="2513" id="2513">
<td><a id="l2513" class='ln'>2513</a></td><td><span class="ct"> *</span></td></tr>
<tr name="2514" id="2514">
<td><a id="l2514" class='ln'>2514</a></td><td><span class="ct"> * The data must be adjusted as below:</span></td></tr>
<tr name="2515" id="2515">
<td><a id="l2515" class='ln'>2515</a></td><td><span class="ct"> * a[0] = x a[6] = y a[12]= z</span></td></tr>
<tr name="2516" id="2516">
<td><a id="l2516" class='ln'>2516</a></td><td><span class="ct"> * a[1] = x a[7] = y a[13]= z</span></td></tr>
<tr name="2517" id="2517">
<td><a id="l2517" class='ln'>2517</a></td><td><span class="ct"> * a[2] = x a[8] = y a[14]= z</span></td></tr>
<tr name="2518" id="2518">
<td><a id="l2518" class='ln'>2518</a></td><td><span class="ct"> * a[3] = x a[9] = y a[15]= z</span></td></tr>
<tr name="2519" id="2519">
<td><a id="l2519" class='ln'>2519</a></td><td><span class="ct"> * a[4] = o a[10]= o a[16]= o</span></td></tr>
<tr name="2520" id="2520">
<td><a id="l2520" class='ln'>2520</a></td><td><span class="ct"> * a[5] = o a[11]= o a[17]= o</span></td></tr>
<tr name="2521" id="2521">
<td><a id="l2521" class='ln'>2521</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2522" id="2522">
<td><a id="l2522" class='ln'>2522</a></td><td> <span class="kw">for</span>(<a id="2522c13" class="tk">k</a> = <a id="2522c17" class="tk">var</a>-&gt;<a id="2522c22" class="tk">data</a>.<a id="2522c27" class="tk">nDims</a><a id="2522c32" class="tk">-</a>1; <a id="2522c36" class="tk">k</a> <a id="2522c38" class="tk">&gt;</a> 0; <a id="2522c43" class="tk">k</a><a id="2522c44" class="tk">--</a>)<span class="br">{</span></td></tr>
<tr name="2523" id="2523">
<td><a id="l2523" class='ln'>2523</a></td><td> (<span class="kw">void</span>) <a id="2523c20" class="tk">memcpy</a>((<a id="2523c28" class="tk">real_T</a><a id="2523c34" class="tk">*</a>)<a id="2523c36" class="tk">tmp</a> <a id="2523c40" class="tk">+</a> <a id="2523c42" class="tk">k</a><a id="2523c43" class="tk">*</a><a id="2523c44" class="tk">nRows</a>, </td></tr>
<tr name="2524" id="2524">
<td><a id="l2524" class='ln'>2524</a></td><td> (<a id="2524c28" class="tk">real_T</a><a id="2524c34" class="tk">*</a>)<a id="2524c36" class="tk">tmp</a> <a id="2524c40" class="tk">+</a> <a id="2524c42" class="tk">k</a><a id="2524c43" class="tk">*</a><a id="2524c44" class="tk">var</a>-&gt;<a id="2524c49" class="tk">valDims</a>-&gt;<a id="2524c58" class="tk">nRows</a>,</td></tr>
<tr name="2525" id="2525">
<td><a id="l2525" class='ln'>2525</a></td><td> <a id="2525c27" class="tk">elSize</a> <a id="2525c34" class="tk">*</a> <a id="2525c36" class="tk">var</a>-&gt;<a id="2525c41" class="tk">valDims</a>-&gt;<a id="2525c50" class="tk">nRows</a>);</td></tr>
<tr name="2526" id="2526">
<td><a id="l2526" class='ln'>2526</a></td><td> <span class="br">}</span></td></tr>
<tr name="2527" id="2527">
<td><a id="l2527" class='ln'>2527</a></td><td></td></tr>
<tr name="2528" id="2528">
<td><a id="l2528" class='ln'>2528</a></td><td> <a id="2528c9" class="tk">var</a>-&gt;<a id="2528c14" class="tk">valDims</a>-&gt;<a id="2528c23" class="tk">dimsData</a> = <a id="2528c34" class="tk">tmp</a>;</td></tr>
<tr name="2529" id="2529">
<td><a id="l2529" class='ln'>2529</a></td><td> <a id="2529c9" class="tk">var</a>-&gt;<a id="2529c14" class="tk">valDims</a>-&gt;<a id="2529c23" class="tk">nRows</a> = <a id="2529c31" class="tk">nRows</a>;</td></tr>
<tr name="2530" id="2530">
<td><a id="l2530" class='ln'>2530</a></td><td> <span class="br">}</span></td></tr>
<tr name="2531" id="2531">
<td><a id="l2531" class='ln'>2531</a></td><td></td></tr>
<tr name="2532" id="2532">
<td><a id="l2532" class='ln'>2532</a></td><td><span class="br">}</span> <span class="ct">/* end rt_ReallocLogVar */</span></td></tr>
<tr name="2533" id="2533">
<td><a id="l2533" class='ln'>2533</a></td><td></td></tr>
<tr name="2534" id="2534">
<td><a id="l2534" class='ln'>2534</a></td><td><span class="kw">const</span> <a id="2534c7" class="tk">char_T</a> <a id="2534c14" class="tk">*</a><a id="2534c15" class="tk">rt_UpdateLogVarWithDiscontiguousData</a>(<a id="2534c52" class="tk">LogVar</a> <a id="2534c75" class="tk">*</a><a id="2534c76" class="tk">var</a>,</td></tr>
<tr name="2535" id="2535">
<td><a id="l2535" class='ln'>2535</a></td><td> <a id="2535c46" class="tk">int8_T</a><a id="2535c52" class="tk">*</a><a id="2535c53" class="tk">*</a> <a id="2535c69" class="tk">data</a>,</td></tr>
<tr name="2536" id="2536">
<td><a id="l2536" class='ln'>2536</a></td><td> <span class="kw">const</span> <a id="2536c52" class="tk">int_T</a> <a id="2536c69" class="tk">*</a><a id="2536c70" class="tk">segmentLengths</a>,</td></tr>
<tr name="2537" id="2537">
<td><a id="l2537" class='ln'>2537</a></td><td> <a id="2537c46" class="tk">int_T</a> <a id="2537c69" class="tk">nSegments</a>,</td></tr>
<tr name="2538" id="2538">
<td><a id="l2538" class='ln'>2538</a></td><td> <a id="2538c46" class="tk">RTWPreprocessingFcnPtr</a> <a id="2538c69" class="tk">*</a><a id="2538c70" class="tk">preprocessingPtrs</a>);</td></tr>
<tr name="2539" id="2539">
<td><a id="l2539" class='ln'>2539</a></td><td> </td></tr>
<tr name="2540" id="2540">
<td><a id="l2540" class='ln'>2540</a></td><td><span class="ct">/* Function: rt_UpdateLogVarWithDiscontinuousData ==============================</span></td></tr>
<tr name="2541" id="2541">
<td><a id="l2541" class='ln'>2541</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="2542" id="2542">
<td><a id="l2542" class='ln'>2542</a></td><td><span class="ct"> * Log one row of the LogVar with data that is not contiguous.</span></td></tr>
<tr name="2543" id="2543">
<td><a id="l2543" class='ln'>2543</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2544" id="2544">
<td><a id="l2544" class='ln'>2544</a></td><td><span class="kw">const</span> <a id="2544c7" class="tk">char_T</a> <a id="2544c14" class="tk">*</a><a id="2544c15" class="tk">rt_UpdateLogVarWithDiscontiguousData</a>(<a id="2544c52" class="tk">LogVar</a> <a id="2544c75" class="tk">*</a><a id="2544c76" class="tk">var</a>,</td></tr>
<tr name="2545" id="2545">
<td><a id="l2545" class='ln'>2545</a></td><td> <a id="2545c46" class="tk">int8_T</a><a id="2545c52" class="tk">*</a><a id="2545c53" class="tk">*</a> <a id="2545c69" class="tk">data</a>,</td></tr>
<tr name="2546" id="2546">
<td><a id="l2546" class='ln'>2546</a></td><td> <span class="kw">const</span> <a id="2546c52" class="tk">int_T</a> <a id="2546c69" class="tk">*</a><a id="2546c70" class="tk">segmentLengths</a>,</td></tr>
<tr name="2547" id="2547">
<td><a id="l2547" class='ln'>2547</a></td><td> <a id="2547c46" class="tk">int_T</a> <a id="2547c69" class="tk">nSegments</a>,</td></tr>
<tr name="2548" id="2548">
<td><a id="l2548" class='ln'>2548</a></td><td> <a id="2548c46" class="tk">RTWPreprocessingFcnPtr</a> <a id="2548c69" class="tk">*</a><a id="2548c70" class="tk">preprocessingPtrs</a>)</td></tr>
<tr name="2549" id="2549">
<td><a id="l2549" class='ln'>2549</a></td><td><span class="br">{</span></td></tr>
<tr name="2550" id="2550">
<td><a id="l2550" class='ln'>2550</a></td><td> <a id="2550c5" class="tk">size_t</a> <a id="2550c12" class="tk">elSize</a> = 0;</td></tr>
<tr name="2551" id="2551">
<td><a id="l2551" class='ln'>2551</a></td><td> <a id="2551c5" class="tk">size_t</a> <a id="2551c12" class="tk">offset</a> = 0;</td></tr>
<tr name="2552" id="2552">
<td><a id="l2552" class='ln'>2552</a></td><td> <span class="kw">int</span> <a id="2552c12" class="tk">segIdx</a> = 0;</td></tr>
<tr name="2553" id="2553">
<td><a id="l2553" class='ln'>2553</a></td><td></td></tr>
<tr name="2554" id="2554">
<td><a id="l2554" class='ln'>2554</a></td><td> <span class="kw">if</span> (<a id="2554c9" class="tk">++</a><a id="2554c11" class="tk">var</a>-&gt;<a id="2554c16" class="tk">numHits</a> <a id="2554c24" class="tk">%</a> <a id="2554c26" class="tk">var</a>-&gt;<a id="2554c31" class="tk">decimation</a>) <span class="kw">return</span>(<a id="2554c50" class="tk">NULL</a>);</td></tr>
<tr name="2555" id="2555">
<td><a id="l2555" class='ln'>2555</a></td><td> <a id="2555c5" class="tk">var</a>-&gt;<a id="2555c10" class="tk">numHits</a> = 0;</td></tr>
<tr name="2556" id="2556">
<td><a id="l2556" class='ln'>2556</a></td><td></td></tr>
<tr name="2557" id="2557">
<td><a id="l2557" class='ln'>2557</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2558" id="2558">
<td><a id="l2558" class='ln'>2558</a></td><td><span class="ct"> * Reallocate or wrap the LogVar</span></td></tr>
<tr name="2559" id="2559">
<td><a id="l2559" class='ln'>2559</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2560" id="2560">
<td><a id="l2560" class='ln'>2560</a></td><td> <span class="kw">if</span> (<a id="2560c9" class="tk">var</a>-&gt;<a id="2560c14" class="tk">rowIdx</a> <a id="2560c21" class="tk">==</a> <a id="2560c24" class="tk">var</a>-&gt;<a id="2560c29" class="tk">data</a>.<a id="2560c34" class="tk">nRows</a>) <span class="br">{</span></td></tr>
<tr name="2561" id="2561">
<td><a id="l2561" class='ln'>2561</a></td><td> <span class="kw">if</span> (<a id="2561c13" class="tk">var</a>-&gt;<a id="2561c18" class="tk">okayToRealloc</a> <a id="2561c32" class="tk">==</a> 1) <span class="br">{</span></td></tr>
<tr name="2562" id="2562">
<td><a id="l2562" class='ln'>2562</a></td><td> <a id="2562c13" class="tk">rt_ReallocLogVar</a>(<a id="2562c30" class="tk">var</a>, false);</td></tr>
<tr name="2563" id="2563">
<td><a id="l2563" class='ln'>2563</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2564" id="2564">
<td><a id="l2564" class='ln'>2564</a></td><td> <span class="ct">/* Circular buffer */</span></td></tr>
<tr name="2565" id="2565">
<td><a id="l2565" class='ln'>2565</a></td><td> <a id="2565c13" class="tk">var</a>-&gt;<a id="2565c18" class="tk">rowIdx</a> = 0;</td></tr>
<tr name="2566" id="2566">
<td><a id="l2566" class='ln'>2566</a></td><td> <a id="2566c13" class="tk">++</a>(<a id="2566c16" class="tk">var</a>-&gt;<a id="2566c21" class="tk">wrapped</a>); <span class="ct">/* increment the wrap around counter */</span></td></tr>
<tr name="2567" id="2567">
<td><a id="l2567" class='ln'>2567</a></td><td> <span class="br">}</span></td></tr>
<tr name="2568" id="2568">
<td><a id="l2568" class='ln'>2568</a></td><td> <span class="br">}</span></td></tr>
<tr name="2569" id="2569">
<td><a id="l2569" class='ln'>2569</a></td><td></td></tr>
<tr name="2570" id="2570">
<td><a id="l2570" class='ln'>2570</a></td><td> <span class="ct">/* This function is only used to log states, there's no var-dims issue. */</span></td></tr>
<tr name="2571" id="2571">
<td><a id="l2571" class='ln'>2571</a></td><td> <a id="2571c5" class="tk">elSize</a> = <a id="2571c14" class="tk">var</a>-&gt;<a id="2571c19" class="tk">data</a>.<a id="2571c24" class="tk">elSize</a>;</td></tr>
<tr name="2572" id="2572">
<td><a id="l2572" class='ln'>2572</a></td><td> <a id="2572c5" class="tk">offset</a> = (<a id="2572c15" class="tk">size_t</a>)(<a id="2572c23" class="tk">elSize</a> <a id="2572c30" class="tk">*</a> <a id="2572c32" class="tk">var</a>-&gt;<a id="2572c37" class="tk">rowIdx</a> <a id="2572c44" class="tk">*</a> <a id="2572c46" class="tk">var</a>-&gt;<a id="2572c51" class="tk">data</a>.<a id="2572c56" class="tk">nCols</a>);</td></tr>
<tr name="2573" id="2573">
<td><a id="l2573" class='ln'>2573</a></td><td></td></tr>
<tr name="2574" id="2574">
<td><a id="l2574" class='ln'>2574</a></td><td> <span class="kw">if</span> (<a id="2574c9" class="tk">var</a>-&gt;<a id="2574c14" class="tk">data</a>.<a id="2574c19" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="2575" id="2575">
<td><a id="l2575" class='ln'>2575</a></td><td> <a id="2575c9" class="tk">char_T</a> <a id="2575c16" class="tk">*</a><a id="2575c17" class="tk">dstRe</a> = (<a id="2575c26" class="tk">char_T</a><a id="2575c32" class="tk">*</a>)(<a id="2575c35" class="tk">var</a>-&gt;<a id="2575c40" class="tk">data</a>.<a id="2575c45" class="tk">re</a>) <a id="2575c49" class="tk">+</a> <a id="2575c51" class="tk">offset</a>;</td></tr>
<tr name="2576" id="2576">
<td><a id="l2576" class='ln'>2576</a></td><td> <a id="2576c9" class="tk">char_T</a> <a id="2576c16" class="tk">*</a><a id="2576c17" class="tk">dstIm</a> = (<a id="2576c26" class="tk">char_T</a><a id="2576c32" class="tk">*</a>)(<a id="2576c35" class="tk">var</a>-&gt;<a id="2576c40" class="tk">data</a>.<a id="2576c45" class="tk">im</a>) <a id="2576c49" class="tk">+</a> <a id="2576c51" class="tk">offset</a>;</td></tr>
<tr name="2577" id="2577">
<td><a id="l2577" class='ln'>2577</a></td><td></td></tr>
<tr name="2578" id="2578">
<td><a id="l2578" class='ln'>2578</a></td><td> <span class="kw">for</span> (<a id="2578c14" class="tk">segIdx</a> = 0; <a id="2578c26" class="tk">segIdx</a> <a id="2578c33" class="tk">&lt;</a> <a id="2578c35" class="tk">nSegments</a>; <a id="2578c46" class="tk">segIdx</a><a id="2578c52" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2579" id="2579">
<td><a id="l2579" class='ln'>2579</a></td><td> <a id="2579c13" class="tk">int_T</a> <a id="2579c27" class="tk">nEl</a> = <a id="2579c34" class="tk">segmentLengths</a>[<a id="2579c49" class="tk">segIdx</a>];</td></tr>
<tr name="2580" id="2580">
<td><a id="l2580" class='ln'>2580</a></td><td> <a id="2580c13" class="tk">char_T</a> <a id="2580c20" class="tk">*</a><a id="2580c21" class="tk">src</a> = (<a id="2580c35" class="tk">char_T</a> <a id="2580c42" class="tk">*</a>)<a id="2580c44" class="tk">data</a>[<a id="2580c49" class="tk">segIdx</a>];</td></tr>
<tr name="2581" id="2581">
<td><a id="l2581" class='ln'>2581</a></td><td> <a id="2581c13" class="tk">int_T</a> <a id="2581c27" class="tk">el</a>;</td></tr>
<tr name="2582" id="2582">
<td><a id="l2582" class='ln'>2582</a></td><td></td></tr>
<tr name="2583" id="2583">
<td><a id="l2583" class='ln'>2583</a></td><td> <span class="ct">/* preprocess data in-place before logging */</span></td></tr>
<tr name="2584" id="2584">
<td><a id="l2584" class='ln'>2584</a></td><td> <a id="2584c13" class="tk">RTWPreprocessingFcnPtr</a> <a id="2584c36" class="tk">preprocessingPtr</a> = <a id="2584c55" class="tk">preprocessingPtrs</a>[<a id="2584c73" class="tk">segIdx</a>];</td></tr>
<tr name="2585" id="2585">
<td><a id="l2585" class='ln'>2585</a></td><td> <span class="kw">if</span> (<a id="2585c17" class="tk">preprocessingPtr</a> <a id="2585c34" class="tk">!=</a> <a id="2585c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2586" id="2586">
<td><a id="l2586" class='ln'>2586</a></td><td> <a id="2586c17" class="tk">src</a> = <a id="2586c23" class="tk">malloc</a>(<a id="2586c30" class="tk">elSize</a> <a id="2586c37" class="tk">*</a> <a id="2586c39" class="tk">nEl</a> <a id="2586c43" class="tk">*</a> 2);</td></tr>
<tr name="2587" id="2587">
<td><a id="l2587" class='ln'>2587</a></td><td> <a id="2587c17" class="tk">preprocessingPtr</a>(<a id="2587c34" class="tk">src</a>, (<span class="kw">void</span> <a id="2587c45" class="tk">*</a>)<a id="2587c47" class="tk">data</a>[<a id="2587c52" class="tk">segIdx</a>]);</td></tr>
<tr name="2588" id="2588">
<td><a id="l2588" class='ln'>2588</a></td><td> <span class="br">}</span></td></tr>
<tr name="2589" id="2589">
<td><a id="l2589" class='ln'>2589</a></td><td></td></tr>
<tr name="2590" id="2590">
<td><a id="l2590" class='ln'>2590</a></td><td> <span class="kw">if</span> (<a id="2590c17" class="tk">src</a> <a id="2590c21" class="tk">==</a> <a id="2590c24" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2591" id="2591">
<td><a id="l2591" class='ln'>2591</a></td><td> <span class="kw">const</span> <a id="2591c23" class="tk">char_T</a> <a id="2591c30" class="tk">*</a><a id="2591c31" class="tk">errorMessage</a> = "Could not allocate memory for logging.";</td></tr>
<tr name="2592" id="2592">
<td><a id="l2592" class='ln'>2592</a></td><td> <a id="2592c17" class="tk">fprintf</a>(<a id="2592c25" class="tk">stderr</a>,"%s.\n", <a id="2592c41" class="tk">errorMessage</a>);</td></tr>
<tr name="2593" id="2593">
<td><a id="l2593" class='ln'>2593</a></td><td> <span class="kw">return</span>(<a id="2593c24" class="tk">errorMessage</a>);</td></tr>
<tr name="2594" id="2594">
<td><a id="l2594" class='ln'>2594</a></td><td> <span class="br">}</span></td></tr>
<tr name="2595" id="2595">
<td><a id="l2595" class='ln'>2595</a></td><td> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2596" id="2596">
<td><a id="l2596" class='ln'>2596</a></td><td> <span class="kw">for</span> (<a id="2596c22" class="tk">el</a> = 0; <a id="2596c30" class="tk">el</a> <a id="2596c33" class="tk">&lt;</a> <a id="2596c35" class="tk">nEl</a>; <a id="2596c40" class="tk">el</a><a id="2596c42" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2597" id="2597">
<td><a id="l2597" class='ln'>2597</a></td><td> (<span class="kw">void</span>)<a id="2597c27" class="tk">memcpy</a>(<a id="2597c34" class="tk">dstRe</a>, <a id="2597c41" class="tk">src</a>, <a id="2597c46" class="tk">elSize</a>);</td></tr>
<tr name="2598" id="2598">
<td><a id="l2598" class='ln'>2598</a></td><td> <a id="2598c21" class="tk">dstRe</a> <a id="2598c27" class="tk">+=</a> <a id="2598c30" class="tk">elSize</a>; <a id="2598c40" class="tk">src</a> <a id="2598c44" class="tk">+=</a> <a id="2598c47" class="tk">elSize</a>;</td></tr>
<tr name="2599" id="2599">
<td><a id="l2599" class='ln'>2599</a></td><td> (<span class="kw">void</span>)<a id="2599c27" class="tk">memcpy</a>(<a id="2599c34" class="tk">dstIm</a>, <a id="2599c41" class="tk">src</a>, <a id="2599c46" class="tk">elSize</a>);</td></tr>
<tr name="2600" id="2600">
<td><a id="l2600" class='ln'>2600</a></td><td> <a id="2600c21" class="tk">dstIm</a> <a id="2600c27" class="tk">+=</a> <a id="2600c30" class="tk">elSize</a>; <a id="2600c40" class="tk">src</a> <a id="2600c44" class="tk">+=</a> <a id="2600c47" class="tk">elSize</a>;</td></tr>
<tr name="2601" id="2601">
<td><a id="l2601" class='ln'>2601</a></td><td> <span class="br">}</span></td></tr>
<tr name="2602" id="2602">
<td><a id="l2602" class='ln'>2602</a></td><td> <span class="br">}</span></td></tr>
<tr name="2603" id="2603">
<td><a id="l2603" class='ln'>2603</a></td><td></td></tr>
<tr name="2604" id="2604">
<td><a id="l2604" class='ln'>2604</a></td><td> <span class="ct">/* free temporarily declared data */</span></td></tr>
<tr name="2605" id="2605">
<td><a id="l2605" class='ln'>2605</a></td><td> <span class="kw">if</span> (<a id="2605c17" class="tk">preprocessingPtr</a> <a id="2605c34" class="tk">!=</a> <a id="2605c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2606" id="2606">
<td><a id="l2606" class='ln'>2606</a></td><td> <a id="2606c17" class="tk">free</a>( <a id="2606c23" class="tk">src</a> );</td></tr>
<tr name="2607" id="2607">
<td><a id="l2607" class='ln'>2607</a></td><td> <span class="br">}</span></td></tr>
<tr name="2608" id="2608">
<td><a id="l2608" class='ln'>2608</a></td><td> <span class="br">}</span></td></tr>
<tr name="2609" id="2609">
<td><a id="l2609" class='ln'>2609</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2610" id="2610">
<td><a id="l2610" class='ln'>2610</a></td><td> <a id="2610c9" class="tk">char_T</a> <a id="2610c16" class="tk">*</a><a id="2610c17" class="tk">dst</a> = (<a id="2610c24" class="tk">char_T</a><a id="2610c30" class="tk">*</a>)(<a id="2610c33" class="tk">var</a>-&gt;<a id="2610c38" class="tk">data</a>.<a id="2610c43" class="tk">re</a>) <a id="2610c47" class="tk">+</a> <a id="2610c49" class="tk">offset</a>;</td></tr>
<tr name="2611" id="2611">
<td><a id="l2611" class='ln'>2611</a></td><td></td></tr>
<tr name="2612" id="2612">
<td><a id="l2612" class='ln'>2612</a></td><td> <span class="kw">for</span> (<a id="2612c14" class="tk">segIdx</a> = 0; <a id="2612c26" class="tk">segIdx</a> <a id="2612c33" class="tk">&lt;</a> <a id="2612c35" class="tk">nSegments</a>; <a id="2612c46" class="tk">segIdx</a><a id="2612c52" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="2613" id="2613">
<td><a id="l2613" class='ln'>2613</a></td><td> <a id="2613c13" class="tk">size_t</a> <a id="2613c25" class="tk">segSize</a> = <a id="2613c35" class="tk">elSize</a><a id="2613c41" class="tk">*</a><a id="2613c42" class="tk">segmentLengths</a>[<a id="2613c57" class="tk">segIdx</a>];</td></tr>
<tr name="2614" id="2614">
<td><a id="l2614" class='ln'>2614</a></td><td> <a id="2614c13" class="tk">char_T</a> <a id="2614c20" class="tk">*</a><a id="2614c21" class="tk">src</a> = (<span class="kw">void</span> <a id="2614c41" class="tk">*</a>) <a id="2614c44" class="tk">data</a>[<a id="2614c49" class="tk">segIdx</a>];</td></tr>
<tr name="2615" id="2615">
<td><a id="l2615" class='ln'>2615</a></td><td></td></tr>
<tr name="2616" id="2616">
<td><a id="l2616" class='ln'>2616</a></td><td> <span class="ct">/* preprocess data in-place before logging */</span></td></tr>
<tr name="2617" id="2617">
<td><a id="l2617" class='ln'>2617</a></td><td> <a id="2617c13" class="tk">RTWPreprocessingFcnPtr</a> <a id="2617c36" class="tk">preprocessingPtr</a> = <a id="2617c55" class="tk">preprocessingPtrs</a>[<a id="2617c73" class="tk">segIdx</a>];</td></tr>
<tr name="2618" id="2618">
<td><a id="l2618" class='ln'>2618</a></td><td> <span class="kw">if</span> (<a id="2618c17" class="tk">preprocessingPtr</a> <a id="2618c34" class="tk">!=</a> <a id="2618c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2619" id="2619">
<td><a id="l2619" class='ln'>2619</a></td><td> <a id="2619c17" class="tk">src</a> = <a id="2619c23" class="tk">malloc</a>(<a id="2619c30" class="tk">segSize</a>);</td></tr>
<tr name="2620" id="2620">
<td><a id="l2620" class='ln'>2620</a></td><td> <a id="2620c17" class="tk">preprocessingPtr</a>(<a id="2620c34" class="tk">src</a>, <a id="2620c39" class="tk">data</a>[<a id="2620c44" class="tk">segIdx</a>]);</td></tr>
<tr name="2621" id="2621">
<td><a id="l2621" class='ln'>2621</a></td><td> <span class="br">}</span></td></tr>
<tr name="2622" id="2622">
<td><a id="l2622" class='ln'>2622</a></td><td> <span class="kw">if</span> (<a id="2622c17" class="tk">src</a> <a id="2622c21" class="tk">==</a> <a id="2622c24" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2623" id="2623">
<td><a id="l2623" class='ln'>2623</a></td><td> <span class="kw">const</span> <a id="2623c23" class="tk">char_T</a> <a id="2623c30" class="tk">*</a><a id="2623c31" class="tk">errorMessage</a> = "Could not allocate memory for logging.";</td></tr>
<tr name="2624" id="2624">
<td><a id="l2624" class='ln'>2624</a></td><td> <a id="2624c17" class="tk">fprintf</a>(<a id="2624c25" class="tk">stderr</a>,"%s.\n", <a id="2624c41" class="tk">errorMessage</a>);</td></tr>
<tr name="2625" id="2625">
<td><a id="l2625" class='ln'>2625</a></td><td> <span class="kw">return</span>(<a id="2625c24" class="tk">errorMessage</a>); <span class="br">}</span></td></tr>
<tr name="2626" id="2626">
<td><a id="l2626" class='ln'>2626</a></td><td> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2627" id="2627">
<td><a id="l2627" class='ln'>2627</a></td><td> (<span class="kw">void</span>)<a id="2627c23" class="tk">memcpy</a>(<a id="2627c30" class="tk">dst</a>, <a id="2627c35" class="tk">src</a>, <a id="2627c40" class="tk">segSize</a>);</td></tr>
<tr name="2628" id="2628">
<td><a id="l2628" class='ln'>2628</a></td><td> <a id="2628c17" class="tk">dst</a> <a id="2628c21" class="tk">+=</a> <a id="2628c24" class="tk">segSize</a>;</td></tr>
<tr name="2629" id="2629">
<td><a id="l2629" class='ln'>2629</a></td><td> <span class="br">}</span></td></tr>
<tr name="2630" id="2630">
<td><a id="l2630" class='ln'>2630</a></td><td></td></tr>
<tr name="2631" id="2631">
<td><a id="l2631" class='ln'>2631</a></td><td> <span class="ct">/* free temporarily declared data */</span></td></tr>
<tr name="2632" id="2632">
<td><a id="l2632" class='ln'>2632</a></td><td> <span class="kw">if</span> (<a id="2632c17" class="tk">preprocessingPtr</a> <a id="2632c34" class="tk">!=</a> <a id="2632c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="2633" id="2633">
<td><a id="l2633" class='ln'>2633</a></td><td> <a id="2633c17" class="tk">free</a>( <a id="2633c23" class="tk">src</a> );</td></tr>
<tr name="2634" id="2634">
<td><a id="l2634" class='ln'>2634</a></td><td> <span class="br">}</span></td></tr>
<tr name="2635" id="2635">
<td><a id="l2635" class='ln'>2635</a></td><td> <span class="br">}</span></td></tr>
<tr name="2636" id="2636">
<td><a id="l2636" class='ln'>2636</a></td><td> <span class="br">}</span></td></tr>
<tr name="2637" id="2637">
<td><a id="l2637" class='ln'>2637</a></td><td></td></tr>
<tr name="2638" id="2638">
<td><a id="l2638" class='ln'>2638</a></td><td> <a id="2638c5" class="tk">++</a><a id="2638c7" class="tk">var</a>-&gt;<a id="2638c12" class="tk">rowIdx</a>;</td></tr>
<tr name="2639" id="2639">
<td><a id="l2639" class='ln'>2639</a></td><td> <span class="kw">return</span>(<a id="2639c12" class="tk">NULL</a>);</td></tr>
<tr name="2640" id="2640">
<td><a id="l2640" class='ln'>2640</a></td><td></td></tr>
<tr name="2641" id="2641">
<td><a id="l2641" class='ln'>2641</a></td><td><span class="br">}</span> <span class="ct">/* end rt_UpdateLogVarWithDiscontinuousData */</span></td></tr>
<tr name="2642" id="2642">
<td><a id="l2642" class='ln'>2642</a></td><td></td></tr>
<tr name="2643" id="2643">
<td><a id="l2643" class='ln'>2643</a></td><td></td></tr>
<tr name="2644" id="2644">
<td><a id="l2644" class='ln'>2644</a></td><td><span class="ct">/*==================*</span></td></tr>
<tr name="2645" id="2645">
<td><a id="l2645" class='ln'>2645</a></td><td><span class="ct"> * Visible routines *</span></td></tr>
<tr name="2646" id="2646">
<td><a id="l2646" class='ln'>2646</a></td><td><span class="ct"> *==================*/</span></td></tr>
<tr name="2647" id="2647">
<td><a id="l2647" class='ln'>2647</a></td><td></td></tr>
<tr name="2648" id="2648">
<td><a id="l2648" class='ln'>2648</a></td><td></td></tr>
<tr name="2649" id="2649">
<td><a id="l2649" class='ln'>2649</a></td><td></td></tr>
<tr name="2650" id="2650">
<td><a id="l2650" class='ln'>2650</a></td><td><span class="pp">#ifdef</span> <a id="2650c8" class="tk">__cplusplus</a></td></tr>
<tr name="2651" id="2651">
<td><a id="l2651" class='ln'>2651</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="2652" id="2652">
<td><a id="l2652" class='ln'>2652</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="2653" id="2653">
<td><a id="l2653" class='ln'>2653</a></td><td></td></tr>
<tr name="2654" id="2654">
<td><a id="l2654" class='ln'>2654</a></td><td> </td></tr>
<tr name="2655" id="2655">
<td><a id="l2655" class='ln'>2655</a></td><td><span class="ct">/* Function: rt_CreateLogVarWithConvert ========================================</span></td></tr>
<tr name="2656" id="2656">
<td><a id="l2656" class='ln'>2656</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="2657" id="2657">
<td><a id="l2657" class='ln'>2657</a></td><td><span class="ct"> * Create a logging variable.</span></td></tr>
<tr name="2658" id="2658">
<td><a id="l2658" class='ln'>2658</a></td><td><span class="ct"> *</span></td></tr>
<tr name="2659" id="2659">
<td><a id="l2659" class='ln'>2659</a></td><td><span class="ct"> * Returns:</span></td></tr>
<tr name="2660" id="2660">
<td><a id="l2660" class='ln'>2660</a></td><td><span class="ct"> * ~= NULL =&gt; success, returns the log variable created.</span></td></tr>
<tr name="2661" id="2661">
<td><a id="l2661" class='ln'>2661</a></td><td><span class="ct"> * == NULL =&gt; failure, error message set in the simstruct.</span></td></tr>
<tr name="2662" id="2662">
<td><a id="l2662" class='ln'>2662</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2663" id="2663">
<td><a id="l2663" class='ln'>2663</a></td><td><a id="2663c1" class="tk">LogVar</a> <a id="2663c8" class="tk">*</a><a id="2663c9" class="tk">rt_CreateLogVarWithConvert</a>(</td></tr>
<tr name="2664" id="2664">
<td><a id="l2664" class='ln'>2664</a></td><td> <a id="2664c5" class="tk">RTWLogInfo</a> <a id="2664c23" class="tk">*</a><a id="2664c24" class="tk">li</a>,</td></tr>
<tr name="2665" id="2665">
<td><a id="l2665" class='ln'>2665</a></td><td> <span class="kw">const</span> <a id="2665c11" class="tk">real_T</a> <a id="2665c23" class="tk">startTime</a>,</td></tr>
<tr name="2666" id="2666">
<td><a id="l2666" class='ln'>2666</a></td><td> <span class="kw">const</span> <a id="2666c11" class="tk">real_T</a> <a id="2666c23" class="tk">finalTime</a>,</td></tr>
<tr name="2667" id="2667">
<td><a id="l2667" class='ln'>2667</a></td><td> <span class="kw">const</span> <a id="2667c11" class="tk">real_T</a> <a id="2667c23" class="tk">inStepSize</a>,</td></tr>
<tr name="2668" id="2668">
<td><a id="l2668" class='ln'>2668</a></td><td> <span class="kw">const</span> <a id="2668c11" class="tk">char_T</a> <a id="2668c23" class="tk">*</a><a id="2668c24" class="tk">*</a><a id="2668c25" class="tk">errStatus</a>,</td></tr>
<tr name="2669" id="2669">
<td><a id="l2669" class='ln'>2669</a></td><td> <span class="kw">const</span> <a id="2669c11" class="tk">char_T</a> <a id="2669c23" class="tk">*</a><a id="2669c24" class="tk">varName</a>,</td></tr>
<tr name="2670" id="2670">
<td><a id="l2670" class='ln'>2670</a></td><td> <a id="2670c5" class="tk">BuiltInDTypeId</a> <a id="2670c23" class="tk">inpDataTypeID</a>,</td></tr>
<tr name="2671" id="2671">
<td><a id="l2671" class='ln'>2671</a></td><td> <span class="kw">const</span> <a id="2671c11" class="tk">RTWLogDataTypeConvert</a> <a id="2671c33" class="tk">*</a><a id="2671c34" class="tk">pDataTypeConvertInfo</a>,</td></tr>
<tr name="2672" id="2672">
<td><a id="l2672" class='ln'>2672</a></td><td> <a id="2672c5" class="tk">int_T</a> <a id="2672c23" class="tk">logical</a>,</td></tr>
<tr name="2673" id="2673">
<td><a id="l2673" class='ln'>2673</a></td><td> <a id="2673c5" class="tk">int_T</a> <a id="2673c23" class="tk">complex</a>,</td></tr>
<tr name="2674" id="2674">
<td><a id="l2674" class='ln'>2674</a></td><td> <a id="2674c5" class="tk">int_T</a> <a id="2674c23" class="tk">frameData</a>,</td></tr>
<tr name="2675" id="2675">
<td><a id="l2675" class='ln'>2675</a></td><td> <a id="2675c5" class="tk">int_T</a> <a id="2675c23" class="tk">nCols</a>,</td></tr>
<tr name="2676" id="2676">
<td><a id="l2676" class='ln'>2676</a></td><td> <a id="2676c5" class="tk">int_T</a> <a id="2676c23" class="tk">nDims</a>,</td></tr>
<tr name="2677" id="2677">
<td><a id="l2677" class='ln'>2677</a></td><td> <span class="kw">const</span> <a id="2677c11" class="tk">int_T</a> <a id="2677c23" class="tk">*</a><a id="2677c24" class="tk">dims</a>,</td></tr>
<tr name="2678" id="2678">
<td><a id="l2678" class='ln'>2678</a></td><td> <a id="2678c5" class="tk">LogValDimsStat</a> <a id="2678c23" class="tk">logValDimsStat</a>,</td></tr>
<tr name="2679" id="2679">
<td><a id="l2679" class='ln'>2679</a></td><td> <span class="kw">void</span> <a id="2679c23" class="tk">*</a><a id="2679c24" class="tk">*</a><a id="2679c25" class="tk">currSigDims</a>,</td></tr>
<tr name="2680" id="2680">
<td><a id="l2680" class='ln'>2680</a></td><td> <a id="2680c5" class="tk">int_T</a> <a id="2680c23" class="tk">*</a><a id="2680c24" class="tk">currSigDimsSize</a>,</td></tr>
<tr name="2681" id="2681">
<td><a id="l2681" class='ln'>2681</a></td><td> <a id="2681c5" class="tk">int_T</a> <a id="2681c23" class="tk">maxRows</a>,</td></tr>
<tr name="2682" id="2682">
<td><a id="l2682" class='ln'>2682</a></td><td> <a id="2682c5" class="tk">int_T</a> <a id="2682c23" class="tk">decimation</a>,</td></tr>
<tr name="2683" id="2683">
<td><a id="l2683" class='ln'>2683</a></td><td> <a id="2683c5" class="tk">real_T</a> <a id="2683c23" class="tk">sampleTime</a>,</td></tr>
<tr name="2684" id="2684">
<td><a id="l2684" class='ln'>2684</a></td><td> <a id="2684c5" class="tk">int_T</a> <a id="2684c23" class="tk">appendToLogVarsList</a>)</td></tr>
<tr name="2685" id="2685">
<td><a id="l2685" class='ln'>2685</a></td><td><span class="br">{</span></td></tr>
<tr name="2686" id="2686">
<td><a id="l2686" class='ln'>2686</a></td><td> <a id="2686c5" class="tk">int_T</a> <a id="2686c20" class="tk">usingDefaultBufSize</a> = 0;</td></tr>
<tr name="2687" id="2687">
<td><a id="l2687" class='ln'>2687</a></td><td><span class="pp">#ifdef</span> <a id="2687c8" class="tk">NO_LOGGING_REALLOC</a></td></tr>
<tr name="2688" id="2688">
<td><a id="l2688" class='ln'>2688</a></td><td> <a id="2688c5" class="tk">int_T</a> <a id="2688c20" class="tk">okayToRealloc</a> = 0;</td></tr>
<tr name="2689" id="2689">
<td><a id="l2689" class='ln'>2689</a></td><td><span class="pp">#else</span></td></tr>
<tr name="2690" id="2690">
<td><a id="l2690" class='ln'>2690</a></td><td> <a id="2690c5" class="tk">int_T</a> <a id="2690c20" class="tk">okayToRealloc</a> = 1;</td></tr>
<tr name="2691" id="2691">
<td><a id="l2691" class='ln'>2691</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="2692" id="2692">
<td><a id="l2692" class='ln'>2692</a></td><td> <a id="2692c5" class="tk">LogVar</a> <a id="2692c20" class="tk">*</a><a id="2692c21" class="tk">var</a> = <a id="2692c42" class="tk">NULL</a>;</td></tr>
<tr name="2693" id="2693">
<td><a id="l2693" class='ln'>2693</a></td><td> <span class="ct">/*inpDataTypeID is the rt_LoggedOutputDataTypeId*/</span></td></tr>
<tr name="2694" id="2694">
<td><a id="l2694" class='ln'>2694</a></td><td> <a id="2694c5" class="tk">BuiltInDTypeId</a> <a id="2694c20" class="tk">dTypeID</a> = (<a id="2694c43" class="tk">BuiltInDTypeId</a>)<a id="2694c58" class="tk">inpDataTypeID</a>; </td></tr>
<tr name="2695" id="2695">
<td><a id="l2695" class='ln'>2695</a></td><td> <a id="2695c5" class="tk">size_t</a> <a id="2695c20" class="tk">elementSize</a> = <a id="2695c42" class="tk">rt_GetSizeofDataType</a>(<a id="2695c63" class="tk">dTypeID</a>);</td></tr>
<tr name="2696" id="2696">
<td><a id="l2696" class='ln'>2696</a></td><td> <a id="2696c5" class="tk">int_T</a> <a id="2696c20" class="tk">frameSize</a>;</td></tr>
<tr name="2697" id="2697">
<td><a id="l2697" class='ln'>2697</a></td><td> <a id="2697c5" class="tk">int_T</a> <a id="2697c20" class="tk">nRows</a>;</td></tr>
<tr name="2698" id="2698">
<td><a id="l2698" class='ln'>2698</a></td><td> <a id="2698c5" class="tk">int_T</a> <a id="2698c20" class="tk">nColumns</a>;</td></tr>
<tr name="2699" id="2699">
<td><a id="l2699" class='ln'>2699</a></td><td></td></tr>
<tr name="2700" id="2700">
<td><a id="l2700" class='ln'>2700</a></td><td> <span class="ct">/*===================================================================*</span></td></tr>
<tr name="2701" id="2701">
<td><a id="l2701" class='ln'>2701</a></td><td><span class="ct"> * Determine the frame size if the data is frame based *</span></td></tr>
<tr name="2702" id="2702">
<td><a id="l2702" class='ln'>2702</a></td><td><span class="ct"> *===================================================================*/</span></td></tr>
<tr name="2703" id="2703">
<td><a id="l2703" class='ln'>2703</a></td><td> <a id="2703c5" class="tk">frameSize</a> = <a id="2703c17" class="tk">frameData</a> <a id="2703c27" class="tk">?</a> <a id="2703c29" class="tk">dims</a>[0] <a id="2703c37" class="tk">:</a> 1;</td></tr>
<tr name="2704" id="2704">
<td><a id="l2704" class='ln'>2704</a></td><td></td></tr>
<tr name="2705" id="2705">
<td><a id="l2705" class='ln'>2705</a></td><td> <span class="ct">/*===================================================================*</span></td></tr>
<tr name="2706" id="2706">
<td><a id="l2706" class='ln'>2706</a></td><td><span class="ct"> * Calculate maximum number of rows needed in the buffer *</span></td></tr>
<tr name="2707" id="2707">
<td><a id="l2707" class='ln'>2707</a></td><td><span class="ct"> *===================================================================*/</span></td></tr>
<tr name="2708" id="2708">
<td><a id="l2708" class='ln'>2708</a></td><td></td></tr>
<tr name="2709" id="2709">
<td><a id="l2709" class='ln'>2709</a></td><td> <span class="kw">if</span> (<a id="2709c9" class="tk">finalTime</a> <a id="2709c19" class="tk">&gt;</a> <a id="2709c21" class="tk">startTime</a> <a id="2709c31" class="tk">&amp;&amp;</a> <a id="2709c34" class="tk">finalTime</a> <a id="2709c44" class="tk">!=</a> <a id="2709c47" class="tk">rtInf</a>) <span class="br">{</span></td></tr>
<tr name="2710" id="2710">
<td><a id="l2710" class='ln'>2710</a></td><td> <a id="2710c9" class="tk">real_T</a> <a id="2710c16" class="tk">nPoints</a>; <span class="ct">/* Tfinal is finite ===&gt; nRows can be */</span></td></tr>
<tr name="2711" id="2711">
<td><a id="l2711" class='ln'>2711</a></td><td> <a id="2711c9" class="tk">real_T</a> <a id="2711c16" class="tk">stepSize</a>; <span class="ct">/* computed since the StepSize is fixed */</span></td></tr>
<tr name="2712" id="2712">
<td><a id="l2712" class='ln'>2712</a></td><td></td></tr>
<tr name="2713" id="2713">
<td><a id="l2713" class='ln'>2713</a></td><td> <span class="kw">if</span> (<a id="2713c13" class="tk">sampleTime</a> <a id="2713c24" class="tk">==</a> <a id="2713c27" class="tk">-</a>2.0) <span class="br">{</span> <span class="ct">/* The signal being logged is constant, *</span></td></tr>
<tr name="2714" id="2714">
<td><a id="l2714" class='ln'>2714</a></td><td><span class="ct"> * Hence, only one data point is logged. */</span></td></tr>
<tr name="2715" id="2715">
<td><a id="l2715" class='ln'>2715</a></td><td> <a id="2715c13" class="tk">stepSize</a> = <a id="2715c24" class="tk">finalTime</a>;</td></tr>
<tr name="2716" id="2716">
<td><a id="l2716" class='ln'>2716</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="2716c20" class="tk">sampleTime</a> <a id="2716c31" class="tk">==</a> <a id="2716c34" class="tk">-</a>1.0 <a id="2716c39" class="tk">||</a> <a id="2716c42" class="tk">sampleTime</a> <a id="2716c53" class="tk">==</a> 0.0) <span class="br">{</span></td></tr>
<tr name="2717" id="2717">
<td><a id="l2717" class='ln'>2717</a></td><td> <span class="ct">/* Signal being logged is either inside a *</span></td></tr>
<tr name="2718" id="2718">
<td><a id="l2718" class='ln'>2718</a></td><td><span class="ct"> * triggered sub-system or it is continuous. */</span></td></tr>
<tr name="2719" id="2719">
<td><a id="l2719" class='ln'>2719</a></td><td> <a id="2719c13" class="tk">stepSize</a> = <a id="2719c24" class="tk">inStepSize</a>;</td></tr>
<tr name="2720" id="2720">
<td><a id="l2720" class='ln'>2720</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* Discrete signal */</span></td></tr>
<tr name="2721" id="2721">
<td><a id="l2721" class='ln'>2721</a></td><td> <a id="2721c13" class="tk">stepSize</a> = <a id="2721c24" class="tk">sampleTime</a>;</td></tr>
<tr name="2722" id="2722">
<td><a id="l2722" class='ln'>2722</a></td><td> <span class="br">}</span></td></tr>
<tr name="2723" id="2723">
<td><a id="l2723" class='ln'>2723</a></td><td></td></tr>
<tr name="2724" id="2724">
<td><a id="l2724" class='ln'>2724</a></td><td> <span class="kw">if</span> (<a id="2724c13" class="tk">stepSize</a> <a id="2724c22" class="tk">==</a> 0.0) <span class="br">{</span></td></tr>
<tr name="2725" id="2725">
<td><a id="l2725" class='ln'>2725</a></td><td> <span class="ct">/* small initial value, so as to exercise the realloc code */</span></td></tr>
<tr name="2726" id="2726">
<td><a id="l2726" class='ln'>2726</a></td><td> <a id="2726c13" class="tk">nRows</a> = <a id="2726c21" class="tk">maxRows</a><a id="2726c28" class="tk">+</a>1;</td></tr>
<tr name="2727" id="2727">
<td><a id="l2727" class='ln'>2727</a></td><td> <a id="2727c13" class="tk">okayToRealloc</a> = 1;</td></tr>
<tr name="2728" id="2728">
<td><a id="l2728" class='ln'>2728</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2729" id="2729">
<td><a id="l2729" class='ln'>2729</a></td><td> <a id="2729c13" class="tk">nPoints</a> = 1.0 <a id="2729c27" class="tk">+</a> <a id="2729c29" class="tk">floor</a>((<a id="2729c36" class="tk">finalTime</a><a id="2729c45" class="tk">-</a><a id="2729c46" class="tk">startTime</a>)<a id="2729c56" class="tk">/</a><a id="2729c57" class="tk">stepSize</a>);</td></tr>
<tr name="2730" id="2730">
<td><a id="l2730" class='ln'>2730</a></td><td></td></tr>
<tr name="2731" id="2731">
<td><a id="l2731" class='ln'>2731</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2732" id="2732">
<td><a id="l2732" class='ln'>2732</a></td><td><span class="ct"> * Add one more data point if needed.</span></td></tr>
<tr name="2733" id="2733">
<td><a id="l2733" class='ln'>2733</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2734" id="2734">
<td><a id="l2734" class='ln'>2734</a></td><td> <span class="kw">if</span> ( <a id="2734c18" class="tk">stepSize</a><a id="2734c26" class="tk">*</a>(<a id="2734c28" class="tk">nPoints</a><a id="2734c35" class="tk">-</a>1.0) <a id="2734c41" class="tk">&lt;</a> (<a id="2734c44" class="tk">finalTime</a><a id="2734c53" class="tk">-</a><a id="2734c54" class="tk">startTime</a>) ) <span class="br">{</span></td></tr>
<tr name="2735" id="2735">
<td><a id="l2735" class='ln'>2735</a></td><td> <a id="2735c17" class="tk">nPoints</a> <a id="2735c25" class="tk">+=</a> 1.0;</td></tr>
<tr name="2736" id="2736">
<td><a id="l2736" class='ln'>2736</a></td><td> <span class="br">}</span></td></tr>
<tr name="2737" id="2737">
<td><a id="l2737" class='ln'>2737</a></td><td></td></tr>
<tr name="2738" id="2738">
<td><a id="l2738" class='ln'>2738</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2739" id="2739">
<td><a id="l2739" class='ln'>2739</a></td><td><span class="ct"> * Actual number of points to log = nPoints * size of</span></td></tr>
<tr name="2740" id="2740">
<td><a id="l2740" class='ln'>2740</a></td><td><span class="ct"> * each frame if data is frame-based</span></td></tr>
<tr name="2741" id="2741">
<td><a id="l2741" class='ln'>2741</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2742" id="2742">
<td><a id="l2742" class='ln'>2742</a></td><td> <a id="2742c13" class="tk">nPoints</a> = <a id="2742c23" class="tk">frameData</a> <a id="2742c33" class="tk">?</a> (<a id="2742c36" class="tk">nPoints</a> <a id="2742c44" class="tk">*</a> <a id="2742c46" class="tk">frameSize</a>) <a id="2742c57" class="tk">:</a> <a id="2742c59" class="tk">nPoints</a>;</td></tr>
<tr name="2743" id="2743">
<td><a id="l2743" class='ln'>2743</a></td><td></td></tr>
<tr name="2744" id="2744">
<td><a id="l2744" class='ln'>2744</a></td><td> <a id="2744c13" class="tk">nPoints</a> <a id="2744c21" class="tk">/=</a> <a id="2744c24" class="tk">decimation</a>;</td></tr>
<tr name="2745" id="2745">
<td><a id="l2745" class='ln'>2745</a></td><td> <span class="kw">if</span> (<a id="2745c17" class="tk">nPoints</a> <a id="2745c25" class="tk">!=</a> <a id="2745c28" class="tk">floor</a>(<a id="2745c34" class="tk">nPoints</a>)) <span class="br">{</span></td></tr>
<tr name="2746" id="2746">
<td><a id="l2746" class='ln'>2746</a></td><td> <a id="2746c17" class="tk">nPoints</a> <a id="2746c25" class="tk">+=</a> 1.0;</td></tr>
<tr name="2747" id="2747">
<td><a id="l2747" class='ln'>2747</a></td><td> <span class="br">}</span></td></tr>
<tr name="2748" id="2748">
<td><a id="l2748" class='ln'>2748</a></td><td> <a id="2748c13" class="tk">nRows</a> = (<a id="2748c22" class="tk">nPoints</a> <a id="2748c30" class="tk">&lt;=</a> <a id="2748c33" class="tk">INT_MAX</a>) <a id="2748c42" class="tk">?</a> ((<a id="2748c46" class="tk">int_T</a>) <a id="2748c53" class="tk">nPoints</a>) <a id="2748c62" class="tk">:</a> <a id="2748c64" class="tk">INT_MAX</a>;</td></tr>
<tr name="2749" id="2749">
<td><a id="l2749" class='ln'>2749</a></td><td> <span class="br">}</span></td></tr>
<tr name="2750" id="2750">
<td><a id="l2750" class='ln'>2750</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2751" id="2751">
<td><a id="l2751" class='ln'>2751</a></td><td><span class="ct"> * If maxRows is specified, and if this number is less</span></td></tr>
<tr name="2752" id="2752">
<td><a id="l2752" class='ln'>2752</a></td><td><span class="ct"> * than the number we computed (nRows) then use maxRows.</span></td></tr>
<tr name="2753" id="2753">
<td><a id="l2753" class='ln'>2753</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2754" id="2754">
<td><a id="l2754" class='ln'>2754</a></td><td> <span class="kw">if</span> ((<a id="2754c14" class="tk">maxRows</a> <a id="2754c22" class="tk">&gt;</a> 0) <a id="2754c27" class="tk">&amp;&amp;</a> (<a id="2754c31" class="tk">maxRows</a> <a id="2754c39" class="tk">&lt;</a> <a id="2754c41" class="tk">nRows</a>)) <span class="br">{</span></td></tr>
<tr name="2755" id="2755">
<td><a id="l2755" class='ln'>2755</a></td><td> <a id="2755c13" class="tk">nRows</a> = <a id="2755c21" class="tk">maxRows</a>;</td></tr>
<tr name="2756" id="2756">
<td><a id="l2756" class='ln'>2756</a></td><td> <a id="2756c13" class="tk">okayToRealloc</a> = 0;</td></tr>
<tr name="2757" id="2757">
<td><a id="l2757" class='ln'>2757</a></td><td> <span class="br">}</span></td></tr>
<tr name="2758" id="2758">
<td><a id="l2758" class='ln'>2758</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="2758c16" class="tk">finalTime</a> <a id="2758c26" class="tk">==</a> <a id="2758c29" class="tk">startTime</a>) <span class="br">{</span></td></tr>
<tr name="2759" id="2759">
<td><a id="l2759" class='ln'>2759</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2760" id="2760">
<td><a id="l2760" class='ln'>2760</a></td><td><span class="ct"> * Number of rows to log is equal to 1 if not frame-based and</span></td></tr>
<tr name="2761" id="2761">
<td><a id="l2761" class='ln'>2761</a></td><td><span class="ct"> * equal to frame size if frame-based</span></td></tr>
<tr name="2762" id="2762">
<td><a id="l2762" class='ln'>2762</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2763" id="2763">
<td><a id="l2763" class='ln'>2763</a></td><td> <a id="2763c9" class="tk">nRows</a> = <a id="2763c17" class="tk">frameData</a> <a id="2763c27" class="tk">?</a> <a id="2763c29" class="tk">frameSize</a> <a id="2763c39" class="tk">:</a> 1;</td></tr>
<tr name="2764" id="2764">
<td><a id="l2764" class='ln'>2764</a></td><td></td></tr>
<tr name="2765" id="2765">
<td><a id="l2765" class='ln'>2765</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2766" id="2766">
<td><a id="l2766" class='ln'>2766</a></td><td><span class="ct"> * If maxRows is specified, and if this number is less</span></td></tr>
<tr name="2767" id="2767">
<td><a id="l2767" class='ln'>2767</a></td><td><span class="ct"> * than the number we computed (nRows) then use maxRows.</span></td></tr>
<tr name="2768" id="2768">
<td><a id="l2768" class='ln'>2768</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2769" id="2769">
<td><a id="l2769" class='ln'>2769</a></td><td> <span class="kw">if</span> ((<a id="2769c14" class="tk">maxRows</a> <a id="2769c22" class="tk">&gt;</a> 0) <a id="2769c27" class="tk">&amp;&amp;</a> (<a id="2769c31" class="tk">maxRows</a> <a id="2769c39" class="tk">&lt;</a> <a id="2769c41" class="tk">nRows</a>)) <span class="br">{</span></td></tr>
<tr name="2770" id="2770">
<td><a id="l2770" class='ln'>2770</a></td><td> <a id="2770c13" class="tk">nRows</a> = <a id="2770c21" class="tk">maxRows</a>;</td></tr>
<tr name="2771" id="2771">
<td><a id="l2771" class='ln'>2771</a></td><td> <a id="2771c13" class="tk">okayToRealloc</a> = 0;</td></tr>
<tr name="2772" id="2772">
<td><a id="l2772" class='ln'>2772</a></td><td> <span class="br">}</span></td></tr>
<tr name="2773" id="2773">
<td><a id="l2773" class='ln'>2773</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="2773c16" class="tk">maxRows</a> <a id="2773c24" class="tk">&gt;</a> 0) <span class="br">{</span> <span class="ct">/* maxRows is specified =&gt; nRows=maxRows */</span></td></tr>
<tr name="2774" id="2774">
<td><a id="l2774" class='ln'>2774</a></td><td> <a id="2774c9" class="tk">nRows</a> = <a id="2774c17" class="tk">maxRows</a>;</td></tr>
<tr name="2775" id="2775">
<td><a id="l2775" class='ln'>2775</a></td><td> <a id="2775c9" class="tk">okayToRealloc</a> = 0;</td></tr>
<tr name="2776" id="2776">
<td><a id="l2776" class='ln'>2776</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2777" id="2777">
<td><a id="l2777" class='ln'>2777</a></td><td></td></tr>
<tr name="2778" id="2778">
<td><a id="l2778" class='ln'>2778</a></td><td> <span class="kw">if</span> (<a id="2778c13" class="tk">inStepSize</a> <a id="2778c24" class="tk">==</a> 0) <span class="br">{</span></td></tr>
<tr name="2779" id="2779">
<td><a id="l2779" class='ln'>2779</a></td><td> <span class="ct">/* small initial value, so as to exercise the realloc code */</span></td></tr>
<tr name="2780" id="2780">
<td><a id="l2780" class='ln'>2780</a></td><td> <a id="2780c13" class="tk">nRows</a> = <a id="2780c21" class="tk">maxRows</a><a id="2780c28" class="tk">+</a>1;</td></tr>
<tr name="2781" id="2781">
<td><a id="l2781" class='ln'>2781</a></td><td> <a id="2781c13" class="tk">okayToRealloc</a> = 1;</td></tr>
<tr name="2782" id="2782">
<td><a id="l2782" class='ln'>2782</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* Use a default value for nRows */</span></td></tr>
<tr name="2783" id="2783">
<td><a id="l2783" class='ln'>2783</a></td><td> <a id="2783c13" class="tk">usingDefaultBufSize</a> = 1;</td></tr>
<tr name="2784" id="2784">
<td><a id="l2784" class='ln'>2784</a></td><td> <a id="2784c13" class="tk">nRows</a> = <a id="2784c21" class="tk">DEFAULT_BUFFER_SIZE</a>;</td></tr>
<tr name="2785" id="2785">
<td><a id="l2785" class='ln'>2785</a></td><td> <a id="2785c13" class="tk">okayToRealloc</a> = 0; <span class="ct">/* No realloc with infinite stop time */</span></td></tr>
<tr name="2786" id="2786">
<td><a id="l2786" class='ln'>2786</a></td><td> (<span class="kw">void</span>)<a id="2786c19" class="tk">fprintf</a>(<a id="2786c27" class="tk">stdout</a>, "*** Using a default buffer of size %d for "</td></tr>
<tr name="2787" id="2787">
<td><a id="l2787" class='ln'>2787</a></td><td> "logging variable %s\n", <a id="2787c52" class="tk">nRows</a>, <a id="2787c59" class="tk">varName</a>);</td></tr>
<tr name="2788" id="2788">
<td><a id="l2788" class='ln'>2788</a></td><td> <span class="br">}</span></td></tr>
<tr name="2789" id="2789">
<td><a id="l2789" class='ln'>2789</a></td><td> <span class="br">}</span></td></tr>
<tr name="2790" id="2790">
<td><a id="l2790" class='ln'>2790</a></td><td></td></tr>
<tr name="2791" id="2791">
<td><a id="l2791" class='ln'>2791</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2792" id="2792">
<td><a id="l2792" class='ln'>2792</a></td><td><span class="ct"> * Figure out the number of columns that the log variable should have.</span></td></tr>
<tr name="2793" id="2793">
<td><a id="l2793" class='ln'>2793</a></td><td><span class="ct"> * If the data is not frame based, then number of columns should equal</span></td></tr>
<tr name="2794" id="2794">
<td><a id="l2794" class='ln'>2794</a></td><td><span class="ct"> * nCols that is provided as input to the function. If the data is</span></td></tr>
<tr name="2795" id="2795">
<td><a id="l2795" class='ln'>2795</a></td><td><span class="ct"> * frame-based, then the number of columns should be equal to the</span></td></tr>
<tr name="2796" id="2796">
<td><a id="l2796" class='ln'>2796</a></td><td><span class="ct"> * number of channels = nCols/frameSize = dims[1];</span></td></tr>
<tr name="2797" id="2797">
<td><a id="l2797" class='ln'>2797</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2798" id="2798">
<td><a id="l2798" class='ln'>2798</a></td><td> <a id="2798c5" class="tk">nColumns</a> = <a id="2798c16" class="tk">frameData</a> <a id="2798c26" class="tk">?</a> <a id="2798c28" class="tk">dims</a>[1] <a id="2798c36" class="tk">:</a> <a id="2798c38" class="tk">nCols</a>;</td></tr>
<tr name="2799" id="2799">
<td><a id="l2799" class='ln'>2799</a></td><td></td></tr>
<tr name="2800" id="2800">
<td><a id="l2800" class='ln'>2800</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2801" id="2801">
<td><a id="l2801" class='ln'>2801</a></td><td><span class="ct"> * Error out if the size of the circular buffer is absurdly large, this</span></td></tr>
<tr name="2802" id="2802">
<td><a id="l2802" class='ln'>2802</a></td><td><span class="ct"> * error message is more informative than the one we get when we try to</span></td></tr>
<tr name="2803" id="2803">
<td><a id="l2803" class='ln'>2803</a></td><td><span class="ct"> * malloc this many number of bytes in one fell swoop.</span></td></tr>
<tr name="2804" id="2804">
<td><a id="l2804" class='ln'>2804</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2805" id="2805">
<td><a id="l2805" class='ln'>2805</a></td><td> <span class="br">{</span></td></tr>
<tr name="2806" id="2806">
<td><a id="l2806" class='ln'>2806</a></td><td> <span class="kw">double</span> <a id="2806c16" class="tk">tmpDbl</a> = ((<span class="kw">double</span>)<a id="2806c34" class="tk">elementSize</a>)<a id="2806c46" class="tk">*</a>((<span class="kw">double</span>)<a id="2806c56" class="tk">nRows</a>)<a id="2806c62" class="tk">*</a></td></tr>
<tr name="2807" id="2807">
<td><a id="l2807" class='ln'>2807</a></td><td> ((<span class="kw">double</span>)<a id="2807c56" class="tk">nColumns</a>);</td></tr>
<tr name="2808" id="2808">
<td><a id="l2808" class='ln'>2808</a></td><td></td></tr>
<tr name="2809" id="2809">
<td><a id="l2809" class='ln'>2809</a></td><td> <span class="kw">if</span> (<a id="2809c13" class="tk">tmpDbl</a> <a id="2809c20" class="tk">&gt;=</a> <a id="2809c23" class="tk">UINT_MAX</a>) <span class="br">{</span></td></tr>
<tr name="2810" id="2810">
<td><a id="l2810" class='ln'>2810</a></td><td> (<span class="kw">void</span>)<a id="2810c19" class="tk">fprintf</a>(<a id="2810c27" class="tk">stderr</a>,</td></tr>
<tr name="2811" id="2811">
<td><a id="l2811" class='ln'>2811</a></td><td> "\n*** Memory required to log variable '%s' is too"</td></tr>
<tr name="2812" id="2812">
<td><a id="l2812" class='ln'>2812</a></td><td> "\n big. Use the 'Limit rows to last:' and (or)"</td></tr>
<tr name="2813" id="2813">
<td><a id="l2813" class='ln'>2813</a></td><td> "\n 'Decimation:' options to reduce the required"</td></tr>
<tr name="2814" id="2814">
<td><a id="l2814" class='ln'>2814</a></td><td> "\n memory size.\n", <a id="2814c51" class="tk">varName</a>);</td></tr>
<tr name="2815" id="2815">
<td><a id="l2815" class='ln'>2815</a></td><td> (<span class="kw">void</span>)<a id="2815c19" class="tk">fprintf</a>(<a id="2815c27" class="tk">stderr</a>, "*** Details:\n"</td></tr>
<tr name="2816" id="2816">
<td><a id="l2816" class='ln'>2816</a></td><td> " varName = %s\n"</td></tr>
<tr name="2817" id="2817">
<td><a id="l2817" class='ln'>2817</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2818" id="2818">
<td><a id="l2818" class='ln'>2818</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2819" id="2819">
<td><a id="l2819" class='ln'>2819</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2820" id="2820">
<td><a id="l2820" class='ln'>2820</a></td><td> " Bytes Required = %.16g\n\n",</td></tr>
<tr name="2821" id="2821">
<td><a id="l2821" class='ln'>2821</a></td><td> <a id="2821c27" class="tk">varName</a>, <a id="2821c36" class="tk">nRows</a>, <a id="2821c43" class="tk">nColumns</a>, (<span class="kw">unsigned</span> <span class="kw">long</span>)</td></tr>
<tr name="2822" id="2822">
<td><a id="l2822" class='ln'>2822</a></td><td> <a id="2822c27" class="tk">elementSize</a>, <a id="2822c40" class="tk">tmpDbl</a>);</td></tr>
<tr name="2823" id="2823">
<td><a id="l2823" class='ln'>2823</a></td><td> <span class="kw">goto</span> <a id="2823c18" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2824" id="2824">
<td><a id="l2824" class='ln'>2824</a></td><td> <span class="br">}</span></td></tr>
<tr name="2825" id="2825">
<td><a id="l2825" class='ln'>2825</a></td><td> <span class="br">}</span></td></tr>
<tr name="2826" id="2826">
<td><a id="l2826" class='ln'>2826</a></td><td></td></tr>
<tr name="2827" id="2827">
<td><a id="l2827" class='ln'>2827</a></td><td> <span class="ct">/* Allocate memory for the log variable */</span></td></tr>
<tr name="2828" id="2828">
<td><a id="l2828" class='ln'>2828</a></td><td> <span class="kw">if</span> ( (<a id="2828c11" class="tk">var</a> = <a id="2828c17" class="tk">calloc</a>(1, <span class="kw">sizeof</span>(<a id="2828c34" class="tk">LogVar</a>))) <a id="2828c44" class="tk">==</a> <a id="2828c47" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2829" id="2829">
<td><a id="l2829" class='ln'>2829</a></td><td> (<span class="kw">void</span>)<a id="2829c15" class="tk">fprintf</a>(<a id="2829c23" class="tk">stderr</a>, "*** Error allocating memory for logging %s\n",</td></tr>
<tr name="2830" id="2830">
<td><a id="l2830" class='ln'>2830</a></td><td> <a id="2830c23" class="tk">varName</a>);</td></tr>
<tr name="2831" id="2831">
<td><a id="l2831" class='ln'>2831</a></td><td> <span class="kw">goto</span> <a id="2831c14" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2832" id="2832">
<td><a id="l2832" class='ln'>2832</a></td><td> <span class="br">}</span></td></tr>
<tr name="2833" id="2833">
<td><a id="l2833" class='ln'>2833</a></td><td></td></tr>
<tr name="2834" id="2834">
<td><a id="l2834" class='ln'>2834</a></td><td> <span class="ct">/* Allocate memory for the circular buffer (real part) */</span></td></tr>
<tr name="2835" id="2835">
<td><a id="l2835" class='ln'>2835</a></td><td> <span class="kw">if</span> ( (<a id="2835c11" class="tk">var</a>-&gt;<a id="2835c16" class="tk">data</a>.<a id="2835c21" class="tk">re</a> = <a id="2835c26" class="tk">malloc</a>(<a id="2835c33" class="tk">nRows</a><a id="2835c38" class="tk">*</a><a id="2835c39" class="tk">nColumns</a><a id="2835c47" class="tk">*</a><a id="2835c48" class="tk">elementSize</a>)) <a id="2835c62" class="tk">==</a> <a id="2835c65" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2836" id="2836">
<td><a id="l2836" class='ln'>2836</a></td><td> (<span class="kw">void</span>)<a id="2836c15" class="tk">fprintf</a>(<a id="2836c23" class="tk">stderr</a>,</td></tr>
<tr name="2837" id="2837">
<td><a id="l2837" class='ln'>2837</a></td><td> "*** Error allocating memory for the circular buffer\n");</td></tr>
<tr name="2838" id="2838">
<td><a id="l2838" class='ln'>2838</a></td><td> (<span class="kw">void</span>)<a id="2838c15" class="tk">fprintf</a>(<a id="2838c23" class="tk">stderr</a>, "*** Details:\n"</td></tr>
<tr name="2839" id="2839">
<td><a id="l2839" class='ln'>2839</a></td><td> " varName = %s\n"</td></tr>
<tr name="2840" id="2840">
<td><a id="l2840" class='ln'>2840</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2841" id="2841">
<td><a id="l2841" class='ln'>2841</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2842" id="2842">
<td><a id="l2842" class='ln'>2842</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2843" id="2843">
<td><a id="l2843" class='ln'>2843</a></td><td> " Bytes Requested = %.16g\n\n",</td></tr>
<tr name="2844" id="2844">
<td><a id="l2844" class='ln'>2844</a></td><td> <a id="2844c23" class="tk">varName</a>, <a id="2844c32" class="tk">nRows</a>, <a id="2844c39" class="tk">nColumns</a>, (<span class="kw">unsigned</span> <span class="kw">long</span>) <a id="2844c65" class="tk">elementSize</a>,</td></tr>
<tr name="2845" id="2845">
<td><a id="l2845" class='ln'>2845</a></td><td> ((<span class="kw">double</span>)<a id="2845c32" class="tk">elementSize</a>)<a id="2845c44" class="tk">*</a>((<span class="kw">double</span>)<a id="2845c54" class="tk">nRows</a>)<a id="2845c60" class="tk">*</a>((<span class="kw">double</span>)<a id="2845c70" class="tk">nColumns</a>));</td></tr>
<tr name="2846" id="2846">
<td><a id="l2846" class='ln'>2846</a></td><td> <span class="kw">goto</span> <a id="2846c14" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2847" id="2847">
<td><a id="l2847" class='ln'>2847</a></td><td> <span class="br">}</span></td></tr>
<tr name="2848" id="2848">
<td><a id="l2848" class='ln'>2848</a></td><td></td></tr>
<tr name="2849" id="2849">
<td><a id="l2849" class='ln'>2849</a></td><td> <span class="ct">/* Allocate memory for the circular buffer for the imaginary part */</span></td></tr>
<tr name="2850" id="2850">
<td><a id="l2850" class='ln'>2850</a></td><td> <span class="kw">if</span> (<a id="2850c9" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="2851" id="2851">
<td><a id="l2851" class='ln'>2851</a></td><td> <span class="kw">if</span> ( (<a id="2851c15" class="tk">var</a>-&gt;<a id="2851c20" class="tk">data</a>.<a id="2851c25" class="tk">im</a> = <a id="2851c30" class="tk">malloc</a>(<a id="2851c37" class="tk">nRows</a><a id="2851c42" class="tk">*</a><a id="2851c43" class="tk">nColumns</a><a id="2851c51" class="tk">*</a><a id="2851c52" class="tk">elementSize</a>)) <a id="2851c66" class="tk">==</a> <a id="2851c69" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2852" id="2852">
<td><a id="l2852" class='ln'>2852</a></td><td> (<span class="kw">void</span>)<a id="2852c19" class="tk">fprintf</a>(<a id="2852c27" class="tk">stderr</a>,</td></tr>
<tr name="2853" id="2853">
<td><a id="l2853" class='ln'>2853</a></td><td> "*** Error allocating memory for the circular buffer "</td></tr>
<tr name="2854" id="2854">
<td><a id="l2854" class='ln'>2854</a></td><td> "for logging the imaginary part of %s\n", <a id="2854c69" class="tk">varName</a>);</td></tr>
<tr name="2855" id="2855">
<td><a id="l2855" class='ln'>2855</a></td><td> (<span class="kw">void</span>)<a id="2855c19" class="tk">fprintf</a>(<a id="2855c27" class="tk">stderr</a>, "*** Details:\n"</td></tr>
<tr name="2856" id="2856">
<td><a id="l2856" class='ln'>2856</a></td><td> " varName = %s\n"</td></tr>
<tr name="2857" id="2857">
<td><a id="l2857" class='ln'>2857</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2858" id="2858">
<td><a id="l2858" class='ln'>2858</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2859" id="2859">
<td><a id="l2859" class='ln'>2859</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2860" id="2860">
<td><a id="l2860" class='ln'>2860</a></td><td> " Bytes Requested = %.16g\n\n",</td></tr>
<tr name="2861" id="2861">
<td><a id="l2861" class='ln'>2861</a></td><td> <a id="2861c27" class="tk">varName</a>, <a id="2861c36" class="tk">nRows</a>, <a id="2861c43" class="tk">nColumns</a>, (<span class="kw">unsigned</span> <span class="kw">long</span>) <a id="2861c69" class="tk">elementSize</a>,</td></tr>
<tr name="2862" id="2862">
<td><a id="l2862" class='ln'>2862</a></td><td> ((<span class="kw">double</span>)<a id="2862c36" class="tk">elementSize</a>)<a id="2862c48" class="tk">*</a>((<span class="kw">double</span>)<a id="2862c58" class="tk">nRows</a>)<a id="2862c64" class="tk">*</a></td></tr>
<tr name="2863" id="2863">
<td><a id="l2863" class='ln'>2863</a></td><td> ((<span class="kw">double</span>)<a id="2863c59" class="tk">nColumns</a>));</td></tr>
<tr name="2864" id="2864">
<td><a id="l2864" class='ln'>2864</a></td><td> <span class="kw">goto</span> <a id="2864c18" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2865" id="2865">
<td><a id="l2865" class='ln'>2865</a></td><td> <span class="br">}</span></td></tr>
<tr name="2866" id="2866">
<td><a id="l2866" class='ln'>2866</a></td><td> <span class="br">}</span></td></tr>
<tr name="2867" id="2867">
<td><a id="l2867" class='ln'>2867</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="2868" id="2868">
<td><a id="l2868" class='ln'>2868</a></td><td><span class="ct"> * Initialize the fields in LogVar structure.</span></td></tr>
<tr name="2869" id="2869">
<td><a id="l2869" class='ln'>2869</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2870" id="2870">
<td><a id="l2870" class='ln'>2870</a></td><td> <span class="kw">if</span> (<a id="2870c9" class="tk">appendToLogVarsList</a>) <span class="br">{</span></td></tr>
<tr name="2871" id="2871">
<td><a id="l2871" class='ln'>2871</a></td><td> <a id="2871c9" class="tk">rt_LoadModifiedLogVarName</a>(<a id="2871c35" class="tk">li</a>,<a id="2871c38" class="tk">varName</a>,<a id="2871c46" class="tk">var</a>-&gt;<a id="2871c51" class="tk">data</a>.<a id="2871c56" class="tk">name</a>);</td></tr>
<tr name="2872" id="2872">
<td><a id="l2872" class='ln'>2872</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2873" id="2873">
<td><a id="l2873" class='ln'>2873</a></td><td> <a id="2873c9" class="tk">var</a>-&gt;<a id="2873c14" class="tk">data</a>.<a id="2873c19" class="tk">name</a>[<a id="2873c24" class="tk">mxMAXNAM</a><a id="2873c32" class="tk">-</a>1] = '\0';</td></tr>
<tr name="2874" id="2874">
<td><a id="l2874" class='ln'>2874</a></td><td> (<span class="kw">void</span>)<a id="2874c15" class="tk">strncpy</a>(<a id="2874c23" class="tk">var</a>-&gt;<a id="2874c28" class="tk">data</a>.<a id="2874c33" class="tk">name</a>,<a id="2874c38" class="tk">varName</a>,<a id="2874c46" class="tk">mxMAXNAM</a><a id="2874c54" class="tk">-</a>1);</td></tr>
<tr name="2875" id="2875">
<td><a id="l2875" class='ln'>2875</a></td><td> <span class="br">}</span></td></tr>
<tr name="2876" id="2876">
<td><a id="l2876" class='ln'>2876</a></td><td> <a id="2876c5" class="tk">var</a>-&gt;<a id="2876c10" class="tk">data</a>.<a id="2876c15" class="tk">nCols</a> = <a id="2876c33" class="tk">nColumns</a>;</td></tr>
<tr name="2877" id="2877">
<td><a id="l2877" class='ln'>2877</a></td><td> <a id="2877c5" class="tk">var</a>-&gt;<a id="2877c10" class="tk">data</a>.<a id="2877c15" class="tk">nRows</a> = <a id="2877c33" class="tk">nRows</a>;</td></tr>
<tr name="2878" id="2878">
<td><a id="l2878" class='ln'>2878</a></td><td></td></tr>
<tr name="2879" id="2879">
<td><a id="l2879" class='ln'>2879</a></td><td> <a id="2879c5" class="tk">var</a>-&gt;<a id="2879c10" class="tk">data</a>.<a id="2879c15" class="tk">nDims</a> = <a id="2879c33" class="tk">frameData</a> <a id="2879c43" class="tk">?</a> 1 <a id="2879c47" class="tk">:</a> <a id="2879c49" class="tk">nDims</a>;</td></tr>
<tr name="2880" id="2880">
<td><a id="l2880" class='ln'>2880</a></td><td> <span class="kw">if</span> (<a id="2880c9" class="tk">var</a>-&gt;<a id="2880c14" class="tk">data</a>.<a id="2880c19" class="tk">nDims</a> <a id="2880c25" class="tk">&gt;</a> 2) <span class="br">{</span></td></tr>
<tr name="2881" id="2881">
<td><a id="l2881" class='ln'>2881</a></td><td> <a id="2881c9" class="tk">var</a>-&gt;<a id="2881c14" class="tk">data</a>.<a id="2881c19" class="tk">dims</a> = (<a id="2881c27" class="tk">int_T</a><a id="2881c32" class="tk">*</a>)<a id="2881c34" class="tk">malloc</a>(<span class="kw">sizeof</span>(<a id="2881c48" class="tk">int_T</a>)<a id="2881c54" class="tk">*</a><a id="2881c55" class="tk">var</a>-&gt;<a id="2881c60" class="tk">data</a>.<a id="2881c65" class="tk">nDims</a>);</td></tr>
<tr name="2882" id="2882">
<td><a id="l2882" class='ln'>2882</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2883" id="2883">
<td><a id="l2883" class='ln'>2883</a></td><td> <a id="2883c9" class="tk">var</a>-&gt;<a id="2883c14" class="tk">data</a>.<a id="2883c19" class="tk">dims</a> = <a id="2883c26" class="tk">var</a>-&gt;<a id="2883c31" class="tk">data</a>.<a id="2883c36" class="tk">_dims</a>;</td></tr>
<tr name="2884" id="2884">
<td><a id="l2884" class='ln'>2884</a></td><td> <span class="br">}</span></td></tr>
<tr name="2885" id="2885">
<td><a id="l2885" class='ln'>2885</a></td><td> <span class="kw">if</span> (<a id="2885c9" class="tk">frameData</a>) <span class="br">{</span></td></tr>
<tr name="2886" id="2886">
<td><a id="l2886" class='ln'>2886</a></td><td> <a id="2886c9" class="tk">var</a>-&gt;<a id="2886c14" class="tk">data</a>.<a id="2886c19" class="tk">dims</a>[0] = <a id="2886c29" class="tk">nColumns</a>;</td></tr>
<tr name="2887" id="2887">
<td><a id="l2887" class='ln'>2887</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="2888" id="2888">
<td><a id="l2888" class='ln'>2888</a></td><td> <span class="ct">/*LINTED E_CAST_INT_TO_SMALL_INT*/</span></td></tr>
<tr name="2889" id="2889">
<td><a id="l2889" class='ln'>2889</a></td><td> (<span class="kw">void</span>)<a id="2889c15" class="tk">memcpy</a>(<a id="2889c22" class="tk">var</a>-&gt;<a id="2889c27" class="tk">data</a>.<a id="2889c32" class="tk">dims</a>, <a id="2889c38" class="tk">dims</a>, (<a id="2889c45" class="tk">size_t</a>)(<a id="2889c53" class="tk">nDims</a><a id="2889c58" class="tk">*</a><span class="kw">sizeof</span>(<a id="2889c66" class="tk">int_T</a>)));</td></tr>
<tr name="2890" id="2890">
<td><a id="l2890" class='ln'>2890</a></td><td> <span class="br">}</span></td></tr>
<tr name="2891" id="2891">
<td><a id="l2891" class='ln'>2891</a></td><td></td></tr>
<tr name="2892" id="2892">
<td><a id="l2892" class='ln'>2892</a></td><td> <a id="2892c5" class="tk">var</a>-&gt;<a id="2892c10" class="tk">data</a>.<a id="2892c15" class="tk">dTypeID</a> = <a id="2892c33" class="tk">dTypeID</a>;</td></tr>
<tr name="2893" id="2893">
<td><a id="l2893" class='ln'>2893</a></td><td> <a id="2893c5" class="tk">var</a>-&gt;<a id="2893c10" class="tk">data</a>.<a id="2893c15" class="tk">elSize</a> = <a id="2893c33" class="tk">elementSize</a>;</td></tr>
<tr name="2894" id="2894">
<td><a id="l2894" class='ln'>2894</a></td><td></td></tr>
<tr name="2895" id="2895">
<td><a id="l2895" class='ln'>2895</a></td><td> <a id="2895c5" class="tk">var</a>-&gt;<a id="2895c10" class="tk">data</a>.<a id="2895c15" class="tk">dataTypeConvertInfo</a> = <a id="2895c37" class="tk">rt_GetDataTypeConvertInfo</a>(</td></tr>
<tr name="2896" id="2896">
<td><a id="l2896" class='ln'>2896</a></td><td> <a id="2896c9" class="tk">pDataTypeConvertInfo</a>, <a id="2896c31" class="tk">dTypeID</a>);</td></tr>
<tr name="2897" id="2897">
<td><a id="l2897" class='ln'>2897</a></td><td></td></tr>
<tr name="2898" id="2898">
<td><a id="l2898" class='ln'>2898</a></td><td> <a id="2898c5" class="tk">var</a>-&gt;<a id="2898c10" class="tk">data</a>.<a id="2898c15" class="tk">mxID</a> = <a id="2898c33" class="tk">rt_GetMxIdFromDTypeId</a>(<a id="2898c55" class="tk">dTypeID</a>);</td></tr>
<tr name="2899" id="2899">
<td><a id="l2899" class='ln'>2899</a></td><td> <span class="ct">/* over-ride logical bit if data type is boolean */</span></td></tr>
<tr name="2900" id="2900">
<td><a id="l2900" class='ln'>2900</a></td><td> <a id="2900c5" class="tk">logical</a> = <a id="2900c15" class="tk">dTypeID</a> <a id="2900c23" class="tk">==</a> <a id="2900c26" class="tk">SS_BOOLEAN</a> <a id="2900c37" class="tk">?</a> 1 <a id="2900c41" class="tk">:</a> 0;</td></tr>
<tr name="2901" id="2901">
<td><a id="l2901" class='ln'>2901</a></td><td> <a id="2901c5" class="tk">var</a>-&gt;<a id="2901c10" class="tk">data</a>.<a id="2901c15" class="tk">logical</a> = (<a id="2901c34" class="tk">logical</a>) <a id="2901c45" class="tk">?</a> <a id="2901c47" class="tk">matLOGICAL_BIT</a> <a id="2901c62" class="tk">:</a> 0x0;</td></tr>
<tr name="2902" id="2902">
<td><a id="l2902" class='ln'>2902</a></td><td> <a id="2902c5" class="tk">var</a>-&gt;<a id="2902c10" class="tk">data</a>.<a id="2902c15" class="tk">complex</a> = (<a id="2902c34" class="tk">complex</a>) <a id="2902c45" class="tk">?</a> <a id="2902c47" class="tk">matCOMPLEX_BIT</a> <a id="2902c62" class="tk">:</a> 0x0;</td></tr>
<tr name="2903" id="2903">
<td><a id="l2903" class='ln'>2903</a></td><td> <a id="2903c5" class="tk">var</a>-&gt;<a id="2903c10" class="tk">data</a>.<a id="2903c15" class="tk">frameData</a> = <a id="2903c33" class="tk">frameData</a>;</td></tr>
<tr name="2904" id="2904">
<td><a id="l2904" class='ln'>2904</a></td><td> <a id="2904c5" class="tk">var</a>-&gt;<a id="2904c10" class="tk">data</a>.<a id="2904c15" class="tk">frameSize</a> = (<a id="2904c34" class="tk">frameData</a>) <a id="2904c45" class="tk">?</a> <a id="2904c47" class="tk">frameSize</a> <a id="2904c57" class="tk">:</a> 1;</td></tr>
<tr name="2905" id="2905">
<td><a id="l2905" class='ln'>2905</a></td><td></td></tr>
<tr name="2906" id="2906">
<td><a id="l2906" class='ln'>2906</a></td><td> <span class="ct">/* fill up valDims field */</span></td></tr>
<tr name="2907" id="2907">
<td><a id="l2907" class='ln'>2907</a></td><td> <span class="kw">if</span>(<a id="2907c8" class="tk">logValDimsStat</a> <a id="2907c23" class="tk">==</a> <a id="2907c26" class="tk">NO_LOGVALDIMS</a>)<span class="br">{</span></td></tr>
<tr name="2908" id="2908">
<td><a id="l2908" class='ln'>2908</a></td><td> <span class="ct">/* All signals are fixed-size, no need to log valueDimensions field */</span></td></tr>
<tr name="2909" id="2909">
<td><a id="l2909" class='ln'>2909</a></td><td> <a id="2909c9" class="tk">var</a>-&gt;<a id="2909c14" class="tk">valDims</a> = <a id="2909c28" class="tk">NULL</a>;</td></tr>
<tr name="2910" id="2910">
<td><a id="l2910" class='ln'>2910</a></td><td> <span class="ct">/* Set these pointers to NULLs in this case */</span></td></tr>
<tr name="2911" id="2911">
<td><a id="l2911" class='ln'>2911</a></td><td> <a id="2911c9" class="tk">var</a>-&gt;<a id="2911c14" class="tk">coords</a> = <a id="2911c28" class="tk">NULL</a>;</td></tr>
<tr name="2912" id="2912">
<td><a id="l2912" class='ln'>2912</a></td><td> <a id="2912c9" class="tk">var</a>-&gt;<a id="2912c14" class="tk">strides</a> = <a id="2912c28" class="tk">NULL</a>;</td></tr>
<tr name="2913" id="2913">
<td><a id="l2913" class='ln'>2913</a></td><td> <a id="2913c9" class="tk">var</a>-&gt;<a id="2913c14" class="tk">currStrides</a> = <a id="2913c28" class="tk">NULL</a>;</td></tr>
<tr name="2914" id="2914">
<td><a id="l2914" class='ln'>2914</a></td><td> <span class="br">}</span></td></tr>
<tr name="2915" id="2915">
<td><a id="l2915" class='ln'>2915</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="2916" id="2916">
<td><a id="l2916" class='ln'>2916</a></td><td> <span class="kw">if</span> ( (<a id="2916c15" class="tk">var</a>-&gt;<a id="2916c20" class="tk">valDims</a> = <a id="2916c30" class="tk">calloc</a>(1, <span class="kw">sizeof</span>(<a id="2916c47" class="tk">ValDimsData</a>))) <a id="2916c62" class="tk">==</a> <a id="2916c65" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2917" id="2917">
<td><a id="l2917" class='ln'>2917</a></td><td> <span class="kw">goto</span> <a id="2917c18" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2918" id="2918">
<td><a id="l2918" class='ln'>2918</a></td><td> <span class="br">}</span></td></tr>
<tr name="2919" id="2919">
<td><a id="l2919" class='ln'>2919</a></td><td></td></tr>
<tr name="2920" id="2920">
<td><a id="l2920" class='ln'>2920</a></td><td> (<span class="kw">void</span>)<a id="2920c15" class="tk">memcpy</a>(<a id="2920c22" class="tk">var</a>-&gt;<a id="2920c27" class="tk">valDims</a>-&gt;<a id="2920c36" class="tk">name</a>, <a id="2920c42" class="tk">&amp;</a><a id="2920c43" class="tk">VALUEDIMENSIONS_FIELD_NAME</a>, <a id="2920c71" class="tk">mxMAXNAM</a>);</td></tr>
<tr name="2921" id="2921">
<td><a id="l2921" class='ln'>2921</a></td><td></td></tr>
<tr name="2922" id="2922">
<td><a id="l2922" class='ln'>2922</a></td><td> <span class="kw">if</span> (<a id="2922c13" class="tk">logValDimsStat</a> <a id="2922c28" class="tk">==</a> <a id="2922c31" class="tk">LOGVALDIMS_EMPTYMX</a>) <span class="br">{</span></td></tr>
<tr name="2923" id="2923">
<td><a id="l2923" class='ln'>2923</a></td><td> <span class="ct">/* At least one signal is variable-size, </span></td></tr>
<tr name="2924" id="2924">
<td><a id="l2924" class='ln'>2924</a></td><td><span class="ct"> but the current signal is fixed-size. </span></td></tr>
<tr name="2925" id="2925">
<td><a id="l2925" class='ln'>2925</a></td><td><span class="ct"> Therefore, create a dummy MatrixData to write out valueDimensions </span></td></tr>
<tr name="2926" id="2926">
<td><a id="l2926" class='ln'>2926</a></td><td><span class="ct"> as an empty matrix. </span></td></tr>
<tr name="2927" id="2927">
<td><a id="l2927" class='ln'>2927</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2928" id="2928">
<td><a id="l2928" class='ln'>2928</a></td><td> <a id="2928c13" class="tk">var</a>-&gt;<a id="2928c18" class="tk">valDims</a>-&gt;<a id="2928c27" class="tk">nRows</a> = 0;</td></tr>
<tr name="2929" id="2929">
<td><a id="l2929" class='ln'>2929</a></td><td> <a id="2929c13" class="tk">var</a>-&gt;<a id="2929c18" class="tk">valDims</a>-&gt;<a id="2929c27" class="tk">nCols</a> = 0;</td></tr>
<tr name="2930" id="2930">
<td><a id="l2930" class='ln'>2930</a></td><td> <a id="2930c13" class="tk">var</a>-&gt;<a id="2930c18" class="tk">valDims</a>-&gt;<a id="2930c27" class="tk">currSigDims</a> = <a id="2930c41" class="tk">NULL</a>;</td></tr>
<tr name="2931" id="2931">
<td><a id="l2931" class='ln'>2931</a></td><td> <a id="2931c13" class="tk">var</a>-&gt;<a id="2931c18" class="tk">valDims</a>-&gt;<a id="2931c27" class="tk">currSigDimsSize</a> = <a id="2931c45" class="tk">NULL</a>;</td></tr>
<tr name="2932" id="2932">
<td><a id="l2932" class='ln'>2932</a></td><td> <a id="2932c13" class="tk">var</a>-&gt;<a id="2932c18" class="tk">valDims</a>-&gt;<a id="2932c27" class="tk">dimsData</a> = <a id="2932c38" class="tk">NULL</a>;</td></tr>
<tr name="2933" id="2933">
<td><a id="l2933" class='ln'>2933</a></td><td> <span class="ct">/* Set these pointers to NULLs in this case */</span></td></tr>
<tr name="2934" id="2934">
<td><a id="l2934" class='ln'>2934</a></td><td> <a id="2934c13" class="tk">var</a>-&gt;<a id="2934c18" class="tk">coords</a> = <a id="2934c32" class="tk">NULL</a>;</td></tr>
<tr name="2935" id="2935">
<td><a id="l2935" class='ln'>2935</a></td><td> <a id="2935c13" class="tk">var</a>-&gt;<a id="2935c18" class="tk">strides</a> = <a id="2935c32" class="tk">NULL</a>;</td></tr>
<tr name="2936" id="2936">
<td><a id="l2936" class='ln'>2936</a></td><td> <a id="2936c13" class="tk">var</a>-&gt;<a id="2936c18" class="tk">currStrides</a> = <a id="2936c32" class="tk">NULL</a>;</td></tr>
<tr name="2937" id="2937">
<td><a id="l2937" class='ln'>2937</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* The current signal is a variable-size signal. */</span></td></tr>
<tr name="2938" id="2938">
<td><a id="l2938" class='ln'>2938</a></td><td> <span class="ct">/* The "valueDimensions" must be double, so re-assign element size */</span></td></tr>
<tr name="2939" id="2939">
<td><a id="l2939" class='ln'>2939</a></td><td> <a id="2939c13" class="tk">elementSize</a> = <span class="kw">sizeof</span>(<a id="2939c34" class="tk">real_T</a>);</td></tr>
<tr name="2940" id="2940">
<td><a id="l2940" class='ln'>2940</a></td><td></td></tr>
<tr name="2941" id="2941">
<td><a id="l2941" class='ln'>2941</a></td><td> <span class="ct">/* When signals are frame-based, 'valueDimensions' has 1 column */</span></td></tr>
<tr name="2942" id="2942">
<td><a id="l2942" class='ln'>2942</a></td><td> <span class="kw">if</span>(<a id="2942c16" class="tk">frameData</a>)<span class="br">{</span></td></tr>
<tr name="2943" id="2943">
<td><a id="l2943" class='ln'>2943</a></td><td> <span class="ct">/* When signal is frame-based, the first dimension is always fixed, </span></td></tr>
<tr name="2944" id="2944">
<td><a id="l2944" class='ln'>2944</a></td><td><span class="ct"> so we only need to record the second dimension.</span></td></tr>
<tr name="2945" id="2945">
<td><a id="l2945" class='ln'>2945</a></td><td><span class="ct"> e.g. Two frame-based signals [10x4] and [10x3], </span></td></tr>
<tr name="2946" id="2946">
<td><a id="l2946" class='ln'>2946</a></td><td><span class="ct"> 'valueDimensions' and 'currSigDims'</span></td></tr>
<tr name="2947" id="2947">
<td><a id="l2947" class='ln'>2947</a></td><td><span class="ct"> only record 4 or 3.</span></td></tr>
<tr name="2948" id="2948">
<td><a id="l2948" class='ln'>2948</a></td><td><span class="ct"> */</span></td></tr>
<tr name="2949" id="2949">
<td><a id="l2949" class='ln'>2949</a></td><td> <a id="2949c17" class="tk">nColumns</a> = 1;</td></tr>
<tr name="2950" id="2950">
<td><a id="l2950" class='ln'>2950</a></td><td> <a id="2950c17" class="tk">var</a>-&gt;<a id="2950c22" class="tk">valDims</a>-&gt;<a id="2950c31" class="tk">currSigDims</a> = (<span class="kw">void</span><a id="2950c50" class="tk">*</a><a id="2950c51" class="tk">*</a>) (<a id="2950c55" class="tk">currSigDims</a> <a id="2950c67" class="tk">+</a> 1);</td></tr>
<tr name="2951" id="2951">
<td><a id="l2951" class='ln'>2951</a></td><td> <a id="2951c17" class="tk">var</a>-&gt;<a id="2951c22" class="tk">valDims</a>-&gt;<a id="2951c31" class="tk">currSigDimsSize</a> = (<a id="2951c50" class="tk">int_T</a><a id="2951c55" class="tk">*</a>) (<a id="2951c59" class="tk">currSigDimsSize</a> <a id="2951c75" class="tk">+</a> 1);</td></tr>
<tr name="2952" id="2952">
<td><a id="l2952" class='ln'>2952</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* non-frame based */</span></td></tr>
<tr name="2953" id="2953">
<td><a id="l2953" class='ln'>2953</a></td><td> <a id="2953c17" class="tk">nColumns</a> = <a id="2953c28" class="tk">nDims</a>;</td></tr>
<tr name="2954" id="2954">
<td><a id="l2954" class='ln'>2954</a></td><td> <a id="2954c17" class="tk">var</a>-&gt;<a id="2954c22" class="tk">valDims</a>-&gt;<a id="2954c31" class="tk">currSigDims</a> = (<span class="kw">void</span><a id="2954c50" class="tk">*</a><a id="2954c51" class="tk">*</a>) <a id="2954c54" class="tk">currSigDims</a>;</td></tr>
<tr name="2955" id="2955">
<td><a id="l2955" class='ln'>2955</a></td><td> <a id="2955c17" class="tk">var</a>-&gt;<a id="2955c22" class="tk">valDims</a>-&gt;<a id="2955c31" class="tk">currSigDimsSize</a> = (<a id="2955c50" class="tk">int_T</a><a id="2955c55" class="tk">*</a>) <a id="2955c58" class="tk">currSigDimsSize</a>;</td></tr>
<tr name="2956" id="2956">
<td><a id="l2956" class='ln'>2956</a></td><td> <span class="br">}</span></td></tr>
<tr name="2957" id="2957">
<td><a id="l2957" class='ln'>2957</a></td><td> </td></tr>
<tr name="2958" id="2958">
<td><a id="l2958" class='ln'>2958</a></td><td> <span class="ct">/* Allocate memory for the circular buffer */</span></td></tr>
<tr name="2959" id="2959">
<td><a id="l2959" class='ln'>2959</a></td><td> <span class="kw">if</span> ( (<a id="2959c19" class="tk">var</a>-&gt;<a id="2959c24" class="tk">valDims</a>-&gt;<a id="2959c33" class="tk">dimsData</a> = <a id="2959c44" class="tk">malloc</a>(<a id="2959c51" class="tk">nRows</a><a id="2959c56" class="tk">*</a><a id="2959c57" class="tk">nColumns</a><a id="2959c65" class="tk">*</a><a id="2959c66" class="tk">elementSize</a>)) <a id="2959c80" class="tk">==</a> <a id="2959c83" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="2960" id="2960">
<td><a id="l2960" class='ln'>2960</a></td><td> (<span class="kw">void</span>)<a id="2960c23" class="tk">fprintf</a>(<a id="2960c31" class="tk">stderr</a>,</td></tr>
<tr name="2961" id="2961">
<td><a id="l2961" class='ln'>2961</a></td><td> "*** Error allocating memory for the circular buffer\n");</td></tr>
<tr name="2962" id="2962">
<td><a id="l2962" class='ln'>2962</a></td><td> (<span class="kw">void</span>)<a id="2962c23" class="tk">fprintf</a>(<a id="2962c31" class="tk">stderr</a>, "*** Details:\n"</td></tr>
<tr name="2963" id="2963">
<td><a id="l2963" class='ln'>2963</a></td><td> " varName = %s\n"</td></tr>
<tr name="2964" id="2964">
<td><a id="l2964" class='ln'>2964</a></td><td> " nRows = %d\n"</td></tr>
<tr name="2965" id="2965">
<td><a id="l2965" class='ln'>2965</a></td><td> " nCols = %d\n"</td></tr>
<tr name="2966" id="2966">
<td><a id="l2966" class='ln'>2966</a></td><td> " elementSize = %lu\n"</td></tr>
<tr name="2967" id="2967">
<td><a id="l2967" class='ln'>2967</a></td><td> " Bytes Requested = %.16g\n\n",</td></tr>
<tr name="2968" id="2968">
<td><a id="l2968" class='ln'>2968</a></td><td> <a id="2968c31" class="tk">var</a>-&gt;<a id="2968c36" class="tk">valDims</a>-&gt;<a id="2968c45" class="tk">name</a>, <a id="2968c51" class="tk">nRows</a>, <a id="2968c58" class="tk">nColumns</a>, (<span class="kw">unsigned</span> <span class="kw">long</span>) <a id="2968c84" class="tk">elementSize</a>,</td></tr>
<tr name="2969" id="2969">
<td><a id="l2969" class='ln'>2969</a></td><td> ((<span class="kw">double</span>)<a id="2969c40" class="tk">elementSize</a>)<a id="2969c52" class="tk">*</a>((<span class="kw">double</span>)<a id="2969c62" class="tk">nRows</a>)<a id="2969c68" class="tk">*</a>((<span class="kw">double</span>)<a id="2969c78" class="tk">nColumns</a>));</td></tr>
<tr name="2970" id="2970">
<td><a id="l2970" class='ln'>2970</a></td><td> <span class="kw">goto</span> <a id="2970c22" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2971" id="2971">
<td><a id="l2971" class='ln'>2971</a></td><td> <span class="br">}</span></td></tr>
<tr name="2972" id="2972">
<td><a id="l2972" class='ln'>2972</a></td><td> <a id="2972c13" class="tk">var</a>-&gt;<a id="2972c18" class="tk">valDims</a>-&gt;<a id="2972c27" class="tk">nRows</a> = <a id="2972c35" class="tk">nRows</a>;</td></tr>
<tr name="2973" id="2973">
<td><a id="l2973" class='ln'>2973</a></td><td> <a id="2973c13" class="tk">var</a>-&gt;<a id="2973c18" class="tk">valDims</a>-&gt;<a id="2973c27" class="tk">nCols</a> = <a id="2973c35" class="tk">nColumns</a>;</td></tr>
<tr name="2974" id="2974">
<td><a id="l2974" class='ln'>2974</a></td><td></td></tr>
<tr name="2975" id="2975">
<td><a id="l2975" class='ln'>2975</a></td><td> <span class="ct">/* Allocate memory for these dynamic arrays */</span></td></tr>
<tr name="2976" id="2976">
<td><a id="l2976" class='ln'>2976</a></td><td> <span class="br">{</span></td></tr>
<tr name="2977" id="2977">
<td><a id="l2977" class='ln'>2977</a></td><td> <a id="2977c17" class="tk">size_t</a> <a id="2977c24" class="tk">nbytes</a> = <a id="2977c33" class="tk">var</a>-&gt;<a id="2977c38" class="tk">data</a>.<a id="2977c43" class="tk">nDims</a><a id="2977c48" class="tk">*</a><span class="kw">sizeof</span>(<a id="2977c56" class="tk">int_T</a>);</td></tr>
<tr name="2978" id="2978">
<td><a id="l2978" class='ln'>2978</a></td><td> <span class="kw">if</span>( ((<a id="2978c23" class="tk">var</a>-&gt;<a id="2978c28" class="tk">coords</a> = <a id="2978c37" class="tk">calloc</a>(<a id="2978c44" class="tk">nbytes</a>, 1)) <a id="2978c56" class="tk">==</a> <a id="2978c59" class="tk">NULL</a>)</td></tr>
<tr name="2979" id="2979">
<td><a id="l2979" class='ln'>2979</a></td><td> <a id="2979c21" class="tk">||</a>((<a id="2979c25" class="tk">var</a>-&gt;<a id="2979c30" class="tk">strides</a> = <a id="2979c40" class="tk">calloc</a>(<a id="2979c47" class="tk">nbytes</a>, 1)) <a id="2979c59" class="tk">==</a> <a id="2979c62" class="tk">NULL</a>)</td></tr>
<tr name="2980" id="2980">
<td><a id="l2980" class='ln'>2980</a></td><td> <a id="2980c21" class="tk">||</a>((<a id="2980c25" class="tk">var</a>-&gt;<a id="2980c30" class="tk">currStrides</a> = <a id="2980c44" class="tk">calloc</a>(<a id="2980c51" class="tk">nbytes</a>, 1)) <a id="2980c63" class="tk">==</a> <a id="2980c66" class="tk">NULL</a>) )</td></tr>
<tr name="2981" id="2981">
<td><a id="l2981" class='ln'>2981</a></td><td> <span class="kw">goto</span> <a id="2981c26" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="2982" id="2982">
<td><a id="l2982" class='ln'>2982</a></td><td> <span class="br">}</span></td></tr>
<tr name="2983" id="2983">
<td><a id="l2983" class='ln'>2983</a></td><td> <span class="br">}</span></td></tr>
<tr name="2984" id="2984">
<td><a id="l2984" class='ln'>2984</a></td><td> <span class="br">}</span></td></tr>
<tr name="2985" id="2985">
<td><a id="l2985" class='ln'>2985</a></td><td></td></tr>
<tr name="2986" id="2986">
<td><a id="l2986" class='ln'>2986</a></td><td> <a id="2986c5" class="tk">var</a>-&gt;<a id="2986c10" class="tk">rowIdx</a> = 0;</td></tr>
<tr name="2987" id="2987">
<td><a id="l2987" class='ln'>2987</a></td><td> <a id="2987c5" class="tk">var</a>-&gt;<a id="2987c10" class="tk">wrapped</a> = 0;</td></tr>
<tr name="2988" id="2988">
<td><a id="l2988" class='ln'>2988</a></td><td> <a id="2988c5" class="tk">var</a>-&gt;<a id="2988c10" class="tk">nDataPoints</a> = 0;</td></tr>
<tr name="2989" id="2989">
<td><a id="l2989" class='ln'>2989</a></td><td> <a id="2989c5" class="tk">var</a>-&gt;<a id="2989c10" class="tk">usingDefaultBufSize</a> = <a id="2989c33" class="tk">usingDefaultBufSize</a>;</td></tr>
<tr name="2990" id="2990">
<td><a id="l2990" class='ln'>2990</a></td><td> <a id="2990c5" class="tk">var</a>-&gt;<a id="2990c10" class="tk">okayToRealloc</a> = <a id="2990c33" class="tk">okayToRealloc</a>;</td></tr>
<tr name="2991" id="2991">
<td><a id="l2991" class='ln'>2991</a></td><td> <a id="2991c5" class="tk">var</a>-&gt;<a id="2991c10" class="tk">decimation</a> = <a id="2991c33" class="tk">decimation</a>;</td></tr>
<tr name="2992" id="2992">
<td><a id="l2992" class='ln'>2992</a></td><td> <a id="2992c5" class="tk">var</a>-&gt;<a id="2992c10" class="tk">numHits</a> = <a id="2992c33" class="tk">-</a>1; <span class="ct">/* so first point gets logged */</span></td></tr>
<tr name="2993" id="2993">
<td><a id="l2993" class='ln'>2993</a></td><td></td></tr>
<tr name="2994" id="2994">
<td><a id="l2994" class='ln'>2994</a></td><td> <span class="ct">/* Add this log var to list in log info, if necessary */</span></td></tr>
<tr name="2995" id="2995">
<td><a id="l2995" class='ln'>2995</a></td><td> <span class="kw">if</span> (<a id="2995c9" class="tk">appendToLogVarsList</a>) <span class="br">{</span></td></tr>
<tr name="2996" id="2996">
<td><a id="l2996" class='ln'>2996</a></td><td> <a id="2996c9" class="tk">LogInfo</a> <a id="2996c17" class="tk">*</a><a id="2996c18" class="tk">logInfo</a> = (<a id="2996c29" class="tk">LogInfo</a><a id="2996c36" class="tk">*</a>) <a id="2996c39" class="tk">rtliGetLogInfo</a>(<a id="2996c54" class="tk">li</a>);</td></tr>
<tr name="2997" id="2997">
<td><a id="l2997" class='ln'>2997</a></td><td> <a id="2997c9" class="tk">LogVar</a> <a id="2997c17" class="tk">*</a><a id="2997c18" class="tk">varList</a> = <a id="2997c28" class="tk">logInfo</a>-&gt;<a id="2997c37" class="tk">logVarsList</a>;</td></tr>
<tr name="2998" id="2998">
<td><a id="l2998" class='ln'>2998</a></td><td></td></tr>
<tr name="2999" id="2999">
<td><a id="l2999" class='ln'>2999</a></td><td> <span class="kw">if</span> (<a id="2999c13" class="tk">varList</a> <a id="2999c21" class="tk">!=</a> <a id="2999c24" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3000" id="3000">
<td><a id="l3000" class='ln'>3000</a></td><td> <span class="kw">while</span> (<a id="3000c20" class="tk">varList</a>-&gt;<a id="3000c29" class="tk">next</a> <a id="3000c34" class="tk">!=</a> <a id="3000c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3001" id="3001">
<td><a id="l3001" class='ln'>3001</a></td><td> <a id="3001c17" class="tk">varList</a> = <a id="3001c27" class="tk">varList</a>-&gt;<a id="3001c36" class="tk">next</a>;</td></tr>
<tr name="3002" id="3002">
<td><a id="l3002" class='ln'>3002</a></td><td> <span class="br">}</span></td></tr>
<tr name="3003" id="3003">
<td><a id="l3003" class='ln'>3003</a></td><td> <a id="3003c13" class="tk">varList</a>-&gt;<a id="3003c22" class="tk">next</a> = <a id="3003c29" class="tk">var</a>;</td></tr>
<tr name="3004" id="3004">
<td><a id="l3004" class='ln'>3004</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3005" id="3005">
<td><a id="l3005" class='ln'>3005</a></td><td> <a id="3005c13" class="tk">logInfo</a>-&gt;<a id="3005c22" class="tk">logVarsList</a> = <a id="3005c36" class="tk">var</a>;</td></tr>
<tr name="3006" id="3006">
<td><a id="l3006" class='ln'>3006</a></td><td> <span class="br">}</span></td></tr>
<tr name="3007" id="3007">
<td><a id="l3007" class='ln'>3007</a></td><td> <span class="br">}</span></td></tr>
<tr name="3008" id="3008">
<td><a id="l3008" class='ln'>3008</a></td><td></td></tr>
<tr name="3009" id="3009">
<td><a id="l3009" class='ln'>3009</a></td><td> <span class="kw">return</span>(<a id="3009c12" class="tk">var</a>); <span class="ct">/* NORMAL_EXIT */</span></td></tr>
<tr name="3010" id="3010">
<td><a id="l3010" class='ln'>3010</a></td><td></td></tr>
<tr name="3011" id="3011">
<td><a id="l3011" class='ln'>3011</a></td><td> <a id="3011c2" class="tk">ERROR_EXIT</a><a id="3011c12" class="tk">:</a></td></tr>
<tr name="3012" id="3012">
<td><a id="l3012" class='ln'>3012</a></td><td> </td></tr>
<tr name="3013" id="3013">
<td><a id="l3013" class='ln'>3013</a></td><td> <a id="3013c5" class="tk">*</a><a id="3013c6" class="tk">errStatus</a> = <a id="3013c18" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="3014" id="3014">
<td><a id="l3014" class='ln'>3014</a></td><td> <a id="3014c5" class="tk">rt_DestroyLogVar</a>(<a id="3014c22" class="tk">var</a>);</td></tr>
<tr name="3015" id="3015">
<td><a id="l3015" class='ln'>3015</a></td><td> <span class="kw">return</span>(<a id="3015c12" class="tk">NULL</a>);</td></tr>
<tr name="3016" id="3016">
<td><a id="l3016" class='ln'>3016</a></td><td></td></tr>
<tr name="3017" id="3017">
<td><a id="l3017" class='ln'>3017</a></td><td><span class="br">}</span> <span class="ct">/* end rt_CreateLogVarWithConvert */</span></td></tr>
<tr name="3018" id="3018">
<td><a id="l3018" class='ln'>3018</a></td><td></td></tr>
<tr name="3019" id="3019">
<td><a id="l3019" class='ln'>3019</a></td><td></td></tr>
<tr name="3020" id="3020">
<td><a id="l3020" class='ln'>3020</a></td><td><span class="pp">#ifdef</span> <a id="3020c8" class="tk">__cplusplus</a></td></tr>
<tr name="3021" id="3021">
<td><a id="l3021" class='ln'>3021</a></td><td><span class="br">}</span></td></tr>
<tr name="3022" id="3022">
<td><a id="l3022" class='ln'>3022</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3023" id="3023">
<td><a id="l3023" class='ln'>3023</a></td><td></td></tr>
<tr name="3024" id="3024">
<td><a id="l3024" class='ln'>3024</a></td><td></td></tr>
<tr name="3025" id="3025">
<td><a id="l3025" class='ln'>3025</a></td><td></td></tr>
<tr name="3026" id="3026">
<td><a id="l3026" class='ln'>3026</a></td><td></td></tr>
<tr name="3027" id="3027">
<td><a id="l3027" class='ln'>3027</a></td><td><span class="pp">#ifdef</span> <a id="3027c8" class="tk">__cplusplus</a></td></tr>
<tr name="3028" id="3028">
<td><a id="l3028" class='ln'>3028</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3029" id="3029">
<td><a id="l3029" class='ln'>3029</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3030" id="3030">
<td><a id="l3030" class='ln'>3030</a></td><td></td></tr>
<tr name="3031" id="3031">
<td><a id="l3031" class='ln'>3031</a></td><td></td></tr>
<tr name="3032" id="3032">
<td><a id="l3032" class='ln'>3032</a></td><td><span class="ct">/* Function: rt_CreateLogVar ===================================================</span></td></tr>
<tr name="3033" id="3033">
<td><a id="l3033" class='ln'>3033</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3034" id="3034">
<td><a id="l3034" class='ln'>3034</a></td><td><span class="ct"> * Create a logging variable.</span></td></tr>
<tr name="3035" id="3035">
<td><a id="l3035" class='ln'>3035</a></td><td><span class="ct"> *</span></td></tr>
<tr name="3036" id="3036">
<td><a id="l3036" class='ln'>3036</a></td><td><span class="ct"> * Returns:</span></td></tr>
<tr name="3037" id="3037">
<td><a id="l3037" class='ln'>3037</a></td><td><span class="ct"> * ~= NULL =&gt; success, returns the log variable created.</span></td></tr>
<tr name="3038" id="3038">
<td><a id="l3038" class='ln'>3038</a></td><td><span class="ct"> * == NULL =&gt; failure, error message set in the simstruct.</span></td></tr>
<tr name="3039" id="3039">
<td><a id="l3039" class='ln'>3039</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3040" id="3040">
<td><a id="l3040" class='ln'>3040</a></td><td><a id="3040c1" class="tk">LogVar</a> <a id="3040c8" class="tk">*</a><a id="3040c9" class="tk">rt_CreateLogVar</a>(<a id="3040c25" class="tk">RTWLogInfo</a> <a id="3040c43" class="tk">*</a><a id="3040c44" class="tk">li</a>,</td></tr>
<tr name="3041" id="3041">
<td><a id="l3041" class='ln'>3041</a></td><td> <span class="kw">const</span> <a id="3041c38" class="tk">real_T</a> <a id="3041c50" class="tk">startTime</a>,</td></tr>
<tr name="3042" id="3042">
<td><a id="l3042" class='ln'>3042</a></td><td> <span class="kw">const</span> <a id="3042c38" class="tk">real_T</a> <a id="3042c50" class="tk">finalTime</a>,</td></tr>
<tr name="3043" id="3043">
<td><a id="l3043" class='ln'>3043</a></td><td> <span class="kw">const</span> <a id="3043c38" class="tk">real_T</a> <a id="3043c50" class="tk">inStepSize</a>,</td></tr>
<tr name="3044" id="3044">
<td><a id="l3044" class='ln'>3044</a></td><td> <span class="kw">const</span> <a id="3044c38" class="tk">char_T</a> <a id="3044c50" class="tk">*</a><a id="3044c51" class="tk">*</a><a id="3044c52" class="tk">errStatus</a>,</td></tr>
<tr name="3045" id="3045">
<td><a id="l3045" class='ln'>3045</a></td><td> <span class="kw">const</span> <a id="3045c38" class="tk">char_T</a> <a id="3045c50" class="tk">*</a><a id="3045c51" class="tk">varName</a>,</td></tr>
<tr name="3046" id="3046">
<td><a id="l3046" class='ln'>3046</a></td><td> <a id="3046c32" class="tk">BuiltInDTypeId</a> <a id="3046c50" class="tk">inpDataTypeID</a>,</td></tr>
<tr name="3047" id="3047">
<td><a id="l3047" class='ln'>3047</a></td><td> <a id="3047c32" class="tk">int_T</a> <a id="3047c50" class="tk">logical</a>,</td></tr>
<tr name="3048" id="3048">
<td><a id="l3048" class='ln'>3048</a></td><td> <a id="3048c32" class="tk">int_T</a> <a id="3048c50" class="tk">complex</a>,</td></tr>
<tr name="3049" id="3049">
<td><a id="l3049" class='ln'>3049</a></td><td> <a id="3049c32" class="tk">int_T</a> <a id="3049c50" class="tk">frameData</a>,</td></tr>
<tr name="3050" id="3050">
<td><a id="l3050" class='ln'>3050</a></td><td> <a id="3050c32" class="tk">int_T</a> <a id="3050c50" class="tk">nCols</a>,</td></tr>
<tr name="3051" id="3051">
<td><a id="l3051" class='ln'>3051</a></td><td> <a id="3051c32" class="tk">int_T</a> <a id="3051c50" class="tk">nDims</a>,</td></tr>
<tr name="3052" id="3052">
<td><a id="l3052" class='ln'>3052</a></td><td> <span class="kw">const</span> <a id="3052c38" class="tk">int_T</a> <a id="3052c50" class="tk">*</a><a id="3052c51" class="tk">dims</a>,</td></tr>
<tr name="3053" id="3053">
<td><a id="l3053" class='ln'>3053</a></td><td> <a id="3053c32" class="tk">LogValDimsStat</a> <a id="3053c50" class="tk">logValDimsStat</a>,</td></tr>
<tr name="3054" id="3054">
<td><a id="l3054" class='ln'>3054</a></td><td> <span class="kw">void</span> <a id="3054c50" class="tk">*</a><a id="3054c51" class="tk">*</a><a id="3054c52" class="tk">currSigDims</a>,</td></tr>
<tr name="3055" id="3055">
<td><a id="l3055" class='ln'>3055</a></td><td> <a id="3055c32" class="tk">int_T</a> <a id="3055c50" class="tk">*</a><a id="3055c51" class="tk">currSigDimsSize</a>,</td></tr>
<tr name="3056" id="3056">
<td><a id="l3056" class='ln'>3056</a></td><td> <a id="3056c32" class="tk">int_T</a> <a id="3056c50" class="tk">maxRows</a>,</td></tr>
<tr name="3057" id="3057">
<td><a id="l3057" class='ln'>3057</a></td><td> <a id="3057c32" class="tk">int_T</a> <a id="3057c50" class="tk">decimation</a>,</td></tr>
<tr name="3058" id="3058">
<td><a id="l3058" class='ln'>3058</a></td><td> <a id="3058c32" class="tk">real_T</a> <a id="3058c50" class="tk">sampleTime</a>,</td></tr>
<tr name="3059" id="3059">
<td><a id="l3059" class='ln'>3059</a></td><td> <a id="3059c32" class="tk">int_T</a> <a id="3059c50" class="tk">appendToLogVarsList</a>)</td></tr>
<tr name="3060" id="3060">
<td><a id="l3060" class='ln'>3060</a></td><td><span class="br">{</span></td></tr>
<tr name="3061" id="3061">
<td><a id="l3061" class='ln'>3061</a></td><td> <span class="kw">const</span> <a id="3061c11" class="tk">RTWLogDataTypeConvert</a> <a id="3061c33" class="tk">*</a><a id="3061c34" class="tk">pDataTypeConvertInfo</a> = <a id="3061c57" class="tk">NULL</a>;</td></tr>
<tr name="3062" id="3062">
<td><a id="l3062" class='ln'>3062</a></td><td></td></tr>
<tr name="3063" id="3063">
<td><a id="l3063" class='ln'>3063</a></td><td> <span class="kw">return</span> <a id="3063c12" class="tk">rt_CreateLogVarWithConvert</a>(<a id="3063c39" class="tk">li</a>,</td></tr>
<tr name="3064" id="3064">
<td><a id="l3064" class='ln'>3064</a></td><td> <a id="3064c39" class="tk">startTime</a>,</td></tr>
<tr name="3065" id="3065">
<td><a id="l3065" class='ln'>3065</a></td><td> <a id="3065c39" class="tk">finalTime</a>,</td></tr>
<tr name="3066" id="3066">
<td><a id="l3066" class='ln'>3066</a></td><td> <a id="3066c39" class="tk">inStepSize</a>,</td></tr>
<tr name="3067" id="3067">
<td><a id="l3067" class='ln'>3067</a></td><td> <a id="3067c39" class="tk">errStatus</a>,</td></tr>
<tr name="3068" id="3068">
<td><a id="l3068" class='ln'>3068</a></td><td> <a id="3068c39" class="tk">varName</a>,</td></tr>
<tr name="3069" id="3069">
<td><a id="l3069" class='ln'>3069</a></td><td> <a id="3069c39" class="tk">inpDataTypeID</a>,</td></tr>
<tr name="3070" id="3070">
<td><a id="l3070" class='ln'>3070</a></td><td> <a id="3070c39" class="tk">pDataTypeConvertInfo</a>,</td></tr>
<tr name="3071" id="3071">
<td><a id="l3071" class='ln'>3071</a></td><td> <a id="3071c39" class="tk">logical</a>,</td></tr>
<tr name="3072" id="3072">
<td><a id="l3072" class='ln'>3072</a></td><td> <a id="3072c39" class="tk">complex</a>,</td></tr>
<tr name="3073" id="3073">
<td><a id="l3073" class='ln'>3073</a></td><td> <a id="3073c39" class="tk">frameData</a>,</td></tr>
<tr name="3074" id="3074">
<td><a id="l3074" class='ln'>3074</a></td><td> <a id="3074c39" class="tk">nCols</a>,</td></tr>
<tr name="3075" id="3075">
<td><a id="l3075" class='ln'>3075</a></td><td> <a id="3075c39" class="tk">nDims</a>,</td></tr>
<tr name="3076" id="3076">
<td><a id="l3076" class='ln'>3076</a></td><td> <a id="3076c39" class="tk">dims</a>,</td></tr>
<tr name="3077" id="3077">
<td><a id="l3077" class='ln'>3077</a></td><td> <a id="3077c39" class="tk">logValDimsStat</a>,</td></tr>
<tr name="3078" id="3078">
<td><a id="l3078" class='ln'>3078</a></td><td> <a id="3078c39" class="tk">currSigDims</a>,</td></tr>
<tr name="3079" id="3079">
<td><a id="l3079" class='ln'>3079</a></td><td> <a id="3079c39" class="tk">currSigDimsSize</a>,</td></tr>
<tr name="3080" id="3080">
<td><a id="l3080" class='ln'>3080</a></td><td> <a id="3080c39" class="tk">maxRows</a>,</td></tr>
<tr name="3081" id="3081">
<td><a id="l3081" class='ln'>3081</a></td><td> <a id="3081c39" class="tk">decimation</a>,</td></tr>
<tr name="3082" id="3082">
<td><a id="l3082" class='ln'>3082</a></td><td> <a id="3082c39" class="tk">sampleTime</a>,</td></tr>
<tr name="3083" id="3083">
<td><a id="l3083" class='ln'>3083</a></td><td> <a id="3083c39" class="tk">appendToLogVarsList</a>);</td></tr>
<tr name="3084" id="3084">
<td><a id="l3084" class='ln'>3084</a></td><td></td></tr>
<tr name="3085" id="3085">
<td><a id="l3085" class='ln'>3085</a></td><td><span class="br">}</span> <span class="ct">/* end rt_CreateLogVar */</span></td></tr>
<tr name="3086" id="3086">
<td><a id="l3086" class='ln'>3086</a></td><td></td></tr>
<tr name="3087" id="3087">
<td><a id="l3087" class='ln'>3087</a></td><td></td></tr>
<tr name="3088" id="3088">
<td><a id="l3088" class='ln'>3088</a></td><td><span class="pp">#ifdef</span> <a id="3088c8" class="tk">__cplusplus</a></td></tr>
<tr name="3089" id="3089">
<td><a id="l3089" class='ln'>3089</a></td><td><span class="br">}</span></td></tr>
<tr name="3090" id="3090">
<td><a id="l3090" class='ln'>3090</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3091" id="3091">
<td><a id="l3091" class='ln'>3091</a></td><td></td></tr>
<tr name="3092" id="3092">
<td><a id="l3092" class='ln'>3092</a></td><td></td></tr>
<tr name="3093" id="3093">
<td><a id="l3093" class='ln'>3093</a></td><td></td></tr>
<tr name="3094" id="3094">
<td><a id="l3094" class='ln'>3094</a></td><td></td></tr>
<tr name="3095" id="3095">
<td><a id="l3095" class='ln'>3095</a></td><td><span class="pp">#ifdef</span> <a id="3095c8" class="tk">__cplusplus</a></td></tr>
<tr name="3096" id="3096">
<td><a id="l3096" class='ln'>3096</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3097" id="3097">
<td><a id="l3097" class='ln'>3097</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3098" id="3098">
<td><a id="l3098" class='ln'>3098</a></td><td></td></tr>
<tr name="3099" id="3099">
<td><a id="l3099" class='ln'>3099</a></td><td></td></tr>
<tr name="3100" id="3100">
<td><a id="l3100" class='ln'>3100</a></td><td><span class="ct">/* Function: rt_CreateStructLogVar =============================================</span></td></tr>
<tr name="3101" id="3101">
<td><a id="l3101" class='ln'>3101</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3102" id="3102">
<td><a id="l3102" class='ln'>3102</a></td><td><span class="ct"> * Create a logging variable in the structure format.</span></td></tr>
<tr name="3103" id="3103">
<td><a id="l3103" class='ln'>3103</a></td><td><span class="ct"> *</span></td></tr>
<tr name="3104" id="3104">
<td><a id="l3104" class='ln'>3104</a></td><td><span class="ct"> * Returns:</span></td></tr>
<tr name="3105" id="3105">
<td><a id="l3105" class='ln'>3105</a></td><td><span class="ct"> * ~= NULL =&gt; success, returns the log variable created.</span></td></tr>
<tr name="3106" id="3106">
<td><a id="l3106" class='ln'>3106</a></td><td><span class="ct"> * == NULL =&gt; failure, error message set in the simstruct.</span></td></tr>
<tr name="3107" id="3107">
<td><a id="l3107" class='ln'>3107</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3108" id="3108">
<td><a id="l3108" class='ln'>3108</a></td><td><a id="3108c1" class="tk">StructLogVar</a> <a id="3108c14" class="tk">*</a><a id="3108c15" class="tk">rt_CreateStructLogVar</a>(<a id="3108c37" class="tk">RTWLogInfo</a> <a id="3108c61" class="tk">*</a><a id="3108c62" class="tk">li</a>,</td></tr>
<tr name="3109" id="3109">
<td><a id="l3109" class='ln'>3109</a></td><td> <span class="kw">const</span> <a id="3109c50" class="tk">real_T</a> <a id="3109c68" class="tk">startTime</a>,</td></tr>
<tr name="3110" id="3110">
<td><a id="l3110" class='ln'>3110</a></td><td> <span class="kw">const</span> <a id="3110c50" class="tk">real_T</a> <a id="3110c68" class="tk">finalTime</a>,</td></tr>
<tr name="3111" id="3111">
<td><a id="l3111" class='ln'>3111</a></td><td> <span class="kw">const</span> <a id="3111c50" class="tk">real_T</a> <a id="3111c68" class="tk">inStepSize</a>,</td></tr>
<tr name="3112" id="3112">
<td><a id="l3112" class='ln'>3112</a></td><td> <span class="kw">const</span> <a id="3112c50" class="tk">char_T</a> <a id="3112c68" class="tk">*</a><a id="3112c69" class="tk">*</a><a id="3112c70" class="tk">errStatus</a>,</td></tr>
<tr name="3113" id="3113">
<td><a id="l3113" class='ln'>3113</a></td><td> <span class="kw">const</span> <a id="3113c50" class="tk">char_T</a> <a id="3113c68" class="tk">*</a><a id="3113c69" class="tk">varName</a>,</td></tr>
<tr name="3114" id="3114">
<td><a id="l3114" class='ln'>3114</a></td><td> <a id="3114c44" class="tk">boolean_T</a> <a id="3114c68" class="tk">logTime</a>,</td></tr>
<tr name="3115" id="3115">
<td><a id="l3115" class='ln'>3115</a></td><td> <a id="3115c44" class="tk">int_T</a> <a id="3115c68" class="tk">maxRows</a>,</td></tr>
<tr name="3116" id="3116">
<td><a id="l3116" class='ln'>3116</a></td><td> <a id="3116c44" class="tk">int_T</a> <a id="3116c68" class="tk">decimation</a>,</td></tr>
<tr name="3117" id="3117">
<td><a id="l3117" class='ln'>3117</a></td><td> <a id="3117c44" class="tk">real_T</a> <a id="3117c68" class="tk">sampleTime</a>,</td></tr>
<tr name="3118" id="3118">
<td><a id="l3118" class='ln'>3118</a></td><td> <span class="kw">const</span> <a id="3118c50" class="tk">RTWLogSignalInfo</a> <a id="3118c68" class="tk">*</a><a id="3118c69" class="tk">sigInfo</a>,</td></tr>
<tr name="3119" id="3119">
<td><a id="l3119" class='ln'>3119</a></td><td> <span class="kw">const</span> <a id="3119c50" class="tk">char_T</a> <a id="3119c68" class="tk">*</a><a id="3119c69" class="tk">blockName</a>)</td></tr>
<tr name="3120" id="3120">
<td><a id="l3120" class='ln'>3120</a></td><td><span class="br">{</span></td></tr>
<tr name="3121" id="3121">
<td><a id="l3121" class='ln'>3121</a></td><td></td></tr>
<tr name="3122" id="3122">
<td><a id="l3122" class='ln'>3122</a></td><td> <span class="kw">return</span>( <a id="3122c13" class="tk">local_CreateStructLogVar</a>(<a id="3122c38" class="tk">li</a>,</td></tr>
<tr name="3123" id="3123">
<td><a id="l3123" class='ln'>3123</a></td><td> <a id="3123c38" class="tk">startTime</a>,</td></tr>
<tr name="3124" id="3124">
<td><a id="l3124" class='ln'>3124</a></td><td> <a id="3124c38" class="tk">finalTime</a>,</td></tr>
<tr name="3125" id="3125">
<td><a id="l3125" class='ln'>3125</a></td><td> <a id="3125c38" class="tk">inStepSize</a>,</td></tr>
<tr name="3126" id="3126">
<td><a id="l3126" class='ln'>3126</a></td><td> <a id="3126c38" class="tk">errStatus</a>,</td></tr>
<tr name="3127" id="3127">
<td><a id="l3127" class='ln'>3127</a></td><td> <a id="3127c38" class="tk">varName</a>,</td></tr>
<tr name="3128" id="3128">
<td><a id="l3128" class='ln'>3128</a></td><td> <a id="3128c38" class="tk">logTime</a>,</td></tr>
<tr name="3129" id="3129">
<td><a id="l3129" class='ln'>3129</a></td><td> <a id="3129c38" class="tk">maxRows</a>,</td></tr>
<tr name="3130" id="3130">
<td><a id="l3130" class='ln'>3130</a></td><td> <a id="3130c38" class="tk">decimation</a>,</td></tr>
<tr name="3131" id="3131">
<td><a id="l3131" class='ln'>3131</a></td><td> <a id="3131c38" class="tk">sampleTime</a>,</td></tr>
<tr name="3132" id="3132">
<td><a id="l3132" class='ln'>3132</a></td><td> <a id="3132c38" class="tk">sigInfo</a>,</td></tr>
<tr name="3133" id="3133">
<td><a id="l3133" class='ln'>3133</a></td><td> <a id="3133c38" class="tk">blockName</a>));</td></tr>
<tr name="3134" id="3134">
<td><a id="l3134" class='ln'>3134</a></td><td></td></tr>
<tr name="3135" id="3135">
<td><a id="l3135" class='ln'>3135</a></td><td><span class="br">}</span> <span class="ct">/* end rt_CreateStructLogVar */</span></td></tr>
<tr name="3136" id="3136">
<td><a id="l3136" class='ln'>3136</a></td><td></td></tr>
<tr name="3137" id="3137">
<td><a id="l3137" class='ln'>3137</a></td><td></td></tr>
<tr name="3138" id="3138">
<td><a id="l3138" class='ln'>3138</a></td><td><span class="pp">#ifdef</span> <a id="3138c8" class="tk">__cplusplus</a></td></tr>
<tr name="3139" id="3139">
<td><a id="l3139" class='ln'>3139</a></td><td><span class="br">}</span></td></tr>
<tr name="3140" id="3140">
<td><a id="l3140" class='ln'>3140</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3141" id="3141">
<td><a id="l3141" class='ln'>3141</a></td><td></td></tr>
<tr name="3142" id="3142">
<td><a id="l3142" class='ln'>3142</a></td><td></td></tr>
<tr name="3143" id="3143">
<td><a id="l3143" class='ln'>3143</a></td><td></td></tr>
<tr name="3144" id="3144">
<td><a id="l3144" class='ln'>3144</a></td><td></td></tr>
<tr name="3145" id="3145">
<td><a id="l3145" class='ln'>3145</a></td><td><span class="pp">#ifdef</span> <a id="3145c8" class="tk">__cplusplus</a></td></tr>
<tr name="3146" id="3146">
<td><a id="l3146" class='ln'>3146</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3147" id="3147">
<td><a id="l3147" class='ln'>3147</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3148" id="3148">
<td><a id="l3148" class='ln'>3148</a></td><td></td></tr>
<tr name="3149" id="3149">
<td><a id="l3149" class='ln'>3149</a></td><td> </td></tr>
<tr name="3150" id="3150">
<td><a id="l3150" class='ln'>3150</a></td><td><span class="ct">/* Function: rt_StartDataLoggingWithStartTime ==================================</span></td></tr>
<tr name="3151" id="3151">
<td><a id="l3151" class='ln'>3151</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3152" id="3152">
<td><a id="l3152" class='ln'>3152</a></td><td><span class="ct"> * Initialize data logging info based upon the following settings cached</span></td></tr>
<tr name="3153" id="3153">
<td><a id="l3153" class='ln'>3153</a></td><td><span class="ct"> * in the RTWLogging data structure of the SimStruct.</span></td></tr>
<tr name="3154" id="3154">
<td><a id="l3154" class='ln'>3154</a></td><td><span class="ct"> *</span></td></tr>
<tr name="3155" id="3155">
<td><a id="l3155" class='ln'>3155</a></td><td><span class="ct"> * Return value is:</span></td></tr>
<tr name="3156" id="3156">
<td><a id="l3156" class='ln'>3156</a></td><td><span class="ct"> * == NULL =&gt; success</span></td></tr>
<tr name="3157" id="3157">
<td><a id="l3157" class='ln'>3157</a></td><td><span class="ct"> * != NULL =&gt; failure (the return value is a pointer that points to the</span></td></tr>
<tr name="3158" id="3158">
<td><a id="l3158" class='ln'>3158</a></td><td><span class="ct"> * error message, which is also set in the simstruct)</span></td></tr>
<tr name="3159" id="3159">
<td><a id="l3159" class='ln'>3159</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3160" id="3160">
<td><a id="l3160" class='ln'>3160</a></td><td><span class="kw">const</span> <a id="3160c7" class="tk">char_T</a> <a id="3160c14" class="tk">*</a><a id="3160c15" class="tk">rt_StartDataLoggingWithStartTime</a>(<a id="3160c48" class="tk">RTWLogInfo</a> <a id="3160c61" class="tk">*</a><a id="3160c62" class="tk">li</a>,</td></tr>
<tr name="3161" id="3161">
<td><a id="l3161" class='ln'>3161</a></td><td> <span class="kw">const</span> <a id="3161c61" class="tk">real_T</a> <a id="3161c68" class="tk">startTime</a>,</td></tr>
<tr name="3162" id="3162">
<td><a id="l3162" class='ln'>3162</a></td><td> <span class="kw">const</span> <a id="3162c61" class="tk">real_T</a> <a id="3162c68" class="tk">finalTime</a>,</td></tr>
<tr name="3163" id="3163">
<td><a id="l3163" class='ln'>3163</a></td><td> <span class="kw">const</span> <a id="3163c61" class="tk">real_T</a> <a id="3163c68" class="tk">stepSize</a>,</td></tr>
<tr name="3164" id="3164">
<td><a id="l3164" class='ln'>3164</a></td><td> <span class="kw">const</span> <a id="3164c61" class="tk">char_T</a> <a id="3164c68" class="tk">*</a><a id="3164c69" class="tk">*</a><a id="3164c70" class="tk">errStatus</a>)</td></tr>
<tr name="3165" id="3165">
<td><a id="l3165" class='ln'>3165</a></td><td><span class="br">{</span></td></tr>
<tr name="3166" id="3166">
<td><a id="l3166" class='ln'>3166</a></td><td> <span class="kw">const</span> <a id="3166c11" class="tk">char_T</a> <a id="3166c20" class="tk">*</a><a id="3166c21" class="tk">varName</a>;</td></tr>
<tr name="3167" id="3167">
<td><a id="l3167" class='ln'>3167</a></td><td> <a id="3167c5" class="tk">LogInfo</a> <a id="3167c20" class="tk">*</a><a id="3167c21" class="tk">logInfo</a>;</td></tr>
<tr name="3168" id="3168">
<td><a id="l3168" class='ln'>3168</a></td><td> <a id="3168c5" class="tk">real_T</a> <a id="3168c20" class="tk">sampleTime</a> = <a id="3168c33" class="tk">stepSize</a>;</td></tr>
<tr name="3169" id="3169">
<td><a id="l3169" class='ln'>3169</a></td><td> <a id="3169c5" class="tk">int_T</a> <a id="3169c20" class="tk">maxRows</a> = <a id="3169c33" class="tk">rtliGetLogMaxRows</a>(<a id="3169c51" class="tk">li</a>);</td></tr>
<tr name="3170" id="3170">
<td><a id="l3170" class='ln'>3170</a></td><td> <a id="3170c5" class="tk">int_T</a> <a id="3170c20" class="tk">decimation</a> = <a id="3170c33" class="tk">rtliGetLogDecimation</a>(<a id="3170c54" class="tk">li</a>);</td></tr>
<tr name="3171" id="3171">
<td><a id="l3171" class='ln'>3171</a></td><td> <a id="3171c5" class="tk">int_T</a> <a id="3171c20" class="tk">logFormat</a> = <a id="3171c33" class="tk">rtliGetLogFormat</a>(<a id="3171c50" class="tk">li</a>);</td></tr>
<tr name="3172" id="3172">
<td><a id="l3172" class='ln'>3172</a></td><td> <a id="3172c5" class="tk">boolean_T</a> <a id="3172c20" class="tk">logTime</a> = (<a id="3172c34" class="tk">logFormat</a><a id="3172c43" class="tk">==</a>2) <a id="3172c48" class="tk">?</a> 1 <a id="3172c52" class="tk">:</a> 0;</td></tr>
<tr name="3173" id="3173">
<td><a id="l3173" class='ln'>3173</a></td><td></td></tr>
<tr name="3174" id="3174">
<td><a id="l3174" class='ln'>3174</a></td><td> <span class="ct">/* reset error status */</span></td></tr>
<tr name="3175" id="3175">
<td><a id="l3175" class='ln'>3175</a></td><td> <a id="3175c5" class="tk">*</a><a id="3175c6" class="tk">errStatus</a> = <a id="3175c18" class="tk">NULL</a>;</td></tr>
<tr name="3176" id="3176">
<td><a id="l3176" class='ln'>3176</a></td><td></td></tr>
<tr name="3177" id="3177">
<td><a id="l3177" class='ln'>3177</a></td><td> <span class="kw">if</span> ((<a id="3177c10" class="tk">logInfo</a>=<a id="3177c18" class="tk">calloc</a>(1,<span class="kw">sizeof</span>(<a id="3177c34" class="tk">LogInfo</a>))) <a id="3177c45" class="tk">==</a> <a id="3177c48" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3178" id="3178">
<td><a id="l3178" class='ln'>3178</a></td><td> <a id="3178c9" class="tk">*</a><a id="3178c10" class="tk">errStatus</a> = <a id="3178c22" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="3179" id="3179">
<td><a id="l3179" class='ln'>3179</a></td><td> <span class="kw">goto</span> <a id="3179c14" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3180" id="3180">
<td><a id="l3180" class='ln'>3180</a></td><td> <span class="br">}</span></td></tr>
<tr name="3181" id="3181">
<td><a id="l3181" class='ln'>3181</a></td><td> <a id="3181c5" class="tk">rtliSetLogInfo</a>(<a id="3181c20" class="tk">li</a>, (<span class="kw">void</span><a id="3181c29" class="tk">*</a>)<a id="3181c31" class="tk">logInfo</a>);</td></tr>
<tr name="3182" id="3182">
<td><a id="l3182" class='ln'>3182</a></td><td></td></tr>
<tr name="3183" id="3183">
<td><a id="l3183" class='ln'>3183</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="3184" id="3184">
<td><a id="l3184" class='ln'>3184</a></td><td> <a id="3184c5" class="tk">varName</a> = <a id="3184c15" class="tk">rtliGetLogT</a>(<a id="3184c27" class="tk">li</a>);</td></tr>
<tr name="3185" id="3185">
<td><a id="l3185" class='ln'>3185</a></td><td> <span class="kw">if</span> (<a id="3185c9" class="tk">varName</a>[0] <a id="3185c20" class="tk">!=</a> '\0') <span class="br">{</span></td></tr>
<tr name="3186" id="3186">
<td><a id="l3186" class='ln'>3186</a></td><td> <a id="3186c9" class="tk">int_T</a> <a id="3186c15" class="tk">dims</a> = 1;</td></tr>
<tr name="3187" id="3187">
<td><a id="l3187" class='ln'>3187</a></td><td> <a id="3187c9" class="tk">logInfo</a>-&gt;<a id="3187c18" class="tk">t</a> = <a id="3187c22" class="tk">rt_CreateLogVarWithConvert</a>(<a id="3187c49" class="tk">li</a>, <a id="3187c53" class="tk">startTime</a>, <a id="3187c64" class="tk">finalTime</a>,</td></tr>
<tr name="3188" id="3188">
<td><a id="l3188" class='ln'>3188</a></td><td> <a id="3188c49" class="tk">stepSize</a>, <a id="3188c59" class="tk">errStatus</a>,</td></tr>
<tr name="3189" id="3189">
<td><a id="l3189" class='ln'>3189</a></td><td> <a id="3189c49" class="tk">varName</a>,<a id="3189c57" class="tk">SS_DOUBLE</a>,</td></tr>
<tr name="3190" id="3190">
<td><a id="l3190" class='ln'>3190</a></td><td> <a id="3190c49" class="tk">NULL</a>,</td></tr>
<tr name="3191" id="3191">
<td><a id="l3191" class='ln'>3191</a></td><td> 0,0,0,1,1,</td></tr>
<tr name="3192" id="3192">
<td><a id="l3192" class='ln'>3192</a></td><td> <a id="3192c49" class="tk">&amp;</a><a id="3192c50" class="tk">dims</a>, <a id="3192c56" class="tk">NO_LOGVALDIMS</a>, <a id="3192c71" class="tk">NULL</a>, <a id="3192c77" class="tk">NULL</a>,</td></tr>
<tr name="3193" id="3193">
<td><a id="l3193" class='ln'>3193</a></td><td> <a id="3193c49" class="tk">maxRows</a>,<a id="3193c57" class="tk">decimation</a>,</td></tr>
<tr name="3194" id="3194">
<td><a id="l3194" class='ln'>3194</a></td><td> <a id="3194c49" class="tk">sampleTime</a>,1);</td></tr>
<tr name="3195" id="3195">
<td><a id="l3195" class='ln'>3195</a></td><td> <span class="kw">if</span> (<a id="3195c13" class="tk">logInfo</a>-&gt;<a id="3195c22" class="tk">t</a> <a id="3195c24" class="tk">==</a> <a id="3195c27" class="tk">NULL</a>) <span class="kw">goto</span> <a id="3195c38" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3196" id="3196">
<td><a id="l3196" class='ln'>3196</a></td><td> <span class="br">}</span></td></tr>
<tr name="3197" id="3197">
<td><a id="l3197" class='ln'>3197</a></td><td></td></tr>
<tr name="3198" id="3198">
<td><a id="l3198" class='ln'>3198</a></td><td> <span class="ct">/* states */</span></td></tr>
<tr name="3199" id="3199">
<td><a id="l3199" class='ln'>3199</a></td><td> <span class="kw">if</span> ( <a id="3199c10" class="tk">rtliGetLogX</a>(<a id="3199c22" class="tk">li</a>)[0] <a id="3199c29" class="tk">!=</a> '\0' <a id="3199c37" class="tk">||</a> <a id="3199c41" class="tk">rtliGetLogXFinal</a>(<a id="3199c58" class="tk">li</a>)[0] <a id="3199c65" class="tk">!=</a> '\0' ) <span class="br">{</span></td></tr>
<tr name="3200" id="3200">
<td><a id="l3200" class='ln'>3200</a></td><td> <span class="kw">const</span> <a id="3200c15" class="tk">RTWLogSignalInfo</a> <a id="3200c33" class="tk">*</a><a id="3200c34" class="tk">xInfo</a> = <a id="3200c42" class="tk">rtliGetLogXSignalInfo</a>(<a id="3200c64" class="tk">li</a>);</td></tr>
<tr name="3201" id="3201">
<td><a id="l3201" class='ln'>3201</a></td><td></td></tr>
<tr name="3202" id="3202">
<td><a id="l3202" class='ln'>3202</a></td><td> <span class="kw">if</span> (<a id="3202c13" class="tk">logFormat</a> <a id="3202c23" class="tk">==</a> 0) <span class="br">{</span> <span class="ct">/* Matrix Format */</span></td></tr>
<tr name="3203" id="3203">
<td><a id="l3203" class='ln'>3203</a></td><td> <span class="kw">int</span> <a id="3203c28" class="tk">numCols</a>;</td></tr>
<tr name="3204" id="3204">
<td><a id="l3204" class='ln'>3204</a></td><td> <span class="kw">int</span> <a id="3204c28" class="tk">nDims</a>;</td></tr>
<tr name="3205" id="3205">
<td><a id="l3205" class='ln'>3205</a></td><td> <span class="kw">const</span> <span class="kw">int</span> <a id="3205c28" class="tk">*</a><a id="3205c29" class="tk">dims</a>;</td></tr>
<tr name="3206" id="3206">
<td><a id="l3206" class='ln'>3206</a></td><td> <a id="3206c13" class="tk">BuiltInDTypeId</a> <a id="3206c28" class="tk">dataType</a>;</td></tr>
<tr name="3207" id="3207">
<td><a id="l3207" class='ln'>3207</a></td><td> <span class="kw">int</span> <a id="3207c28" class="tk">isComplex</a>;</td></tr>
<tr name="3208" id="3208">
<td><a id="l3208" class='ln'>3208</a></td><td> <a id="3208c13" class="tk">int_T</a> <a id="3208c28" class="tk">sIdx</a>;</td></tr>
<tr name="3209" id="3209">
<td><a id="l3209" class='ln'>3209</a></td><td></td></tr>
<tr name="3210" id="3210">
<td><a id="l3210" class='ln'>3210</a></td><td> <span class="kw">const</span> <a id="3210c19" class="tk">RTWLogDataTypeConvert</a> <a id="3210c41" class="tk">*</a><a id="3210c42" class="tk">pDTConvInfo</a>;</td></tr>
<tr name="3211" id="3211">
<td><a id="l3211" class='ln'>3211</a></td><td></td></tr>
<tr name="3212" id="3212">
<td><a id="l3212" class='ln'>3212</a></td><td> <a id="3212c13" class="tk">numCols</a> = <a id="3212c23" class="tk">xInfo</a>[0].<a id="3212c32" class="tk">numCols</a> <a id="3212c40" class="tk">?</a> <a id="3212c42" class="tk">xInfo</a>[0].<a id="3212c51" class="tk">numCols</a>[0] <a id="3212c62" class="tk">:</a> 0;</td></tr>
<tr name="3213" id="3213">
<td><a id="l3213" class='ln'>3213</a></td><td> <span class="kw">for</span> (<a id="3213c18" class="tk">sIdx</a> = 1; <a id="3213c28" class="tk">sIdx</a> <a id="3213c33" class="tk">&lt;</a> <a id="3213c35" class="tk">xInfo</a>[0].<a id="3213c44" class="tk">numSignals</a>; <a id="3213c56" class="tk">sIdx</a><a id="3213c60" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="3214" id="3214">
<td><a id="l3214" class='ln'>3214</a></td><td> <a id="3214c17" class="tk">numCols</a> <a id="3214c25" class="tk">+=</a> <a id="3214c28" class="tk">xInfo</a>[0].<a id="3214c37" class="tk">numCols</a>[<a id="3214c45" class="tk">sIdx</a>];</td></tr>
<tr name="3215" id="3215">
<td><a id="l3215" class='ln'>3215</a></td><td> <span class="br">}</span></td></tr>
<tr name="3216" id="3216">
<td><a id="l3216" class='ln'>3216</a></td><td> <span class="ct">/* If we have only one "matrix" state, we can log as a matrix */</span></td></tr>
<tr name="3217" id="3217">
<td><a id="l3217" class='ln'>3217</a></td><td> <span class="kw">if</span> (<a id="3217c17" class="tk">xInfo</a>[0].<a id="3217c26" class="tk">numSignals</a> <a id="3217c37" class="tk">==</a> 1) <span class="br">{</span></td></tr>
<tr name="3218" id="3218">
<td><a id="l3218" class='ln'>3218</a></td><td> <a id="3218c17" class="tk">nDims</a> = <a id="3218c29" class="tk">xInfo</a>[0].<a id="3218c38" class="tk">numDims</a> <a id="3218c46" class="tk">?</a> <a id="3218c48" class="tk">xInfo</a>[0].<a id="3218c57" class="tk">numDims</a>[0] <a id="3218c68" class="tk">:</a> 1;</td></tr>
<tr name="3219" id="3219">
<td><a id="l3219" class='ln'>3219</a></td><td> <a id="3219c17" class="tk">dims</a> = <a id="3219c29" class="tk">xInfo</a>[0].<a id="3219c38" class="tk">dims</a>;</td></tr>
<tr name="3220" id="3220">
<td><a id="l3220" class='ln'>3220</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3221" id="3221">
<td><a id="l3221" class='ln'>3221</a></td><td> <a id="3221c17" class="tk">nDims</a> = 1;</td></tr>
<tr name="3222" id="3222">
<td><a id="l3222" class='ln'>3222</a></td><td> <a id="3222c17" class="tk">dims</a> = <a id="3222c29" class="tk">&amp;</a><a id="3222c30" class="tk">numCols</a>;</td></tr>
<tr name="3223" id="3223">
<td><a id="l3223" class='ln'>3223</a></td><td> <span class="br">}</span></td></tr>
<tr name="3224" id="3224">
<td><a id="l3224" class='ln'>3224</a></td><td> <a id="3224c13" class="tk">dataType</a> = <a id="3224c25" class="tk">xInfo</a>[0].<a id="3224c34" class="tk">dataTypes</a> <a id="3224c44" class="tk">?</a> <a id="3224c46" class="tk">xInfo</a>[0].<a id="3224c55" class="tk">dataTypes</a>[0] <a id="3224c68" class="tk">:</a> 0;</td></tr>
<tr name="3225" id="3225">
<td><a id="l3225" class='ln'>3225</a></td><td> <a id="3225c13" class="tk">isComplex</a> = <a id="3225c25" class="tk">xInfo</a>[0].<a id="3225c34" class="tk">complexSignals</a> <a id="3225c49" class="tk">?</a> <a id="3225c51" class="tk">xInfo</a>[0].<a id="3225c60" class="tk">complexSignals</a>[0] <a id="3225c78" class="tk">:</a> 0;</td></tr>
<tr name="3226" id="3226">
<td><a id="l3226" class='ln'>3226</a></td><td></td></tr>
<tr name="3227" id="3227">
<td><a id="l3227" class='ln'>3227</a></td><td> <a id="3227c13" class="tk">pDTConvInfo</a> = <a id="3227c27" class="tk">xInfo</a>[0].<a id="3227c36" class="tk">dataTypeConvert</a>;</td></tr>
<tr name="3228" id="3228">
<td><a id="l3228" class='ln'>3228</a></td><td></td></tr>
<tr name="3229" id="3229">
<td><a id="l3229" class='ln'>3229</a></td><td> <span class="kw">if</span> (<a id="3229c17" class="tk">rtliGetLogX</a>(<a id="3229c29" class="tk">li</a>)[0] <a id="3229c36" class="tk">!=</a> '\0') <span class="br">{</span></td></tr>
<tr name="3230" id="3230">
<td><a id="l3230" class='ln'>3230</a></td><td> <a id="3230c17" class="tk">logInfo</a>-&gt;<a id="3230c26" class="tk">x</a> = <a id="3230c30" class="tk">rt_CreateLogVarWithConvert</a>(<a id="3230c57" class="tk">li</a>, <a id="3230c61" class="tk">startTime</a>, <a id="3230c72" class="tk">finalTime</a>,</td></tr>
<tr name="3231" id="3231">
<td><a id="l3231" class='ln'>3231</a></td><td> <a id="3231c57" class="tk">stepSize</a>, <a id="3231c67" class="tk">errStatus</a>,</td></tr>
<tr name="3232" id="3232">
<td><a id="l3232" class='ln'>3232</a></td><td> <a id="3232c57" class="tk">rtliGetLogX</a>(<a id="3232c69" class="tk">li</a>),<a id="3232c73" class="tk">dataType</a>,</td></tr>
<tr name="3233" id="3233">
<td><a id="l3233" class='ln'>3233</a></td><td> <a id="3233c57" class="tk">pDTConvInfo</a>,</td></tr>
<tr name="3234" id="3234">
<td><a id="l3234" class='ln'>3234</a></td><td> 0,</td></tr>
<tr name="3235" id="3235">
<td><a id="l3235" class='ln'>3235</a></td><td> <a id="3235c57" class="tk">isComplex</a>,0,<a id="3235c69" class="tk">numCols</a>,<a id="3235c77" class="tk">nDims</a>,<a id="3235c83" class="tk">dims</a>,</td></tr>
<tr name="3236" id="3236">
<td><a id="l3236" class='ln'>3236</a></td><td> <a id="3236c57" class="tk">NO_LOGVALDIMS</a>, <a id="3236c72" class="tk">NULL</a>, <a id="3236c78" class="tk">NULL</a>,</td></tr>
<tr name="3237" id="3237">
<td><a id="l3237" class='ln'>3237</a></td><td> <a id="3237c57" class="tk">maxRows</a>,<a id="3237c65" class="tk">decimation</a>,<a id="3237c76" class="tk">sampleTime</a>,1);</td></tr>
<tr name="3238" id="3238">
<td><a id="l3238" class='ln'>3238</a></td><td> <span class="kw">if</span> (<a id="3238c21" class="tk">logInfo</a>-&gt;<a id="3238c30" class="tk">x</a> <a id="3238c32" class="tk">==</a> <a id="3238c35" class="tk">NULL</a>) <span class="kw">goto</span> <a id="3238c47" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3239" id="3239">
<td><a id="l3239" class='ln'>3239</a></td><td> <span class="br">}</span></td></tr>
<tr name="3240" id="3240">
<td><a id="l3240" class='ln'>3240</a></td><td> <span class="kw">if</span> (<a id="3240c17" class="tk">rtliGetLogXFinal</a>(<a id="3240c34" class="tk">li</a>)[0] <a id="3240c41" class="tk">!=</a> '\0') <span class="br">{</span></td></tr>
<tr name="3241" id="3241">
<td><a id="l3241" class='ln'>3241</a></td><td> <a id="3241c17" class="tk">logInfo</a>-&gt;<a id="3241c26" class="tk">xFinal</a> = <a id="3241c35" class="tk">rt_CreateLogVarWithConvert</a>(<a id="3241c62" class="tk">li</a>, <a id="3241c66" class="tk">startTime</a>, <a id="3241c77" class="tk">finalTime</a>,</td></tr>
<tr name="3242" id="3242">
<td><a id="l3242" class='ln'>3242</a></td><td> <a id="3242c62" class="tk">stepSize</a>, <a id="3242c72" class="tk">errStatus</a>,</td></tr>
<tr name="3243" id="3243">
<td><a id="l3243" class='ln'>3243</a></td><td> <a id="3243c62" class="tk">rtliGetLogXFinal</a>(<a id="3243c79" class="tk">li</a>),<a id="3243c83" class="tk">dataType</a>,</td></tr>
<tr name="3244" id="3244">
<td><a id="l3244" class='ln'>3244</a></td><td> <a id="3244c62" class="tk">pDTConvInfo</a>,</td></tr>
<tr name="3245" id="3245">
<td><a id="l3245" class='ln'>3245</a></td><td> 0,<a id="3245c64" class="tk">isComplex</a>,0,<a id="3245c76" class="tk">numCols</a>,<a id="3245c84" class="tk">nDims</a>,</td></tr>
<tr name="3246" id="3246">
<td><a id="l3246" class='ln'>3246</a></td><td> <a id="3246c62" class="tk">dims</a>, <a id="3246c68" class="tk">NO_LOGVALDIMS</a>, <a id="3246c83" class="tk">NULL</a>, </td></tr>
<tr name="3247" id="3247">
<td><a id="l3247" class='ln'>3247</a></td><td> <a id="3247c62" class="tk">NULL</a>, 1,<a id="3247c70" class="tk">decimation</a>,</td></tr>
<tr name="3248" id="3248">
<td><a id="l3248" class='ln'>3248</a></td><td> <a id="3248c62" class="tk">sampleTime</a>,1);</td></tr>
<tr name="3249" id="3249">
<td><a id="l3249" class='ln'>3249</a></td><td> <span class="kw">if</span> (<a id="3249c21" class="tk">logInfo</a>-&gt;<a id="3249c30" class="tk">xFinal</a> <a id="3249c37" class="tk">==</a> <a id="3249c40" class="tk">NULL</a>) <span class="kw">goto</span> <a id="3249c52" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3250" id="3250">
<td><a id="l3250" class='ln'>3250</a></td><td> <span class="br">}</span></td></tr>
<tr name="3251" id="3251">
<td><a id="l3251" class='ln'>3251</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* Structure Format */</span></td></tr>
<tr name="3252" id="3252">
<td><a id="l3252" class='ln'>3252</a></td><td> <span class="kw">if</span> (<a id="3252c17" class="tk">rtliGetLogX</a>(<a id="3252c29" class="tk">li</a>)[0] <a id="3252c36" class="tk">!=</a> '\0') <span class="br">{</span></td></tr>
<tr name="3253" id="3253">
<td><a id="l3253" class='ln'>3253</a></td><td> <a id="3253c17" class="tk">logInfo</a>-&gt;<a id="3253c26" class="tk">x</a> = <a id="3253c30" class="tk">local_CreateStructLogVar</a>(<a id="3253c55" class="tk">li</a>, <a id="3253c59" class="tk">startTime</a>, <a id="3253c70" class="tk">finalTime</a>,</td></tr>
<tr name="3254" id="3254">
<td><a id="l3254" class='ln'>3254</a></td><td> <a id="3254c55" class="tk">stepSize</a>, <a id="3254c65" class="tk">errStatus</a>,</td></tr>
<tr name="3255" id="3255">
<td><a id="l3255" class='ln'>3255</a></td><td> <a id="3255c55" class="tk">rtliGetLogX</a>(<a id="3255c67" class="tk">li</a>), <a id="3255c72" class="tk">logTime</a>,</td></tr>
<tr name="3256" id="3256">
<td><a id="l3256" class='ln'>3256</a></td><td> <a id="3256c55" class="tk">maxRows</a>, <a id="3256c64" class="tk">decimation</a>,</td></tr>
<tr name="3257" id="3257">
<td><a id="l3257" class='ln'>3257</a></td><td> <a id="3257c55" class="tk">sampleTime</a>, <a id="3257c67" class="tk">xInfo</a>, <a id="3257c74" class="tk">NULL</a>);</td></tr>
<tr name="3258" id="3258">
<td><a id="l3258" class='ln'>3258</a></td><td> <span class="kw">if</span> (<a id="3258c21" class="tk">logInfo</a>-&gt;<a id="3258c30" class="tk">x</a> <a id="3258c32" class="tk">==</a> <a id="3258c35" class="tk">NULL</a>) <span class="kw">goto</span> <a id="3258c46" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3259" id="3259">
<td><a id="l3259" class='ln'>3259</a></td><td> <span class="br">}</span></td></tr>
<tr name="3260" id="3260">
<td><a id="l3260" class='ln'>3260</a></td><td> <span class="kw">if</span> (<a id="3260c17" class="tk">rtliGetLogXFinal</a>(<a id="3260c34" class="tk">li</a>)[0] <a id="3260c41" class="tk">!=</a> '\0') <span class="br">{</span></td></tr>
<tr name="3261" id="3261">
<td><a id="l3261" class='ln'>3261</a></td><td> <a id="3261c17" class="tk">logInfo</a>-&gt;<a id="3261c26" class="tk">xFinal</a> = <a id="3261c35" class="tk">local_CreateStructLogVar</a>(<a id="3261c60" class="tk">li</a>, <a id="3261c64" class="tk">startTime</a>, <a id="3261c75" class="tk">finalTime</a>,</td></tr>
<tr name="3262" id="3262">
<td><a id="l3262" class='ln'>3262</a></td><td> <a id="3262c60" class="tk">stepSize</a>, <a id="3262c70" class="tk">errStatus</a>,</td></tr>
<tr name="3263" id="3263">
<td><a id="l3263" class='ln'>3263</a></td><td> <a id="3263c60" class="tk">rtliGetLogXFinal</a>(<a id="3263c77" class="tk">li</a>),</td></tr>
<tr name="3264" id="3264">
<td><a id="l3264" class='ln'>3264</a></td><td> <a id="3264c60" class="tk">logTime</a>,1,<a id="3264c70" class="tk">decimation</a>,</td></tr>
<tr name="3265" id="3265">
<td><a id="l3265" class='ln'>3265</a></td><td> <a id="3265c60" class="tk">sampleTime</a>,<a id="3265c71" class="tk">xInfo</a>,<a id="3265c77" class="tk">NULL</a>);</td></tr>
<tr name="3266" id="3266">
<td><a id="l3266" class='ln'>3266</a></td><td> <span class="kw">if</span> (<a id="3266c21" class="tk">logInfo</a>-&gt;<a id="3266c30" class="tk">xFinal</a> <a id="3266c37" class="tk">==</a> <a id="3266c40" class="tk">NULL</a>) <span class="kw">goto</span> <a id="3266c51" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3267" id="3267">
<td><a id="l3267" class='ln'>3267</a></td><td> <span class="br">}</span></td></tr>
<tr name="3268" id="3268">
<td><a id="l3268" class='ln'>3268</a></td><td> <span class="br">}</span></td></tr>
<tr name="3269" id="3269">
<td><a id="l3269" class='ln'>3269</a></td><td> <span class="br">}</span></td></tr>
<tr name="3270" id="3270">
<td><a id="l3270" class='ln'>3270</a></td><td></td></tr>
<tr name="3271" id="3271">
<td><a id="l3271" class='ln'>3271</a></td><td> <span class="ct">/* outputs */</span></td></tr>
<tr name="3272" id="3272">
<td><a id="l3272" class='ln'>3272</a></td><td> <a id="3272c5" class="tk">*</a><a id="3272c6" class="tk">errStatus</a> = <a id="3272c18" class="tk">rt_StartDataLoggingForOutput</a>(<a id="3272c47" class="tk">li</a>,<a id="3272c50" class="tk">startTime</a>,<a id="3272c60" class="tk">finalTime</a>,</td></tr>
<tr name="3273" id="3273">
<td><a id="l3273" class='ln'>3273</a></td><td> <a id="3273c47" class="tk">stepSize</a>,<a id="3273c56" class="tk">errStatus</a>);</td></tr>
<tr name="3274" id="3274">
<td><a id="l3274" class='ln'>3274</a></td><td> <span class="kw">if</span> (<a id="3274c9" class="tk">*</a><a id="3274c10" class="tk">errStatus</a> <a id="3274c20" class="tk">!=</a> <a id="3274c23" class="tk">NULL</a>) <span class="kw">goto</span> <a id="3274c35" class="tk">ERROR_EXIT</a>;</td></tr>
<tr name="3275" id="3275">
<td><a id="l3275" class='ln'>3275</a></td><td></td></tr>
<tr name="3276" id="3276">
<td><a id="l3276" class='ln'>3276</a></td><td> <span class="kw">return</span>(<a id="3276c12" class="tk">NULL</a>); <span class="ct">/* NORMAL_EXIT */</span></td></tr>
<tr name="3277" id="3277">
<td><a id="l3277" class='ln'>3277</a></td><td></td></tr>
<tr name="3278" id="3278">
<td><a id="l3278" class='ln'>3278</a></td><td> <a id="3278c2" class="tk">ERROR_EXIT</a><a id="3278c12" class="tk">:</a></td></tr>
<tr name="3279" id="3279">
<td><a id="l3279" class='ln'>3279</a></td><td> (<span class="kw">void</span>)<a id="3279c11" class="tk">fprintf</a>(<a id="3279c19" class="tk">stderr</a>, "*** Errors occurred when starting data logging.\n");</td></tr>
<tr name="3280" id="3280">
<td><a id="l3280" class='ln'>3280</a></td><td> <span class="kw">if</span> (<a id="3280c9" class="tk">*</a><a id="3280c10" class="tk">errStatus</a> <a id="3280c20" class="tk">==</a> <a id="3280c23" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3281" id="3281">
<td><a id="l3281" class='ln'>3281</a></td><td> <a id="3281c9" class="tk">*</a><a id="3281c10" class="tk">errStatus</a> = <a id="3281c22" class="tk">rtMemAllocError</a>;</td></tr>
<tr name="3282" id="3282">
<td><a id="l3282" class='ln'>3282</a></td><td> <span class="br">}</span></td></tr>
<tr name="3283" id="3283">
<td><a id="l3283" class='ln'>3283</a></td><td> <span class="kw">if</span> (<a id="3283c9" class="tk">logInfo</a>) <span class="br">{</span></td></tr>
<tr name="3284" id="3284">
<td><a id="l3284" class='ln'>3284</a></td><td> <a id="3284c9" class="tk">rt_DestroyLogVar</a>(<a id="3284c26" class="tk">logInfo</a>-&gt;<a id="3284c35" class="tk">logVarsList</a>);</td></tr>
<tr name="3285" id="3285">
<td><a id="l3285" class='ln'>3285</a></td><td> <a id="3285c9" class="tk">logInfo</a>-&gt;<a id="3285c18" class="tk">logVarsList</a> = <a id="3285c32" class="tk">NULL</a>;</td></tr>
<tr name="3286" id="3286">
<td><a id="l3286" class='ln'>3286</a></td><td> <a id="3286c9" class="tk">rt_DestroyStructLogVar</a>(<a id="3286c32" class="tk">logInfo</a>-&gt;<a id="3286c41" class="tk">structLogVarsList</a>);</td></tr>
<tr name="3287" id="3287">
<td><a id="l3287" class='ln'>3287</a></td><td> <a id="3287c9" class="tk">logInfo</a>-&gt;<a id="3287c18" class="tk">structLogVarsList</a> = <a id="3287c38" class="tk">NULL</a>;</td></tr>
<tr name="3288" id="3288">
<td><a id="l3288" class='ln'>3288</a></td><td> <a id="3288c9" class="tk">FREE</a>(<a id="3288c14" class="tk">logInfo</a>);</td></tr>
<tr name="3289" id="3289">
<td><a id="l3289" class='ln'>3289</a></td><td> <a id="3289c9" class="tk">rtliSetLogInfo</a>(<a id="3289c24" class="tk">li</a>,<a id="3289c27" class="tk">NULL</a>);</td></tr>
<tr name="3290" id="3290">
<td><a id="l3290" class='ln'>3290</a></td><td> <span class="br">}</span></td></tr>
<tr name="3291" id="3291">
<td><a id="l3291" class='ln'>3291</a></td><td> <span class="kw">return</span>(<a id="3291c12" class="tk">*</a><a id="3291c13" class="tk">errStatus</a>);</td></tr>
<tr name="3292" id="3292">
<td><a id="l3292" class='ln'>3292</a></td><td></td></tr>
<tr name="3293" id="3293">
<td><a id="l3293" class='ln'>3293</a></td><td><span class="br">}</span> <span class="ct">/* end rt_StartDataLoggingWithStartTime */</span></td></tr>
<tr name="3294" id="3294">
<td><a id="l3294" class='ln'>3294</a></td><td></td></tr>
<tr name="3295" id="3295">
<td><a id="l3295" class='ln'>3295</a></td><td></td></tr>
<tr name="3296" id="3296">
<td><a id="l3296" class='ln'>3296</a></td><td><span class="pp">#ifdef</span> <a id="3296c8" class="tk">__cplusplus</a></td></tr>
<tr name="3297" id="3297">
<td><a id="l3297" class='ln'>3297</a></td><td><span class="br">}</span></td></tr>
<tr name="3298" id="3298">
<td><a id="l3298" class='ln'>3298</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3299" id="3299">
<td><a id="l3299" class='ln'>3299</a></td><td></td></tr>
<tr name="3300" id="3300">
<td><a id="l3300" class='ln'>3300</a></td><td></td></tr>
<tr name="3301" id="3301">
<td><a id="l3301" class='ln'>3301</a></td><td></td></tr>
<tr name="3302" id="3302">
<td><a id="l3302" class='ln'>3302</a></td><td></td></tr>
<tr name="3303" id="3303">
<td><a id="l3303" class='ln'>3303</a></td><td><span class="pp">#ifdef</span> <a id="3303c8" class="tk">__cplusplus</a></td></tr>
<tr name="3304" id="3304">
<td><a id="l3304" class='ln'>3304</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3305" id="3305">
<td><a id="l3305" class='ln'>3305</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3306" id="3306">
<td><a id="l3306" class='ln'>3306</a></td><td></td></tr>
<tr name="3307" id="3307">
<td><a id="l3307" class='ln'>3307</a></td><td></td></tr>
<tr name="3308" id="3308">
<td><a id="l3308" class='ln'>3308</a></td><td><span class="ct">/* Function: rt_StartDataLogging ===============================================</span></td></tr>
<tr name="3309" id="3309">
<td><a id="l3309" class='ln'>3309</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3310" id="3310">
<td><a id="l3310" class='ln'>3310</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3311" id="3311">
<td><a id="l3311" class='ln'>3311</a></td><td><span class="kw">const</span> <a id="3311c7" class="tk">char_T</a> <a id="3311c14" class="tk">*</a><a id="3311c15" class="tk">rt_StartDataLogging</a>(<a id="3311c35" class="tk">RTWLogInfo</a> <a id="3311c48" class="tk">*</a><a id="3311c49" class="tk">li</a>,</td></tr>
<tr name="3312" id="3312">
<td><a id="l3312" class='ln'>3312</a></td><td> <span class="kw">const</span> <a id="3312c48" class="tk">real_T</a> <a id="3312c55" class="tk">finalTime</a>,</td></tr>
<tr name="3313" id="3313">
<td><a id="l3313" class='ln'>3313</a></td><td> <span class="kw">const</span> <a id="3313c48" class="tk">real_T</a> <a id="3313c55" class="tk">stepSize</a>,</td></tr>
<tr name="3314" id="3314">
<td><a id="l3314" class='ln'>3314</a></td><td> <span class="kw">const</span> <a id="3314c48" class="tk">char_T</a> <a id="3314c55" class="tk">*</a><a id="3314c56" class="tk">*</a><a id="3314c57" class="tk">errStatus</a>)</td></tr>
<tr name="3315" id="3315">
<td><a id="l3315" class='ln'>3315</a></td><td><span class="br">{</span></td></tr>
<tr name="3316" id="3316">
<td><a id="l3316" class='ln'>3316</a></td><td> <span class="kw">return</span> <a id="3316c12" class="tk">rt_StartDataLoggingWithStartTime</a>(<a id="3316c45" class="tk">li</a>,</td></tr>
<tr name="3317" id="3317">
<td><a id="l3317" class='ln'>3317</a></td><td> 0.0,</td></tr>
<tr name="3318" id="3318">
<td><a id="l3318" class='ln'>3318</a></td><td> <a id="3318c45" class="tk">finalTime</a>,</td></tr>
<tr name="3319" id="3319">
<td><a id="l3319" class='ln'>3319</a></td><td> <a id="3319c45" class="tk">stepSize</a>,</td></tr>
<tr name="3320" id="3320">
<td><a id="l3320" class='ln'>3320</a></td><td> <a id="3320c45" class="tk">errStatus</a>);</td></tr>
<tr name="3321" id="3321">
<td><a id="l3321" class='ln'>3321</a></td><td><span class="br">}</span></td></tr>
<tr name="3322" id="3322">
<td><a id="l3322" class='ln'>3322</a></td><td></td></tr>
<tr name="3323" id="3323">
<td><a id="l3323" class='ln'>3323</a></td><td></td></tr>
<tr name="3324" id="3324">
<td><a id="l3324" class='ln'>3324</a></td><td><span class="pp">#ifdef</span> <a id="3324c8" class="tk">__cplusplus</a></td></tr>
<tr name="3325" id="3325">
<td><a id="l3325" class='ln'>3325</a></td><td><span class="br">}</span></td></tr>
<tr name="3326" id="3326">
<td><a id="l3326" class='ln'>3326</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3327" id="3327">
<td><a id="l3327" class='ln'>3327</a></td><td></td></tr>
<tr name="3328" id="3328">
<td><a id="l3328" class='ln'>3328</a></td><td></td></tr>
<tr name="3329" id="3329">
<td><a id="l3329" class='ln'>3329</a></td><td></td></tr>
<tr name="3330" id="3330">
<td><a id="l3330" class='ln'>3330</a></td><td></td></tr>
<tr name="3331" id="3331">
<td><a id="l3331" class='ln'>3331</a></td><td><span class="pp">#ifdef</span> <a id="3331c8" class="tk">__cplusplus</a></td></tr>
<tr name="3332" id="3332">
<td><a id="l3332" class='ln'>3332</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3333" id="3333">
<td><a id="l3333" class='ln'>3333</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3334" id="3334">
<td><a id="l3334" class='ln'>3334</a></td><td></td></tr>
<tr name="3335" id="3335">
<td><a id="l3335" class='ln'>3335</a></td><td> </td></tr>
<tr name="3336" id="3336">
<td><a id="l3336" class='ln'>3336</a></td><td><span class="ct">/* Function: rt_UpdateLogVar ===================================================</span></td></tr>
<tr name="3337" id="3337">
<td><a id="l3337" class='ln'>3337</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3338" id="3338">
<td><a id="l3338" class='ln'>3338</a></td><td><span class="ct"> * Called to log data for a log variable.</span></td></tr>
<tr name="3339" id="3339">
<td><a id="l3339" class='ln'>3339</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3340" id="3340">
<td><a id="l3340" class='ln'>3340</a></td><td><span class="kw">void</span> <a id="3340c6" class="tk">rt_UpdateLogVar</a>(<a id="3340c22" class="tk">LogVar</a> <a id="3340c29" class="tk">*</a><a id="3340c30" class="tk">var</a>, <span class="kw">const</span> <span class="kw">void</span> <a id="3340c46" class="tk">*</a><a id="3340c47" class="tk">data</a>, <a id="3340c53" class="tk">boolean_T</a> <a id="3340c63" class="tk">isVarDims</a>)</td></tr>
<tr name="3341" id="3341">
<td><a id="l3341" class='ln'>3341</a></td><td><span class="br">{</span></td></tr>
<tr name="3342" id="3342">
<td><a id="l3342" class='ln'>3342</a></td><td> <a id="3342c5" class="tk">size_t</a> <a id="3342c19" class="tk">elSize</a> = <a id="3342c31" class="tk">var</a>-&gt;<a id="3342c36" class="tk">data</a>.<a id="3342c41" class="tk">elSize</a>;</td></tr>
<tr name="3343" id="3343">
<td><a id="l3343" class='ln'>3343</a></td><td> <span class="kw">const</span> <a id="3343c12" class="tk">char_T</a> <a id="3343c19" class="tk">*</a><a id="3343c20" class="tk">cData</a> = <a id="3343c31" class="tk">data</a>;</td></tr>
<tr name="3344" id="3344">
<td><a id="l3344" class='ln'>3344</a></td><td> <span class="kw">const</span> <a id="3344c12" class="tk">int_T</a> <a id="3344c19" class="tk">frameData</a> = <a id="3344c31" class="tk">var</a>-&gt;<a id="3344c36" class="tk">data</a>.<a id="3344c41" class="tk">frameData</a>;</td></tr>
<tr name="3345" id="3345">
<td><a id="l3345" class='ln'>3345</a></td><td> <span class="kw">const</span> <a id="3345c12" class="tk">int_T</a> <a id="3345c19" class="tk">frameSize</a> = <a id="3345c31" class="tk">frameData</a> <a id="3345c41" class="tk">?</a> (<a id="3345c44" class="tk">var</a>-&gt;<a id="3345c49" class="tk">data</a>.<a id="3345c54" class="tk">frameSize</a>) <a id="3345c65" class="tk">:</a> 1;</td></tr>
<tr name="3346" id="3346">
<td><a id="l3346" class='ln'>3346</a></td><td> <span class="kw">const</span> <a id="3346c12" class="tk">int_T</a> <a id="3346c19" class="tk">logWidth</a> = <a id="3346c31" class="tk">var</a>-&gt;<a id="3346c36" class="tk">data</a>.<a id="3346c41" class="tk">nCols</a>;</td></tr>
<tr name="3347" id="3347">
<td><a id="l3347" class='ln'>3347</a></td><td> <a id="3347c5" class="tk">BuiltInDTypeId</a> <a id="3347c20" class="tk">dTypeID</a> = <a id="3347c31" class="tk">var</a>-&gt;<a id="3347c36" class="tk">data</a>.<a id="3347c41" class="tk">dTypeID</a>;</td></tr>
<tr name="3348" id="3348">
<td><a id="l3348" class='ln'>3348</a></td><td></td></tr>
<tr name="3349" id="3349">
<td><a id="l3349" class='ln'>3349</a></td><td> <a id="3349c5" class="tk">size_t</a> <a id="3349c12" class="tk">offset</a> = 0;</td></tr>
<tr name="3350" id="3350">
<td><a id="l3350" class='ln'>3350</a></td><td> <a id="3350c5" class="tk">char_T</a> <a id="3350c12" class="tk">*</a><a id="3350c13" class="tk">currRealRow</a> = <a id="3350c28" class="tk">NULL</a>;</td></tr>
<tr name="3351" id="3351">
<td><a id="l3351" class='ln'>3351</a></td><td> <a id="3351c5" class="tk">char_T</a> <a id="3351c12" class="tk">*</a><a id="3351c13" class="tk">currImagRow</a> = <a id="3351c28" class="tk">NULL</a>;</td></tr>
<tr name="3352" id="3352">
<td><a id="l3352" class='ln'>3352</a></td><td> <a id="3352c5" class="tk">int_T</a> <a id="3352c12" class="tk">pointSize</a> = (<a id="3352c29" class="tk">int_T</a>)((<a id="3352c37" class="tk">var</a>-&gt;<a id="3352c42" class="tk">data</a>.<a id="3352c47" class="tk">complex</a>) <a id="3352c56" class="tk">?</a> <a id="3352c58" class="tk">rt_GetSizeofComplexType</a>(<a id="3352c82" class="tk">dTypeID</a>) <a id="3352c91" class="tk">:</a> <a id="3352c93" class="tk">elSize</a>);</td></tr>
<tr name="3353" id="3353">
<td><a id="l3353" class='ln'>3353</a></td><td></td></tr>
<tr name="3354" id="3354">
<td><a id="l3354" class='ln'>3354</a></td><td> <span class="kw">int</span> <a id="3354c12" class="tk">i</a>, <a id="3354c15" class="tk">j</a>, <a id="3354c18" class="tk">k</a>;</td></tr>
<tr name="3355" id="3355">
<td><a id="l3355" class='ln'>3355</a></td><td></td></tr>
<tr name="3356" id="3356">
<td><a id="l3356" class='ln'>3356</a></td><td> <span class="ct">/* The following variables will be used for </span></td></tr>
<tr name="3357" id="3357">
<td><a id="l3357" class='ln'>3357</a></td><td><span class="ct"> logging variable-size signals */</span></td></tr>
<tr name="3358" id="3358">
<td><a id="l3358" class='ln'>3358</a></td><td> <span class="kw">const</span> <a id="3358c12" class="tk">int_T</a> <a id="3358c19" class="tk">nDims</a> = <a id="3358c27" class="tk">var</a>-&gt;<a id="3358c32" class="tk">data</a>.<a id="3358c37" class="tk">nDims</a>;</td></tr>
<tr name="3359" id="3359">
<td><a id="l3359" class='ln'>3359</a></td><td> <span class="kw">const</span> <a id="3359c12" class="tk">int_T</a> <a id="3359c19" class="tk">*</a><a id="3359c20" class="tk">dims</a> = <a id="3359c27" class="tk">var</a>-&gt;<a id="3359c32" class="tk">data</a>.<a id="3359c37" class="tk">dims</a>;</td></tr>
<tr name="3360" id="3360">
<td><a id="l3360" class='ln'>3360</a></td><td> <span class="kw">const</span> <span class="kw">void</span> <a id="3360c19" class="tk">*</a> <span class="kw">const</span> <a id="3360c27" class="tk">*</a><a id="3360c28" class="tk">currDimsPtr</a> = <a id="3360c42" class="tk">NULL</a>;</td></tr>
<tr name="3361" id="3361">
<td><a id="l3361" class='ln'>3361</a></td><td> <span class="kw">const</span> <a id="3361c12" class="tk">int_T</a> <a id="3361c19" class="tk">*</a><a id="3361c20" class="tk">currDimsSizePtr</a> = <a id="3361c38" class="tk">NULL</a>;</td></tr>
<tr name="3362" id="3362">
<td><a id="l3362" class='ln'>3362</a></td><td></td></tr>
<tr name="3363" id="3363">
<td><a id="l3363" class='ln'>3363</a></td><td> <span class="ct">/* The following variables will be used for </span></td></tr>
<tr name="3364" id="3364">
<td><a id="l3364" class='ln'>3364</a></td><td><span class="ct"> logging "valueDimensions" field */</span></td></tr>
<tr name="3365" id="3365">
<td><a id="l3365" class='ln'>3365</a></td><td> <a id="3365c5" class="tk">size_t</a> <a id="3365c12" class="tk">offset_valDims</a> = 0;</td></tr>
<tr name="3366" id="3366">
<td><a id="l3366" class='ln'>3366</a></td><td> <a id="3366c5" class="tk">char_T</a> <a id="3366c12" class="tk">*</a><a id="3366c13" class="tk">currValDimsRow</a> = <a id="3366c31" class="tk">NULL</a>;</td></tr>
<tr name="3367" id="3367">
<td><a id="l3367" class='ln'>3367</a></td><td> <a id="3367c5" class="tk">size_t</a> <a id="3367c12" class="tk">elSize_valDims</a> = <span class="kw">sizeof</span>(<a id="3367c38" class="tk">real_T</a>);</td></tr>
<tr name="3368" id="3368">
<td><a id="l3368" class='ln'>3368</a></td><td> <a id="3368c5" class="tk">real_T</a> <a id="3368c12" class="tk">currentSigDims</a> = 0;</td></tr>
<tr name="3369" id="3369">
<td><a id="l3369" class='ln'>3369</a></td><td> <a id="3369c5" class="tk">int_T</a> <a id="3369c12" class="tk">nRows_valDims</a> = 0;</td></tr>
<tr name="3370" id="3370">
<td><a id="l3370" class='ln'>3370</a></td><td> <a id="3370c5" class="tk">int_T</a> <a id="3370c12" class="tk">logWidth_valDims</a> = 0;</td></tr>
<tr name="3371" id="3371">
<td><a id="l3371" class='ln'>3371</a></td><td></td></tr>
<tr name="3372" id="3372">
<td><a id="l3372" class='ln'>3372</a></td><td> <span class="kw">for</span> (<a id="3372c10" class="tk">i</a> = 0; <a id="3372c17" class="tk">i</a> <a id="3372c19" class="tk">&lt;</a> <a id="3372c21" class="tk">frameSize</a>; <a id="3372c32" class="tk">i</a><a id="3372c33" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="3373" id="3373">
<td><a id="l3373" class='ln'>3373</a></td><td> <span class="kw">if</span> (<a id="3373c13" class="tk">++</a><a id="3373c15" class="tk">var</a>-&gt;<a id="3373c20" class="tk">numHits</a> <a id="3373c28" class="tk">%</a> <a id="3373c30" class="tk">var</a>-&gt;<a id="3373c35" class="tk">decimation</a>) <span class="kw">continue</span>;</td></tr>
<tr name="3374" id="3374">
<td><a id="l3374" class='ln'>3374</a></td><td> <a id="3374c9" class="tk">var</a>-&gt;<a id="3374c14" class="tk">numHits</a> = 0;</td></tr>
<tr name="3375" id="3375">
<td><a id="l3375" class='ln'>3375</a></td><td></td></tr>
<tr name="3376" id="3376">
<td><a id="l3376" class='ln'>3376</a></td><td> <span class="kw">if</span> (<a id="3376c13" class="tk">var</a>-&gt;<a id="3376c18" class="tk">rowIdx</a> <a id="3376c25" class="tk">==</a> <a id="3376c28" class="tk">var</a>-&gt;<a id="3376c33" class="tk">data</a>.<a id="3376c38" class="tk">nRows</a>) <span class="br">{</span></td></tr>
<tr name="3377" id="3377">
<td><a id="l3377" class='ln'>3377</a></td><td> <span class="kw">if</span> (<a id="3377c17" class="tk">var</a>-&gt;<a id="3377c22" class="tk">okayToRealloc</a> <a id="3377c36" class="tk">==</a> 1) <span class="br">{</span></td></tr>
<tr name="3378" id="3378">
<td><a id="l3378" class='ln'>3378</a></td><td> <a id="3378c17" class="tk">rt_ReallocLogVar</a>(<a id="3378c34" class="tk">var</a>, <a id="3378c39" class="tk">isVarDims</a>);</td></tr>
<tr name="3379" id="3379">
<td><a id="l3379" class='ln'>3379</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3380" id="3380">
<td><a id="l3380" class='ln'>3380</a></td><td> <span class="ct">/* Circular buffer */</span></td></tr>
<tr name="3381" id="3381">
<td><a id="l3381" class='ln'>3381</a></td><td> <a id="3381c17" class="tk">var</a>-&gt;<a id="3381c22" class="tk">rowIdx</a> = 0;</td></tr>
<tr name="3382" id="3382">
<td><a id="l3382" class='ln'>3382</a></td><td> <a id="3382c17" class="tk">++</a>(<a id="3382c20" class="tk">var</a>-&gt;<a id="3382c25" class="tk">wrapped</a>); <span class="ct">/* increment the wrap around counter */</span></td></tr>
<tr name="3383" id="3383">
<td><a id="l3383" class='ln'>3383</a></td><td> <span class="br">}</span></td></tr>
<tr name="3384" id="3384">
<td><a id="l3384" class='ln'>3384</a></td><td> <span class="br">}</span></td></tr>
<tr name="3385" id="3385">
<td><a id="l3385" class='ln'>3385</a></td><td></td></tr>
<tr name="3386" id="3386">
<td><a id="l3386" class='ln'>3386</a></td><td> <span class="kw">if</span>(<a id="3386c12" class="tk">isVarDims</a>)<span class="br">{</span></td></tr>
<tr name="3387" id="3387">
<td><a id="l3387" class='ln'>3387</a></td><td> <a id="3387c13" class="tk">currDimsPtr</a> = (<span class="kw">const</span> <span class="kw">void</span> <a id="3387c39" class="tk">*</a> <span class="kw">const</span> <a id="3387c47" class="tk">*</a>) <a id="3387c50" class="tk">var</a>-&gt;<a id="3387c55" class="tk">valDims</a>-&gt;<a id="3387c64" class="tk">currSigDims</a>;</td></tr>
<tr name="3388" id="3388">
<td><a id="l3388" class='ln'>3388</a></td><td> <a id="3388c13" class="tk">currDimsSizePtr</a> = (<span class="kw">const</span> <a id="3388c38" class="tk">int_T</a><a id="3388c43" class="tk">*</a>) <a id="3388c46" class="tk">var</a>-&gt;<a id="3388c51" class="tk">valDims</a>-&gt;<a id="3388c60" class="tk">currSigDimsSize</a>;</td></tr>
<tr name="3389" id="3389">
<td><a id="l3389" class='ln'>3389</a></td><td> <a id="3389c13" class="tk">logWidth_valDims</a> = <a id="3389c32" class="tk">frameData</a> <a id="3389c42" class="tk">?</a> 1 <a id="3389c46" class="tk">:</a> <a id="3389c48" class="tk">var</a>-&gt;<a id="3389c53" class="tk">valDims</a>-&gt;<a id="3389c62" class="tk">nCols</a>;</td></tr>
<tr name="3390" id="3390">
<td><a id="l3390" class='ln'>3390</a></td><td> <a id="3390c13" class="tk">nRows_valDims</a> = <a id="3390c29" class="tk">var</a>-&gt;<a id="3390c34" class="tk">valDims</a>-&gt;<a id="3390c43" class="tk">nRows</a>;</td></tr>
<tr name="3391" id="3391">
<td><a id="l3391" class='ln'>3391</a></td><td></td></tr>
<tr name="3392" id="3392">
<td><a id="l3392" class='ln'>3392</a></td><td> <a id="3392c13" class="tk">var</a>-&gt;<a id="3392c18" class="tk">strides</a>[0] = 1;</td></tr>
<tr name="3393" id="3393">
<td><a id="l3393" class='ln'>3393</a></td><td> <a id="3393c13" class="tk">var</a>-&gt;<a id="3393c18" class="tk">currStrides</a>[0] = 1;</td></tr>
<tr name="3394" id="3394">
<td><a id="l3394" class='ln'>3394</a></td><td></td></tr>
<tr name="3395" id="3395">
<td><a id="l3395" class='ln'>3395</a></td><td> <span class="kw">for</span> (<a id="3395c18" class="tk">k</a> = 1; <a id="3395c25" class="tk">k</a> <a id="3395c27" class="tk">&lt;</a> <a id="3395c29" class="tk">nDims</a>; <a id="3395c36" class="tk">k</a><a id="3395c37" class="tk">++</a>)<span class="br">{</span></td></tr>
<tr name="3396" id="3396">
<td><a id="l3396" class='ln'>3396</a></td><td> <a id="3396c17" class="tk">int32_T</a> <a id="3396c25" class="tk">currDimsVal</a>=0;</td></tr>
<tr name="3397" id="3397">
<td><a id="l3397" class='ln'>3397</a></td><td> <span class="kw">switch</span> (<a id="3397c25" class="tk">currDimsSizePtr</a>[<a id="3397c41" class="tk">k</a><a id="3397c42" class="tk">-</a>1]) <span class="br">{</span></td></tr>
<tr name="3398" id="3398">
<td><a id="l3398" class='ln'>3398</a></td><td> <span class="kw">case</span> 1<a id="3398c25" class="tk">:</a></td></tr>
<tr name="3399" id="3399">
<td><a id="l3399" class='ln'>3399</a></td><td> <a id="3399c21" class="tk">currDimsVal</a> = (<a id="3399c36" class="tk">*</a><a id="3399c37" class="tk">*</a>(((<span class="kw">const</span> <a id="3399c47" class="tk">uint8_T</a> <a id="3399c55" class="tk">*</a> <span class="kw">const</span> <a id="3399c63" class="tk">*</a>) <a id="3399c66" class="tk">currDimsPtr</a>)<a id="3399c78" class="tk">+</a>(<a id="3399c80" class="tk">k</a><a id="3399c81" class="tk">-</a>1)));</td></tr>
<tr name="3400" id="3400">
<td><a id="l3400" class='ln'>3400</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3401" id="3401">
<td><a id="l3401" class='ln'>3401</a></td><td> <span class="kw">case</span> 2<a id="3401c25" class="tk">:</a></td></tr>
<tr name="3402" id="3402">
<td><a id="l3402" class='ln'>3402</a></td><td> <a id="3402c21" class="tk">currDimsVal</a> = (<a id="3402c36" class="tk">*</a><a id="3402c37" class="tk">*</a>(((<span class="kw">const</span> <a id="3402c47" class="tk">uint16_T</a> <a id="3402c56" class="tk">*</a> <span class="kw">const</span> <a id="3402c64" class="tk">*</a>) <a id="3402c67" class="tk">currDimsPtr</a>)<a id="3402c79" class="tk">+</a>(<a id="3402c81" class="tk">k</a><a id="3402c82" class="tk">-</a>1)));</td></tr>
<tr name="3403" id="3403">
<td><a id="l3403" class='ln'>3403</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3404" id="3404">
<td><a id="l3404" class='ln'>3404</a></td><td> <span class="kw">case</span> 4<a id="3404c25" class="tk">:</a></td></tr>
<tr name="3405" id="3405">
<td><a id="l3405" class='ln'>3405</a></td><td> <a id="3405c21" class="tk">currDimsVal</a> = (<a id="3405c36" class="tk">*</a><a id="3405c37" class="tk">*</a>(((<span class="kw">const</span> <a id="3405c47" class="tk">uint32_T</a> <a id="3405c56" class="tk">*</a> <span class="kw">const</span> <a id="3405c64" class="tk">*</a>) <a id="3405c67" class="tk">currDimsPtr</a>)<a id="3405c79" class="tk">+</a>(<a id="3405c81" class="tk">k</a><a id="3405c82" class="tk">-</a>1)));</td></tr>
<tr name="3406" id="3406">
<td><a id="l3406" class='ln'>3406</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3407" id="3407">
<td><a id="l3407" class='ln'>3407</a></td><td> <span class="br">}</span></td></tr>
<tr name="3408" id="3408">
<td><a id="l3408" class='ln'>3408</a></td><td> <a id="3408c17" class="tk">var</a>-&gt;<a id="3408c22" class="tk">strides</a>[<a id="3408c30" class="tk">k</a>] = <a id="3408c35" class="tk">var</a>-&gt;<a id="3408c40" class="tk">strides</a>[<a id="3408c48" class="tk">k</a><a id="3408c49" class="tk">-</a>1] <a id="3408c53" class="tk">*</a> <a id="3408c55" class="tk">dims</a>[<a id="3408c60" class="tk">k</a><a id="3408c61" class="tk">-</a>1];</td></tr>
<tr name="3409" id="3409">
<td><a id="l3409" class='ln'>3409</a></td><td> <a id="3409c17" class="tk">var</a>-&gt;<a id="3409c22" class="tk">currStrides</a>[<a id="3409c34" class="tk">k</a>] = <a id="3409c39" class="tk">var</a>-&gt;<a id="3409c44" class="tk">currStrides</a>[<a id="3409c56" class="tk">k</a><a id="3409c57" class="tk">-</a>1] <a id="3409c61" class="tk">*</a> <a id="3409c63" class="tk">currDimsVal</a>;</td></tr>
<tr name="3410" id="3410">
<td><a id="l3410" class='ln'>3410</a></td><td> <span class="br">}</span></td></tr>
<tr name="3411" id="3411">
<td><a id="l3411" class='ln'>3411</a></td><td> <span class="br">}</span></td></tr>
<tr name="3412" id="3412">
<td><a id="l3412" class='ln'>3412</a></td><td></td></tr>
<tr name="3413" id="3413">
<td><a id="l3413" class='ln'>3413</a></td><td> <a id="3413c9" class="tk">offset</a> = (<a id="3413c25" class="tk">size_t</a>)(<a id="3413c33" class="tk">elSize</a> <a id="3413c40" class="tk">*</a> <a id="3413c42" class="tk">var</a>-&gt;<a id="3413c47" class="tk">rowIdx</a> <a id="3413c54" class="tk">*</a> <a id="3413c56" class="tk">logWidth</a>);</td></tr>
<tr name="3414" id="3414">
<td><a id="l3414" class='ln'>3414</a></td><td> <a id="3414c9" class="tk">currRealRow</a> = ((<a id="3414c26" class="tk">char_T</a><a id="3414c32" class="tk">*</a>) (<a id="3414c36" class="tk">var</a>-&gt;<a id="3414c41" class="tk">data</a>.<a id="3414c46" class="tk">re</a>)) <a id="3414c51" class="tk">+</a> <a id="3414c53" class="tk">offset</a>;</td></tr>
<tr name="3415" id="3415">
<td><a id="l3415" class='ln'>3415</a></td><td> <a id="3415c9" class="tk">currImagRow</a> = (<a id="3415c25" class="tk">var</a>-&gt;<a id="3415c30" class="tk">data</a>.<a id="3415c35" class="tk">complex</a>) <a id="3415c44" class="tk">?</a></td></tr>
<tr name="3416" id="3416">
<td><a id="l3416" class='ln'>3416</a></td><td> ((<a id="3416c26" class="tk">char_T</a><a id="3416c32" class="tk">*</a>) (<a id="3416c36" class="tk">var</a>-&gt;<a id="3416c41" class="tk">data</a>.<a id="3416c46" class="tk">im</a>)) <a id="3416c51" class="tk">+</a> <a id="3416c53" class="tk">offset</a> <a id="3416c60" class="tk">:</a> <a id="3416c63" class="tk">NULL</a>;</td></tr>
<tr name="3417" id="3417">
<td><a id="l3417" class='ln'>3417</a></td><td></td></tr>
<tr name="3418" id="3418">
<td><a id="l3418" class='ln'>3418</a></td><td> <span class="ct">/* update logging data */</span></td></tr>
<tr name="3419" id="3419">
<td><a id="l3419" class='ln'>3419</a></td><td> <span class="kw">for</span> (<a id="3419c14" class="tk">j</a> = 0; <a id="3419c21" class="tk">j</a> <a id="3419c23" class="tk">&lt;</a> <a id="3419c25" class="tk">logWidth</a>; <a id="3419c35" class="tk">j</a><a id="3419c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="3420" id="3420">
<td><a id="l3420" class='ln'>3420</a></td><td></td></tr>
<tr name="3421" id="3421">
<td><a id="l3421" class='ln'>3421</a></td><td> <a id="3421c13" class="tk">boolean_T</a> <a id="3421c23" class="tk">inRange</a> = true;</td></tr>
<tr name="3422" id="3422">
<td><a id="l3422" class='ln'>3422</a></td><td> <span class="kw">int</span> <a id="3422c17" class="tk">idx</a> = <a id="3422c23" class="tk">j</a>;</td></tr>
<tr name="3423" id="3423">
<td><a id="l3423" class='ln'>3423</a></td><td></td></tr>
<tr name="3424" id="3424">
<td><a id="l3424" class='ln'>3424</a></td><td> <span class="ct">/* Check whether the currently logged value is in range or not.</span></td></tr>
<tr name="3425" id="3425">
<td><a id="l3425" class='ln'>3425</a></td><td><span class="ct"> For fixed-size signal logging, always inRange = true; idx = j;</span></td></tr>
<tr name="3426" id="3426">
<td><a id="l3426" class='ln'>3426</a></td><td><span class="ct"> For variable-size signal logging, use strides, coordinates</span></td></tr>
<tr name="3427" id="3427">
<td><a id="l3427" class='ln'>3427</a></td><td><span class="ct"> and current strides to decide whether the currently logged</span></td></tr>
<tr name="3428" id="3428">
<td><a id="l3428" class='ln'>3428</a></td><td><span class="ct"> data is in range or not and its location in the logging </span></td></tr>
<tr name="3429" id="3429">
<td><a id="l3429" class='ln'>3429</a></td><td><span class="ct"> matrix.</span></td></tr>
<tr name="3430" id="3430">
<td><a id="l3430" class='ln'>3430</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3431" id="3431">
<td><a id="l3431" class='ln'>3431</a></td><td> <span class="kw">if</span>(<a id="3431c16" class="tk">isVarDims</a>)<span class="br">{</span></td></tr>
<tr name="3432" id="3432">
<td><a id="l3432" class='ln'>3432</a></td><td> <span class="kw">int</span> <a id="3432c21" class="tk">rem</a> = <a id="3432c27" class="tk">j</a>;</td></tr>
<tr name="3433" id="3433">
<td><a id="l3433" class='ln'>3433</a></td><td> <a id="3433c17" class="tk">idx</a> = 0;</td></tr>
<tr name="3434" id="3434">
<td><a id="l3434" class='ln'>3434</a></td><td> <span class="kw">for</span>(<a id="3434c21" class="tk">k</a> = <a id="3434c25" class="tk">nDims</a><a id="3434c30" class="tk">-</a>1; <a id="3434c34" class="tk">k</a><a id="3434c35" class="tk">&gt;=</a>0; <a id="3434c40" class="tk">k</a><a id="3434c41" class="tk">--</a>)<span class="br">{</span></td></tr>
<tr name="3435" id="3435">
<td><a id="l3435" class='ln'>3435</a></td><td> <a id="3435c21" class="tk">int32_T</a> <a id="3435c29" class="tk">currDimsVal</a>=0;</td></tr>
<tr name="3436" id="3436">
<td><a id="l3436" class='ln'>3436</a></td><td> <span class="kw">switch</span> (<a id="3436c29" class="tk">currDimsSizePtr</a>[<a id="3436c45" class="tk">k</a>]) <span class="br">{</span></td></tr>
<tr name="3437" id="3437">
<td><a id="l3437" class='ln'>3437</a></td><td> <span class="kw">case</span> 1<a id="3437c29" class="tk">:</a></td></tr>
<tr name="3438" id="3438">
<td><a id="l3438" class='ln'>3438</a></td><td> <a id="3438c25" class="tk">currDimsVal</a> = (<a id="3438c40" class="tk">*</a><a id="3438c41" class="tk">*</a>(((<span class="kw">const</span> <a id="3438c51" class="tk">uint8_T</a> <a id="3438c59" class="tk">*</a> <span class="kw">const</span> <a id="3438c67" class="tk">*</a>) <a id="3438c70" class="tk">currDimsPtr</a>)<a id="3438c82" class="tk">+</a><a id="3438c83" class="tk">k</a>));</td></tr>
<tr name="3439" id="3439">
<td><a id="l3439" class='ln'>3439</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3440" id="3440">
<td><a id="l3440" class='ln'>3440</a></td><td> <span class="kw">case</span> 2<a id="3440c29" class="tk">:</a></td></tr>
<tr name="3441" id="3441">
<td><a id="l3441" class='ln'>3441</a></td><td> <a id="3441c25" class="tk">currDimsVal</a> = (<a id="3441c40" class="tk">*</a><a id="3441c41" class="tk">*</a>(((<span class="kw">const</span> <a id="3441c51" class="tk">uint16_T</a> <a id="3441c60" class="tk">*</a> <span class="kw">const</span> <a id="3441c68" class="tk">*</a>) <a id="3441c71" class="tk">currDimsPtr</a>)<a id="3441c83" class="tk">+</a><a id="3441c84" class="tk">k</a>));</td></tr>
<tr name="3442" id="3442">
<td><a id="l3442" class='ln'>3442</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3443" id="3443">
<td><a id="l3443" class='ln'>3443</a></td><td> <span class="kw">case</span> 4<a id="3443c29" class="tk">:</a></td></tr>
<tr name="3444" id="3444">
<td><a id="l3444" class='ln'>3444</a></td><td> <a id="3444c25" class="tk">currDimsVal</a> = (<a id="3444c40" class="tk">*</a><a id="3444c41" class="tk">*</a>(((<span class="kw">const</span> <a id="3444c51" class="tk">uint32_T</a> <a id="3444c60" class="tk">*</a> <span class="kw">const</span> <a id="3444c68" class="tk">*</a>) <a id="3444c71" class="tk">currDimsPtr</a>)<a id="3444c83" class="tk">+</a><a id="3444c84" class="tk">k</a>));</td></tr>
<tr name="3445" id="3445">
<td><a id="l3445" class='ln'>3445</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3446" id="3446">
<td><a id="l3446" class='ln'>3446</a></td><td> <span class="br">}</span></td></tr>
<tr name="3447" id="3447">
<td><a id="l3447" class='ln'>3447</a></td><td> <a id="3447c21" class="tk">var</a>-&gt;<a id="3447c26" class="tk">coords</a>[<a id="3447c33" class="tk">k</a>] = <a id="3447c38" class="tk">rem</a> <a id="3447c42" class="tk">/</a> <a id="3447c44" class="tk">var</a>-&gt;<a id="3447c49" class="tk">strides</a>[<a id="3447c57" class="tk">k</a>];</td></tr>
<tr name="3448" id="3448">
<td><a id="l3448" class='ln'>3448</a></td><td> <span class="kw">if</span>( <a id="3448c25" class="tk">var</a>-&gt;<a id="3448c30" class="tk">coords</a>[<a id="3448c37" class="tk">k</a>] <a id="3448c40" class="tk">&gt;=</a> <a id="3448c43" class="tk">currDimsVal</a> )<span class="br">{</span></td></tr>
<tr name="3449" id="3449">
<td><a id="l3449" class='ln'>3449</a></td><td> <a id="3449c25" class="tk">inRange</a> = false;</td></tr>
<tr name="3450" id="3450">
<td><a id="l3450" class='ln'>3450</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3451" id="3451">
<td><a id="l3451" class='ln'>3451</a></td><td> <span class="br">}</span></td></tr>
<tr name="3452" id="3452">
<td><a id="l3452" class='ln'>3452</a></td><td> <a id="3452c21" class="tk">rem</a> = <a id="3452c27" class="tk">rem</a> <a id="3452c31" class="tk">-</a> <a id="3452c33" class="tk">var</a>-&gt;<a id="3452c38" class="tk">coords</a>[<a id="3452c45" class="tk">k</a>] <a id="3452c48" class="tk">*</a> <a id="3452c50" class="tk">var</a>-&gt;<a id="3452c55" class="tk">strides</a>[<a id="3452c63" class="tk">k</a>];</td></tr>
<tr name="3453" id="3453">
<td><a id="l3453" class='ln'>3453</a></td><td> <span class="br">}</span></td></tr>
<tr name="3454" id="3454">
<td><a id="l3454" class='ln'>3454</a></td><td> <span class="kw">if</span>(<a id="3454c20" class="tk">inRange</a>)<span class="br">{</span></td></tr>
<tr name="3455" id="3455">
<td><a id="l3455" class='ln'>3455</a></td><td> <a id="3455c21" class="tk">idx</a> = <a id="3455c27" class="tk">var</a>-&gt;<a id="3455c32" class="tk">coords</a>[0];</td></tr>
<tr name="3456" id="3456">
<td><a id="l3456" class='ln'>3456</a></td><td> <span class="kw">for</span> (<a id="3456c26" class="tk">k</a> = 1; <a id="3456c33" class="tk">k</a> <a id="3456c35" class="tk">&lt;</a> <a id="3456c37" class="tk">nDims</a>; <a id="3456c44" class="tk">k</a><a id="3456c45" class="tk">++</a>)<span class="br">{</span></td></tr>
<tr name="3457" id="3457">
<td><a id="l3457" class='ln'>3457</a></td><td> <a id="3457c25" class="tk">idx</a> <a id="3457c29" class="tk">+=</a> <a id="3457c32" class="tk">var</a>-&gt;<a id="3457c37" class="tk">coords</a>[<a id="3457c44" class="tk">k</a>] <a id="3457c47" class="tk">*</a> <a id="3457c49" class="tk">var</a>-&gt;<a id="3457c54" class="tk">currStrides</a>[<a id="3457c66" class="tk">k</a>];</td></tr>
<tr name="3458" id="3458">
<td><a id="l3458" class='ln'>3458</a></td><td> <span class="br">}</span></td></tr>
<tr name="3459" id="3459">
<td><a id="l3459" class='ln'>3459</a></td><td> <span class="br">}</span></td></tr>
<tr name="3460" id="3460">
<td><a id="l3460" class='ln'>3460</a></td><td> <span class="br">}</span></td></tr>
<tr name="3461" id="3461">
<td><a id="l3461" class='ln'>3461</a></td><td> </td></tr>
<tr name="3462" id="3462">
<td><a id="l3462" class='ln'>3462</a></td><td> <span class="kw">if</span> (<a id="3462c17" class="tk">!</a><a id="3462c18" class="tk">var</a>-&gt;<a id="3462c23" class="tk">data</a>.<a id="3462c28" class="tk">dataTypeConvertInfo</a>.<a id="3462c48" class="tk">conversionNeeded</a>) <span class="br">{</span></td></tr>
<tr name="3463" id="3463">
<td><a id="l3463" class='ln'>3463</a></td><td> <span class="ct">/* NO conversion needed</span></td></tr>
<tr name="3464" id="3464">
<td><a id="l3464" class='ln'>3464</a></td><td><span class="ct"> */</span> </td></tr>
<tr name="3465" id="3465">
<td><a id="l3465" class='ln'>3465</a></td><td> <span class="kw">if</span> (<a id="3465c21" class="tk">inRange</a>) <span class="br">{</span></td></tr>
<tr name="3466" id="3466">
<td><a id="l3466" class='ln'>3466</a></td><td> <span class="ct">/* If in range, fill in data */</span></td></tr>
<tr name="3467" id="3467">
<td><a id="l3467" class='ln'>3467</a></td><td> <span class="kw">const</span> <span class="kw">char</span> <a id="3467c32" class="tk">*</a><a id="3467c33" class="tk">cDataPoint</a> = <a id="3467c46" class="tk">cData</a> <a id="3467c52" class="tk">+</a> (<a id="3467c55" class="tk">i</a><a id="3467c56" class="tk">+</a><a id="3467c57" class="tk">frameSize</a><a id="3467c66" class="tk">*</a><a id="3467c67" class="tk">idx</a>) <a id="3467c72" class="tk">*</a> <a id="3467c74" class="tk">pointSize</a>;</td></tr>
<tr name="3468" id="3468">
<td><a id="l3468" class='ln'>3468</a></td><td></td></tr>
<tr name="3469" id="3469">
<td><a id="l3469" class='ln'>3469</a></td><td> (<span class="kw">void</span>) <a id="3469c28" class="tk">memcpy</a>(<a id="3469c35" class="tk">currRealRow</a>, <a id="3469c48" class="tk">cDataPoint</a>, <a id="3469c60" class="tk">elSize</a>);</td></tr>
<tr name="3470" id="3470">
<td><a id="l3470" class='ln'>3470</a></td><td> <a id="3470c21" class="tk">currRealRow</a> <a id="3470c33" class="tk">+=</a> <a id="3470c36" class="tk">elSize</a>;</td></tr>
<tr name="3471" id="3471">
<td><a id="l3471" class='ln'>3471</a></td><td> <span class="kw">if</span> (<a id="3471c25" class="tk">var</a>-&gt;<a id="3471c30" class="tk">data</a>.<a id="3471c35" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3472" id="3472">
<td><a id="l3472" class='ln'>3472</a></td><td> (<span class="kw">void</span>) <a id="3472c32" class="tk">memcpy</a>(<a id="3472c39" class="tk">currImagRow</a>, <a id="3472c52" class="tk">cDataPoint</a> <a id="3472c63" class="tk">+</a> <a id="3472c65" class="tk">pointSize</a><a id="3472c74" class="tk">/</a>2, <a id="3472c78" class="tk">elSize</a>);</td></tr>
<tr name="3473" id="3473">
<td><a id="l3473" class='ln'>3473</a></td><td> <a id="3473c25" class="tk">currImagRow</a> <a id="3473c37" class="tk">+=</a> <a id="3473c40" class="tk">elSize</a>;</td></tr>
<tr name="3474" id="3474">
<td><a id="l3474" class='ln'>3474</a></td><td> <span class="br">}</span></td></tr>
<tr name="3475" id="3475">
<td><a id="l3475" class='ln'>3475</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3476" id="3476">
<td><a id="l3476" class='ln'>3476</a></td><td> <span class="ct">/* If out of range, fill in NaN or 0:</span></td></tr>
<tr name="3477" id="3477">
<td><a id="l3477" class='ln'>3477</a></td><td><span class="ct"> 1) For bool, int32, uint32, int16, uint16, etc,</span></td></tr>
<tr name="3478" id="3478">
<td><a id="l3478" class='ln'>3478</a></td><td><span class="ct"> memset to zeros;</span></td></tr>
<tr name="3479" id="3479">
<td><a id="l3479" class='ln'>3479</a></td><td><span class="ct"> 2) For fixed-point data type, NaN conversion is not</span></td></tr>
<tr name="3480" id="3480">
<td><a id="l3480" class='ln'>3480</a></td><td><span class="ct"> allowed, memset to zeros.</span></td></tr>
<tr name="3481" id="3481">
<td><a id="l3481" class='ln'>3481</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3482" id="3482">
<td><a id="l3482" class='ln'>3482</a></td><td> <span class="kw">if</span> (<a id="3482c25" class="tk">dTypeID</a> <a id="3482c33" class="tk">==</a> <a id="3482c36" class="tk">SS_DOUBLE</a>) <span class="br">{</span></td></tr>
<tr name="3483" id="3483">
<td><a id="l3483" class='ln'>3483</a></td><td> (<span class="kw">void</span>) <a id="3483c31" class="tk">memcpy</a>(<a id="3483c38" class="tk">currRealRow</a>, <a id="3483c51" class="tk">&amp;</a><a id="3483c52" class="tk">rtNaN</a>, <a id="3483c59" class="tk">elSize</a>);</td></tr>
<tr name="3484" id="3484">
<td><a id="l3484" class='ln'>3484</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="3484c32" class="tk">dTypeID</a> <a id="3484c40" class="tk">==</a> <a id="3484c43" class="tk">SS_SINGLE</a>)<span class="br">{</span></td></tr>
<tr name="3485" id="3485">
<td><a id="l3485" class='ln'>3485</a></td><td> (<span class="kw">void</span>) <a id="3485c32" class="tk">memcpy</a>(<a id="3485c39" class="tk">currRealRow</a>, <a id="3485c52" class="tk">&amp;</a><a id="3485c53" class="tk">rtNaNF</a>, <a id="3485c61" class="tk">elSize</a>);</td></tr>
<tr name="3486" id="3486">
<td><a id="l3486" class='ln'>3486</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3487" id="3487">
<td><a id="l3487" class='ln'>3487</a></td><td> (<span class="kw">void</span>) <a id="3487c32" class="tk">memset</a>(<a id="3487c39" class="tk">currRealRow</a>, 0, <a id="3487c55" class="tk">elSize</a>);</td></tr>
<tr name="3488" id="3488">
<td><a id="l3488" class='ln'>3488</a></td><td> <span class="br">}</span></td></tr>
<tr name="3489" id="3489">
<td><a id="l3489" class='ln'>3489</a></td><td> </td></tr>
<tr name="3490" id="3490">
<td><a id="l3490" class='ln'>3490</a></td><td> <a id="3490c21" class="tk">currRealRow</a> <a id="3490c33" class="tk">+=</a> <a id="3490c36" class="tk">elSize</a>;</td></tr>
<tr name="3491" id="3491">
<td><a id="l3491" class='ln'>3491</a></td><td> <span class="kw">if</span> (<a id="3491c25" class="tk">var</a>-&gt;<a id="3491c30" class="tk">data</a>.<a id="3491c35" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3492" id="3492">
<td><a id="l3492" class='ln'>3492</a></td><td> <span class="ct">/* For imaginary part, fill in 0 */</span></td></tr>
<tr name="3493" id="3493">
<td><a id="l3493" class='ln'>3493</a></td><td> (<span class="kw">void</span>) <a id="3493c32" class="tk">memset</a>(<a id="3493c39" class="tk">currImagRow</a>, 0, <a id="3493c55" class="tk">elSize</a>);</td></tr>
<tr name="3494" id="3494">
<td><a id="l3494" class='ln'>3494</a></td><td> <a id="3494c25" class="tk">currImagRow</a> <a id="3494c37" class="tk">+=</a> <a id="3494c40" class="tk">elSize</a>;</td></tr>
<tr name="3495" id="3495">
<td><a id="l3495" class='ln'>3495</a></td><td> <span class="br">}</span></td></tr>
<tr name="3496" id="3496">
<td><a id="l3496" class='ln'>3496</a></td><td> <span class="br">}</span></td></tr>
<tr name="3497" id="3497">
<td><a id="l3497" class='ln'>3497</a></td><td> <span class="br">}</span></td></tr>
<tr name="3498" id="3498">
<td><a id="l3498" class='ln'>3498</a></td><td> <span class="kw">else</span></td></tr>
<tr name="3499" id="3499">
<td><a id="l3499" class='ln'>3499</a></td><td> <span class="br">{</span></td></tr>
<tr name="3500" id="3500">
<td><a id="l3500" class='ln'>3500</a></td><td> <span class="ct">/* YES conversion needed</span></td></tr>
<tr name="3501" id="3501">
<td><a id="l3501" class='ln'>3501</a></td><td><span class="ct"> */</span> </td></tr>
<tr name="3502" id="3502">
<td><a id="l3502" class='ln'>3502</a></td><td> <a id="3502c17" class="tk">DTypeId</a> <a id="3502c25" class="tk">dataTypeIdOriginal</a> = </td></tr>
<tr name="3503" id="3503">
<td><a id="l3503" class='ln'>3503</a></td><td> <a id="3503c21" class="tk">var</a>-&gt;<a id="3503c26" class="tk">data</a>.<a id="3503c31" class="tk">dataTypeConvertInfo</a>.<a id="3503c51" class="tk">dataTypeIdOriginal</a>;</td></tr>
<tr name="3504" id="3504">
<td><a id="l3504" class='ln'>3504</a></td><td> <a id="3504c17" class="tk">int_T</a> <a id="3504c23" class="tk">DpSize</a> = (<a id="3504c33" class="tk">int_T</a>)((<a id="3504c41" class="tk">var</a>-&gt;<a id="3504c46" class="tk">data</a>.<a id="3504c51" class="tk">complex</a>) <a id="3504c60" class="tk">?</a> </td></tr>
<tr name="3505" id="3505">
<td><a id="l3505" class='ln'>3505</a></td><td> <a id="3505c40" class="tk">rt_GetSizeofComplexType</a>(<a id="3505c64" class="tk">dataTypeIdOriginal</a>) <a id="3505c84" class="tk">:</a> </td></tr>
<tr name="3506" id="3506">
<td><a id="l3506" class='ln'>3506</a></td><td> <a id="3506c40" class="tk">rt_GetSizeofDataType</a>(<a id="3506c61" class="tk">dataTypeIdOriginal</a>));</td></tr>
<tr name="3507" id="3507">
<td><a id="l3507" class='ln'>3507</a></td><td></td></tr>
<tr name="3508" id="3508">
<td><a id="l3508" class='ln'>3508</a></td><td> <a id="3508c17" class="tk">DTypeId</a> <a id="3508c25" class="tk">dataTypeIdLoggingTo</a> = </td></tr>
<tr name="3509" id="3509">
<td><a id="l3509" class='ln'>3509</a></td><td> <a id="3509c21" class="tk">var</a>-&gt;<a id="3509c26" class="tk">data</a>.<a id="3509c31" class="tk">dataTypeConvertInfo</a>.<a id="3509c51" class="tk">dataTypeIdLoggingTo</a>;</td></tr>
<tr name="3510" id="3510">
<td><a id="l3510" class='ln'>3510</a></td><td></td></tr>
<tr name="3511" id="3511">
<td><a id="l3511" class='ln'>3511</a></td><td> <span class="kw">int</span> <a id="3511c21" class="tk">bitsPerChunk</a> = <a id="3511c36" class="tk">var</a>-&gt;<a id="3511c41" class="tk">data</a>.<a id="3511c46" class="tk">dataTypeConvertInfo</a>.<a id="3511c66" class="tk">bitsPerChunk</a>;</td></tr>
<tr name="3512" id="3512">
<td><a id="l3512" class='ln'>3512</a></td><td> <span class="kw">int</span> <a id="3512c21" class="tk">numOfChunk</a> = <a id="3512c35" class="tk">var</a>-&gt;<a id="3512c40" class="tk">data</a>.<a id="3512c45" class="tk">dataTypeConvertInfo</a>.<a id="3512c65" class="tk">numOfChunk</a>;</td></tr>
<tr name="3513" id="3513">
<td><a id="l3513" class='ln'>3513</a></td><td> <span class="kw">unsigned</span> <span class="kw">int</span> <a id="3513c30" class="tk">isSigned</a> = <a id="3513c41" class="tk">var</a>-&gt;<a id="3513c46" class="tk">data</a>.<a id="3513c51" class="tk">dataTypeConvertInfo</a>.<a id="3513c71" class="tk">isSigned</a>;</td></tr>
<tr name="3514" id="3514">
<td><a id="l3514" class='ln'>3514</a></td><td></td></tr>
<tr name="3515" id="3515">
<td><a id="l3515" class='ln'>3515</a></td><td> <span class="kw">double</span> <a id="3515c24" class="tk">fracSlope</a> = <a id="3515c36" class="tk">var</a>-&gt;<a id="3515c41" class="tk">data</a>.<a id="3515c46" class="tk">dataTypeConvertInfo</a>.<a id="3515c66" class="tk">fracSlope</a>;</td></tr>
<tr name="3516" id="3516">
<td><a id="l3516" class='ln'>3516</a></td><td> <span class="kw">int</span> <a id="3516c24" class="tk">fixedExp</a> = <a id="3516c36" class="tk">var</a>-&gt;<a id="3516c41" class="tk">data</a>.<a id="3516c46" class="tk">dataTypeConvertInfo</a>.<a id="3516c66" class="tk">fixedExp</a>;</td></tr>
<tr name="3517" id="3517">
<td><a id="l3517" class='ln'>3517</a></td><td> <span class="kw">double</span> <a id="3517c24" class="tk">bias</a> = <a id="3517c36" class="tk">var</a>-&gt;<a id="3517c41" class="tk">data</a>.<a id="3517c46" class="tk">dataTypeConvertInfo</a>.<a id="3517c66" class="tk">bias</a>;</td></tr>
<tr name="3518" id="3518">
<td><a id="l3518" class='ln'>3518</a></td><td></td></tr>
<tr name="3519" id="3519">
<td><a id="l3519" class='ln'>3519</a></td><td> <span class="kw">double</span> <a id="3519c24" class="tk">curRealValue</a> = <a id="3519c39" class="tk">-</a>0.12345678987654;</td></tr>
<tr name="3520" id="3520">
<td><a id="l3520" class='ln'>3520</a></td><td> <span class="kw">double</span> <a id="3520c24" class="tk">curImagValue</a> = <a id="3520c39" class="tk">-</a>0.12345678987654;</td></tr>
<tr name="3521" id="3521">
<td><a id="l3521" class='ln'>3521</a></td><td></td></tr>
<tr name="3522" id="3522">
<td><a id="l3522" class='ln'>3522</a></td><td> <a id="3522c17" class="tk">int_T</a> <a id="3522c23" class="tk">adjIndexIfComplex</a> = (<a id="3522c44" class="tk">var</a>-&gt;<a id="3522c49" class="tk">data</a>.<a id="3522c54" class="tk">complex</a>) <a id="3522c63" class="tk">?</a> 2 <a id="3522c67" class="tk">:</a> 1;</td></tr>
<tr name="3523" id="3523">
<td><a id="l3523" class='ln'>3523</a></td><td></td></tr>
<tr name="3524" id="3524">
<td><a id="l3524" class='ln'>3524</a></td><td> <span class="kw">if</span>(<a id="3524c20" class="tk">inRange</a>)<span class="br">{</span></td></tr>
<tr name="3525" id="3525">
<td><a id="l3525" class='ln'>3525</a></td><td> <span class="kw">if</span>(<a id="3525c24" class="tk">numOfChunk</a> <a id="3525c35" class="tk">&gt;</a> 1)</td></tr>
<tr name="3526" id="3526">
<td><a id="l3526" class='ln'>3526</a></td><td> <span class="br">{</span></td></tr>
<tr name="3527" id="3527">
<td><a id="l3527" class='ln'>3527</a></td><td> <span class="ct">/* For multiword */</span></td></tr>
<tr name="3528" id="3528">
<td><a id="l3528" class='ln'>3528</a></td><td> <span class="kw">const</span> <span class="kw">char</span> <a id="3528c36" class="tk">*</a><a id="3528c37" class="tk">pInData</a> = (<span class="kw">const</span> <span class="kw">char</span> <a id="3528c59" class="tk">*</a>)(<a id="3528c62" class="tk">cData</a>);</td></tr>
<tr name="3529" id="3529">
<td><a id="l3529" class='ln'>3529</a></td><td> <span class="kw">int</span> <a id="3529c29" class="tk">dtSize</a> = <a id="3529c38" class="tk">bitsPerChunk</a><a id="3529c50" class="tk">*</a><a id="3529c51" class="tk">numOfChunk</a><a id="3529c61" class="tk">/</a>8;</td></tr>
<tr name="3530" id="3530">
<td><a id="l3530" class='ln'>3530</a></td><td> <a id="3530c25" class="tk">pInData</a> <a id="3530c33" class="tk">+=</a> ((<a id="3530c38" class="tk">i</a><a id="3530c39" class="tk">+</a><a id="3530c40" class="tk">frameSize</a><a id="3530c49" class="tk">*</a><a id="3530c50" class="tk">idx</a>) <a id="3530c55" class="tk">*</a> <a id="3530c57" class="tk">adjIndexIfComplex</a>) <a id="3530c76" class="tk">*</a> <a id="3530c78" class="tk">dtSize</a>;</td></tr>
<tr name="3531" id="3531">
<td><a id="l3531" class='ln'>3531</a></td><td> </td></tr>
<tr name="3532" id="3532">
<td><a id="l3532" class='ln'>3532</a></td><td> <a id="3532c25" class="tk">curRealValue</a> = <a id="3532c40" class="tk">rt_GetDblValueFromOverSizedData</a>(<a id="3532c72" class="tk">pInData</a>, <a id="3532c81" class="tk">bitsPerChunk</a>, <a id="3532c95" class="tk">numOfChunk</a>, </td></tr>
<tr name="3533" id="3533">
<td><a id="l3533" class='ln'>3533</a></td><td> <a id="3533c72" class="tk">isSigned</a>, <a id="3533c82" class="tk">fracSlope</a>, <a id="3533c93" class="tk">fixedExp</a>, <a id="3533c103" class="tk">bias</a>);</td></tr>
<tr name="3534" id="3534">
<td><a id="l3534" class='ln'>3534</a></td><td> <span class="kw">if</span> (<a id="3534c29" class="tk">var</a>-&gt;<a id="3534c34" class="tk">data</a>.<a id="3534c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3535" id="3535">
<td><a id="l3535" class='ln'>3535</a></td><td> <a id="3535c29" class="tk">curImagValue</a> = <a id="3535c44" class="tk">rt_GetDblValueFromOverSizedData</a>((<a id="3535c77" class="tk">pInData</a><a id="3535c84" class="tk">+</a><a id="3535c85" class="tk">dtSize</a>), <a id="3535c94" class="tk">bitsPerChunk</a>, <a id="3535c108" class="tk">numOfChunk</a>, </td></tr>
<tr name="3536" id="3536">
<td><a id="l3536" class='ln'>3536</a></td><td> <a id="3536c76" class="tk">isSigned</a>, <a id="3536c86" class="tk">fracSlope</a>, <a id="3536c97" class="tk">fixedExp</a>, <a id="3536c107" class="tk">bias</a>);</td></tr>
<tr name="3537" id="3537">
<td><a id="l3537" class='ln'>3537</a></td><td> <span class="br">}</span></td></tr>
<tr name="3538" id="3538">
<td><a id="l3538" class='ln'>3538</a></td><td> <span class="br">}</span></td></tr>
<tr name="3539" id="3539">
<td><a id="l3539" class='ln'>3539</a></td><td> <span class="kw">else</span></td></tr>
<tr name="3540" id="3540">
<td><a id="l3540" class='ln'>3540</a></td><td> <span class="br">{</span></td></tr>
<tr name="3541" id="3541">
<td><a id="l3541" class='ln'>3541</a></td><td> <span class="ct">/* if in range, fill in data that is converted first */</span></td></tr>
<tr name="3542" id="3542">
<td><a id="l3542" class='ln'>3542</a></td><td> <span class="kw">switch</span> ( <a id="3542c34" class="tk">dataTypeIdOriginal</a> )</td></tr>
<tr name="3543" id="3543">
<td><a id="l3543" class='ln'>3543</a></td><td> <span class="br">{</span></td></tr>
<tr name="3544" id="3544">
<td><a id="l3544" class='ln'>3544</a></td><td> <span class="kw">case</span> <a id="3544c32" class="tk">SS_DOUBLE</a><a id="3544c41" class="tk">:</a></td></tr>
<tr name="3545" id="3545">
<td><a id="l3545" class='ln'>3545</a></td><td> <span class="br">{</span></td></tr>
<tr name="3546" id="3546">
<td><a id="l3546" class='ln'>3546</a></td><td> <span class="kw">const</span> <a id="3546c39" class="tk">real_T</a> <a id="3546c46" class="tk">*</a><a id="3546c47" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3546c64" class="tk">real_T</a> <a id="3546c71" class="tk">*</a>)(<a id="3546c74" class="tk">cData</a> <a id="3546c80" class="tk">+</a> (<a id="3546c83" class="tk">i</a><a id="3546c84" class="tk">+</a><a id="3546c85" class="tk">frameSize</a><a id="3546c94" class="tk">*</a><a id="3546c95" class="tk">idx</a>)<a id="3546c99" class="tk">*</a> <a id="3546c101" class="tk">DpSize</a>);</td></tr>
<tr name="3547" id="3547">
<td><a id="l3547" class='ln'>3547</a></td><td> </td></tr>
<tr name="3548" id="3548">
<td><a id="l3548" class='ln'>3548</a></td><td> <a id="3548c33" class="tk">curRealValue</a> = <a id="3548c48" class="tk">ldexp</a>( <a id="3548c55" class="tk">fracSlope</a> <a id="3548c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3548c76" class="tk">*</a><a id="3548c77" class="tk">pInData</a>), <a id="3548c87" class="tk">fixedExp</a> ) <a id="3548c98" class="tk">+</a> <a id="3548c100" class="tk">bias</a>;</td></tr>
<tr name="3549" id="3549">
<td><a id="l3549" class='ln'>3549</a></td><td> <span class="kw">if</span> (<a id="3549c37" class="tk">var</a>-&gt;<a id="3549c42" class="tk">data</a>.<a id="3549c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3550" id="3550">
<td><a id="l3550" class='ln'>3550</a></td><td> <a id="3550c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3550c54" class="tk">real_T</a> <a id="3550c61" class="tk">*</a>)(<a id="3550c64" class="tk">cData</a> <a id="3550c70" class="tk">+</a> (<a id="3550c73" class="tk">i</a><a id="3550c74" class="tk">+</a><a id="3550c75" class="tk">frameSize</a><a id="3550c84" class="tk">*</a><a id="3550c85" class="tk">idx</a>)<a id="3550c89" class="tk">*</a> <a id="3550c91" class="tk">DpSize</a> <a id="3550c98" class="tk">+</a> <a id="3550c100" class="tk">DpSize</a><a id="3550c106" class="tk">/</a>2);</td></tr>
<tr name="3551" id="3551">
<td><a id="l3551" class='ln'>3551</a></td><td> <a id="3551c37" class="tk">curImagValue</a> = <a id="3551c52" class="tk">ldexp</a>( <a id="3551c59" class="tk">fracSlope</a> <a id="3551c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3551c80" class="tk">*</a><a id="3551c81" class="tk">pInData</a>), <a id="3551c91" class="tk">fixedExp</a> ) <a id="3551c102" class="tk">+</a> <a id="3551c104" class="tk">bias</a>;</td></tr>
<tr name="3552" id="3552">
<td><a id="l3552" class='ln'>3552</a></td><td> <span class="br">}</span></td></tr>
<tr name="3553" id="3553">
<td><a id="l3553" class='ln'>3553</a></td><td> <span class="br">}</span></td></tr>
<tr name="3554" id="3554">
<td><a id="l3554" class='ln'>3554</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3555" id="3555">
<td><a id="l3555" class='ln'>3555</a></td><td> <span class="kw">case</span> <a id="3555c32" class="tk">SS_SINGLE</a><a id="3555c41" class="tk">:</a></td></tr>
<tr name="3556" id="3556">
<td><a id="l3556" class='ln'>3556</a></td><td> <span class="br">{</span></td></tr>
<tr name="3557" id="3557">
<td><a id="l3557" class='ln'>3557</a></td><td> <span class="kw">const</span> <a id="3557c39" class="tk">real32_T</a> <a id="3557c48" class="tk">*</a><a id="3557c49" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3557c66" class="tk">real32_T</a> <a id="3557c75" class="tk">*</a>)(<a id="3557c78" class="tk">cData</a> <a id="3557c84" class="tk">+</a> (<a id="3557c87" class="tk">i</a><a id="3557c88" class="tk">+</a><a id="3557c89" class="tk">frameSize</a><a id="3557c98" class="tk">*</a><a id="3557c99" class="tk">idx</a>)<a id="3557c103" class="tk">*</a> <a id="3557c105" class="tk">DpSize</a>);</td></tr>
<tr name="3558" id="3558">
<td><a id="l3558" class='ln'>3558</a></td><td></td></tr>
<tr name="3559" id="3559">
<td><a id="l3559" class='ln'>3559</a></td><td> <a id="3559c33" class="tk">curRealValue</a> = <a id="3559c48" class="tk">ldexp</a>( <a id="3559c55" class="tk">fracSlope</a> <a id="3559c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3559c76" class="tk">*</a><a id="3559c77" class="tk">pInData</a>), <a id="3559c87" class="tk">fixedExp</a> ) <a id="3559c98" class="tk">+</a> <a id="3559c100" class="tk">bias</a>;</td></tr>
<tr name="3560" id="3560">
<td><a id="l3560" class='ln'>3560</a></td><td> <span class="kw">if</span> (<a id="3560c37" class="tk">var</a>-&gt;<a id="3560c42" class="tk">data</a>.<a id="3560c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3561" id="3561">
<td><a id="l3561" class='ln'>3561</a></td><td> <a id="3561c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3561c54" class="tk">real32_T</a> <a id="3561c63" class="tk">*</a>)(<a id="3561c66" class="tk">cData</a> <a id="3561c72" class="tk">+</a> (<a id="3561c75" class="tk">i</a><a id="3561c76" class="tk">+</a><a id="3561c77" class="tk">frameSize</a><a id="3561c86" class="tk">*</a><a id="3561c87" class="tk">idx</a>)<a id="3561c91" class="tk">*</a> <a id="3561c93" class="tk">DpSize</a> <a id="3561c100" class="tk">+</a> <a id="3561c102" class="tk">DpSize</a><a id="3561c108" class="tk">/</a>2);</td></tr>
<tr name="3562" id="3562">
<td><a id="l3562" class='ln'>3562</a></td><td> <a id="3562c37" class="tk">curImagValue</a> = <a id="3562c52" class="tk">ldexp</a>( <a id="3562c59" class="tk">fracSlope</a> <a id="3562c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3562c80" class="tk">*</a><a id="3562c81" class="tk">pInData</a>), <a id="3562c91" class="tk">fixedExp</a> ) <a id="3562c102" class="tk">+</a> <a id="3562c104" class="tk">bias</a>;</td></tr>
<tr name="3563" id="3563">
<td><a id="l3563" class='ln'>3563</a></td><td> <span class="br">}</span></td></tr>
<tr name="3564" id="3564">
<td><a id="l3564" class='ln'>3564</a></td><td> <span class="br">}</span></td></tr>
<tr name="3565" id="3565">
<td><a id="l3565" class='ln'>3565</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3566" id="3566">
<td><a id="l3566" class='ln'>3566</a></td><td> <span class="kw">case</span> <a id="3566c32" class="tk">SS_INT8</a><a id="3566c39" class="tk">:</a></td></tr>
<tr name="3567" id="3567">
<td><a id="l3567" class='ln'>3567</a></td><td> <span class="br">{</span></td></tr>
<tr name="3568" id="3568">
<td><a id="l3568" class='ln'>3568</a></td><td> <span class="kw">const</span> <a id="3568c39" class="tk">int8_T</a> <a id="3568c46" class="tk">*</a><a id="3568c47" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3568c64" class="tk">int8_T</a> <a id="3568c71" class="tk">*</a>)(<a id="3568c74" class="tk">cData</a> <a id="3568c80" class="tk">+</a> (<a id="3568c83" class="tk">i</a><a id="3568c84" class="tk">+</a><a id="3568c85" class="tk">frameSize</a><a id="3568c94" class="tk">*</a><a id="3568c95" class="tk">idx</a>)<a id="3568c99" class="tk">*</a> <a id="3568c101" class="tk">DpSize</a>);</td></tr>
<tr name="3569" id="3569">
<td><a id="l3569" class='ln'>3569</a></td><td> </td></tr>
<tr name="3570" id="3570">
<td><a id="l3570" class='ln'>3570</a></td><td> <a id="3570c33" class="tk">curRealValue</a> = <a id="3570c48" class="tk">ldexp</a>( <a id="3570c55" class="tk">fracSlope</a> <a id="3570c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3570c76" class="tk">*</a><a id="3570c77" class="tk">pInData</a>), <a id="3570c87" class="tk">fixedExp</a> ) <a id="3570c98" class="tk">+</a> <a id="3570c100" class="tk">bias</a>;</td></tr>
<tr name="3571" id="3571">
<td><a id="l3571" class='ln'>3571</a></td><td> <span class="kw">if</span> (<a id="3571c37" class="tk">var</a>-&gt;<a id="3571c42" class="tk">data</a>.<a id="3571c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3572" id="3572">
<td><a id="l3572" class='ln'>3572</a></td><td> <a id="3572c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3572c54" class="tk">int8_T</a> <a id="3572c61" class="tk">*</a>)(<a id="3572c64" class="tk">cData</a> <a id="3572c70" class="tk">+</a> (<a id="3572c73" class="tk">i</a><a id="3572c74" class="tk">+</a><a id="3572c75" class="tk">frameSize</a><a id="3572c84" class="tk">*</a><a id="3572c85" class="tk">idx</a>)<a id="3572c89" class="tk">*</a> <a id="3572c91" class="tk">DpSize</a> <a id="3572c98" class="tk">+</a> <a id="3572c100" class="tk">DpSize</a><a id="3572c106" class="tk">/</a>2);</td></tr>
<tr name="3573" id="3573">
<td><a id="l3573" class='ln'>3573</a></td><td> <a id="3573c37" class="tk">curImagValue</a> = <a id="3573c52" class="tk">ldexp</a>( <a id="3573c59" class="tk">fracSlope</a> <a id="3573c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3573c80" class="tk">*</a><a id="3573c81" class="tk">pInData</a>), <a id="3573c91" class="tk">fixedExp</a> ) <a id="3573c102" class="tk">+</a> <a id="3573c104" class="tk">bias</a>;</td></tr>
<tr name="3574" id="3574">
<td><a id="l3574" class='ln'>3574</a></td><td> <span class="br">}</span></td></tr>
<tr name="3575" id="3575">
<td><a id="l3575" class='ln'>3575</a></td><td> <span class="br">}</span></td></tr>
<tr name="3576" id="3576">
<td><a id="l3576" class='ln'>3576</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3577" id="3577">
<td><a id="l3577" class='ln'>3577</a></td><td> <span class="kw">case</span> <a id="3577c32" class="tk">SS_UINT8</a><a id="3577c40" class="tk">:</a></td></tr>
<tr name="3578" id="3578">
<td><a id="l3578" class='ln'>3578</a></td><td> <span class="br">{</span></td></tr>
<tr name="3579" id="3579">
<td><a id="l3579" class='ln'>3579</a></td><td> <span class="kw">const</span> <a id="3579c39" class="tk">uint8_T</a> <a id="3579c47" class="tk">*</a><a id="3579c48" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3579c65" class="tk">uint8_T</a> <a id="3579c73" class="tk">*</a>)(<a id="3579c76" class="tk">cData</a> <a id="3579c82" class="tk">+</a> (<a id="3579c85" class="tk">i</a><a id="3579c86" class="tk">+</a><a id="3579c87" class="tk">frameSize</a><a id="3579c96" class="tk">*</a><a id="3579c97" class="tk">idx</a>)<a id="3579c101" class="tk">*</a> <a id="3579c103" class="tk">DpSize</a>);</td></tr>
<tr name="3580" id="3580">
<td><a id="l3580" class='ln'>3580</a></td><td> </td></tr>
<tr name="3581" id="3581">
<td><a id="l3581" class='ln'>3581</a></td><td> <a id="3581c33" class="tk">curRealValue</a> = <a id="3581c48" class="tk">ldexp</a>( <a id="3581c55" class="tk">fracSlope</a> <a id="3581c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3581c76" class="tk">*</a><a id="3581c77" class="tk">pInData</a>), <a id="3581c87" class="tk">fixedExp</a> ) <a id="3581c98" class="tk">+</a> <a id="3581c100" class="tk">bias</a>;</td></tr>
<tr name="3582" id="3582">
<td><a id="l3582" class='ln'>3582</a></td><td> <span class="kw">if</span> (<a id="3582c37" class="tk">var</a>-&gt;<a id="3582c42" class="tk">data</a>.<a id="3582c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3583" id="3583">
<td><a id="l3583" class='ln'>3583</a></td><td> <a id="3583c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3583c54" class="tk">uint8_T</a> <a id="3583c62" class="tk">*</a>)(<a id="3583c65" class="tk">cData</a> <a id="3583c71" class="tk">+</a> (<a id="3583c74" class="tk">i</a><a id="3583c75" class="tk">+</a><a id="3583c76" class="tk">frameSize</a><a id="3583c85" class="tk">*</a><a id="3583c86" class="tk">idx</a>)<a id="3583c90" class="tk">*</a> <a id="3583c92" class="tk">DpSize</a> <a id="3583c99" class="tk">+</a> <a id="3583c101" class="tk">DpSize</a><a id="3583c107" class="tk">/</a>2);</td></tr>
<tr name="3584" id="3584">
<td><a id="l3584" class='ln'>3584</a></td><td> <a id="3584c37" class="tk">curImagValue</a> = <a id="3584c52" class="tk">ldexp</a>( <a id="3584c59" class="tk">fracSlope</a> <a id="3584c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3584c80" class="tk">*</a><a id="3584c81" class="tk">pInData</a>), <a id="3584c91" class="tk">fixedExp</a> ) <a id="3584c102" class="tk">+</a> <a id="3584c104" class="tk">bias</a>;</td></tr>
<tr name="3585" id="3585">
<td><a id="l3585" class='ln'>3585</a></td><td> <span class="br">}</span></td></tr>
<tr name="3586" id="3586">
<td><a id="l3586" class='ln'>3586</a></td><td> <span class="br">}</span></td></tr>
<tr name="3587" id="3587">
<td><a id="l3587" class='ln'>3587</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3588" id="3588">
<td><a id="l3588" class='ln'>3588</a></td><td> <span class="kw">case</span> <a id="3588c32" class="tk">SS_INT16</a><a id="3588c40" class="tk">:</a></td></tr>
<tr name="3589" id="3589">
<td><a id="l3589" class='ln'>3589</a></td><td> <span class="br">{</span></td></tr>
<tr name="3590" id="3590">
<td><a id="l3590" class='ln'>3590</a></td><td> <span class="kw">const</span> <a id="3590c39" class="tk">int16_T</a> <a id="3590c47" class="tk">*</a><a id="3590c48" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3590c65" class="tk">int16_T</a> <a id="3590c73" class="tk">*</a>)(<a id="3590c76" class="tk">cData</a> <a id="3590c82" class="tk">+</a> (<a id="3590c85" class="tk">i</a><a id="3590c86" class="tk">+</a><a id="3590c87" class="tk">frameSize</a><a id="3590c96" class="tk">*</a><a id="3590c97" class="tk">idx</a>)<a id="3590c101" class="tk">*</a> <a id="3590c103" class="tk">DpSize</a>);</td></tr>
<tr name="3591" id="3591">
<td><a id="l3591" class='ln'>3591</a></td><td> </td></tr>
<tr name="3592" id="3592">
<td><a id="l3592" class='ln'>3592</a></td><td> <a id="3592c33" class="tk">curRealValue</a> = <a id="3592c48" class="tk">ldexp</a>( <a id="3592c55" class="tk">fracSlope</a> <a id="3592c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3592c76" class="tk">*</a><a id="3592c77" class="tk">pInData</a>), <a id="3592c87" class="tk">fixedExp</a> ) <a id="3592c98" class="tk">+</a> <a id="3592c100" class="tk">bias</a>;</td></tr>
<tr name="3593" id="3593">
<td><a id="l3593" class='ln'>3593</a></td><td> <span class="kw">if</span> (<a id="3593c37" class="tk">var</a>-&gt;<a id="3593c42" class="tk">data</a>.<a id="3593c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3594" id="3594">
<td><a id="l3594" class='ln'>3594</a></td><td> <a id="3594c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3594c54" class="tk">int16_T</a> <a id="3594c62" class="tk">*</a>)(<a id="3594c65" class="tk">cData</a> <a id="3594c71" class="tk">+</a> (<a id="3594c74" class="tk">i</a><a id="3594c75" class="tk">+</a><a id="3594c76" class="tk">frameSize</a><a id="3594c85" class="tk">*</a><a id="3594c86" class="tk">idx</a>)<a id="3594c90" class="tk">*</a> <a id="3594c92" class="tk">DpSize</a> <a id="3594c99" class="tk">+</a> <a id="3594c101" class="tk">DpSize</a><a id="3594c107" class="tk">/</a>2);</td></tr>
<tr name="3595" id="3595">
<td><a id="l3595" class='ln'>3595</a></td><td> <a id="3595c37" class="tk">curImagValue</a> = <a id="3595c52" class="tk">ldexp</a>( <a id="3595c59" class="tk">fracSlope</a> <a id="3595c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3595c80" class="tk">*</a><a id="3595c81" class="tk">pInData</a>), <a id="3595c91" class="tk">fixedExp</a> ) <a id="3595c102" class="tk">+</a> <a id="3595c104" class="tk">bias</a>;</td></tr>
<tr name="3596" id="3596">
<td><a id="l3596" class='ln'>3596</a></td><td> <span class="br">}</span></td></tr>
<tr name="3597" id="3597">
<td><a id="l3597" class='ln'>3597</a></td><td> <span class="br">}</span></td></tr>
<tr name="3598" id="3598">
<td><a id="l3598" class='ln'>3598</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3599" id="3599">
<td><a id="l3599" class='ln'>3599</a></td><td> <span class="kw">case</span> <a id="3599c32" class="tk">SS_UINT16</a><a id="3599c41" class="tk">:</a></td></tr>
<tr name="3600" id="3600">
<td><a id="l3600" class='ln'>3600</a></td><td> <span class="br">{</span></td></tr>
<tr name="3601" id="3601">
<td><a id="l3601" class='ln'>3601</a></td><td> <span class="kw">const</span> <a id="3601c39" class="tk">uint16_T</a> <a id="3601c48" class="tk">*</a><a id="3601c49" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3601c66" class="tk">uint16_T</a> <a id="3601c75" class="tk">*</a>)(<a id="3601c78" class="tk">cData</a> <a id="3601c84" class="tk">+</a> (<a id="3601c87" class="tk">i</a><a id="3601c88" class="tk">+</a><a id="3601c89" class="tk">frameSize</a><a id="3601c98" class="tk">*</a><a id="3601c99" class="tk">idx</a>)<a id="3601c103" class="tk">*</a> <a id="3601c105" class="tk">DpSize</a>);</td></tr>
<tr name="3602" id="3602">
<td><a id="l3602" class='ln'>3602</a></td><td> </td></tr>
<tr name="3603" id="3603">
<td><a id="l3603" class='ln'>3603</a></td><td> <a id="3603c33" class="tk">curRealValue</a> = <a id="3603c48" class="tk">ldexp</a>( <a id="3603c55" class="tk">fracSlope</a> <a id="3603c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3603c76" class="tk">*</a><a id="3603c77" class="tk">pInData</a>), <a id="3603c87" class="tk">fixedExp</a> ) <a id="3603c98" class="tk">+</a> <a id="3603c100" class="tk">bias</a>;</td></tr>
<tr name="3604" id="3604">
<td><a id="l3604" class='ln'>3604</a></td><td> <span class="kw">if</span> (<a id="3604c37" class="tk">var</a>-&gt;<a id="3604c42" class="tk">data</a>.<a id="3604c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3605" id="3605">
<td><a id="l3605" class='ln'>3605</a></td><td> <a id="3605c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3605c54" class="tk">uint16_T</a> <a id="3605c63" class="tk">*</a>)(<a id="3605c66" class="tk">cData</a> <a id="3605c72" class="tk">+</a> (<a id="3605c75" class="tk">i</a><a id="3605c76" class="tk">+</a><a id="3605c77" class="tk">frameSize</a><a id="3605c86" class="tk">*</a><a id="3605c87" class="tk">idx</a>)<a id="3605c91" class="tk">*</a> <a id="3605c93" class="tk">DpSize</a> <a id="3605c100" class="tk">+</a> <a id="3605c102" class="tk">DpSize</a><a id="3605c108" class="tk">/</a>2);</td></tr>
<tr name="3606" id="3606">
<td><a id="l3606" class='ln'>3606</a></td><td> <a id="3606c37" class="tk">curImagValue</a> = <a id="3606c52" class="tk">ldexp</a>( <a id="3606c59" class="tk">fracSlope</a> <a id="3606c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3606c80" class="tk">*</a><a id="3606c81" class="tk">pInData</a>), <a id="3606c91" class="tk">fixedExp</a> ) <a id="3606c102" class="tk">+</a> <a id="3606c104" class="tk">bias</a>;</td></tr>
<tr name="3607" id="3607">
<td><a id="l3607" class='ln'>3607</a></td><td> <span class="br">}</span></td></tr>
<tr name="3608" id="3608">
<td><a id="l3608" class='ln'>3608</a></td><td> <span class="br">}</span></td></tr>
<tr name="3609" id="3609">
<td><a id="l3609" class='ln'>3609</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3610" id="3610">
<td><a id="l3610" class='ln'>3610</a></td><td> <span class="kw">case</span> <a id="3610c32" class="tk">SS_INT32</a><a id="3610c40" class="tk">:</a></td></tr>
<tr name="3611" id="3611">
<td><a id="l3611" class='ln'>3611</a></td><td> <span class="br">{</span></td></tr>
<tr name="3612" id="3612">
<td><a id="l3612" class='ln'>3612</a></td><td> <span class="kw">const</span> <a id="3612c39" class="tk">int32_T</a> <a id="3612c47" class="tk">*</a><a id="3612c48" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3612c65" class="tk">int32_T</a> <a id="3612c73" class="tk">*</a>)(<a id="3612c76" class="tk">cData</a> <a id="3612c82" class="tk">+</a> (<a id="3612c85" class="tk">i</a><a id="3612c86" class="tk">+</a><a id="3612c87" class="tk">frameSize</a><a id="3612c96" class="tk">*</a><a id="3612c97" class="tk">idx</a>)<a id="3612c101" class="tk">*</a> <a id="3612c103" class="tk">DpSize</a>);</td></tr>
<tr name="3613" id="3613">
<td><a id="l3613" class='ln'>3613</a></td><td></td></tr>
<tr name="3614" id="3614">
<td><a id="l3614" class='ln'>3614</a></td><td> <a id="3614c33" class="tk">curRealValue</a> = <a id="3614c48" class="tk">ldexp</a>( <a id="3614c55" class="tk">fracSlope</a> <a id="3614c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3614c76" class="tk">*</a><a id="3614c77" class="tk">pInData</a>), <a id="3614c87" class="tk">fixedExp</a> ) <a id="3614c98" class="tk">+</a> <a id="3614c100" class="tk">bias</a>;</td></tr>
<tr name="3615" id="3615">
<td><a id="l3615" class='ln'>3615</a></td><td> <span class="kw">if</span> (<a id="3615c37" class="tk">var</a>-&gt;<a id="3615c42" class="tk">data</a>.<a id="3615c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3616" id="3616">
<td><a id="l3616" class='ln'>3616</a></td><td> <a id="3616c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3616c54" class="tk">int32_T</a> <a id="3616c62" class="tk">*</a>)(<a id="3616c65" class="tk">cData</a> <a id="3616c71" class="tk">+</a> (<a id="3616c74" class="tk">i</a><a id="3616c75" class="tk">+</a><a id="3616c76" class="tk">frameSize</a><a id="3616c85" class="tk">*</a><a id="3616c86" class="tk">idx</a>)<a id="3616c90" class="tk">*</a> <a id="3616c92" class="tk">DpSize</a> <a id="3616c99" class="tk">+</a> <a id="3616c101" class="tk">DpSize</a><a id="3616c107" class="tk">/</a>2);</td></tr>
<tr name="3617" id="3617">
<td><a id="l3617" class='ln'>3617</a></td><td> <a id="3617c37" class="tk">curImagValue</a> = <a id="3617c52" class="tk">ldexp</a>( <a id="3617c59" class="tk">fracSlope</a> <a id="3617c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3617c80" class="tk">*</a><a id="3617c81" class="tk">pInData</a>), <a id="3617c91" class="tk">fixedExp</a> ) <a id="3617c102" class="tk">+</a> <a id="3617c104" class="tk">bias</a>;</td></tr>
<tr name="3618" id="3618">
<td><a id="l3618" class='ln'>3618</a></td><td> <span class="br">}</span></td></tr>
<tr name="3619" id="3619">
<td><a id="l3619" class='ln'>3619</a></td><td> <span class="br">}</span></td></tr>
<tr name="3620" id="3620">
<td><a id="l3620" class='ln'>3620</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3621" id="3621">
<td><a id="l3621" class='ln'>3621</a></td><td> <span class="kw">case</span> <a id="3621c32" class="tk">SS_UINT32</a><a id="3621c41" class="tk">:</a></td></tr>
<tr name="3622" id="3622">
<td><a id="l3622" class='ln'>3622</a></td><td> <span class="br">{</span></td></tr>
<tr name="3623" id="3623">
<td><a id="l3623" class='ln'>3623</a></td><td> <span class="kw">const</span> <a id="3623c39" class="tk">uint32_T</a> <a id="3623c48" class="tk">*</a><a id="3623c49" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3623c66" class="tk">uint32_T</a> <a id="3623c75" class="tk">*</a>)(<a id="3623c78" class="tk">cData</a> <a id="3623c84" class="tk">+</a> (<a id="3623c87" class="tk">i</a><a id="3623c88" class="tk">+</a><a id="3623c89" class="tk">frameSize</a><a id="3623c98" class="tk">*</a><a id="3623c99" class="tk">idx</a>)<a id="3623c103" class="tk">*</a> <a id="3623c105" class="tk">DpSize</a>);</td></tr>
<tr name="3624" id="3624">
<td><a id="l3624" class='ln'>3624</a></td><td> </td></tr>
<tr name="3625" id="3625">
<td><a id="l3625" class='ln'>3625</a></td><td> <a id="3625c33" class="tk">curRealValue</a> = <a id="3625c48" class="tk">ldexp</a>( <a id="3625c55" class="tk">fracSlope</a> <a id="3625c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3625c76" class="tk">*</a><a id="3625c77" class="tk">pInData</a>), <a id="3625c87" class="tk">fixedExp</a> ) <a id="3625c98" class="tk">+</a> <a id="3625c100" class="tk">bias</a>;</td></tr>
<tr name="3626" id="3626">
<td><a id="l3626" class='ln'>3626</a></td><td> <span class="kw">if</span> (<a id="3626c37" class="tk">var</a>-&gt;<a id="3626c42" class="tk">data</a>.<a id="3626c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3627" id="3627">
<td><a id="l3627" class='ln'>3627</a></td><td> <a id="3627c37" class="tk">pInData</a> = (<span class="kw">const</span> <a id="3627c54" class="tk">uint32_T</a> <a id="3627c63" class="tk">*</a>)(<a id="3627c66" class="tk">cData</a> <a id="3627c72" class="tk">+</a> (<a id="3627c75" class="tk">i</a><a id="3627c76" class="tk">+</a><a id="3627c77" class="tk">frameSize</a><a id="3627c86" class="tk">*</a><a id="3627c87" class="tk">idx</a>)<a id="3627c91" class="tk">*</a> <a id="3627c93" class="tk">DpSize</a> <a id="3627c100" class="tk">+</a> <a id="3627c102" class="tk">DpSize</a><a id="3627c108" class="tk">/</a>2);</td></tr>
<tr name="3628" id="3628">
<td><a id="l3628" class='ln'>3628</a></td><td> <a id="3628c37" class="tk">curImagValue</a> = <a id="3628c52" class="tk">ldexp</a>( <a id="3628c59" class="tk">fracSlope</a> <a id="3628c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3628c80" class="tk">*</a><a id="3628c81" class="tk">pInData</a>), <a id="3628c91" class="tk">fixedExp</a> ) <a id="3628c102" class="tk">+</a> <a id="3628c104" class="tk">bias</a>;</td></tr>
<tr name="3629" id="3629">
<td><a id="l3629" class='ln'>3629</a></td><td> <span class="br">}</span></td></tr>
<tr name="3630" id="3630">
<td><a id="l3630" class='ln'>3630</a></td><td> <span class="br">}</span></td></tr>
<tr name="3631" id="3631">
<td><a id="l3631" class='ln'>3631</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3632" id="3632">
<td><a id="l3632" class='ln'>3632</a></td><td> <span class="kw">case</span> <a id="3632c32" class="tk">SS_BOOLEAN</a><a id="3632c42" class="tk">:</a></td></tr>
<tr name="3633" id="3633">
<td><a id="l3633" class='ln'>3633</a></td><td> <span class="br">{</span></td></tr>
<tr name="3634" id="3634">
<td><a id="l3634" class='ln'>3634</a></td><td> <span class="kw">const</span> <a id="3634c39" class="tk">boolean_T</a> <a id="3634c49" class="tk">*</a><a id="3634c50" class="tk">pInData</a> = ((<span class="kw">const</span> <a id="3634c68" class="tk">boolean_T</a> <a id="3634c78" class="tk">*</a>)(<a id="3634c81" class="tk">cData</a>));</td></tr>
<tr name="3635" id="3635">
<td><a id="l3635" class='ln'>3635</a></td><td> </td></tr>
<tr name="3636" id="3636">
<td><a id="l3636" class='ln'>3636</a></td><td> <a id="3636c33" class="tk">pInData</a> <a id="3636c41" class="tk">+=</a> (<a id="3636c45" class="tk">i</a><a id="3636c46" class="tk">+</a><a id="3636c47" class="tk">frameSize</a><a id="3636c56" class="tk">*</a><a id="3636c57" class="tk">idx</a>) <a id="3636c62" class="tk">*</a> <a id="3636c64" class="tk">adjIndexIfComplex</a>;</td></tr>
<tr name="3637" id="3637">
<td><a id="l3637" class='ln'>3637</a></td><td> </td></tr>
<tr name="3638" id="3638">
<td><a id="l3638" class='ln'>3638</a></td><td> <a id="3638c33" class="tk">curRealValue</a> = <a id="3638c48" class="tk">ldexp</a>( <a id="3638c55" class="tk">fracSlope</a> <a id="3638c65" class="tk">*</a> (<span class="kw">double</span>)(<a id="3638c76" class="tk">*</a><a id="3638c77" class="tk">pInData</a>), <a id="3638c87" class="tk">fixedExp</a> ) <a id="3638c98" class="tk">+</a> <a id="3638c100" class="tk">bias</a>;</td></tr>
<tr name="3639" id="3639">
<td><a id="l3639" class='ln'>3639</a></td><td> <span class="kw">if</span> (<a id="3639c37" class="tk">var</a>-&gt;<a id="3639c42" class="tk">data</a>.<a id="3639c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3640" id="3640">
<td><a id="l3640" class='ln'>3640</a></td><td> <a id="3640c37" class="tk">curImagValue</a> = <a id="3640c52" class="tk">ldexp</a>( <a id="3640c59" class="tk">fracSlope</a> <a id="3640c69" class="tk">*</a> (<span class="kw">double</span>)(<a id="3640c80" class="tk">*</a><a id="3640c81" class="tk">pInData</a>), <a id="3640c91" class="tk">fixedExp</a> ) <a id="3640c102" class="tk">+</a> <a id="3640c104" class="tk">bias</a>;</td></tr>
<tr name="3641" id="3641">
<td><a id="l3641" class='ln'>3641</a></td><td> <span class="br">}</span></td></tr>
<tr name="3642" id="3642">
<td><a id="l3642" class='ln'>3642</a></td><td> <span class="br">}</span></td></tr>
<tr name="3643" id="3643">
<td><a id="l3643" class='ln'>3643</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3644" id="3644">
<td><a id="l3644" class='ln'>3644</a></td><td> <span class="kw">default</span><a id="3644c34" class="tk">:</a> </td></tr>
<tr name="3645" id="3645">
<td><a id="l3645" class='ln'>3645</a></td><td> <span class="br">{</span></td></tr>
<tr name="3646" id="3646">
<td><a id="l3646" class='ln'>3646</a></td><td> <span class="ct">/* For biglong */</span></td></tr>
<tr name="3647" id="3647">
<td><a id="l3647" class='ln'>3647</a></td><td> <span class="kw">const</span> <span class="kw">char</span> <a id="3647c44" class="tk">*</a><a id="3647c45" class="tk">pInData</a> = (<span class="kw">const</span> <span class="kw">char</span> <a id="3647c67" class="tk">*</a>)(<a id="3647c70" class="tk">cData</a>);</td></tr>
<tr name="3648" id="3648">
<td><a id="l3648" class='ln'>3648</a></td><td> <span class="kw">int</span> <a id="3648c37" class="tk">dtSize</a> = <a id="3648c46" class="tk">bitsPerChunk</a><a id="3648c58" class="tk">*</a><a id="3648c59" class="tk">numOfChunk</a><a id="3648c69" class="tk">/</a>8;</td></tr>
<tr name="3649" id="3649">
<td><a id="l3649" class='ln'>3649</a></td><td> <a id="3649c33" class="tk">pInData</a> <a id="3649c41" class="tk">+=</a> ((<a id="3649c46" class="tk">i</a><a id="3649c47" class="tk">+</a><a id="3649c48" class="tk">frameSize</a><a id="3649c57" class="tk">*</a><a id="3649c58" class="tk">idx</a>) <a id="3649c63" class="tk">*</a> <a id="3649c65" class="tk">adjIndexIfComplex</a>) <a id="3649c84" class="tk">*</a> <a id="3649c86" class="tk">dtSize</a>;</td></tr>
<tr name="3650" id="3650">
<td><a id="l3650" class='ln'>3650</a></td><td> </td></tr>
<tr name="3651" id="3651">
<td><a id="l3651" class='ln'>3651</a></td><td> <a id="3651c33" class="tk">curRealValue</a> = <a id="3651c48" class="tk">rt_GetDblValueFromOverSizedData</a>(<a id="3651c80" class="tk">pInData</a>, <a id="3651c89" class="tk">bitsPerChunk</a>, <a id="3651c103" class="tk">numOfChunk</a>, </td></tr>
<tr name="3652" id="3652">
<td><a id="l3652" class='ln'>3652</a></td><td> <a id="3652c80" class="tk">isSigned</a>, <a id="3652c90" class="tk">fracSlope</a>, <a id="3652c101" class="tk">fixedExp</a>, <a id="3652c111" class="tk">bias</a>);</td></tr>
<tr name="3653" id="3653">
<td><a id="l3653" class='ln'>3653</a></td><td> <span class="kw">if</span> (<a id="3653c37" class="tk">var</a>-&gt;<a id="3653c42" class="tk">data</a>.<a id="3653c47" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3654" id="3654">
<td><a id="l3654" class='ln'>3654</a></td><td> <a id="3654c37" class="tk">curImagValue</a> = <a id="3654c52" class="tk">rt_GetDblValueFromOverSizedData</a>((<a id="3654c85" class="tk">pInData</a><a id="3654c92" class="tk">+</a><a id="3654c93" class="tk">dtSize</a>), <a id="3654c102" class="tk">bitsPerChunk</a>, <a id="3654c116" class="tk">numOfChunk</a>, </td></tr>
<tr name="3655" id="3655">
<td><a id="l3655" class='ln'>3655</a></td><td> <a id="3655c84" class="tk">isSigned</a>, <a id="3655c94" class="tk">fracSlope</a>, <a id="3655c105" class="tk">fixedExp</a>, <a id="3655c115" class="tk">bias</a>);</td></tr>
<tr name="3656" id="3656">
<td><a id="l3656" class='ln'>3656</a></td><td> <span class="br">}</span></td></tr>
<tr name="3657" id="3657">
<td><a id="l3657" class='ln'>3657</a></td><td> <span class="br">}</span></td></tr>
<tr name="3658" id="3658">
<td><a id="l3658" class='ln'>3658</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3659" id="3659">
<td><a id="l3659" class='ln'>3659</a></td><td> <span class="br">}</span> <span class="ct">/* -- end of switch -- */</span></td></tr>
<tr name="3660" id="3660">
<td><a id="l3660" class='ln'>3660</a></td><td> <span class="br">}</span></td></tr>
<tr name="3661" id="3661">
<td><a id="l3661" class='ln'>3661</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3662" id="3662">
<td><a id="l3662" class='ln'>3662</a></td><td> <span class="ct">/* if out of range, just fill NaN or 0 */</span></td></tr>
<tr name="3663" id="3663">
<td><a id="l3663" class='ln'>3663</a></td><td> <span class="kw">if</span>(<a id="3663c24" class="tk">dTypeID</a> <a id="3663c32" class="tk">==</a> <a id="3663c35" class="tk">SS_DOUBLE</a> <a id="3663c45" class="tk">||</a> <a id="3663c48" class="tk">dTypeID</a> <a id="3663c56" class="tk">==</a> <a id="3663c59" class="tk">SS_SINGLE</a>)<span class="br">{</span></td></tr>
<tr name="3664" id="3664">
<td><a id="l3664" class='ln'>3664</a></td><td> <span class="ct">/* vijay 4/11/2013: DO NOT CALL ldexp() with NaN below as it causes </span></td></tr>
<tr name="3665" id="3665">
<td><a id="l3665" class='ln'>3665</a></td><td><span class="ct"> * lcc-win64 to generate inf instead of NaN as output. </span></td></tr>
<tr name="3666" id="3666">
<td><a id="l3666" class='ln'>3666</a></td><td><span class="ct"> * Just use rtNaN directly */</span></td></tr>
<tr name="3667" id="3667">
<td><a id="l3667" class='ln'>3667</a></td><td> <a id="3667c25" class="tk">curRealValue</a> = <a id="3667c40" class="tk">rtNaN</a>;</td></tr>
<tr name="3668" id="3668">
<td><a id="l3668" class='ln'>3668</a></td><td> <span class="br">}</span></td></tr>
<tr name="3669" id="3669">
<td><a id="l3669" class='ln'>3669</a></td><td> <span class="kw">else</span><span class="br">{</span></td></tr>
<tr name="3670" id="3670">
<td><a id="l3670" class='ln'>3670</a></td><td> <a id="3670c25" class="tk">curRealValue</a> = <a id="3670c40" class="tk">ldexp</a>( 0, <a id="3670c50" class="tk">fixedExp</a> ) <a id="3670c61" class="tk">+</a> <a id="3670c63" class="tk">bias</a>;</td></tr>
<tr name="3671" id="3671">
<td><a id="l3671" class='ln'>3671</a></td><td> <span class="br">}</span></td></tr>
<tr name="3672" id="3672">
<td><a id="l3672" class='ln'>3672</a></td><td> <span class="kw">if</span> (<a id="3672c25" class="tk">var</a>-&gt;<a id="3672c30" class="tk">data</a>.<a id="3672c35" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3673" id="3673">
<td><a id="l3673" class='ln'>3673</a></td><td> <span class="ct">/* fill 0 in imaginary part*/</span></td></tr>
<tr name="3674" id="3674">
<td><a id="l3674" class='ln'>3674</a></td><td> <a id="3674c25" class="tk">curImagValue</a> = <a id="3674c40" class="tk">ldexp</a>( 0, <a id="3674c50" class="tk">fixedExp</a> ) <a id="3674c61" class="tk">+</a> <a id="3674c63" class="tk">bias</a>;</td></tr>
<tr name="3675" id="3675">
<td><a id="l3675" class='ln'>3675</a></td><td> <span class="br">}</span></td></tr>
<tr name="3676" id="3676">
<td><a id="l3676" class='ln'>3676</a></td><td> <span class="br">}</span></td></tr>
<tr name="3677" id="3677">
<td><a id="l3677" class='ln'>3677</a></td><td></td></tr>
<tr name="3678" id="3678">
<td><a id="l3678" class='ln'>3678</a></td><td> <span class="kw">switch</span> ( <a id="3678c26" class="tk">dataTypeIdLoggingTo</a> )</td></tr>
<tr name="3679" id="3679">
<td><a id="l3679" class='ln'>3679</a></td><td> <span class="br">{</span></td></tr>
<tr name="3680" id="3680">
<td><a id="l3680" class='ln'>3680</a></td><td> <span class="kw">case</span> <a id="3680c24" class="tk">SS_DOUBLE</a><a id="3680c33" class="tk">:</a></td></tr>
<tr name="3681" id="3681">
<td><a id="l3681" class='ln'>3681</a></td><td> <span class="br">{</span></td></tr>
<tr name="3682" id="3682">
<td><a id="l3682" class='ln'>3682</a></td><td> <a id="3682c25" class="tk">*</a>((<a id="3682c28" class="tk">real_T</a> <a id="3682c35" class="tk">*</a>)<a id="3682c37" class="tk">currRealRow</a>) = (<a id="3682c53" class="tk">real_T</a>)<a id="3682c60" class="tk">curRealValue</a>;</td></tr>
<tr name="3683" id="3683">
<td><a id="l3683" class='ln'>3683</a></td><td></td></tr>
<tr name="3684" id="3684">
<td><a id="l3684" class='ln'>3684</a></td><td> <span class="kw">if</span> (<a id="3684c29" class="tk">var</a>-&gt;<a id="3684c34" class="tk">data</a>.<a id="3684c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3685" id="3685">
<td><a id="l3685" class='ln'>3685</a></td><td></td></tr>
<tr name="3686" id="3686">
<td><a id="l3686" class='ln'>3686</a></td><td> <a id="3686c29" class="tk">*</a>((<a id="3686c32" class="tk">real_T</a> <a id="3686c39" class="tk">*</a>)<a id="3686c41" class="tk">currImagRow</a>) = (<a id="3686c57" class="tk">real_T</a>)<a id="3686c64" class="tk">curImagValue</a>;</td></tr>
<tr name="3687" id="3687">
<td><a id="l3687" class='ln'>3687</a></td><td> <span class="br">}</span></td></tr>
<tr name="3688" id="3688">
<td><a id="l3688" class='ln'>3688</a></td><td> <span class="br">}</span></td></tr>
<tr name="3689" id="3689">
<td><a id="l3689" class='ln'>3689</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3690" id="3690">
<td><a id="l3690" class='ln'>3690</a></td><td> <span class="kw">case</span> <a id="3690c24" class="tk">SS_SINGLE</a><a id="3690c33" class="tk">:</a></td></tr>
<tr name="3691" id="3691">
<td><a id="l3691" class='ln'>3691</a></td><td> <span class="br">{</span></td></tr>
<tr name="3692" id="3692">
<td><a id="l3692" class='ln'>3692</a></td><td> <a id="3692c25" class="tk">*</a>((<a id="3692c28" class="tk">real32_T</a> <a id="3692c37" class="tk">*</a>)<a id="3692c39" class="tk">currRealRow</a>) = (<a id="3692c55" class="tk">real32_T</a>)<a id="3692c64" class="tk">curRealValue</a>;</td></tr>
<tr name="3693" id="3693">
<td><a id="l3693" class='ln'>3693</a></td><td></td></tr>
<tr name="3694" id="3694">
<td><a id="l3694" class='ln'>3694</a></td><td> <span class="kw">if</span> (<a id="3694c29" class="tk">var</a>-&gt;<a id="3694c34" class="tk">data</a>.<a id="3694c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3695" id="3695">
<td><a id="l3695" class='ln'>3695</a></td><td></td></tr>
<tr name="3696" id="3696">
<td><a id="l3696" class='ln'>3696</a></td><td> <a id="3696c29" class="tk">*</a>((<a id="3696c32" class="tk">real32_T</a> <a id="3696c41" class="tk">*</a>)<a id="3696c43" class="tk">currImagRow</a>) = (<a id="3696c59" class="tk">real32_T</a>)<a id="3696c68" class="tk">curImagValue</a>;</td></tr>
<tr name="3697" id="3697">
<td><a id="l3697" class='ln'>3697</a></td><td> <span class="br">}</span></td></tr>
<tr name="3698" id="3698">
<td><a id="l3698" class='ln'>3698</a></td><td> <span class="br">}</span></td></tr>
<tr name="3699" id="3699">
<td><a id="l3699" class='ln'>3699</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3700" id="3700">
<td><a id="l3700" class='ln'>3700</a></td><td> <span class="kw">case</span> <a id="3700c24" class="tk">SS_INT8</a><a id="3700c31" class="tk">:</a></td></tr>
<tr name="3701" id="3701">
<td><a id="l3701" class='ln'>3701</a></td><td> <span class="br">{</span></td></tr>
<tr name="3702" id="3702">
<td><a id="l3702" class='ln'>3702</a></td><td> <a id="3702c25" class="tk">*</a>((<a id="3702c28" class="tk">int8_T</a> <a id="3702c35" class="tk">*</a>)<a id="3702c37" class="tk">currRealRow</a>) = (<a id="3702c53" class="tk">int8_T</a>)<a id="3702c60" class="tk">curRealValue</a>;</td></tr>
<tr name="3703" id="3703">
<td><a id="l3703" class='ln'>3703</a></td><td></td></tr>
<tr name="3704" id="3704">
<td><a id="l3704" class='ln'>3704</a></td><td> <span class="kw">if</span> (<a id="3704c29" class="tk">var</a>-&gt;<a id="3704c34" class="tk">data</a>.<a id="3704c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3705" id="3705">
<td><a id="l3705" class='ln'>3705</a></td><td></td></tr>
<tr name="3706" id="3706">
<td><a id="l3706" class='ln'>3706</a></td><td> <a id="3706c29" class="tk">*</a>((<a id="3706c32" class="tk">int8_T</a> <a id="3706c39" class="tk">*</a>)<a id="3706c41" class="tk">currImagRow</a>) = (<a id="3706c57" class="tk">int8_T</a>)<a id="3706c64" class="tk">curImagValue</a>;</td></tr>
<tr name="3707" id="3707">
<td><a id="l3707" class='ln'>3707</a></td><td> <span class="br">}</span></td></tr>
<tr name="3708" id="3708">
<td><a id="l3708" class='ln'>3708</a></td><td> <span class="br">}</span></td></tr>
<tr name="3709" id="3709">
<td><a id="l3709" class='ln'>3709</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3710" id="3710">
<td><a id="l3710" class='ln'>3710</a></td><td> <span class="kw">case</span> <a id="3710c24" class="tk">SS_UINT8</a><a id="3710c32" class="tk">:</a></td></tr>
<tr name="3711" id="3711">
<td><a id="l3711" class='ln'>3711</a></td><td> <span class="br">{</span></td></tr>
<tr name="3712" id="3712">
<td><a id="l3712" class='ln'>3712</a></td><td> <a id="3712c25" class="tk">*</a>((<a id="3712c28" class="tk">uint8_T</a> <a id="3712c36" class="tk">*</a>)<a id="3712c38" class="tk">currRealRow</a>) = (<a id="3712c54" class="tk">uint8_T</a>)<a id="3712c62" class="tk">curRealValue</a>;</td></tr>
<tr name="3713" id="3713">
<td><a id="l3713" class='ln'>3713</a></td><td></td></tr>
<tr name="3714" id="3714">
<td><a id="l3714" class='ln'>3714</a></td><td> <span class="kw">if</span> (<a id="3714c29" class="tk">var</a>-&gt;<a id="3714c34" class="tk">data</a>.<a id="3714c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3715" id="3715">
<td><a id="l3715" class='ln'>3715</a></td><td></td></tr>
<tr name="3716" id="3716">
<td><a id="l3716" class='ln'>3716</a></td><td> <a id="3716c29" class="tk">*</a>((<a id="3716c32" class="tk">uint8_T</a> <a id="3716c40" class="tk">*</a>)<a id="3716c42" class="tk">currImagRow</a>) = (<a id="3716c58" class="tk">uint8_T</a>)<a id="3716c66" class="tk">curImagValue</a>;</td></tr>
<tr name="3717" id="3717">
<td><a id="l3717" class='ln'>3717</a></td><td> <span class="br">}</span></td></tr>
<tr name="3718" id="3718">
<td><a id="l3718" class='ln'>3718</a></td><td> <span class="br">}</span></td></tr>
<tr name="3719" id="3719">
<td><a id="l3719" class='ln'>3719</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3720" id="3720">
<td><a id="l3720" class='ln'>3720</a></td><td> <span class="kw">case</span> <a id="3720c24" class="tk">SS_INT16</a><a id="3720c32" class="tk">:</a></td></tr>
<tr name="3721" id="3721">
<td><a id="l3721" class='ln'>3721</a></td><td> <span class="br">{</span></td></tr>
<tr name="3722" id="3722">
<td><a id="l3722" class='ln'>3722</a></td><td> <a id="3722c25" class="tk">*</a>((<a id="3722c28" class="tk">int16_T</a> <a id="3722c36" class="tk">*</a>)<a id="3722c38" class="tk">currRealRow</a>) = (<a id="3722c54" class="tk">int16_T</a>)<a id="3722c62" class="tk">curRealValue</a>;</td></tr>
<tr name="3723" id="3723">
<td><a id="l3723" class='ln'>3723</a></td><td></td></tr>
<tr name="3724" id="3724">
<td><a id="l3724" class='ln'>3724</a></td><td> <span class="kw">if</span> (<a id="3724c29" class="tk">var</a>-&gt;<a id="3724c34" class="tk">data</a>.<a id="3724c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3725" id="3725">
<td><a id="l3725" class='ln'>3725</a></td><td></td></tr>
<tr name="3726" id="3726">
<td><a id="l3726" class='ln'>3726</a></td><td> <a id="3726c29" class="tk">*</a>((<a id="3726c32" class="tk">int16_T</a> <a id="3726c40" class="tk">*</a>)<a id="3726c42" class="tk">currImagRow</a>) = (<a id="3726c58" class="tk">int16_T</a>)<a id="3726c66" class="tk">curImagValue</a>;</td></tr>
<tr name="3727" id="3727">
<td><a id="l3727" class='ln'>3727</a></td><td> <span class="br">}</span></td></tr>
<tr name="3728" id="3728">
<td><a id="l3728" class='ln'>3728</a></td><td> <span class="br">}</span></td></tr>
<tr name="3729" id="3729">
<td><a id="l3729" class='ln'>3729</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3730" id="3730">
<td><a id="l3730" class='ln'>3730</a></td><td> <span class="kw">case</span> <a id="3730c24" class="tk">SS_UINT16</a><a id="3730c33" class="tk">:</a></td></tr>
<tr name="3731" id="3731">
<td><a id="l3731" class='ln'>3731</a></td><td> <span class="br">{</span></td></tr>
<tr name="3732" id="3732">
<td><a id="l3732" class='ln'>3732</a></td><td> <a id="3732c25" class="tk">*</a>((<a id="3732c28" class="tk">uint16_T</a> <a id="3732c37" class="tk">*</a>)<a id="3732c39" class="tk">currRealRow</a>) = (<a id="3732c55" class="tk">uint16_T</a>)<a id="3732c64" class="tk">curRealValue</a>;</td></tr>
<tr name="3733" id="3733">
<td><a id="l3733" class='ln'>3733</a></td><td></td></tr>
<tr name="3734" id="3734">
<td><a id="l3734" class='ln'>3734</a></td><td> <span class="kw">if</span> (<a id="3734c29" class="tk">var</a>-&gt;<a id="3734c34" class="tk">data</a>.<a id="3734c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3735" id="3735">
<td><a id="l3735" class='ln'>3735</a></td><td></td></tr>
<tr name="3736" id="3736">
<td><a id="l3736" class='ln'>3736</a></td><td> <a id="3736c29" class="tk">*</a>((<a id="3736c32" class="tk">uint16_T</a> <a id="3736c41" class="tk">*</a>)<a id="3736c43" class="tk">currImagRow</a>) = (<a id="3736c59" class="tk">uint16_T</a>)<a id="3736c68" class="tk">curImagValue</a>;</td></tr>
<tr name="3737" id="3737">
<td><a id="l3737" class='ln'>3737</a></td><td> <span class="br">}</span></td></tr>
<tr name="3738" id="3738">
<td><a id="l3738" class='ln'>3738</a></td><td> <span class="br">}</span></td></tr>
<tr name="3739" id="3739">
<td><a id="l3739" class='ln'>3739</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3740" id="3740">
<td><a id="l3740" class='ln'>3740</a></td><td> <span class="kw">case</span> <a id="3740c24" class="tk">SS_INT32</a><a id="3740c32" class="tk">:</a></td></tr>
<tr name="3741" id="3741">
<td><a id="l3741" class='ln'>3741</a></td><td> <span class="br">{</span></td></tr>
<tr name="3742" id="3742">
<td><a id="l3742" class='ln'>3742</a></td><td> <a id="3742c25" class="tk">*</a>((<a id="3742c28" class="tk">int32_T</a> <a id="3742c36" class="tk">*</a>)<a id="3742c38" class="tk">currRealRow</a>) = (<a id="3742c54" class="tk">int32_T</a>)<a id="3742c62" class="tk">curRealValue</a>;</td></tr>
<tr name="3743" id="3743">
<td><a id="l3743" class='ln'>3743</a></td><td></td></tr>
<tr name="3744" id="3744">
<td><a id="l3744" class='ln'>3744</a></td><td> <span class="kw">if</span> (<a id="3744c29" class="tk">var</a>-&gt;<a id="3744c34" class="tk">data</a>.<a id="3744c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3745" id="3745">
<td><a id="l3745" class='ln'>3745</a></td><td></td></tr>
<tr name="3746" id="3746">
<td><a id="l3746" class='ln'>3746</a></td><td> <a id="3746c29" class="tk">*</a>((<a id="3746c32" class="tk">int32_T</a> <a id="3746c40" class="tk">*</a>)<a id="3746c42" class="tk">currImagRow</a>) = (<a id="3746c58" class="tk">int32_T</a>)<a id="3746c66" class="tk">curImagValue</a>;</td></tr>
<tr name="3747" id="3747">
<td><a id="l3747" class='ln'>3747</a></td><td> <span class="br">}</span></td></tr>
<tr name="3748" id="3748">
<td><a id="l3748" class='ln'>3748</a></td><td> <span class="br">}</span></td></tr>
<tr name="3749" id="3749">
<td><a id="l3749" class='ln'>3749</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3750" id="3750">
<td><a id="l3750" class='ln'>3750</a></td><td> <span class="kw">case</span> <a id="3750c24" class="tk">SS_UINT32</a><a id="3750c33" class="tk">:</a></td></tr>
<tr name="3751" id="3751">
<td><a id="l3751" class='ln'>3751</a></td><td> <span class="br">{</span></td></tr>
<tr name="3752" id="3752">
<td><a id="l3752" class='ln'>3752</a></td><td> <a id="3752c25" class="tk">*</a>((<a id="3752c28" class="tk">uint32_T</a> <a id="3752c37" class="tk">*</a>)<a id="3752c39" class="tk">currRealRow</a>) = (<a id="3752c55" class="tk">uint32_T</a>)<a id="3752c64" class="tk">curRealValue</a>;</td></tr>
<tr name="3753" id="3753">
<td><a id="l3753" class='ln'>3753</a></td><td></td></tr>
<tr name="3754" id="3754">
<td><a id="l3754" class='ln'>3754</a></td><td> <span class="kw">if</span> (<a id="3754c29" class="tk">var</a>-&gt;<a id="3754c34" class="tk">data</a>.<a id="3754c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3755" id="3755">
<td><a id="l3755" class='ln'>3755</a></td><td></td></tr>
<tr name="3756" id="3756">
<td><a id="l3756" class='ln'>3756</a></td><td> <a id="3756c29" class="tk">*</a>((<a id="3756c32" class="tk">uint32_T</a> <a id="3756c41" class="tk">*</a>)<a id="3756c43" class="tk">currImagRow</a>) = (<a id="3756c59" class="tk">uint32_T</a>)<a id="3756c68" class="tk">curImagValue</a>;</td></tr>
<tr name="3757" id="3757">
<td><a id="l3757" class='ln'>3757</a></td><td> <span class="br">}</span></td></tr>
<tr name="3758" id="3758">
<td><a id="l3758" class='ln'>3758</a></td><td> <span class="br">}</span></td></tr>
<tr name="3759" id="3759">
<td><a id="l3759" class='ln'>3759</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3760" id="3760">
<td><a id="l3760" class='ln'>3760</a></td><td> <span class="kw">case</span> <a id="3760c24" class="tk">SS_BOOLEAN</a><a id="3760c34" class="tk">:</a></td></tr>
<tr name="3761" id="3761">
<td><a id="l3761" class='ln'>3761</a></td><td> <span class="br">{</span></td></tr>
<tr name="3762" id="3762">
<td><a id="l3762" class='ln'>3762</a></td><td> <a id="3762c25" class="tk">*</a>((<a id="3762c28" class="tk">boolean_T</a> <a id="3762c38" class="tk">*</a>)<a id="3762c40" class="tk">currRealRow</a>) = (<a id="3762c56" class="tk">boolean_T</a>)(<a id="3762c67" class="tk">curRealValue</a> <a id="3762c80" class="tk">!=</a> 0.0);</td></tr>
<tr name="3763" id="3763">
<td><a id="l3763" class='ln'>3763</a></td><td></td></tr>
<tr name="3764" id="3764">
<td><a id="l3764" class='ln'>3764</a></td><td> <span class="kw">if</span> (<a id="3764c29" class="tk">var</a>-&gt;<a id="3764c34" class="tk">data</a>.<a id="3764c39" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3765" id="3765">
<td><a id="l3765" class='ln'>3765</a></td><td></td></tr>
<tr name="3766" id="3766">
<td><a id="l3766" class='ln'>3766</a></td><td> <a id="3766c29" class="tk">*</a>((<a id="3766c32" class="tk">boolean_T</a> <a id="3766c42" class="tk">*</a>)<a id="3766c44" class="tk">currImagRow</a>) = (<a id="3766c60" class="tk">boolean_T</a>)(<a id="3766c71" class="tk">curImagValue</a> <a id="3766c84" class="tk">!=</a> 0.0);</td></tr>
<tr name="3767" id="3767">
<td><a id="l3767" class='ln'>3767</a></td><td> <span class="br">}</span></td></tr>
<tr name="3768" id="3768">
<td><a id="l3768" class='ln'>3768</a></td><td> <span class="br">}</span></td></tr>
<tr name="3769" id="3769">
<td><a id="l3769" class='ln'>3769</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3770" id="3770">
<td><a id="l3770" class='ln'>3770</a></td><td> <span class="br">}</span> <span class="ct">/* -- end of switch -- */</span></td></tr>
<tr name="3771" id="3771">
<td><a id="l3771" class='ln'>3771</a></td><td></td></tr>
<tr name="3772" id="3772">
<td><a id="l3772" class='ln'>3772</a></td><td> <a id="3772c17" class="tk">currRealRow</a> <a id="3772c29" class="tk">+=</a> <a id="3772c32" class="tk">elSize</a>;</td></tr>
<tr name="3773" id="3773">
<td><a id="l3773" class='ln'>3773</a></td><td> <span class="kw">if</span> (<a id="3773c21" class="tk">var</a>-&gt;<a id="3773c26" class="tk">data</a>.<a id="3773c31" class="tk">complex</a>) <span class="br">{</span></td></tr>
<tr name="3774" id="3774">
<td><a id="l3774" class='ln'>3774</a></td><td> <a id="3774c21" class="tk">currImagRow</a> <a id="3774c33" class="tk">+=</a> <a id="3774c36" class="tk">elSize</a>;</td></tr>
<tr name="3775" id="3775">
<td><a id="l3775" class='ln'>3775</a></td><td> <span class="br">}</span></td></tr>
<tr name="3776" id="3776">
<td><a id="l3776" class='ln'>3776</a></td><td> <span class="br">}</span></td></tr>
<tr name="3777" id="3777">
<td><a id="l3777" class='ln'>3777</a></td><td> <span class="br">}</span></td></tr>
<tr name="3778" id="3778">
<td><a id="l3778" class='ln'>3778</a></td><td></td></tr>
<tr name="3779" id="3779">
<td><a id="l3779" class='ln'>3779</a></td><td> <span class="kw">if</span>(<a id="3779c12" class="tk">isVarDims</a>)<span class="br">{</span> <span class="ct">/* update "valueDimensions" field */</span></td></tr>
<tr name="3780" id="3780">
<td><a id="l3780" class='ln'>3780</a></td><td> <span class="kw">for</span>(<a id="3780c17" class="tk">j</a> = 0; <a id="3780c24" class="tk">j</a> <a id="3780c26" class="tk">&lt;</a> <a id="3780c28" class="tk">logWidth_valDims</a>; <a id="3780c46" class="tk">j</a> <a id="3780c48" class="tk">++</a>)<span class="br">{</span></td></tr>
<tr name="3781" id="3781">
<td><a id="l3781" class='ln'>3781</a></td><td> <a id="3781c17" class="tk">int32_T</a> <a id="3781c25" class="tk">currDimsVal</a>=0;</td></tr>
<tr name="3782" id="3782">
<td><a id="l3782" class='ln'>3782</a></td><td> <span class="kw">switch</span> (<a id="3782c25" class="tk">currDimsSizePtr</a>[<a id="3782c41" class="tk">j</a>]) <span class="br">{</span></td></tr>
<tr name="3783" id="3783">
<td><a id="l3783" class='ln'>3783</a></td><td> <span class="kw">case</span> 1<a id="3783c25" class="tk">:</a></td></tr>
<tr name="3784" id="3784">
<td><a id="l3784" class='ln'>3784</a></td><td> <a id="3784c21" class="tk">currDimsVal</a> = (<a id="3784c36" class="tk">*</a><a id="3784c37" class="tk">*</a>(((<span class="kw">const</span> <a id="3784c47" class="tk">uint8_T</a> <a id="3784c55" class="tk">*</a> <span class="kw">const</span> <a id="3784c63" class="tk">*</a>) <a id="3784c66" class="tk">currDimsPtr</a>)<a id="3784c78" class="tk">+</a><a id="3784c79" class="tk">j</a>));</td></tr>
<tr name="3785" id="3785">
<td><a id="l3785" class='ln'>3785</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3786" id="3786">
<td><a id="l3786" class='ln'>3786</a></td><td> <span class="kw">case</span> 2<a id="3786c25" class="tk">:</a></td></tr>
<tr name="3787" id="3787">
<td><a id="l3787" class='ln'>3787</a></td><td> <a id="3787c21" class="tk">currDimsVal</a> = (<a id="3787c36" class="tk">*</a><a id="3787c37" class="tk">*</a>(((<span class="kw">const</span> <a id="3787c47" class="tk">uint16_T</a> <a id="3787c56" class="tk">*</a> <span class="kw">const</span> <a id="3787c64" class="tk">*</a>) <a id="3787c67" class="tk">currDimsPtr</a>)<a id="3787c79" class="tk">+</a><a id="3787c80" class="tk">j</a>));</td></tr>
<tr name="3788" id="3788">
<td><a id="l3788" class='ln'>3788</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3789" id="3789">
<td><a id="l3789" class='ln'>3789</a></td><td> <span class="kw">case</span> 4<a id="3789c25" class="tk">:</a></td></tr>
<tr name="3790" id="3790">
<td><a id="l3790" class='ln'>3790</a></td><td> <a id="3790c21" class="tk">currDimsVal</a> = (<a id="3790c36" class="tk">*</a><a id="3790c37" class="tk">*</a>(((<span class="kw">const</span> <a id="3790c47" class="tk">uint32_T</a> <a id="3790c56" class="tk">*</a> <span class="kw">const</span> <a id="3790c64" class="tk">*</a>) <a id="3790c67" class="tk">currDimsPtr</a>)<a id="3790c79" class="tk">+</a><a id="3790c80" class="tk">j</a>));</td></tr>
<tr name="3791" id="3791">
<td><a id="l3791" class='ln'>3791</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="3792" id="3792">
<td><a id="l3792" class='ln'>3792</a></td><td> <span class="br">}</span></td></tr>
<tr name="3793" id="3793">
<td><a id="l3793" class='ln'>3793</a></td><td> <a id="3793c17" class="tk">offset_valDims</a> = (<a id="3793c36" class="tk">size_t</a>)(<a id="3793c44" class="tk">elSize_valDims</a> <a id="3793c59" class="tk">*</a>( <a id="3793c62" class="tk">var</a>-&gt;<a id="3793c67" class="tk">rowIdx</a> <a id="3793c74" class="tk">+</a> <a id="3793c76" class="tk">nRows_valDims</a> <a id="3793c90" class="tk">*</a> <a id="3793c92" class="tk">j</a>));</td></tr>
<tr name="3794" id="3794">
<td><a id="l3794" class='ln'>3794</a></td><td> <a id="3794c17" class="tk">currValDimsRow</a> = ((<a id="3794c37" class="tk">char_T</a><a id="3794c43" class="tk">*</a>) (<a id="3794c47" class="tk">var</a>-&gt;<a id="3794c52" class="tk">valDims</a>-&gt;<a id="3794c61" class="tk">dimsData</a>)) <a id="3794c72" class="tk">+</a> <a id="3794c74" class="tk">offset_valDims</a>;</td></tr>
<tr name="3795" id="3795">
<td><a id="l3795" class='ln'>3795</a></td><td></td></tr>
<tr name="3796" id="3796">
<td><a id="l3796" class='ln'>3796</a></td><td> <span class="ct">/* convert int_T to real_T */</span></td></tr>
<tr name="3797" id="3797">
<td><a id="l3797" class='ln'>3797</a></td><td> <a id="3797c17" class="tk">currentSigDims</a> = (<a id="3797c35" class="tk">real_T</a>) <a id="3797c43" class="tk">currDimsVal</a>;</td></tr>
<tr name="3798" id="3798">
<td><a id="l3798" class='ln'>3798</a></td><td> (<span class="kw">void</span>) <a id="3798c24" class="tk">memcpy</a>(<a id="3798c31" class="tk">currValDimsRow</a>, <a id="3798c47" class="tk">&amp;</a><a id="3798c48" class="tk">currentSigDims</a>, <a id="3798c64" class="tk">elSize_valDims</a>);</td></tr>
<tr name="3799" id="3799">
<td><a id="l3799" class='ln'>3799</a></td><td> <a id="3799c17" class="tk">currValDimsRow</a> <a id="3799c32" class="tk">+=</a> <a id="3799c35" class="tk">elSize_valDims</a>;</td></tr>
<tr name="3800" id="3800">
<td><a id="l3800" class='ln'>3800</a></td><td> <span class="br">}</span></td></tr>
<tr name="3801" id="3801">
<td><a id="l3801" class='ln'>3801</a></td><td> <span class="br">}</span></td></tr>
<tr name="3802" id="3802">
<td><a id="l3802" class='ln'>3802</a></td><td> </td></tr>
<tr name="3803" id="3803">
<td><a id="l3803" class='ln'>3803</a></td><td> <a id="3803c9" class="tk">++</a><a id="3803c11" class="tk">var</a>-&gt;<a id="3803c16" class="tk">rowIdx</a>;</td></tr>
<tr name="3804" id="3804">
<td><a id="l3804" class='ln'>3804</a></td><td> <span class="br">}</span></td></tr>
<tr name="3805" id="3805">
<td><a id="l3805" class='ln'>3805</a></td><td></td></tr>
<tr name="3806" id="3806">
<td><a id="l3806" class='ln'>3806</a></td><td> <span class="kw">return</span>;</td></tr>
<tr name="3807" id="3807">
<td><a id="l3807" class='ln'>3807</a></td><td></td></tr>
<tr name="3808" id="3808">
<td><a id="l3808" class='ln'>3808</a></td><td><span class="br">}</span> <span class="ct">/* end rt_UpdateLogVar */</span></td></tr>
<tr name="3809" id="3809">
<td><a id="l3809" class='ln'>3809</a></td><td></td></tr>
<tr name="3810" id="3810">
<td><a id="l3810" class='ln'>3810</a></td><td></td></tr>
<tr name="3811" id="3811">
<td><a id="l3811" class='ln'>3811</a></td><td><span class="pp">#ifdef</span> <a id="3811c8" class="tk">__cplusplus</a></td></tr>
<tr name="3812" id="3812">
<td><a id="l3812" class='ln'>3812</a></td><td><span class="br">}</span></td></tr>
<tr name="3813" id="3813">
<td><a id="l3813" class='ln'>3813</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3814" id="3814">
<td><a id="l3814" class='ln'>3814</a></td><td></td></tr>
<tr name="3815" id="3815">
<td><a id="l3815" class='ln'>3815</a></td><td></td></tr>
<tr name="3816" id="3816">
<td><a id="l3816" class='ln'>3816</a></td><td></td></tr>
<tr name="3817" id="3817">
<td><a id="l3817" class='ln'>3817</a></td><td></td></tr>
<tr name="3818" id="3818">
<td><a id="l3818" class='ln'>3818</a></td><td><span class="pp">#ifdef</span> <a id="3818c8" class="tk">__cplusplus</a></td></tr>
<tr name="3819" id="3819">
<td><a id="l3819" class='ln'>3819</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3820" id="3820">
<td><a id="l3820" class='ln'>3820</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3821" id="3821">
<td><a id="l3821" class='ln'>3821</a></td><td> </td></tr>
<tr name="3822" id="3822">
<td><a id="l3822" class='ln'>3822</a></td><td> </td></tr>
<tr name="3823" id="3823">
<td><a id="l3823" class='ln'>3823</a></td><td><span class="ct">/* Function: rt_UpdateStructLogVar =============================================</span></td></tr>
<tr name="3824" id="3824">
<td><a id="l3824" class='ln'>3824</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3825" id="3825">
<td><a id="l3825" class='ln'>3825</a></td><td><span class="ct"> * Called to log data for a structure log variable.</span></td></tr>
<tr name="3826" id="3826">
<td><a id="l3826" class='ln'>3826</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3827" id="3827">
<td><a id="l3827" class='ln'>3827</a></td><td><span class="kw">void</span> <a id="3827c6" class="tk">rt_UpdateStructLogVar</a>(<a id="3827c28" class="tk">StructLogVar</a> <a id="3827c41" class="tk">*</a><a id="3827c42" class="tk">var</a>, <span class="kw">const</span> <a id="3827c53" class="tk">real_T</a> <a id="3827c60" class="tk">*</a><a id="3827c61" class="tk">t</a>, <span class="kw">const</span> <span class="kw">void</span> <a id="3827c75" class="tk">*</a><a id="3827c76" class="tk">data</a>)</td></tr>
<tr name="3828" id="3828">
<td><a id="l3828" class='ln'>3828</a></td><td><span class="br">{</span></td></tr>
<tr name="3829" id="3829">
<td><a id="l3829" class='ln'>3829</a></td><td> <a id="3829c5" class="tk">LogVar</a> <a id="3829c18" class="tk">*</a><a id="3829c19" class="tk">values</a> = <a id="3829c28" class="tk">var</a>-&gt;<a id="3829c33" class="tk">signals</a>.<a id="3829c41" class="tk">values</a>;</td></tr>
<tr name="3830" id="3830">
<td><a id="l3830" class='ln'>3830</a></td><td> <span class="kw">const</span> <a id="3830c11" class="tk">char_T</a> <a id="3830c18" class="tk">*</a><a id="3830c19" class="tk">signal</a> = <a id="3830c28" class="tk">data</a>;</td></tr>
<tr name="3831" id="3831">
<td><a id="l3831" class='ln'>3831</a></td><td> <a id="3831c5" class="tk">boolean_T</a> <a id="3831c15" class="tk">*</a><a id="3831c16" class="tk">isVarDims</a> = <a id="3831c28" class="tk">var</a>-&gt;<a id="3831c33" class="tk">signals</a>.<a id="3831c41" class="tk">isVarDims</a>;</td></tr>
<tr name="3832" id="3832">
<td><a id="l3832" class='ln'>3832</a></td><td> <span class="kw">int</span> <a id="3832c9" class="tk">i</a> = 0;</td></tr>
<tr name="3833" id="3833">
<td><a id="l3833" class='ln'>3833</a></td><td></td></tr>
<tr name="3834" id="3834">
<td><a id="l3834" class='ln'>3834</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="3835" id="3835">
<td><a id="l3835" class='ln'>3835</a></td><td> <span class="kw">if</span> (<a id="3835c9" class="tk">var</a>-&gt;<a id="3835c14" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="3836" id="3836">
<td><a id="l3836" class='ln'>3836</a></td><td> <a id="3836c9" class="tk">rt_UpdateLogVar</a>(<a id="3836c25" class="tk">var</a>-&gt;<a id="3836c30" class="tk">time</a>, <a id="3836c36" class="tk">t</a>, false);</td></tr>
<tr name="3837" id="3837">
<td><a id="l3837" class='ln'>3837</a></td><td> <span class="br">}</span></td></tr>
<tr name="3838" id="3838">
<td><a id="l3838" class='ln'>3838</a></td><td></td></tr>
<tr name="3839" id="3839">
<td><a id="l3839" class='ln'>3839</a></td><td> <span class="ct">/* signals */</span></td></tr>
<tr name="3840" id="3840">
<td><a id="l3840" class='ln'>3840</a></td><td> <span class="kw">while</span> (<a id="3840c12" class="tk">values</a>) <span class="br">{</span></td></tr>
<tr name="3841" id="3841">
<td><a id="l3841" class='ln'>3841</a></td><td> <a id="3841c9" class="tk">size_t</a> <a id="3841c16" class="tk">elSz</a> = <a id="3841c23" class="tk">values</a>-&gt;<a id="3841c31" class="tk">data</a>.<a id="3841c36" class="tk">elSize</a>;</td></tr>
<tr name="3842" id="3842">
<td><a id="l3842" class='ln'>3842</a></td><td></td></tr>
<tr name="3843" id="3843">
<td><a id="l3843" class='ln'>3843</a></td><td> <a id="3843c9" class="tk">rt_UpdateLogVar</a>(<a id="3843c25" class="tk">values</a>, <a id="3843c33" class="tk">signal</a>, <a id="3843c41" class="tk">isVarDims</a>[<a id="3843c51" class="tk">i</a>]);</td></tr>
<tr name="3844" id="3844">
<td><a id="l3844" class='ln'>3844</a></td><td></td></tr>
<tr name="3845" id="3845">
<td><a id="l3845" class='ln'>3845</a></td><td> <span class="kw">if</span> (<a id="3845c13" class="tk">values</a>-&gt;<a id="3845c21" class="tk">data</a>.<a id="3845c26" class="tk">complex</a>) <a id="3845c35" class="tk">elSz</a> <a id="3845c40" class="tk">*=</a> 2;</td></tr>
<tr name="3846" id="3846">
<td><a id="l3846" class='ln'>3846</a></td><td> <a id="3846c9" class="tk">signal</a> <a id="3846c16" class="tk">+=</a> <a id="3846c19" class="tk">elSz</a> <a id="3846c24" class="tk">*</a> <a id="3846c26" class="tk">values</a>-&gt;<a id="3846c34" class="tk">data</a>.<a id="3846c39" class="tk">nCols</a>;</td></tr>
<tr name="3847" id="3847">
<td><a id="l3847" class='ln'>3847</a></td><td></td></tr>
<tr name="3848" id="3848">
<td><a id="l3848" class='ln'>3848</a></td><td> <a id="3848c9" class="tk">values</a> = <a id="3848c18" class="tk">values</a>-&gt;<a id="3848c26" class="tk">next</a>;</td></tr>
<tr name="3849" id="3849">
<td><a id="l3849" class='ln'>3849</a></td><td> <a id="3849c9" class="tk">i</a><a id="3849c10" class="tk">++</a>;</td></tr>
<tr name="3850" id="3850">
<td><a id="l3850" class='ln'>3850</a></td><td> <span class="br">}</span></td></tr>
<tr name="3851" id="3851">
<td><a id="l3851" class='ln'>3851</a></td><td></td></tr>
<tr name="3852" id="3852">
<td><a id="l3852" class='ln'>3852</a></td><td><span class="br">}</span> <span class="ct">/* end rt_UpdateStructLogVar */</span></td></tr>
<tr name="3853" id="3853">
<td><a id="l3853" class='ln'>3853</a></td><td></td></tr>
<tr name="3854" id="3854">
<td><a id="l3854" class='ln'>3854</a></td><td></td></tr>
<tr name="3855" id="3855">
<td><a id="l3855" class='ln'>3855</a></td><td><span class="pp">#ifdef</span> <a id="3855c8" class="tk">__cplusplus</a></td></tr>
<tr name="3856" id="3856">
<td><a id="l3856" class='ln'>3856</a></td><td><span class="br">}</span></td></tr>
<tr name="3857" id="3857">
<td><a id="l3857" class='ln'>3857</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3858" id="3858">
<td><a id="l3858" class='ln'>3858</a></td><td></td></tr>
<tr name="3859" id="3859">
<td><a id="l3859" class='ln'>3859</a></td><td></td></tr>
<tr name="3860" id="3860">
<td><a id="l3860" class='ln'>3860</a></td><td></td></tr>
<tr name="3861" id="3861">
<td><a id="l3861" class='ln'>3861</a></td><td></td></tr>
<tr name="3862" id="3862">
<td><a id="l3862" class='ln'>3862</a></td><td><span class="pp">#ifdef</span> <a id="3862c8" class="tk">__cplusplus</a></td></tr>
<tr name="3863" id="3863">
<td><a id="l3863" class='ln'>3863</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="3864" id="3864">
<td><a id="l3864" class='ln'>3864</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="3865" id="3865">
<td><a id="l3865" class='ln'>3865</a></td><td></td></tr>
<tr name="3866" id="3866">
<td><a id="l3866" class='ln'>3866</a></td><td><span class="ct">/*</span></td></tr>
<tr name="3867" id="3867">
<td><a id="l3867" class='ln'>3867</a></td><td><span class="ct"> * g1614989:Refactoring this function to accept number of elements</span></td></tr>
<tr name="3868" id="3868">
<td><a id="l3868" class='ln'>3868</a></td><td><span class="ct"> * instead of accepting signalInfo and index.</span></td></tr>
<tr name="3869" id="3869">
<td><a id="l3869" class='ln'>3869</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3870" id="3870">
<td><a id="l3870" class='ln'>3870</a></td><td><span class="kw">void</span><a id="3870c5" class="tk">*</a> <a id="3870c7" class="tk">rt_getTempMemory</a>(<a id="3870c24" class="tk">LogVar</a><a id="3870c30" class="tk">*</a> <a id="3870c32" class="tk">var</a>, <a id="3870c37" class="tk">int_T</a> <a id="3870c43" class="tk">numEls</a>);</td></tr>
<tr name="3871" id="3871">
<td><a id="l3871" class='ln'>3871</a></td><td></td></tr>
<tr name="3872" id="3872">
<td><a id="l3872" class='ln'>3872</a></td><td><span class="kw">void</span><a id="3872c5" class="tk">*</a> <a id="3872c7" class="tk">rt_getTempMemory</a>(<a id="3872c24" class="tk">LogVar</a><a id="3872c30" class="tk">*</a> <a id="3872c32" class="tk">var</a>, <a id="3872c37" class="tk">int_T</a> <a id="3872c43" class="tk">numEls</a>)</td></tr>
<tr name="3873" id="3873">
<td><a id="l3873" class='ln'>3873</a></td><td><span class="br">{</span></td></tr>
<tr name="3874" id="3874">
<td><a id="l3874" class='ln'>3874</a></td><td> <a id="3874c5" class="tk">size_t</a> <a id="3874c12" class="tk">elSize</a> = <a id="3874c22" class="tk">var</a>-&gt;<a id="3874c27" class="tk">data</a>.<a id="3874c32" class="tk">elSize</a>;</td></tr>
<tr name="3875" id="3875">
<td><a id="l3875" class='ln'>3875</a></td><td> <a id="3875c5" class="tk">size_t</a> <a id="3875c12" class="tk">cmplxMult</a> = <a id="3875c24" class="tk">var</a>-&gt;<a id="3875c29" class="tk">data</a>.<a id="3875c34" class="tk">complex</a> <a id="3875c42" class="tk">?</a> 2 <a id="3875c46" class="tk">:</a> 1;</td></tr>
<tr name="3876" id="3876">
<td><a id="l3876" class='ln'>3876</a></td><td> <span class="ct">/*</span></td></tr>
<tr name="3877" id="3877">
<td><a id="l3877" class='ln'>3877</a></td><td><span class="ct"> * g1689750: With multiword support for mat file logging in row major array layout, we need to allocate more space to</span></td></tr>
<tr name="3878" id="3878">
<td><a id="l3878" class='ln'>3878</a></td><td><span class="ct"> * store the data when the transpose operation is being performed. The additional space is required to store multiple</span></td></tr>
<tr name="3879" id="3879">
<td><a id="l3879" class='ln'>3879</a></td><td><span class="ct"> * chunks that each multi word contains.</span></td></tr>
<tr name="3880" id="3880">
<td><a id="l3880" class='ln'>3880</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3881" id="3881">
<td><a id="l3881" class='ln'>3881</a></td><td> <a id="3881c5" class="tk">size_t</a> <a id="3881c12" class="tk">numOfChunks</a> = <a id="3881c26" class="tk">var</a>-&gt;<a id="3881c31" class="tk">data</a>.<a id="3881c36" class="tk">dataTypeConvertInfo</a>.<a id="3881c56" class="tk">conversionNeeded</a> <a id="3881c73" class="tk">?</a> <a id="3881c75" class="tk">var</a>-&gt;<a id="3881c80" class="tk">data</a>.<a id="3881c85" class="tk">dataTypeConvertInfo</a>.<a id="3881c105" class="tk">numOfChunk</a> <a id="3881c116" class="tk">:</a> 1;</td></tr>
<tr name="3882" id="3882">
<td><a id="l3882" class='ln'>3882</a></td><td> <span class="kw">void</span><a id="3882c9" class="tk">*</a> <a id="3882c11" class="tk">tempMemory</a> = <a id="3882c24" class="tk">malloc</a>(<a id="3882c31" class="tk">elSize</a> <a id="3882c38" class="tk">*</a> <a id="3882c40" class="tk">numEls</a> <a id="3882c47" class="tk">*</a> <a id="3882c49" class="tk">cmplxMult</a> <a id="3882c59" class="tk">*</a> <a id="3882c61" class="tk">numOfChunks</a>);</td></tr>
<tr name="3883" id="3883">
<td><a id="l3883" class='ln'>3883</a></td><td> <span class="kw">return</span> <a id="3883c12" class="tk">tempMemory</a>;</td></tr>
<tr name="3884" id="3884">
<td><a id="l3884" class='ln'>3884</a></td><td><span class="br">}</span></td></tr>
<tr name="3885" id="3885">
<td><a id="l3885" class='ln'>3885</a></td><td></td></tr>
<tr name="3886" id="3886">
<td><a id="l3886" class='ln'>3886</a></td><td><span class="ct">/*</span></td></tr>
<tr name="3887" id="3887">
<td><a id="l3887" class='ln'>3887</a></td><td><span class="ct">* g1614989:This function processes the signal data if a function pointer is available and then logs the data.</span></td></tr>
<tr name="3888" id="3888">
<td><a id="l3888" class='ln'>3888</a></td><td><span class="ct">* If a function pointer is not present, signal data is logged without any processing.</span></td></tr>
<tr name="3889" id="3889">
<td><a id="l3889" class='ln'>3889</a></td><td><span class="ct">* The idx parameter specifies which information from the SignalInfo to be used for processing and logging.</span></td></tr>
<tr name="3890" id="3890">
<td><a id="l3890" class='ln'>3890</a></td><td><span class="ct">* When idx is -1, the provided signal info is to be used for processing and logging the data.</span></td></tr>
<tr name="3891" id="3891">
<td><a id="l3891" class='ln'>3891</a></td><td><span class="ct">*/</span></td></tr>
<tr name="3892" id="3892">
<td><a id="l3892" class='ln'>3892</a></td><td><span class="kw">void</span> <a id="3892c6" class="tk">rt_preProcessAndLogDataWithIndex</a>(<span class="kw">const</span> <a id="3892c45" class="tk">RTWLogSignalInfo</a> <a id="3892c62" class="tk">*</a><a id="3892c63" class="tk">signalInfo</a>, <a id="3892c75" class="tk">int_T</a> <a id="3892c81" class="tk">idx</a>, <a id="3892c86" class="tk">LogVar</a><a id="3892c92" class="tk">*</a> <a id="3892c94" class="tk">val</a>, <span class="kw">const</span> <span class="kw">void</span> <a id="3892c110" class="tk">*</a> <a id="3892c112" class="tk">data</a>, <a id="3892c118" class="tk">boolean_T</a> <a id="3892c128" class="tk">isVarDims</a>);</td></tr>
<tr name="3893" id="3893">
<td><a id="l3893" class='ln'>3893</a></td><td></td></tr>
<tr name="3894" id="3894">
<td><a id="l3894" class='ln'>3894</a></td><td><span class="kw">void</span> <a id="3894c6" class="tk">rt_preProcessAndLogDataWithIndex</a>(<span class="kw">const</span> <a id="3894c45" class="tk">RTWLogSignalInfo</a> <a id="3894c62" class="tk">*</a><a id="3894c63" class="tk">signalInfo</a>, <a id="3894c75" class="tk">int_T</a> <a id="3894c81" class="tk">idx</a>, <a id="3894c86" class="tk">LogVar</a><a id="3894c92" class="tk">*</a> <a id="3894c94" class="tk">val</a>, <span class="kw">const</span> <span class="kw">void</span> <a id="3894c110" class="tk">*</a> <a id="3894c112" class="tk">data</a>, <a id="3894c118" class="tk">boolean_T</a> <a id="3894c128" class="tk">isVarDims</a>)</td></tr>
<tr name="3895" id="3895">
<td><a id="l3895" class='ln'>3895</a></td><td><span class="br">{</span></td></tr>
<tr name="3896" id="3896">
<td><a id="l3896" class='ln'>3896</a></td><td> <a id="3896c5" class="tk">RTWPreprocessingFcnPtr</a> <a id="3896c28" class="tk">preprocessingPtr</a> = <a id="3896c47" class="tk">NULL</a>;</td></tr>
<tr name="3897" id="3897">
<td><a id="l3897" class='ln'>3897</a></td><td> <a id="3897c5" class="tk">int_T</a> <a id="3897c11" class="tk">numEls</a> = <a id="3897c20" class="tk">-</a>1;</td></tr>
<tr name="3898" id="3898">
<td><a id="l3898" class='ln'>3898</a></td><td> <span class="kw">if</span> (<a id="3898c9" class="tk">idx</a> <a id="3898c13" class="tk">==</a> <a id="3898c16" class="tk">-</a>1) <span class="br">{</span></td></tr>
<tr name="3899" id="3899">
<td><a id="l3899" class='ln'>3899</a></td><td> <a id="3899c9" class="tk">preprocessingPtr</a> = <a id="3899c28" class="tk">*</a>(<a id="3899c30" class="tk">signalInfo</a>-&gt;<a id="3899c42" class="tk">preprocessingPtrs</a>);</td></tr>
<tr name="3900" id="3900">
<td><a id="l3900" class='ln'>3900</a></td><td> <a id="3900c9" class="tk">numEls</a> = <a id="3900c18" class="tk">*</a>(<a id="3900c20" class="tk">signalInfo</a>-&gt;<a id="3900c32" class="tk">numCols</a>);</td></tr>
<tr name="3901" id="3901">
<td><a id="l3901" class='ln'>3901</a></td><td> <span class="br">}</span></td></tr>
<tr name="3902" id="3902">
<td><a id="l3902" class='ln'>3902</a></td><td> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3903" id="3903">
<td><a id="l3903" class='ln'>3903</a></td><td> <a id="3903c9" class="tk">preprocessingPtr</a> = <a id="3903c28" class="tk">signalInfo</a>-&gt;<a id="3903c40" class="tk">preprocessingPtrs</a>[<a id="3903c58" class="tk">idx</a>];</td></tr>
<tr name="3904" id="3904">
<td><a id="l3904" class='ln'>3904</a></td><td> <a id="3904c9" class="tk">numEls</a> = <a id="3904c18" class="tk">signalInfo</a>-&gt;<a id="3904c30" class="tk">numCols</a>[<a id="3904c38" class="tk">idx</a>];</td></tr>
<tr name="3905" id="3905">
<td><a id="l3905" class='ln'>3905</a></td><td> <span class="br">}</span></td></tr>
<tr name="3906" id="3906">
<td><a id="l3906" class='ln'>3906</a></td><td></td></tr>
<tr name="3907" id="3907">
<td><a id="l3907" class='ln'>3907</a></td><td> <span class="kw">if</span> (<a id="3907c9" class="tk">preprocessingPtr</a> <a id="3907c26" class="tk">!=</a> <a id="3907c29" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3908" id="3908">
<td><a id="l3908" class='ln'>3908</a></td><td> <span class="kw">void</span><a id="3908c13" class="tk">*</a> <a id="3908c15" class="tk">curData</a> = <a id="3908c25" class="tk">rt_getTempMemory</a>(<a id="3908c42" class="tk">val</a>, <a id="3908c47" class="tk">numEls</a>);</td></tr>
<tr name="3909" id="3909">
<td><a id="l3909" class='ln'>3909</a></td><td> <a id="3909c9" class="tk">preprocessingPtr</a>(<a id="3909c26" class="tk">curData</a>, <a id="3909c35" class="tk">data</a>);</td></tr>
<tr name="3910" id="3910">
<td><a id="l3910" class='ln'>3910</a></td><td> <a id="3910c9" class="tk">rt_UpdateLogVar</a>(<a id="3910c25" class="tk">val</a>, <a id="3910c30" class="tk">curData</a>, <a id="3910c39" class="tk">isVarDims</a>);</td></tr>
<tr name="3911" id="3911">
<td><a id="l3911" class='ln'>3911</a></td><td> <a id="3911c9" class="tk">free</a>(<a id="3911c14" class="tk">curData</a>);</td></tr>
<tr name="3912" id="3912">
<td><a id="l3912" class='ln'>3912</a></td><td> <span class="br">}</span></td></tr>
<tr name="3913" id="3913">
<td><a id="l3913" class='ln'>3913</a></td><td> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="3914" id="3914">
<td><a id="l3914" class='ln'>3914</a></td><td> <a id="3914c9" class="tk">rt_UpdateLogVar</a>(<a id="3914c25" class="tk">val</a>, <a id="3914c30" class="tk">data</a>, <a id="3914c36" class="tk">isVarDims</a>);</td></tr>
<tr name="3915" id="3915">
<td><a id="l3915" class='ln'>3915</a></td><td> <span class="br">}</span></td></tr>
<tr name="3916" id="3916">
<td><a id="l3916" class='ln'>3916</a></td><td><span class="br">}</span></td></tr>
<tr name="3917" id="3917">
<td><a id="l3917" class='ln'>3917</a></td><td></td></tr>
<tr name="3918" id="3918">
<td><a id="l3918" class='ln'>3918</a></td><td><span class="ct">/*</span></td></tr>
<tr name="3919" id="3919">
<td><a id="l3919" class='ln'>3919</a></td><td><span class="ct">* g1614989:This function is called when each signal has a specific RTWLogSignalInfo structure defined.</span></td></tr>
<tr name="3920" id="3920">
<td><a id="l3920" class='ln'>3920</a></td><td><span class="ct">*/</span></td></tr>
<tr name="3921" id="3921">
<td><a id="l3921" class='ln'>3921</a></td><td></td></tr>
<tr name="3922" id="3922">
<td><a id="l3922" class='ln'>3922</a></td><td><span class="kw">void</span> <a id="3922c6" class="tk">rt_preProcessAndLogData</a>(<a id="3922c30" class="tk">RTWLogSignalInfo</a> <a id="3922c47" class="tk">signalInfo</a>, <a id="3922c59" class="tk">LogVar</a><a id="3922c65" class="tk">*</a> <a id="3922c67" class="tk">val</a>, <span class="kw">const</span> <span class="kw">void</span> <a id="3922c83" class="tk">*</a> <a id="3922c85" class="tk">data</a>, <a id="3922c91" class="tk">boolean_T</a> <a id="3922c101" class="tk">isVarDims</a>);</td></tr>
<tr name="3923" id="3923">
<td><a id="l3923" class='ln'>3923</a></td><td></td></tr>
<tr name="3924" id="3924">
<td><a id="l3924" class='ln'>3924</a></td><td><span class="kw">void</span> <a id="3924c6" class="tk">rt_preProcessAndLogData</a>(<a id="3924c30" class="tk">RTWLogSignalInfo</a> <a id="3924c47" class="tk">signalInfo</a>, <a id="3924c59" class="tk">LogVar</a><a id="3924c65" class="tk">*</a> <a id="3924c67" class="tk">val</a>, <span class="kw">const</span> <span class="kw">void</span> <a id="3924c83" class="tk">*</a> <a id="3924c85" class="tk">data</a>, <a id="3924c91" class="tk">boolean_T</a> <a id="3924c101" class="tk">isVarDims</a>)</td></tr>
<tr name="3925" id="3925">
<td><a id="l3925" class='ln'>3925</a></td><td><span class="br">{</span></td></tr>
<tr name="3926" id="3926">
<td><a id="l3926" class='ln'>3926</a></td><td> <a id="3926c5" class="tk">rt_preProcessAndLogDataWithIndex</a>(<a id="3926c38" class="tk">&amp;</a><a id="3926c39" class="tk">signalInfo</a>, <a id="3926c51" class="tk">-</a>1, <a id="3926c55" class="tk">val</a>, <a id="3926c60" class="tk">data</a>, <a id="3926c66" class="tk">isVarDims</a>);</td></tr>
<tr name="3927" id="3927">
<td><a id="l3927" class='ln'>3927</a></td><td><span class="br">}</span></td></tr>
<tr name="3928" id="3928">
<td><a id="l3928" class='ln'>3928</a></td><td> </td></tr>
<tr name="3929" id="3929">
<td><a id="l3929" class='ln'>3929</a></td><td><span class="ct">/* Function: rt_UpdateTXYLogVars ===============================================</span></td></tr>
<tr name="3930" id="3930">
<td><a id="l3930" class='ln'>3930</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3931" id="3931">
<td><a id="l3931" class='ln'>3931</a></td><td><span class="ct"> * Update the xFinal,T,X,Y variables that are being logged.</span></td></tr>
<tr name="3932" id="3932">
<td><a id="l3932" class='ln'>3932</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3933" id="3933">
<td><a id="l3933" class='ln'>3933</a></td><td><span class="kw">const</span> <a id="3933c7" class="tk">char_T</a> <a id="3933c14" class="tk">*</a><a id="3933c15" class="tk">rt_UpdateTXYLogVars</a>(<a id="3933c35" class="tk">RTWLogInfo</a> <a id="3933c46" class="tk">*</a><a id="3933c47" class="tk">li</a>, <a id="3933c51" class="tk">time_T</a> <a id="3933c58" class="tk">*</a><a id="3933c59" class="tk">tPtr</a>)</td></tr>
<tr name="3934" id="3934">
<td><a id="l3934" class='ln'>3934</a></td><td><span class="br">{</span></td></tr>
<tr name="3935" id="3935">
<td><a id="l3935" class='ln'>3935</a></td><td> <span class="kw">return</span> <a id="3935c12" class="tk">rt_UpdateTXXFYLogVars</a>(<a id="3935c34" class="tk">li</a>, <a id="3935c38" class="tk">tPtr</a>, true);</td></tr>
<tr name="3936" id="3936">
<td><a id="l3936" class='ln'>3936</a></td><td><span class="br">}</span></td></tr>
<tr name="3937" id="3937">
<td><a id="l3937" class='ln'>3937</a></td><td> </td></tr>
<tr name="3938" id="3938">
<td><a id="l3938" class='ln'>3938</a></td><td><span class="ct">/* Function: rt_UpdateTXXFYLogVars =============================================</span></td></tr>
<tr name="3939" id="3939">
<td><a id="l3939" class='ln'>3939</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="3940" id="3940">
<td><a id="l3940" class='ln'>3940</a></td><td><span class="ct"> * Update xFinal and/or the T,X,Y variables that are being logged</span></td></tr>
<tr name="3941" id="3941">
<td><a id="l3941" class='ln'>3941</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3942" id="3942">
<td><a id="l3942" class='ln'>3942</a></td><td><span class="kw">const</span> <a id="3942c7" class="tk">char_T</a> <a id="3942c14" class="tk">*</a><a id="3942c15" class="tk">rt_UpdateTXXFYLogVars</a>(<a id="3942c37" class="tk">RTWLogInfo</a> <a id="3942c48" class="tk">*</a><a id="3942c49" class="tk">li</a>, <a id="3942c53" class="tk">time_T</a> <a id="3942c60" class="tk">*</a><a id="3942c61" class="tk">tPtr</a>, <a id="3942c67" class="tk">boolean_T</a> <a id="3942c77" class="tk">updateTXY</a>)</td></tr>
<tr name="3943" id="3943">
<td><a id="l3943" class='ln'>3943</a></td><td><span class="br">{</span></td></tr>
<tr name="3944" id="3944">
<td><a id="l3944" class='ln'>3944</a></td><td> <a id="3944c5" class="tk">LogInfo</a> <a id="3944c13" class="tk">*</a><a id="3944c14" class="tk">logInfo</a> = <a id="3944c28" class="tk">rtliGetLogInfo</a>(<a id="3944c43" class="tk">li</a>);</td></tr>
<tr name="3945" id="3945">
<td><a id="l3945" class='ln'>3945</a></td><td> <a id="3945c5" class="tk">int_T</a> <a id="3945c13" class="tk">matrixFormat</a> = (<a id="3945c29" class="tk">rtliGetLogFormat</a>(<a id="3945c46" class="tk">li</a>) <a id="3945c50" class="tk">==</a> 0);</td></tr>
<tr name="3946" id="3946">
<td><a id="l3946" class='ln'>3946</a></td><td> <span class="kw">const</span> <a id="3946c11" class="tk">RTWLogSignalInfo</a><a id="3946c27" class="tk">*</a> <a id="3946c29" class="tk">yInfo</a> = <a id="3946c37" class="tk">rtliGetLogYSignalInfo</a>(<a id="3946c59" class="tk">li</a>);</td></tr>
<tr name="3947" id="3947">
<td><a id="l3947" class='ln'>3947</a></td><td> <span class="kw">const</span> <a id="3947c11" class="tk">RTWLogSignalInfo</a><a id="3947c27" class="tk">*</a> <a id="3947c29" class="tk">xInfo</a> = <a id="3947c37" class="tk">rtliGetLogXSignalInfo</a>(<a id="3947c59" class="tk">li</a>);</td></tr>
<tr name="3948" id="3948">
<td><a id="l3948" class='ln'>3948</a></td><td></td></tr>
<tr name="3949" id="3949">
<td><a id="l3949" class='ln'>3949</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="3950" id="3950">
<td><a id="l3950" class='ln'>3950</a></td><td> <span class="kw">if</span> (<a id="3950c9" class="tk">logInfo</a>-&gt;<a id="3950c18" class="tk">t</a> <a id="3950c20" class="tk">!=</a> <a id="3950c23" class="tk">NULL</a> <a id="3950c28" class="tk">&amp;&amp;</a> <a id="3950c31" class="tk">updateTXY</a>) <span class="br">{</span></td></tr>
<tr name="3951" id="3951">
<td><a id="l3951" class='ln'>3951</a></td><td> <a id="3951c9" class="tk">rt_UpdateLogVar</a>(<a id="3951c25" class="tk">logInfo</a>-&gt;<a id="3951c34" class="tk">t</a>, <a id="3951c37" class="tk">tPtr</a>, false);</td></tr>
<tr name="3952" id="3952">
<td><a id="l3952" class='ln'>3952</a></td><td> <span class="br">}</span></td></tr>
<tr name="3953" id="3953">
<td><a id="l3953" class='ln'>3953</a></td><td></td></tr>
<tr name="3954" id="3954">
<td><a id="l3954" class='ln'>3954</a></td><td> <span class="kw">if</span> (<a id="3954c9" class="tk">matrixFormat</a>) <span class="br">{</span> <span class="ct">/* MATRIX_FORMAT */</span></td></tr>
<tr name="3955" id="3955">
<td><a id="l3955" class='ln'>3955</a></td><td> <span class="ct">/* states */</span></td></tr>
<tr name="3956" id="3956">
<td><a id="l3956" class='ln'>3956</a></td><td> <span class="kw">if</span> (<a id="3956c13" class="tk">logInfo</a>-&gt;<a id="3956c22" class="tk">x</a> <a id="3956c24" class="tk">!=</a> <a id="3956c27" class="tk">NULL</a> <a id="3956c32" class="tk">||</a> <a id="3956c35" class="tk">logInfo</a>-&gt;<a id="3956c44" class="tk">xFinal</a> <a id="3956c51" class="tk">!=</a> <a id="3956c54" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3957" id="3957">
<td><a id="l3957" class='ln'>3957</a></td><td> <a id="3957c13" class="tk">int8_T</a><a id="3957c19" class="tk">*</a><a id="3957c20" class="tk">*</a> <a id="3957c36" class="tk">segAddr</a> = <a id="3957c50" class="tk">_rtliGetLogXSignalPtrs</a>(<a id="3957c73" class="tk">li</a>);</td></tr>
<tr name="3958" id="3958">
<td><a id="l3958" class='ln'>3958</a></td><td> <span class="kw">const</span> <a id="3958c19" class="tk">int_T</a> <a id="3958c36" class="tk">*</a><a id="3958c37" class="tk">segLengths</a> = <a id="3958c50" class="tk">xInfo</a>-&gt;<a id="3958c57" class="tk">numCols</a>;</td></tr>
<tr name="3959" id="3959">
<td><a id="l3959" class='ln'>3959</a></td><td> <a id="3959c13" class="tk">int_T</a> <a id="3959c36" class="tk">nSegments</a> = <a id="3959c50" class="tk">xInfo</a>-&gt;<a id="3959c57" class="tk">numSignals</a>;</td></tr>
<tr name="3960" id="3960">
<td><a id="l3960" class='ln'>3960</a></td><td> <a id="3960c13" class="tk">RTWPreprocessingFcnPtr</a><a id="3960c35" class="tk">*</a> <a id="3960c37" class="tk">preprocessingPtrs</a> = <a id="3960c57" class="tk">xInfo</a>-&gt;<a id="3960c64" class="tk">preprocessingPtrs</a>;</td></tr>
<tr name="3961" id="3961">
<td><a id="l3961" class='ln'>3961</a></td><td></td></tr>
<tr name="3962" id="3962">
<td><a id="l3962" class='ln'>3962</a></td><td> <span class="kw">if</span> (<a id="3962c17" class="tk">logInfo</a>-&gt;<a id="3962c26" class="tk">x</a> <a id="3962c28" class="tk">!=</a> <a id="3962c31" class="tk">NULL</a> <a id="3962c36" class="tk">&amp;&amp;</a> <a id="3962c39" class="tk">updateTXY</a>) <span class="br">{</span></td></tr>
<tr name="3963" id="3963">
<td><a id="l3963" class='ln'>3963</a></td><td> <span class="kw">const</span> <a id="3963c23" class="tk">char_T</a> <a id="3963c30" class="tk">*</a><a id="3963c31" class="tk">errorMessage</a> = <a id="3963c46" class="tk">rt_UpdateLogVarWithDiscontiguousData</a>(<a id="3963c83" class="tk">logInfo</a>-&gt;<a id="3963c92" class="tk">x</a>, <a id="3963c95" class="tk">segAddr</a>,</td></tr>
<tr name="3964" id="3964">
<td><a id="l3964" class='ln'>3964</a></td><td> <a id="3964c83" class="tk">segLengths</a>, <a id="3964c95" class="tk">nSegments</a>, </td></tr>
<tr name="3965" id="3965">
<td><a id="l3965" class='ln'>3965</a></td><td> <a id="3965c83" class="tk">preprocessingPtrs</a>);</td></tr>
<tr name="3966" id="3966">
<td><a id="l3966" class='ln'>3966</a></td><td> <span class="kw">if</span> (<a id="3966c21" class="tk">errorMessage</a> <a id="3966c34" class="tk">!=</a> <a id="3966c37" class="tk">NULL</a>) <span class="kw">return</span>(<a id="3966c50" class="tk">errorMessage</a>);</td></tr>
<tr name="3967" id="3967">
<td><a id="l3967" class='ln'>3967</a></td><td> <span class="br">}</span></td></tr>
<tr name="3968" id="3968">
<td><a id="l3968" class='ln'>3968</a></td><td> <span class="kw">if</span> (<a id="3968c17" class="tk">logInfo</a>-&gt;<a id="3968c26" class="tk">xFinal</a> <a id="3968c33" class="tk">!=</a> <a id="3968c36" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3969" id="3969">
<td><a id="l3969" class='ln'>3969</a></td><td> <span class="kw">const</span> <a id="3969c23" class="tk">char_T</a> <a id="3969c30" class="tk">*</a><a id="3969c31" class="tk">errorMessage</a> = <a id="3969c46" class="tk">rt_UpdateLogVarWithDiscontiguousData</a>(<a id="3969c83" class="tk">logInfo</a>-&gt;<a id="3969c92" class="tk">xFinal</a>, <a id="3969c100" class="tk">segAddr</a>,</td></tr>
<tr name="3970" id="3970">
<td><a id="l3970" class='ln'>3970</a></td><td> <a id="3970c83" class="tk">segLengths</a>, <a id="3970c95" class="tk">nSegments</a>, </td></tr>
<tr name="3971" id="3971">
<td><a id="l3971" class='ln'>3971</a></td><td> <a id="3971c83" class="tk">preprocessingPtrs</a>);</td></tr>
<tr name="3972" id="3972">
<td><a id="l3972" class='ln'>3972</a></td><td> <span class="kw">if</span> (<a id="3972c21" class="tk">errorMessage</a> <a id="3972c34" class="tk">!=</a> <a id="3972c37" class="tk">NULL</a>) <span class="kw">return</span>(<a id="3972c50" class="tk">errorMessage</a>);</td></tr>
<tr name="3973" id="3973">
<td><a id="l3973" class='ln'>3973</a></td><td> <span class="br">}</span></td></tr>
<tr name="3974" id="3974">
<td><a id="l3974" class='ln'>3974</a></td><td> <span class="br">}</span></td></tr>
<tr name="3975" id="3975">
<td><a id="l3975" class='ln'>3975</a></td><td> <span class="ct">/* outputs */</span></td></tr>
<tr name="3976" id="3976">
<td><a id="l3976" class='ln'>3976</a></td><td> <span class="kw">if</span> (<a id="3976c13" class="tk">logInfo</a>-&gt;<a id="3976c22" class="tk">y</a> <a id="3976c24" class="tk">!=</a> <a id="3976c27" class="tk">NULL</a> <a id="3976c32" class="tk">&amp;&amp;</a> <a id="3976c35" class="tk">updateTXY</a>) <span class="br">{</span></td></tr>
<tr name="3977" id="3977">
<td><a id="l3977" class='ln'>3977</a></td><td> <a id="3977c13" class="tk">LogVar</a> <a id="3977c20" class="tk">*</a><a id="3977c21" class="tk">*</a><a id="3977c22" class="tk">var</a> = (<a id="3977c29" class="tk">LogVar</a><a id="3977c35" class="tk">*</a><a id="3977c36" class="tk">*</a>) (<a id="3977c40" class="tk">logInfo</a>-&gt;<a id="3977c49" class="tk">y</a>);</td></tr>
<tr name="3978" id="3978">
<td><a id="l3978" class='ln'>3978</a></td><td> <a id="3978c13" class="tk">int_T</a> <a id="3978c20" class="tk">ny</a> = <a id="3978c28" class="tk">logInfo</a>-&gt;<a id="3978c37" class="tk">ny</a>;</td></tr>
<tr name="3979" id="3979">
<td><a id="l3979" class='ln'>3979</a></td><td> <a id="3979c13" class="tk">int_T</a> <a id="3979c20" class="tk">i</a>;</td></tr>
<tr name="3980" id="3980">
<td><a id="l3980" class='ln'>3980</a></td><td> <span class="kw">int</span> <a id="3980c20" class="tk">yIdx</a>;</td></tr>
<tr name="3981" id="3981">
<td><a id="l3981" class='ln'>3981</a></td><td> <a id="3981c13" class="tk">LogSignalPtrsType</a> <a id="3981c31" class="tk">data</a> = <a id="3981c38" class="tk">rtliGetLogYSignalPtrs</a>(<a id="3981c60" class="tk">li</a>);</td></tr>
<tr name="3982" id="3982">
<td><a id="l3982" class='ln'>3982</a></td><td></td></tr>
<tr name="3983" id="3983">
<td><a id="l3983" class='ln'>3983</a></td><td> <span class="kw">for</span> (<a id="3983c18" class="tk">i</a> = 0, <a id="3983c25" class="tk">yIdx</a> = 0; <a id="3983c35" class="tk">i</a> <a id="3983c37" class="tk">&lt;</a> <a id="3983c39" class="tk">ny</a>; <a id="3983c43" class="tk">i</a><a id="3983c44" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="3984" id="3984">
<td><a id="l3984" class='ln'>3984</a></td><td> <span class="kw">if</span> (<a id="3984c21" class="tk">data</a>[<a id="3984c26" class="tk">i</a>] <a id="3984c29" class="tk">!=</a> <a id="3984c32" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="3985" id="3985">
<td><a id="l3985" class='ln'>3985</a></td><td> <span class="ct">/* </span></td></tr>
<tr name="3986" id="3986">
<td><a id="l3986" class='ln'>3986</a></td><td><span class="ct"> When outputs are logged in Matrix format, </span></td></tr>
<tr name="3987" id="3987">
<td><a id="l3987" class='ln'>3987</a></td><td><span class="ct"> no variable-size signal logging is allowed.</span></td></tr>
<tr name="3988" id="3988">
<td><a id="l3988" class='ln'>3988</a></td><td><span class="ct"> */</span></td></tr>
<tr name="3989" id="3989">
<td><a id="l3989" class='ln'>3989</a></td><td> <span class="ct">/* g1614989:Code refactoring and fix for logging issue.</span></td></tr>
<tr name="3990" id="3990">
<td><a id="l3990" class='ln'>3990</a></td><td><span class="ct"> * Function pointer is now identified by using </span></td></tr>
<tr name="3991" id="3991">
<td><a id="l3991" class='ln'>3991</a></td><td><span class="ct"> * Y Signal Info instead of iterating over pre-processing </span></td></tr>
<tr name="3992" id="3992">
<td><a id="l3992" class='ln'>3992</a></td><td><span class="ct"> * function pointers.</span></td></tr>
<tr name="3993" id="3993">
<td><a id="l3993" class='ln'>3993</a></td><td><span class="ct"> */</span> </td></tr>
<tr name="3994" id="3994">
<td><a id="l3994" class='ln'>3994</a></td><td> <a id="3994c21" class="tk">rt_preProcessAndLogData</a>(<a id="3994c45" class="tk">yInfo</a>[<a id="3994c51" class="tk">yIdx</a>], <a id="3994c58" class="tk">var</a>[<a id="3994c62" class="tk">yIdx</a>], <a id="3994c69" class="tk">data</a>[<a id="3994c74" class="tk">i</a>], false);</td></tr>
<tr name="3995" id="3995">
<td><a id="l3995" class='ln'>3995</a></td><td> <a id="3995c21" class="tk">yIdx</a><a id="3995c25" class="tk">++</a>;</td></tr>
<tr name="3996" id="3996">
<td><a id="l3996" class='ln'>3996</a></td><td> <span class="br">}</span></td></tr>
<tr name="3997" id="3997">
<td><a id="l3997" class='ln'>3997</a></td><td> <span class="br">}</span></td></tr>
<tr name="3998" id="3998">
<td><a id="l3998" class='ln'>3998</a></td><td> <span class="br">}</span></td></tr>
<tr name="3999" id="3999">
<td><a id="l3999" class='ln'>3999</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span> <span class="ct">/* STRUCTURE_FORMAT */</span></td></tr>
<tr name="4000" id="4000">
<td><a id="l4000" class='ln'>4000</a></td><td> <span class="ct">/* states */</span></td></tr>
<tr name="4001" id="4001">
<td><a id="l4001" class='ln'>4001</a></td><td> <span class="kw">if</span> (<a id="4001c13" class="tk">logInfo</a>-&gt;<a id="4001c22" class="tk">x</a> <a id="4001c24" class="tk">!=</a> <a id="4001c27" class="tk">NULL</a> <a id="4001c32" class="tk">&amp;&amp;</a> <a id="4001c35" class="tk">updateTXY</a>) <span class="br">{</span></td></tr>
<tr name="4002" id="4002">
<td><a id="l4002" class='ln'>4002</a></td><td> <a id="4002c13" class="tk">int_T</a> <a id="4002c31" class="tk">i</a>;</td></tr>
<tr name="4003" id="4003">
<td><a id="l4003" class='ln'>4003</a></td><td> <a id="4003c13" class="tk">StructLogVar</a> <a id="4003c31" class="tk">*</a><a id="4003c32" class="tk">var</a> = <a id="4003c38" class="tk">logInfo</a>-&gt;<a id="4003c47" class="tk">x</a>;</td></tr>
<tr name="4004" id="4004">
<td><a id="l4004" class='ln'>4004</a></td><td> <a id="4004c13" class="tk">LogVar</a> <a id="4004c31" class="tk">*</a><a id="4004c32" class="tk">val</a> = <a id="4004c38" class="tk">var</a>-&gt;<a id="4004c43" class="tk">signals</a>.<a id="4004c51" class="tk">values</a>;</td></tr>
<tr name="4005" id="4005">
<td><a id="l4005" class='ln'>4005</a></td><td> <a id="4005c13" class="tk">int_T</a> <a id="4005c31" class="tk">nsig</a> = <a id="4005c38" class="tk">var</a>-&gt;<a id="4005c43" class="tk">signals</a>.<a id="4005c51" class="tk">numSignals</a>;</td></tr>
<tr name="4006" id="4006">
<td><a id="l4006" class='ln'>4006</a></td><td> <a id="4006c13" class="tk">LogSignalPtrsType</a> <a id="4006c31" class="tk">data</a> = <a id="4006c38" class="tk">rtliGetLogXSignalPtrs</a>(<a id="4006c60" class="tk">li</a>);</td></tr>
<tr name="4007" id="4007">
<td><a id="l4007" class='ln'>4007</a></td><td></td></tr>
<tr name="4008" id="4008">
<td><a id="l4008" class='ln'>4008</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="4009" id="4009">
<td><a id="l4009" class='ln'>4009</a></td><td> <span class="kw">if</span> (<a id="4009c17" class="tk">var</a>-&gt;<a id="4009c22" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="4010" id="4010">
<td><a id="l4010" class='ln'>4010</a></td><td> <a id="4010c17" class="tk">rt_UpdateLogVar</a>(<a id="4010c33" class="tk">var</a>-&gt;<a id="4010c38" class="tk">time</a>, <a id="4010c44" class="tk">tPtr</a>, false);</td></tr>
<tr name="4011" id="4011">
<td><a id="l4011" class='ln'>4011</a></td><td> <span class="br">}</span></td></tr>
<tr name="4012" id="4012">
<td><a id="l4012" class='ln'>4012</a></td><td></td></tr>
<tr name="4013" id="4013">
<td><a id="l4013" class='ln'>4013</a></td><td> <span class="ct">/* signals */</span></td></tr>
<tr name="4014" id="4014">
<td><a id="l4014" class='ln'>4014</a></td><td> <span class="kw">for</span> (<a id="4014c18" class="tk">i</a> = 0; <a id="4014c25" class="tk">i</a> <a id="4014c27" class="tk">&lt;</a> <a id="4014c29" class="tk">nsig</a>; <a id="4014c35" class="tk">i</a><a id="4014c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="4015" id="4015">
<td><a id="l4015" class='ln'>4015</a></td><td> <span class="ct">/* g1614989:Code refactoring and fix for logging issue.</span></td></tr>
<tr name="4016" id="4016">
<td><a id="l4016" class='ln'>4016</a></td><td><span class="ct"> * Function pointer is now identified by using </span></td></tr>
<tr name="4017" id="4017">
<td><a id="l4017" class='ln'>4017</a></td><td><span class="ct"> * X Signal Info instead of iterating over pre-processing </span></td></tr>
<tr name="4018" id="4018">
<td><a id="l4018" class='ln'>4018</a></td><td><span class="ct"> * function pointers.</span></td></tr>
<tr name="4019" id="4019">
<td><a id="l4019" class='ln'>4019</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4020" id="4020">
<td><a id="l4020" class='ln'>4020</a></td><td> <a id="4020c17" class="tk">rt_preProcessAndLogDataWithIndex</a>(<a id="4020c50" class="tk">xInfo</a>, <a id="4020c57" class="tk">i</a>, <a id="4020c60" class="tk">val</a>, <a id="4020c65" class="tk">data</a>[<a id="4020c70" class="tk">i</a>], false);</td></tr>
<tr name="4021" id="4021">
<td><a id="l4021" class='ln'>4021</a></td><td> <a id="4021c17" class="tk">val</a> = <a id="4021c23" class="tk">val</a>-&gt;<a id="4021c28" class="tk">next</a>;</td></tr>
<tr name="4022" id="4022">
<td><a id="l4022" class='ln'>4022</a></td><td> <span class="br">}</span></td></tr>
<tr name="4023" id="4023">
<td><a id="l4023" class='ln'>4023</a></td><td> <span class="br">}</span></td></tr>
<tr name="4024" id="4024">
<td><a id="l4024" class='ln'>4024</a></td><td></td></tr>
<tr name="4025" id="4025">
<td><a id="l4025" class='ln'>4025</a></td><td> <span class="ct">/* outputs */</span></td></tr>
<tr name="4026" id="4026">
<td><a id="l4026" class='ln'>4026</a></td><td> <span class="kw">if</span> (<a id="4026c13" class="tk">logInfo</a>-&gt;<a id="4026c22" class="tk">y</a> <a id="4026c24" class="tk">!=</a> <a id="4026c27" class="tk">NULL</a> <a id="4026c32" class="tk">&amp;&amp;</a> <a id="4026c35" class="tk">updateTXY</a>) <span class="br">{</span></td></tr>
<tr name="4027" id="4027">
<td><a id="l4027" class='ln'>4027</a></td><td> <a id="4027c13" class="tk">int_T</a> <a id="4027c31" class="tk">ny</a> = <a id="4027c41" class="tk">logInfo</a>-&gt;<a id="4027c50" class="tk">ny</a>;</td></tr>
<tr name="4028" id="4028">
<td><a id="l4028" class='ln'>4028</a></td><td> <a id="4028c13" class="tk">LogSignalPtrsType</a> <a id="4028c31" class="tk">data</a> = <a id="4028c41" class="tk">rtliGetLogYSignalPtrs</a>(<a id="4028c63" class="tk">li</a>);</td></tr>
<tr name="4029" id="4029">
<td><a id="l4029" class='ln'>4029</a></td><td> <a id="4029c13" class="tk">StructLogVar</a> <a id="4029c31" class="tk">*</a><a id="4029c32" class="tk">*</a><a id="4029c33" class="tk">var</a> = (<a id="4029c42" class="tk">StructLogVar</a><a id="4029c54" class="tk">*</a><a id="4029c55" class="tk">*</a>) (<a id="4029c59" class="tk">logInfo</a>-&gt;<a id="4029c68" class="tk">y</a>);</td></tr>
<tr name="4030" id="4030">
<td><a id="l4030" class='ln'>4030</a></td><td></td></tr>
<tr name="4031" id="4031">
<td><a id="l4031" class='ln'>4031</a></td><td> <span class="kw">if</span> (<a id="4031c17" class="tk">ny</a> <a id="4031c20" class="tk">==</a> 1) <span class="br">{</span></td></tr>
<tr name="4032" id="4032">
<td><a id="l4032" class='ln'>4032</a></td><td> <a id="4032c17" class="tk">int_T</a> <a id="4032c24" class="tk">i</a>;</td></tr>
<tr name="4033" id="4033">
<td><a id="l4033" class='ln'>4033</a></td><td> <a id="4033c17" class="tk">int_T</a> <a id="4033c24" class="tk">dataIdx</a>;</td></tr>
<tr name="4034" id="4034">
<td><a id="l4034" class='ln'>4034</a></td><td> <a id="4034c17" class="tk">LogVar</a> <a id="4034c24" class="tk">*</a><a id="4034c25" class="tk">val</a> = <a id="4034c31" class="tk">var</a>[0]-&gt;<a id="4034c39" class="tk">signals</a>.<a id="4034c47" class="tk">values</a>;</td></tr>
<tr name="4035" id="4035">
<td><a id="l4035" class='ln'>4035</a></td><td> <a id="4035c17" class="tk">int_T</a> <a id="4035c24" class="tk">nsig</a> = <a id="4035c31" class="tk">var</a>[0]-&gt;<a id="4035c39" class="tk">signals</a>.<a id="4035c47" class="tk">numSignals</a>;</td></tr>
<tr name="4036" id="4036">
<td><a id="l4036" class='ln'>4036</a></td><td> <a id="4036c17" class="tk">boolean_T</a> <a id="4036c29" class="tk">*</a><a id="4036c30" class="tk">isVarDims</a> = <a id="4036c42" class="tk">var</a>[0]-&gt;<a id="4036c50" class="tk">signals</a>.<a id="4036c58" class="tk">isVarDims</a>;</td></tr>
<tr name="4037" id="4037">
<td><a id="l4037" class='ln'>4037</a></td><td></td></tr>
<tr name="4038" id="4038">
<td><a id="l4038" class='ln'>4038</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="4039" id="4039">
<td><a id="l4039" class='ln'>4039</a></td><td> <span class="kw">if</span> (<a id="4039c21" class="tk">var</a>[0]-&gt;<a id="4039c29" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="4040" id="4040">
<td><a id="l4040" class='ln'>4040</a></td><td> <a id="4040c21" class="tk">rt_UpdateLogVar</a>(<a id="4040c37" class="tk">var</a>[0]-&gt;<a id="4040c45" class="tk">time</a>, <a id="4040c51" class="tk">tPtr</a>, false);</td></tr>
<tr name="4041" id="4041">
<td><a id="l4041" class='ln'>4041</a></td><td> <span class="br">}</span></td></tr>
<tr name="4042" id="4042">
<td><a id="l4042" class='ln'>4042</a></td><td></td></tr>
<tr name="4043" id="4043">
<td><a id="l4043" class='ln'>4043</a></td><td> <span class="ct">/* signals */</span></td></tr>
<tr name="4044" id="4044">
<td><a id="l4044" class='ln'>4044</a></td><td> <span class="kw">for</span> (<a id="4044c22" class="tk">i</a> = 0, <a id="4044c29" class="tk">dataIdx</a> = 0; <a id="4044c42" class="tk">i</a> <a id="4044c44" class="tk">&lt;</a> <a id="4044c46" class="tk">nsig</a>; <a id="4044c52" class="tk">i</a><a id="4044c53" class="tk">++</a>) <span class="br">{</span> </td></tr>
<tr name="4045" id="4045">
<td><a id="l4045" class='ln'>4045</a></td><td> <span class="kw">while</span> (<a id="4045c28" class="tk">data</a>[<a id="4045c33" class="tk">dataIdx</a>] <a id="4045c42" class="tk">==</a> <a id="4045c45" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="4046" id="4046">
<td><a id="l4046" class='ln'>4046</a></td><td> <a id="4046c25" class="tk">++</a><a id="4046c27" class="tk">dataIdx</a>;</td></tr>
<tr name="4047" id="4047">
<td><a id="l4047" class='ln'>4047</a></td><td> <span class="br">}</span></td></tr>
<tr name="4048" id="4048">
<td><a id="l4048" class='ln'>4048</a></td><td> <span class="ct">/* g1614989:Code refactoring and fix for logging issue.</span></td></tr>
<tr name="4049" id="4049">
<td><a id="l4049" class='ln'>4049</a></td><td><span class="ct"> * Function pointer is now identified by using </span></td></tr>
<tr name="4050" id="4050">
<td><a id="l4050" class='ln'>4050</a></td><td><span class="ct"> * Y Signal Info instead of iterating over pre-processing </span></td></tr>
<tr name="4051" id="4051">
<td><a id="l4051" class='ln'>4051</a></td><td><span class="ct"> * function pointers.</span></td></tr>
<tr name="4052" id="4052">
<td><a id="l4052" class='ln'>4052</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4053" id="4053">
<td><a id="l4053" class='ln'>4053</a></td><td> <a id="4053c21" class="tk">rt_preProcessAndLogDataWithIndex</a>(<a id="4053c54" class="tk">yInfo</a>, <a id="4053c61" class="tk">i</a>, <a id="4053c64" class="tk">val</a>, <a id="4053c69" class="tk">data</a>[<a id="4053c74" class="tk">dataIdx</a>], <a id="4053c84" class="tk">isVarDims</a>[<a id="4053c94" class="tk">i</a>]);</td></tr>
<tr name="4054" id="4054">
<td><a id="l4054" class='ln'>4054</a></td><td> <a id="4054c21" class="tk">dataIdx</a><a id="4054c28" class="tk">++</a>;</td></tr>
<tr name="4055" id="4055">
<td><a id="l4055" class='ln'>4055</a></td><td> <a id="4055c21" class="tk">val</a> = <a id="4055c27" class="tk">val</a>-&gt;<a id="4055c32" class="tk">next</a>;</td></tr>
<tr name="4056" id="4056">
<td><a id="l4056" class='ln'>4056</a></td><td> <span class="br">}</span></td></tr>
<tr name="4057" id="4057">
<td><a id="l4057" class='ln'>4057</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="4058" id="4058">
<td><a id="l4058" class='ln'>4058</a></td><td> <a id="4058c17" class="tk">int_T</a> <a id="4058c24" class="tk">i</a>;</td></tr>
<tr name="4059" id="4059">
<td><a id="l4059" class='ln'>4059</a></td><td> <a id="4059c17" class="tk">int_T</a> <a id="4059c24" class="tk">dataIdx</a>;</td></tr>
<tr name="4060" id="4060">
<td><a id="l4060" class='ln'>4060</a></td><td></td></tr>
<tr name="4061" id="4061">
<td><a id="l4061" class='ln'>4061</a></td><td> <span class="kw">for</span> (<a id="4061c22" class="tk">i</a> = 0, <a id="4061c29" class="tk">dataIdx</a> = 0; <a id="4061c42" class="tk">i</a> <a id="4061c44" class="tk">&lt;</a> <a id="4061c46" class="tk">ny</a> <a id="4061c49" class="tk">&amp;&amp;</a> <a id="4061c52" class="tk">var</a>[<a id="4061c56" class="tk">i</a>] <a id="4061c59" class="tk">!=</a> <a id="4061c62" class="tk">NULL</a>; <a id="4061c68" class="tk">i</a><a id="4061c69" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="4062" id="4062">
<td><a id="l4062" class='ln'>4062</a></td><td> <a id="4062c21" class="tk">LogVar</a> <a id="4062c28" class="tk">*</a><a id="4062c29" class="tk">val</a> = <a id="4062c35" class="tk">var</a>[<a id="4062c39" class="tk">i</a>]-&gt;<a id="4062c43" class="tk">signals</a>.<a id="4062c51" class="tk">values</a>;</td></tr>
<tr name="4063" id="4063">
<td><a id="l4063" class='ln'>4063</a></td><td> <a id="4063c21" class="tk">boolean_T</a> <a id="4063c33" class="tk">*</a><a id="4063c34" class="tk">isVarDims</a> = <a id="4063c46" class="tk">var</a>[<a id="4063c50" class="tk">i</a>]-&gt;<a id="4063c54" class="tk">signals</a>.<a id="4063c62" class="tk">isVarDims</a>;</td></tr>
<tr name="4064" id="4064">
<td><a id="l4064" class='ln'>4064</a></td><td></td></tr>
<tr name="4065" id="4065">
<td><a id="l4065" class='ln'>4065</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="4066" id="4066">
<td><a id="l4066" class='ln'>4066</a></td><td> <span class="kw">if</span> (<a id="4066c25" class="tk">var</a>[<a id="4066c29" class="tk">i</a>]-&gt;<a id="4066c33" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="4067" id="4067">
<td><a id="l4067" class='ln'>4067</a></td><td> <a id="4067c25" class="tk">rt_UpdateLogVar</a>(<a id="4067c41" class="tk">var</a>[<a id="4067c45" class="tk">i</a>]-&gt;<a id="4067c49" class="tk">time</a>, <a id="4067c55" class="tk">tPtr</a>, false);</td></tr>
<tr name="4068" id="4068">
<td><a id="l4068" class='ln'>4068</a></td><td> <span class="br">}</span></td></tr>
<tr name="4069" id="4069">
<td><a id="l4069" class='ln'>4069</a></td><td></td></tr>
<tr name="4070" id="4070">
<td><a id="l4070" class='ln'>4070</a></td><td> <span class="ct">/* signals */</span></td></tr>
<tr name="4071" id="4071">
<td><a id="l4071" class='ln'>4071</a></td><td> <span class="kw">while</span> (<a id="4071c28" class="tk">data</a>[<a id="4071c33" class="tk">dataIdx</a>] <a id="4071c42" class="tk">==</a> <a id="4071c45" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="4072" id="4072">
<td><a id="l4072" class='ln'>4072</a></td><td> <a id="4072c25" class="tk">++</a><a id="4072c27" class="tk">dataIdx</a>;</td></tr>
<tr name="4073" id="4073">
<td><a id="l4073" class='ln'>4073</a></td><td> <span class="br">}</span></td></tr>
<tr name="4074" id="4074">
<td><a id="l4074" class='ln'>4074</a></td><td> <span class="ct">/* g1614989:Code refactoring and fix for logging issue.</span></td></tr>
<tr name="4075" id="4075">
<td><a id="l4075" class='ln'>4075</a></td><td><span class="ct"> * Function pointer is now identified by using </span></td></tr>
<tr name="4076" id="4076">
<td><a id="l4076" class='ln'>4076</a></td><td><span class="ct"> * Y Signal Info instead of iterating over pre-processing </span></td></tr>
<tr name="4077" id="4077">
<td><a id="l4077" class='ln'>4077</a></td><td><span class="ct"> * function pointers.</span></td></tr>
<tr name="4078" id="4078">
<td><a id="l4078" class='ln'>4078</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4079" id="4079">
<td><a id="l4079" class='ln'>4079</a></td><td> <a id="4079c21" class="tk">rt_preProcessAndLogData</a>(<a id="4079c45" class="tk">yInfo</a>[<a id="4079c51" class="tk">i</a>], <a id="4079c55" class="tk">val</a>, <a id="4079c60" class="tk">data</a>[<a id="4079c65" class="tk">dataIdx</a>], <a id="4079c75" class="tk">isVarDims</a>[0]);</td></tr>
<tr name="4080" id="4080">
<td><a id="l4080" class='ln'>4080</a></td><td> <a id="4080c21" class="tk">dataIdx</a><a id="4080c28" class="tk">++</a>;</td></tr>
<tr name="4081" id="4081">
<td><a id="l4081" class='ln'>4081</a></td><td> <a id="4081c21" class="tk">val</a> = <a id="4081c27" class="tk">val</a>-&gt;<a id="4081c32" class="tk">next</a>;</td></tr>
<tr name="4082" id="4082">
<td><a id="l4082" class='ln'>4082</a></td><td> <span class="br">}</span></td></tr>
<tr name="4083" id="4083">
<td><a id="l4083" class='ln'>4083</a></td><td> <span class="br">}</span></td></tr>
<tr name="4084" id="4084">
<td><a id="l4084" class='ln'>4084</a></td><td> <span class="br">}</span></td></tr>
<tr name="4085" id="4085">
<td><a id="l4085" class='ln'>4085</a></td><td> <span class="ct">/* final state */</span></td></tr>
<tr name="4086" id="4086">
<td><a id="l4086" class='ln'>4086</a></td><td> <span class="kw">if</span> (<a id="4086c13" class="tk">logInfo</a>-&gt;<a id="4086c22" class="tk">xFinal</a> <a id="4086c29" class="tk">!=</a> <a id="4086c32" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="4087" id="4087">
<td><a id="l4087" class='ln'>4087</a></td><td> <a id="4087c13" class="tk">StructLogVar</a> <a id="4087c26" class="tk">*</a><a id="4087c27" class="tk">xf</a> = <a id="4087c33" class="tk">logInfo</a>-&gt;<a id="4087c42" class="tk">xFinal</a>;</td></tr>
<tr name="4088" id="4088">
<td><a id="l4088" class='ln'>4088</a></td><td> <a id="4088c13" class="tk">LogVar</a> <a id="4088c26" class="tk">*</a><a id="4088c27" class="tk">val</a> = <a id="4088c33" class="tk">xf</a>-&gt;<a id="4088c37" class="tk">signals</a>.<a id="4088c45" class="tk">values</a>;</td></tr>
<tr name="4089" id="4089">
<td><a id="l4089" class='ln'>4089</a></td><td> <a id="4089c13" class="tk">int_T</a> <a id="4089c26" class="tk">nsig</a> = <a id="4089c33" class="tk">xf</a>-&gt;<a id="4089c37" class="tk">signals</a>.<a id="4089c45" class="tk">numSignals</a>;</td></tr>
<tr name="4090" id="4090">
<td><a id="l4090" class='ln'>4090</a></td><td> <a id="4090c13" class="tk">int_T</a> <a id="4090c26" class="tk">i</a>;</td></tr>
<tr name="4091" id="4091">
<td><a id="l4091" class='ln'>4091</a></td><td></td></tr>
<tr name="4092" id="4092">
<td><a id="l4092" class='ln'>4092</a></td><td> <span class="ct">/* time */</span></td></tr>
<tr name="4093" id="4093">
<td><a id="l4093" class='ln'>4093</a></td><td> <span class="kw">if</span> (<a id="4093c17" class="tk">xf</a>-&gt;<a id="4093c21" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="4094" id="4094">
<td><a id="l4094" class='ln'>4094</a></td><td> <a id="4094c17" class="tk">rt_UpdateLogVar</a>(<a id="4094c33" class="tk">xf</a>-&gt;<a id="4094c37" class="tk">time</a>, <a id="4094c43" class="tk">tPtr</a>, false);</td></tr>
<tr name="4095" id="4095">
<td><a id="l4095" class='ln'>4095</a></td><td> <span class="br">}</span></td></tr>
<tr name="4096" id="4096">
<td><a id="l4096" class='ln'>4096</a></td><td></td></tr>
<tr name="4097" id="4097">
<td><a id="l4097" class='ln'>4097</a></td><td> <span class="ct">/* signals */</span></td></tr>
<tr name="4098" id="4098">
<td><a id="l4098" class='ln'>4098</a></td><td> <span class="kw">for</span> (<a id="4098c18" class="tk">i</a> = 0; <a id="4098c25" class="tk">i</a> <a id="4098c27" class="tk">&lt;</a> <a id="4098c29" class="tk">nsig</a>; <a id="4098c35" class="tk">i</a><a id="4098c36" class="tk">++</a>) <span class="br">{</span></td></tr>
<tr name="4099" id="4099">
<td><a id="l4099" class='ln'>4099</a></td><td> <a id="4099c17" class="tk">LogSignalPtrsType</a> <a id="4099c35" class="tk">data</a> = <a id="4099c42" class="tk">rtliGetLogXSignalPtrs</a>(<a id="4099c64" class="tk">li</a>);</td></tr>
<tr name="4100" id="4100">
<td><a id="l4100" class='ln'>4100</a></td><td> <span class="ct">/* g1614989:Code refactoring and fix for logging issue.</span></td></tr>
<tr name="4101" id="4101">
<td><a id="l4101" class='ln'>4101</a></td><td><span class="ct"> * Function pointer is now identified by using </span></td></tr>
<tr name="4102" id="4102">
<td><a id="l4102" class='ln'>4102</a></td><td><span class="ct"> * X Signal Info instead of iterating over pre-processing </span></td></tr>
<tr name="4103" id="4103">
<td><a id="l4103" class='ln'>4103</a></td><td><span class="ct"> * function pointers.</span></td></tr>
<tr name="4104" id="4104">
<td><a id="l4104" class='ln'>4104</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4105" id="4105">
<td><a id="l4105" class='ln'>4105</a></td><td> <a id="4105c17" class="tk">rt_preProcessAndLogDataWithIndex</a>(<a id="4105c50" class="tk">xInfo</a>, <a id="4105c57" class="tk">i</a>, <a id="4105c60" class="tk">val</a>, <a id="4105c65" class="tk">data</a>[<a id="4105c70" class="tk">i</a>], false);</td></tr>
<tr name="4106" id="4106">
<td><a id="l4106" class='ln'>4106</a></td><td> <a id="4106c17" class="tk">val</a> = <a id="4106c23" class="tk">val</a>-&gt;<a id="4106c28" class="tk">next</a>;</td></tr>
<tr name="4107" id="4107">
<td><a id="l4107" class='ln'>4107</a></td><td> <span class="br">}</span></td></tr>
<tr name="4108" id="4108">
<td><a id="l4108" class='ln'>4108</a></td><td> <span class="br">}</span></td></tr>
<tr name="4109" id="4109">
<td><a id="l4109" class='ln'>4109</a></td><td> <span class="br">}</span></td></tr>
<tr name="4110" id="4110">
<td><a id="l4110" class='ln'>4110</a></td><td> <span class="kw">return</span>(<a id="4110c12" class="tk">NULL</a>);</td></tr>
<tr name="4111" id="4111">
<td><a id="l4111" class='ln'>4111</a></td><td><span class="br">}</span> <span class="ct">/* end rt_UpdateTXXFYLogVars */</span></td></tr>
<tr name="4112" id="4112">
<td><a id="l4112" class='ln'>4112</a></td><td></td></tr>
<tr name="4113" id="4113">
<td><a id="l4113" class='ln'>4113</a></td><td></td></tr>
<tr name="4114" id="4114">
<td><a id="l4114" class='ln'>4114</a></td><td><span class="pp">#ifdef</span> <a id="4114c8" class="tk">__cplusplus</a></td></tr>
<tr name="4115" id="4115">
<td><a id="l4115" class='ln'>4115</a></td><td><span class="br">}</span></td></tr>
<tr name="4116" id="4116">
<td><a id="l4116" class='ln'>4116</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="4117" id="4117">
<td><a id="l4117" class='ln'>4117</a></td><td> </td></tr>
<tr name="4118" id="4118">
<td><a id="l4118" class='ln'>4118</a></td><td></td></tr>
<tr name="4119" id="4119">
<td><a id="l4119" class='ln'>4119</a></td><td> </td></tr>
<tr name="4120" id="4120">
<td><a id="l4120" class='ln'>4120</a></td><td></td></tr>
<tr name="4121" id="4121">
<td><a id="l4121" class='ln'>4121</a></td><td><span class="pp">#ifdef</span> <a id="4121c8" class="tk">__cplusplus</a></td></tr>
<tr name="4122" id="4122">
<td><a id="l4122" class='ln'>4122</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="4123" id="4123">
<td><a id="l4123" class='ln'>4123</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="4124" id="4124">
<td><a id="l4124" class='ln'>4124</a></td><td></td></tr>
<tr name="4125" id="4125">
<td><a id="l4125" class='ln'>4125</a></td><td></td></tr>
<tr name="4126" id="4126">
<td><a id="l4126" class='ln'>4126</a></td><td><span class="ct">/* Function: rt_StopDataLoggingImpl =======================================</span></td></tr>
<tr name="4127" id="4127">
<td><a id="l4127" class='ln'>4127</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="4128" id="4128">
<td><a id="l4128" class='ln'>4128</a></td><td><span class="ct"> * Write logged data to model.mat and free memory.</span></td></tr>
<tr name="4129" id="4129">
<td><a id="l4129" class='ln'>4129</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4130" id="4130">
<td><a id="l4130" class='ln'>4130</a></td><td><span class="kw">void</span> <a id="4130c6" class="tk">rt_StopDataLoggingImpl</a>(<span class="kw">const</span> <a id="4130c35" class="tk">char_T</a> <a id="4130c42" class="tk">*</a><a id="4130c43" class="tk">file</a>, <a id="4130c49" class="tk">RTWLogInfo</a> <a id="4130c60" class="tk">*</a><a id="4130c61" class="tk">li</a>, <a id="4130c65" class="tk">boolean_T</a> <a id="4130c75" class="tk">isRaccel</a>)</td></tr>
<tr name="4131" id="4131">
<td><a id="l4131" class='ln'>4131</a></td><td><span class="br">{</span></td></tr>
<tr name="4132" id="4132">
<td><a id="l4132" class='ln'>4132</a></td><td> <a id="4132c5" class="tk">FILE</a> <a id="4132c19" class="tk">*</a><a id="4132c20" class="tk">fptr</a>;</td></tr>
<tr name="4133" id="4133">
<td><a id="l4133" class='ln'>4133</a></td><td> <a id="4133c5" class="tk">LogInfo</a> <a id="4133c19" class="tk">*</a><a id="4133c20" class="tk">logInfo</a> = (<a id="4133c35" class="tk">LogInfo</a><a id="4133c42" class="tk">*</a>) <a id="4133c45" class="tk">rtliGetLogInfo</a>(<a id="4133c60" class="tk">li</a>);</td></tr>
<tr name="4134" id="4134">
<td><a id="l4134" class='ln'>4134</a></td><td> <a id="4134c5" class="tk">LogVar</a> <a id="4134c19" class="tk">*</a><a id="4134c20" class="tk">var</a> = <a id="4134c34" class="tk">logInfo</a>-&gt;<a id="4134c43" class="tk">logVarsList</a>;</td></tr>
<tr name="4135" id="4135">
<td><a id="l4135" class='ln'>4135</a></td><td> <a id="4135c5" class="tk">StructLogVar</a> <a id="4135c19" class="tk">*</a><a id="4135c20" class="tk">svar</a> = <a id="4135c34" class="tk">logInfo</a>-&gt;<a id="4135c43" class="tk">structLogVarsList</a>;</td></tr>
<tr name="4136" id="4136">
<td><a id="l4136" class='ln'>4136</a></td><td> <span class="ct">/* At this time, verbose is only needed if running rapid accelerator</span></td></tr>
<tr name="4137" id="4137">
<td><a id="l4137" class='ln'>4137</a></td><td><span class="ct"> * simulations. */</span></td></tr>
<tr name="4138" id="4138">
<td><a id="l4138" class='ln'>4138</a></td><td> <span class="kw">int</span> <a id="4138c19" class="tk">verbose</a> = <a id="4138c34" class="tk">isRaccel</a> <a id="4138c43" class="tk">?</a> 0<a id="4138c46" class="tk">:</a> 1;</td></tr>
<tr name="4139" id="4139">
<td><a id="l4139" class='ln'>4139</a></td><td></td></tr>
<tr name="4140" id="4140">
<td><a id="l4140" class='ln'>4140</a></td><td> <a id="4140c5" class="tk">boolean_T</a> <a id="4140c19" class="tk">emptyFile</a> = 1; <span class="ct">/* assume */</span></td></tr>
<tr name="4141" id="4141">
<td><a id="l4141" class='ln'>4141</a></td><td> <a id="4141c5" class="tk">boolean_T</a> <a id="4141c19" class="tk">errFlag</a> = 0;</td></tr>
<tr name="4142" id="4142">
<td><a id="l4142" class='ln'>4142</a></td><td> <span class="kw">const</span> <a id="4142c11" class="tk">char_T</a> <a id="4142c19" class="tk">*</a><a id="4142c20" class="tk">msg</a>;</td></tr>
<tr name="4143" id="4143">
<td><a id="l4143" class='ln'>4143</a></td><td></td></tr>
<tr name="4144" id="4144">
<td><a id="l4144" class='ln'>4144</a></td><td> <span class="ct">/*******************************</span></td></tr>
<tr name="4145" id="4145">
<td><a id="l4145" class='ln'>4145</a></td><td><span class="ct"> * Create MAT file with header *</span></td></tr>
<tr name="4146" id="4146">
<td><a id="l4146" class='ln'>4146</a></td><td><span class="ct"> *******************************/</span></td></tr>
<tr name="4147" id="4147">
<td><a id="l4147" class='ln'>4147</a></td><td> <span class="kw">if</span> ((<a id="4147c10" class="tk">fptr</a>=<a id="4147c15" class="tk">fopen</a>(<a id="4147c21" class="tk">file</a>,"w+b")) <a id="4147c34" class="tk">==</a> <a id="4147c37" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="4148" id="4148">
<td><a id="l4148" class='ln'>4148</a></td><td> (<span class="kw">void</span>)<a id="4148c15" class="tk">fprintf</a>(<a id="4148c23" class="tk">stderr</a>,"*** Error opening %s",<a id="4148c53" class="tk">file</a>);</td></tr>
<tr name="4149" id="4149">
<td><a id="l4149" class='ln'>4149</a></td><td> <span class="kw">goto</span> <a id="4149c14" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="4150" id="4150">
<td><a id="l4150" class='ln'>4150</a></td><td> <span class="br">}</span></td></tr>
<tr name="4151" id="4151">
<td><a id="l4151" class='ln'>4151</a></td><td> <span class="kw">if</span> (<a id="4151c9" class="tk">rt_WriteMat5FileHeader</a>(<a id="4151c32" class="tk">fptr</a>)) <span class="br">{</span></td></tr>
<tr name="4152" id="4152">
<td><a id="l4152" class='ln'>4152</a></td><td> (<span class="kw">void</span>)<a id="4152c15" class="tk">fprintf</a>(<a id="4152c23" class="tk">stderr</a>,"*** Error writing to %s",<a id="4152c56" class="tk">file</a>);</td></tr>
<tr name="4153" id="4153">
<td><a id="l4153" class='ln'>4153</a></td><td> <span class="kw">goto</span> <a id="4153c14" class="tk">EXIT_POINT</a>;</td></tr>
<tr name="4154" id="4154">
<td><a id="l4154" class='ln'>4154</a></td><td> <span class="br">}</span></td></tr>
<tr name="4155" id="4155">
<td><a id="l4155" class='ln'>4155</a></td><td></td></tr>
<tr name="4156" id="4156">
<td><a id="l4156" class='ln'>4156</a></td><td> <span class="ct">/**************************************************</span></td></tr>
<tr name="4157" id="4157">
<td><a id="l4157" class='ln'>4157</a></td><td><span class="ct"> * First log all the variables in the LogVar list *</span></td></tr>
<tr name="4158" id="4158">
<td><a id="l4158" class='ln'>4158</a></td><td><span class="ct"> **************************************************/</span></td></tr>
<tr name="4159" id="4159">
<td><a id="l4159" class='ln'>4159</a></td><td> <span class="kw">while</span> (<a id="4159c12" class="tk">var</a> <a id="4159c16" class="tk">!=</a> <a id="4159c19" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="4160" id="4160">
<td><a id="l4160" class='ln'>4160</a></td><td> <span class="kw">if</span> ( (<a id="4160c15" class="tk">msg</a> = <a id="4160c21" class="tk">rt_FixupLogVar</a>(<a id="4160c36" class="tk">var</a>,<a id="4160c40" class="tk">verbose</a>)) <a id="4160c50" class="tk">!=</a> <a id="4160c53" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="4161" id="4161">
<td><a id="l4161" class='ln'>4161</a></td><td> (<span class="kw">void</span>)<a id="4161c19" class="tk">fprintf</a>(<a id="4161c27" class="tk">stderr</a>,"*** Error writing %s due to: %s\n",<a id="4161c70" class="tk">file</a>,<a id="4161c75" class="tk">msg</a>);</td></tr>
<tr name="4162" id="4162">
<td><a id="l4162" class='ln'>4162</a></td><td> <a id="4162c13" class="tk">errFlag</a> = 1;</td></tr>
<tr name="4163" id="4163">
<td><a id="l4163" class='ln'>4163</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="4164" id="4164">
<td><a id="l4164" class='ln'>4164</a></td><td> <span class="br">}</span></td></tr>
<tr name="4165" id="4165">
<td><a id="l4165" class='ln'>4165</a></td><td> <span class="kw">if</span> (<a id="4165c13" class="tk">var</a>-&gt;<a id="4165c18" class="tk">nDataPoints</a> <a id="4165c30" class="tk">&gt;</a> 0 <a id="4165c34" class="tk">||</a> <a id="4165c37" class="tk">isRaccel</a>) <span class="br">{</span></td></tr>
<tr name="4166" id="4166">
<td><a id="l4166" class='ln'>4166</a></td><td> <a id="4166c13" class="tk">MatItem</a> <a id="4166c21" class="tk">item</a>;</td></tr>
<tr name="4167" id="4167">
<td><a id="l4167" class='ln'>4167</a></td><td></td></tr>
<tr name="4168" id="4168">
<td><a id="l4168" class='ln'>4168</a></td><td> <a id="4168c13" class="tk">item</a>.<a id="4168c18" class="tk">type</a> = <a id="4168c27" class="tk">matMATRIX</a>;</td></tr>
<tr name="4169" id="4169">
<td><a id="l4169" class='ln'>4169</a></td><td> <a id="4169c13" class="tk">item</a>.<a id="4169c18" class="tk">nbytes</a> = 0; <span class="ct">/* not yet known */</span></td></tr>
<tr name="4170" id="4170">
<td><a id="l4170" class='ln'>4170</a></td><td> <a id="4170c13" class="tk">item</a>.<a id="4170c18" class="tk">data</a> = <a id="4170c27" class="tk">&amp;</a>(<a id="4170c29" class="tk">var</a>-&gt;<a id="4170c34" class="tk">data</a>);</td></tr>
<tr name="4171" id="4171">
<td><a id="l4171" class='ln'>4171</a></td><td> <span class="kw">if</span> (<a id="4171c17" class="tk">rt_WriteItemToMatFile</a>(<a id="4171c39" class="tk">fptr</a>, <a id="4171c45" class="tk">&amp;</a><a id="4171c46" class="tk">item</a>, <a id="4171c52" class="tk">MATRIX_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="4172" id="4172">
<td><a id="l4172" class='ln'>4172</a></td><td> (<span class="kw">void</span>)<a id="4172c23" class="tk">fprintf</a>(<a id="4172c31" class="tk">stderr</a>,"*** Error writing log variable %s to "</td></tr>
<tr name="4173" id="4173">
<td><a id="l4173" class='ln'>4173</a></td><td> "file %s",<a id="4173c41" class="tk">var</a>-&gt;<a id="4173c46" class="tk">data</a>.<a id="4173c51" class="tk">name</a>, <a id="4173c57" class="tk">file</a>);</td></tr>
<tr name="4174" id="4174">
<td><a id="l4174" class='ln'>4174</a></td><td> <a id="4174c17" class="tk">errFlag</a> = 1;</td></tr>
<tr name="4175" id="4175">
<td><a id="l4175" class='ln'>4175</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="4176" id="4176">
<td><a id="l4176" class='ln'>4176</a></td><td> <span class="br">}</span></td></tr>
<tr name="4177" id="4177">
<td><a id="l4177" class='ln'>4177</a></td><td> <a id="4177c13" class="tk">emptyFile</a> = 0;</td></tr>
<tr name="4178" id="4178">
<td><a id="l4178" class='ln'>4178</a></td><td> <span class="br">}</span></td></tr>
<tr name="4179" id="4179">
<td><a id="l4179" class='ln'>4179</a></td><td> <a id="4179c9" class="tk">var</a> = <a id="4179c15" class="tk">var</a>-&gt;<a id="4179c20" class="tk">next</a>;</td></tr>
<tr name="4180" id="4180">
<td><a id="l4180" class='ln'>4180</a></td><td> <span class="br">}</span></td></tr>
<tr name="4181" id="4181">
<td><a id="l4181" class='ln'>4181</a></td><td> <span class="ct">/* free up some memory by destroying the log var list here */</span></td></tr>
<tr name="4182" id="4182">
<td><a id="l4182" class='ln'>4182</a></td><td> <a id="4182c5" class="tk">rt_DestroyLogVar</a>(<a id="4182c22" class="tk">logInfo</a>-&gt;<a id="4182c31" class="tk">logVarsList</a>);</td></tr>
<tr name="4183" id="4183">
<td><a id="l4183" class='ln'>4183</a></td><td> <a id="4183c5" class="tk">logInfo</a>-&gt;<a id="4183c14" class="tk">logVarsList</a> = <a id="4183c28" class="tk">NULL</a>;</td></tr>
<tr name="4184" id="4184">
<td><a id="l4184" class='ln'>4184</a></td><td></td></tr>
<tr name="4185" id="4185">
<td><a id="l4185" class='ln'>4185</a></td><td> <span class="ct">/*******************************************************</span></td></tr>
<tr name="4186" id="4186">
<td><a id="l4186" class='ln'>4186</a></td><td><span class="ct"> * Next log all the variables in the StructLogVar list *</span></td></tr>
<tr name="4187" id="4187">
<td><a id="l4187" class='ln'>4187</a></td><td><span class="ct"> *******************************************************/</span></td></tr>
<tr name="4188" id="4188">
<td><a id="l4188" class='ln'>4188</a></td><td> <span class="kw">while</span> (<a id="4188c12" class="tk">svar</a> <a id="4188c17" class="tk">!=</a> <a id="4188c20" class="tk">NULL</a>) <span class="br">{</span></td></tr>
<tr name="4189" id="4189">
<td><a id="l4189" class='ln'>4189</a></td><td> <a id="4189c9" class="tk">MatItem</a> <a id="4189c17" class="tk">item</a>;</td></tr>
<tr name="4190" id="4190">
<td><a id="l4190" class='ln'>4190</a></td><td></td></tr>
<tr name="4191" id="4191">
<td><a id="l4191" class='ln'>4191</a></td><td> <span class="kw">if</span> (<a id="4191c13" class="tk">svar</a>-&gt;<a id="4191c19" class="tk">logTime</a>) <span class="br">{</span></td></tr>
<tr name="4192" id="4192">
<td><a id="l4192" class='ln'>4192</a></td><td> <a id="4192c13" class="tk">var</a> = <a id="4192c19" class="tk">svar</a>-&gt;<a id="4192c25" class="tk">time</a>;</td></tr>
<tr name="4193" id="4193">
<td><a id="l4193" class='ln'>4193</a></td><td> <span class="kw">if</span> ( (<a id="4193c19" class="tk">msg</a> = <a id="4193c25" class="tk">rt_FixupLogVar</a>(<a id="4193c40" class="tk">var</a>,<a id="4193c44" class="tk">verbose</a>)) <a id="4193c54" class="tk">!=</a> <a id="4193c57" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="4194" id="4194">
<td><a id="l4194" class='ln'>4194</a></td><td> (<span class="kw">void</span>)<a id="4194c23" class="tk">fprintf</a>(<a id="4194c31" class="tk">stderr</a>, "*** Error writing %s due to: %s\n",</td></tr>
<tr name="4195" id="4195">
<td><a id="l4195" class='ln'>4195</a></td><td> <a id="4195c31" class="tk">file</a>, <a id="4195c37" class="tk">msg</a>);</td></tr>
<tr name="4196" id="4196">
<td><a id="l4196" class='ln'>4196</a></td><td> <a id="4196c17" class="tk">errFlag</a> = 1;</td></tr>
<tr name="4197" id="4197">
<td><a id="l4197" class='ln'>4197</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="4198" id="4198">
<td><a id="l4198" class='ln'>4198</a></td><td> <span class="br">}</span></td></tr>
<tr name="4199" id="4199">
<td><a id="l4199" class='ln'>4199</a></td><td> <span class="br">}</span></td></tr>
<tr name="4200" id="4200">
<td><a id="l4200" class='ln'>4200</a></td><td></td></tr>
<tr name="4201" id="4201">
<td><a id="l4201" class='ln'>4201</a></td><td> <a id="4201c9" class="tk">var</a> = <a id="4201c15" class="tk">svar</a>-&gt;<a id="4201c21" class="tk">signals</a>.<a id="4201c29" class="tk">values</a>;</td></tr>
<tr name="4202" id="4202">
<td><a id="l4202" class='ln'>4202</a></td><td> <span class="kw">while</span> (<a id="4202c16" class="tk">var</a>) <span class="br">{</span></td></tr>
<tr name="4203" id="4203">
<td><a id="l4203" class='ln'>4203</a></td><td> <span class="kw">if</span> ( (<a id="4203c19" class="tk">msg</a> = <a id="4203c25" class="tk">rt_FixupLogVar</a>(<a id="4203c40" class="tk">var</a>,<a id="4203c44" class="tk">verbose</a>)) <a id="4203c54" class="tk">!=</a> <a id="4203c57" class="tk">NULL</a> ) <span class="br">{</span></td></tr>
<tr name="4204" id="4204">
<td><a id="l4204" class='ln'>4204</a></td><td> (<span class="kw">void</span>)<a id="4204c23" class="tk">fprintf</a>(<a id="4204c31" class="tk">stderr</a>, "*** Error writing %s due to: %s\n",</td></tr>
<tr name="4205" id="4205">
<td><a id="l4205" class='ln'>4205</a></td><td> <a id="4205c31" class="tk">file</a>, <a id="4205c37" class="tk">msg</a>);</td></tr>
<tr name="4206" id="4206">
<td><a id="l4206" class='ln'>4206</a></td><td> <a id="4206c17" class="tk">errFlag</a> = 1;</td></tr>
<tr name="4207" id="4207">
<td><a id="l4207" class='ln'>4207</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="4208" id="4208">
<td><a id="l4208" class='ln'>4208</a></td><td> <span class="br">}</span></td></tr>
<tr name="4209" id="4209">
<td><a id="l4209" class='ln'>4209</a></td><td> <a id="4209c13" class="tk">var</a> = <a id="4209c19" class="tk">var</a>-&gt;<a id="4209c24" class="tk">next</a>;</td></tr>
<tr name="4210" id="4210">
<td><a id="l4210" class='ln'>4210</a></td><td> <span class="br">}</span></td></tr>
<tr name="4211" id="4211">
<td><a id="l4211" class='ln'>4211</a></td><td></td></tr>
<tr name="4212" id="4212">
<td><a id="l4212" class='ln'>4212</a></td><td> <a id="4212c9" class="tk">item</a>.<a id="4212c14" class="tk">type</a> = <a id="4212c23" class="tk">matMATRIX</a>;</td></tr>
<tr name="4213" id="4213">
<td><a id="l4213" class='ln'>4213</a></td><td> <a id="4213c9" class="tk">item</a>.<a id="4213c14" class="tk">nbytes</a> = 0; <span class="ct">/* not yet known */</span></td></tr>
<tr name="4214" id="4214">
<td><a id="l4214" class='ln'>4214</a></td><td> <a id="4214c9" class="tk">item</a>.<a id="4214c14" class="tk">data</a> = <a id="4214c23" class="tk">svar</a>;</td></tr>
<tr name="4215" id="4215">
<td><a id="l4215" class='ln'>4215</a></td><td></td></tr>
<tr name="4216" id="4216">
<td><a id="l4216" class='ln'>4216</a></td><td> <span class="kw">if</span> (<a id="4216c13" class="tk">rt_WriteItemToMatFile</a>(<a id="4216c35" class="tk">fptr</a>, <a id="4216c41" class="tk">&amp;</a><a id="4216c42" class="tk">item</a>, <a id="4216c48" class="tk">STRUCT_LOG_VAR_ITEM</a>)) <span class="br">{</span></td></tr>
<tr name="4217" id="4217">
<td><a id="l4217" class='ln'>4217</a></td><td> (<span class="kw">void</span>)<a id="4217c19" class="tk">fprintf</a>(<a id="4217c27" class="tk">stderr</a>,"*** Error writing structure log variable "</td></tr>
<tr name="4218" id="4218">
<td><a id="l4218" class='ln'>4218</a></td><td> "%s to file %s",<a id="4218c43" class="tk">svar</a>-&gt;<a id="4218c49" class="tk">name</a>, <a id="4218c55" class="tk">file</a>);</td></tr>
<tr name="4219" id="4219">
<td><a id="l4219" class='ln'>4219</a></td><td> <a id="4219c13" class="tk">errFlag</a> = 1;</td></tr>
<tr name="4220" id="4220">
<td><a id="l4220" class='ln'>4220</a></td><td> <span class="kw">break</span>;</td></tr>
<tr name="4221" id="4221">
<td><a id="l4221" class='ln'>4221</a></td><td> <span class="br">}</span></td></tr>
<tr name="4222" id="4222">
<td><a id="l4222" class='ln'>4222</a></td><td> <a id="4222c9" class="tk">emptyFile</a> = 0;</td></tr>
<tr name="4223" id="4223">
<td><a id="l4223" class='ln'>4223</a></td><td></td></tr>
<tr name="4224" id="4224">
<td><a id="l4224" class='ln'>4224</a></td><td> <a id="4224c9" class="tk">svar</a> = <a id="4224c16" class="tk">svar</a>-&gt;<a id="4224c22" class="tk">next</a>;</td></tr>
<tr name="4225" id="4225">
<td><a id="l4225" class='ln'>4225</a></td><td> <span class="br">}</span></td></tr>
<tr name="4226" id="4226">
<td><a id="l4226" class='ln'>4226</a></td><td></td></tr>
<tr name="4227" id="4227">
<td><a id="l4227" class='ln'>4227</a></td><td> <span class="ct">/******************</span></td></tr>
<tr name="4228" id="4228">
<td><a id="l4228" class='ln'>4228</a></td><td><span class="ct"> * Close the file *</span></td></tr>
<tr name="4229" id="4229">
<td><a id="l4229" class='ln'>4229</a></td><td><span class="ct"> ******************/</span></td></tr>
<tr name="4230" id="4230">
<td><a id="l4230" class='ln'>4230</a></td><td> (<span class="kw">void</span>)<a id="4230c11" class="tk">fclose</a>(<a id="4230c18" class="tk">fptr</a>);</td></tr>
<tr name="4231" id="4231">
<td><a id="l4231" class='ln'>4231</a></td><td> <span class="kw">if</span> (<a id="4231c9" class="tk">emptyFile</a> <a id="4231c19" class="tk">||</a> <a id="4231c22" class="tk">errFlag</a>) <span class="br">{</span></td></tr>
<tr name="4232" id="4232">
<td><a id="l4232" class='ln'>4232</a></td><td> (<span class="kw">void</span>)<a id="4232c15" class="tk">remove</a>(<a id="4232c22" class="tk">file</a>);</td></tr>
<tr name="4233" id="4233">
<td><a id="l4233" class='ln'>4233</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
<tr name="4234" id="4234">
<td><a id="l4234" class='ln'>4234</a></td><td> <span class="kw">if</span>( <a id="4234c13" class="tk">verbose</a> ) <span class="br">{</span></td></tr>
<tr name="4235" id="4235">
<td><a id="l4235" class='ln'>4235</a></td><td> (<span class="kw">void</span>)<a id="4235c19" class="tk">printf</a>("** created %s **\n\n", <a id="4235c50" class="tk">file</a>);</td></tr>
<tr name="4236" id="4236">
<td><a id="l4236" class='ln'>4236</a></td><td> <span class="br">}</span></td></tr>
<tr name="4237" id="4237">
<td><a id="l4237" class='ln'>4237</a></td><td> <span class="br">}</span></td></tr>
<tr name="4238" id="4238">
<td><a id="l4238" class='ln'>4238</a></td><td></td></tr>
<tr name="4239" id="4239">
<td><a id="l4239" class='ln'>4239</a></td><td> <a id="4239c2" class="tk">EXIT_POINT</a><a id="4239c12" class="tk">:</a></td></tr>
<tr name="4240" id="4240">
<td><a id="l4240" class='ln'>4240</a></td><td></td></tr>
<tr name="4241" id="4241">
<td><a id="l4241" class='ln'>4241</a></td><td> <span class="ct">/****************</span></td></tr>
<tr name="4242" id="4242">
<td><a id="l4242" class='ln'>4242</a></td><td><span class="ct"> * free logInfo *</span></td></tr>
<tr name="4243" id="4243">
<td><a id="l4243" class='ln'>4243</a></td><td><span class="ct"> ****************/</span></td></tr>
<tr name="4244" id="4244">
<td><a id="l4244" class='ln'>4244</a></td><td> <a id="4244c5" class="tk">rt_DestroyLogVar</a>(<a id="4244c22" class="tk">logInfo</a>-&gt;<a id="4244c31" class="tk">logVarsList</a>);</td></tr>
<tr name="4245" id="4245">
<td><a id="l4245" class='ln'>4245</a></td><td> <a id="4245c5" class="tk">logInfo</a>-&gt;<a id="4245c14" class="tk">logVarsList</a> = <a id="4245c28" class="tk">NULL</a>;</td></tr>
<tr name="4246" id="4246">
<td><a id="l4246" class='ln'>4246</a></td><td> <a id="4246c5" class="tk">rt_DestroyStructLogVar</a>(<a id="4246c28" class="tk">logInfo</a>-&gt;<a id="4246c37" class="tk">structLogVarsList</a>);</td></tr>
<tr name="4247" id="4247">
<td><a id="l4247" class='ln'>4247</a></td><td> <a id="4247c5" class="tk">logInfo</a>-&gt;<a id="4247c14" class="tk">structLogVarsList</a> = <a id="4247c34" class="tk">NULL</a>;</td></tr>
<tr name="4248" id="4248">
<td><a id="l4248" class='ln'>4248</a></td><td> <a id="4248c5" class="tk">FREE</a>(<a id="4248c10" class="tk">logInfo</a>-&gt;<a id="4248c19" class="tk">y</a>);</td></tr>
<tr name="4249" id="4249">
<td><a id="l4249" class='ln'>4249</a></td><td> <a id="4249c5" class="tk">logInfo</a>-&gt;<a id="4249c14" class="tk">y</a> = <a id="4249c18" class="tk">NULL</a>;</td></tr>
<tr name="4250" id="4250">
<td><a id="l4250" class='ln'>4250</a></td><td> <a id="4250c5" class="tk">FREE</a>(<a id="4250c10" class="tk">logInfo</a>);</td></tr>
<tr name="4251" id="4251">
<td><a id="l4251" class='ln'>4251</a></td><td> <a id="4251c5" class="tk">rtliSetLogInfo</a>(<a id="4251c20" class="tk">li</a>,<a id="4251c23" class="tk">NULL</a>);</td></tr>
<tr name="4252" id="4252">
<td><a id="l4252" class='ln'>4252</a></td><td></td></tr>
<tr name="4253" id="4253">
<td><a id="l4253" class='ln'>4253</a></td><td><span class="br">}</span> <span class="ct">/* end rt_StopDataLoggingImpl */</span></td></tr>
<tr name="4254" id="4254">
<td><a id="l4254" class='ln'>4254</a></td><td></td></tr>
<tr name="4255" id="4255">
<td><a id="l4255" class='ln'>4255</a></td><td></td></tr>
<tr name="4256" id="4256">
<td><a id="l4256" class='ln'>4256</a></td><td><span class="pp">#ifdef</span> <a id="4256c8" class="tk">__cplusplus</a></td></tr>
<tr name="4257" id="4257">
<td><a id="l4257" class='ln'>4257</a></td><td><span class="br">}</span></td></tr>
<tr name="4258" id="4258">
<td><a id="l4258" class='ln'>4258</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="4259" id="4259">
<td><a id="l4259" class='ln'>4259</a></td><td></td></tr>
<tr name="4260" id="4260">
<td><a id="l4260" class='ln'>4260</a></td><td></td></tr>
<tr name="4261" id="4261">
<td><a id="l4261" class='ln'>4261</a></td><td><span class="pp">#ifdef</span> <a id="4261c8" class="tk">__cplusplus</a></td></tr>
<tr name="4262" id="4262">
<td><a id="l4262" class='ln'>4262</a></td><td><span class="kw">extern</span> "C" <span class="br">{</span></td></tr>
<tr name="4263" id="4263">
<td><a id="l4263" class='ln'>4263</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="4264" id="4264">
<td><a id="l4264" class='ln'>4264</a></td><td></td></tr>
<tr name="4265" id="4265">
<td><a id="l4265" class='ln'>4265</a></td><td></td></tr>
<tr name="4266" id="4266">
<td><a id="l4266" class='ln'>4266</a></td><td><span class="ct">/* Function: rt_StopDataLogging ================================================</span></td></tr>
<tr name="4267" id="4267">
<td><a id="l4267" class='ln'>4267</a></td><td><span class="ct"> * Abstract:</span></td></tr>
<tr name="4268" id="4268">
<td><a id="l4268" class='ln'>4268</a></td><td><span class="ct"> * Write logged data to model.mat and free memory.</span></td></tr>
<tr name="4269" id="4269">
<td><a id="l4269" class='ln'>4269</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4270" id="4270">
<td><a id="l4270" class='ln'>4270</a></td><td><span class="kw">void</span> <a id="4270c6" class="tk">rt_StopDataLogging</a>(<span class="kw">const</span> <a id="4270c31" class="tk">char_T</a> <a id="4270c38" class="tk">*</a><a id="4270c39" class="tk">file</a>, <a id="4270c45" class="tk">RTWLogInfo</a> <a id="4270c56" class="tk">*</a><a id="4270c57" class="tk">li</a>)</td></tr>
<tr name="4271" id="4271">
<td><a id="l4271" class='ln'>4271</a></td><td><span class="br">{</span></td></tr>
<tr name="4272" id="4272">
<td><a id="l4272" class='ln'>4272</a></td><td> <a id="4272c5" class="tk">rt_StopDataLoggingImpl</a>(<a id="4272c28" class="tk">file</a>,<a id="4272c33" class="tk">li</a>,false);</td></tr>
<tr name="4273" id="4273">
<td><a id="l4273" class='ln'>4273</a></td><td></td></tr>
<tr name="4274" id="4274">
<td><a id="l4274" class='ln'>4274</a></td><td><span class="br">}</span> <span class="ct">/* end rt_StopDataLogging */</span></td></tr>
<tr name="4275" id="4275">
<td><a id="l4275" class='ln'>4275</a></td><td></td></tr>
<tr name="4276" id="4276">
<td><a id="l4276" class='ln'>4276</a></td><td></td></tr>
<tr name="4277" id="4277">
<td><a id="l4277" class='ln'>4277</a></td><td><span class="pp">#ifdef</span> <a id="4277c8" class="tk">__cplusplus</a></td></tr>
<tr name="4278" id="4278">
<td><a id="l4278" class='ln'>4278</a></td><td><span class="br">}</span></td></tr>
<tr name="4279" id="4279">
<td><a id="l4279" class='ln'>4279</a></td><td><span class="pp">#endif</span></td></tr>
<tr name="4280" id="4280">
<td><a id="l4280" class='ln'>4280</a></td><td></td></tr>
<tr name="4281" id="4281">
<td><a id="l4281" class='ln'>4281</a></td><td><span class="pp">#else</span> <span class="ct">/*!defined(MAT_FILE) || (defined(MAT_FILE) &amp;&amp; MAT_FILE == 1)*/</span></td></tr>
<tr name="4282" id="4282">
<td><a id="l4282" class='ln'>4282</a></td><td></td></tr>
<tr name="4283" id="4283">
<td><a id="l4283" class='ln'>4283</a></td><td><span class="pp">#define</span> <a id="4283c9" class="tk">rt_StartDataLogging</a>(<a id="4283c29" class="tk">li</a>, <a id="4283c33" class="tk">finalTime</a>, <a id="4283c44" class="tk">stepSize</a>, <a id="4283c54" class="tk">errStatus</a>) <a id="4283c65" class="tk">NULL</a> <span class="ct">/* do nothing */</span></td></tr>
<tr name="4284" id="4284">
<td><a id="l4284" class='ln'>4284</a></td><td><span class="pp">#define</span> <a id="4284c9" class="tk">rt_UpdateTXYLogVars</a>(<a id="4284c29" class="tk">li</a>, <a id="4284c33" class="tk">tPtr</a>) <a id="4284c39" class="tk">NULL</a> <span class="ct">/* do nothing */</span></td></tr>
<tr name="4285" id="4285">
<td><a id="l4285" class='ln'>4285</a></td><td><span class="pp">#define</span> <a id="4285c9" class="tk">rt_StopDataLogging</a>(<a id="4285c28" class="tk">file</a>, <a id="4285c34" class="tk">li</a>) <span class="br">{</span> (<span class="kw">void</span>(<a id="4285c46" class="tk">file</a>)); <span class="br">}</span> <span class="ct">/* use file quiet unused macro warning */</span> <span class="ct">/* do nothing */</span></td></tr>
<tr name="4286" id="4286">
<td><a id="l4286" class='ln'>4286</a></td><td></td></tr>
<tr name="4287" id="4287">
<td><a id="l4287" class='ln'>4287</a></td><td><span class="pp">#endif</span> <span class="ct">/*!defined(MAT_FILE) || (defined(MAT_FILE) &amp;&amp; MAT_FILE == 1)*/</span></td></tr>
<tr name="4288" id="4288">
<td><a id="l4288" class='ln'>4288</a></td><td></td></tr>
<tr name="4289" id="4289">
<td><a id="l4289" class='ln'>4289</a></td><td></td></tr>
<tr name="4290" id="4290">
<td><a id="l4290" class='ln'>4290</a></td><td></td></tr>
<tr name="4291" id="4291">
<td><a id="l4291" class='ln'>4291</a></td><td><span class="ct">/* [eof] rt_logging.c */</span></td></tr>
<tr name="4292" id="4292">
<td><a id="l4292" class='ln'>4292</a></td><td></td></tr>
<tr name="4293" id="4293">
<td><a id="l4293" class='ln'>4293</a></td><td><span class="ct">/* LocalWords: Tfinal MAXNAM nonfinite DType PWS RSim Fixup logvar DDEFAULT th</span></td></tr>
<tr name="4294" id="4294">
<td><a id="l4294" class='ln'>4294</a></td><td><span class="ct"> * LocalWords: curr Realloc realloc inp biglong vijay ldexp TXY eof XFinal th</span></td></tr>
<tr name="4295" id="4295">
<td><a id="l4295" class='ln'>4295</a></td><td><span class="ct"> * LocalWords: TXXFY NULL typedefs ret polyspace NUL</span></td></tr>
<tr name="4296" id="4296">
<td><a id="l4296" class='ln'>4296</a></td><td><span class="ct"> */</span></td></tr>
<tr name="4297" id="4297">
<td><a id="l4297" class='ln'>4297</a></td><td></td></tr>
</table>
</pre>
</body>
</html>