Hi Pinus..
              Thanks for the quick response.

ARROW_COSINE[0] = m_oFixed.valueOf("0.000");

In the above statement "m_oFixed" is an object of "Fixed" class used in our application.
Am pasting the code below.

Fixed Fixed::valueOf(char* sValue){
//   Fixed* fx = new Fixed(sValue, STRLEN(sValue));
   //REPORT_ALLOC(fx);
   Fixed retFX;
   retFX.m_lValue = strToX(sValue);
   //DELETE_OBJECT(fx);
   return retFX;
}

long strToX(char* sValue){
   UInt32 result;

   int len = StrLen(sValue);
   int signBit = 0;
   char whole[20];
   char fraction[20];

   int  i   = 0;
   char val = sValue[i];
      // Get the sign parity
   if(val == '-'){
       signBit = 1;                   i++;
   }
      // Get Whole Number
   int wholeCount = 0;
   while(i < len){                               if((val = sValue[i]) == '.'){
           break;
       }                       if(val == '0' || val == '1' || val == '2' || val == '3' || val == '4' ||
           val == '5' || val == '6' || val == '7' || val == '8' || val == '9'){
           whole[wholeCount++] = val;
       }                i++;
   }           i++;       whole[wholeCount] = '\0';
      // Get Fractional Number
   int fractCount = 0;
   while(i < len){                   val = sValue[i];
       if(val == '0' || val == '1' || val == '2' || val == '3' || val == '4' ||
           val == '5' || val == '6' || val == '7' || val == '8' || val == '9'){
           fraction[fractCount++] = val;
       }
       if(fractCount == Fixed::FIXED_PRECISION){
           break;
       }
       i++;
   }                  while(fractCount < Fixed::FIXED_PRECISION){
       fraction[fractCount++] = '0';
       //fractCount++;
   }
   fraction[fractCount] = '\0';

   result  = (StrAToI (whole) << Fixed::FIXED_SHIFT);
   result |= (StrAToI (fraction) & Fixed::FRACT_AND);
   result |= ((signBit << Fixed::SIGN_BIT_SHIFT) & Fixed::SIGN_BIT_ON);
   return result;
}

Waiting for your reply.
Regards..



Pinus Alba wrote:
Hi Sruthi,

I don't use CodeWarrior but do not believe it would have such a low  limit.

How are your arrays declared?

e.g. if WIND_ANGLES is an array of dynamically allocated large structures you may be running out of memory.

Regards,

On 01/02/07, Sruthi <[EMAIL PROTECTED]> wrote:
hi..

    Am trying to initialize a list of array at my application's startup
point. There are about 13 arrays. After initializing about 9 arrays my
application breaksup. Am attaching the code segment below. Is there any
limitation regarding arrays in codewarrior.

void Animate::initialize()
{
  WIND_ANGLES[0] = m_oFixed.valueOf((long)0);
   WIND_ANGLES[1] = m_oFixed.valueOf(45);
   WIND_ANGLES[2] = m_oFixed.valueOf(90);
   WIND_ANGLES[3] = m_oFixed.valueOf(135);
   WIND_ANGLES[4] = m_oFixed.valueOf(180);
   WIND_ANGLES[5] = m_oFixed.valueOf(225);
   WIND_ANGLES[6] = m_oFixed.valueOf(270);
   WIND_ANGLES[7] = m_oFixed.valueOf(315);

   WIND_COSINE[0] = m_oFixed.valueOf("1.000");
   WIND_COSINE[1] = m_oFixed.valueOf("0.707");
   WIND_COSINE[2] = m_oFixed.valueOf("0.000");
   WIND_COSINE[3] = m_oFixed.valueOf("- 0.707");
   WIND_COSINE[4] = m_oFixed.valueOf("-1.000");
   WIND_COSINE[5] = m_oFixed.valueOf("-0.707");
   WIND_COSINE[6] = m_oFixed.valueOf("0.000");
   WIND_COSINE[7] = m_oFixed.valueOf(" 0.707");
...
...
   AIM_TIME[0] = m_oFixed.valueOf(50);  // Al
   AIM_TIME[1] = m_oFixed.valueOf(80);  // Danny
   AIM_TIME[2] = m_oFixed.valueOf(70);  // Beeper
   AIM_TIME[3] = m_oFixed.valueOf(60);  // Bishop
   AIM_TIME[4] = m_oFixed.valueOf(40);  // Spaulding
   AIM_TIME[5] = m_oFixed.valueOf(90); // Lama
}


-- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

--
For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to