Пример #1
0
        /// <summary>
        /// Initializes <c>m_argumentPtr</c> automatically from the <c>m_argumentTypeNames</c>.
        /// The length of the <c>m_argumentPtr</c> array is adjusted to match <c>m_argumentTypeNames</c>.
        /// Existing values are not changed. The other values are set in a language-dependent way.
        /// (currently only for 'C' language).
        /// 
        /// Does nothing when <c>m_argumentTypeNames</c> is null.
        /// </summary>
        /// <param name="S">Used for <c>m_outputLanguage</c> and the types.</param>
        public void InitArgumentPtrFromTypeNames(Specification S)
        {
            if (m_argumentTypeNames == null) return;

            int i = (m_argumentPtr == null) ? 0 : m_argumentPtr.Length;
            if (i != m_argumentTypeNames.Length)
            {// resize the array
                System.Array.Resize<bool>(ref m_argumentPtr, m_argumentTypeNames.Length);
                System.Array.Resize<bool>(ref m_argumentArr, m_argumentTypeNames.Length);
            }

            if (S.OutputC()) {
                // if it is not a float or a double, then it is a pointer
                for (; i < m_argumentTypeNames.Length; i++)
                {
                    //m_argumentPtr[i] = !(S.IsFloatType(m_argumentTypeNames[i]);
                    m_argumentPtr[i] = S.IsGaTypeName(m_argumentTypeNames[i]);
                }
            }
        }