Segmentation is handled differently depending on whether you are using Code
Warrior or PODS. I will assume PODS.
I strongly recommend the book Professional Palm OS Programming by Foster
and Bachmann. It contained this info and has lots more. I'm a relative
newbie as well.
1. Create a file and included it in your project, called sections.def. That
file should contain 2 lines-
application {"YourAppName" BIGAPP}
multiple code {"segment1" "segment2"}
2. In the PODS makefile, include the statement MULTIPLE_CODE_SECTIONS = TRUE
3. Create a header file Sections.h containing
#ifndef _SECTIONS_H
#define _SECTIONS_H
#define CODESEGMENT1 __attribute__ ((section ("segment1")))
#define CODESEGMENT2 __attribute__ ((section ("segment2")))
#endif
4. For each function you want in the second segment, change the definition
of the function adding the code segment to the definition like this:
void yourfunction(void) CODESEGMENT2;
If you don't declare a code segment, it will go into the first segment.
You can declare more segments, in the same manner as above.
Jeff Summers
In your message regarding Re: Displaying Float Values in simple format
dated Wed, 21 Sep 2005 20:33:24 +0530, Dighe Jeetendra said that ...
>
>
>
> On 9/21/05, Jeff Summers <[EMAIL PROTECTED]> wrote:
> I just asked the same question, and apparently there is a common routine
> called GetStringFromDouble that, although not part of the SDK, is a
> function that has been publicly posted and is in common use. I was
> referred to the archives for this newsgroup, but could not find it there.
> I found it in another newsgroup archive (not one of Palm's) through a
> Google search and will post it below.
>
> Pass the routine your destination string, the floating point number, and
> the number of digits after the decimal point desired.
>
>
> //********************************************************************
> // GetStringFromDouble()
> //********************************************************************
> //
> // Gets string from double, and rounds to the appropriate number of
> // decimal points.
> //
> // Taken from Palm Dev Forum
> //
> //********************************************************************
>
> void GetStringFromDouble(Char* str, double dblNum, Int16 numFractDigits)
>
> double flpIP, zeros, round;
> Int32 remainder, longNumber;
> Int16 i, strLen;
> Char buffer[16];
>
> str[0] = 0;
>
> if (dblNum < 0.0)
>
> dblNum = -dblNum;
> StrCat(str, "-");
>
>
> zeros = 1.0;
> for (i = 0; i < numFractDigits; i++)
>
> zeros *= 10.0;
>
> round = 0.5 / zeros;
>
> dblNum += round;
> flpIP = (Int32) dblNum;
> dblNum -= flpIP;
>
> StrIToA(buffer, (Int32) flpIP);
> StrCat(str, buffer);
> strLen = (Int16) StrLen(str);
> StrCat(str, "."); // put in the decimal point and terminate the string
> str[numFractDigits + strLen + 1] = '0';
> longNumber = (Int32) (dblNum * zeros); // fractional part
>
> for (i = numFractDigits + strLen; i > strLen; i--)
>
> remainder = longNumber % 10; // convert the integer part
> str[i] = (Char) (remainder + 0x30);
> longNumber /= 10;
>
>
>
>
> Thank's jeff the above code really helped me a lot by making some changes
> in the parameters.
>
> yet another issue i got after making final changes in my Project for all
> the Float values,i got a Segmentation problem i think so my code has
> exceeded 32k size.
>
> Do u have some sample tips regarding Segmentation, it would really help me
> a lot.
> Thankx
>
>
>
>
>
>
>
>
> -- 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/