Re: Globals in Hacks

2008-05-29 Thread Richard Hartman
Stuart Nicholson wrote in message <[EMAIL PROTECTED]>... > >You can only really store 4 byte (UInt32) pieces of information in >Features (unless you want to write some extremely hokey storage scheme >that breaks structures down into 4 byte chunks ;) ). > Note that a "handle" is a 4 byte chunk ...

Re: Globals in shared libraries and virtual drivers.

2008-05-29 Thread Richard Hartman
Did you read the entire response, or stop after "you don't need ..."? What do you expect to get out of "real" globals that is not provided by the technique that Aaron suggested? -- -Richard M. Hartman [EMAIL PROTECTED] 186,000 mi/sec: not just a good idea, it's the LAW! Petrus Wrangö wrote in

Re: Globals in shared libraries and virtual drivers.

2008-05-28 Thread David Kendall
"Aaron Ardiri" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Official information states that 'real' globals canot be used in a shared > library. What I want to know is: Can I use globals in serial and virtual > drivers? > How? > > I'm also interested in using globals in shared li

Re: Globals problem with Tbl callback in shared library

2008-05-28 Thread David Kendall
"Ken Krugler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > >I have a table with a custom draw procedure. When the draw procedure get's > >called (from TblDrawTable/TblRedrawTable), the globals are pooched. > > Any OS routine can use/modify/trash register A4, as long as it > re

Re: globals & #defines & sections

2006-12-13 Thread Ben Combee
On 12/13/06, Michael <[EMAIL PROTECTED]> wrote: > > Thanks for the super-thorough explanation. How did you get the assembly > code? After a quick search, one tool I found was EZAsm. In CodeWarrior, you just right click on the source file in the project list and choose "Disassemble" to get the dum

Re: globals & #defines & sections

2006-12-13 Thread Michael
Thanks for the super-thorough explanation. How did you get the assembly code? After a quick search, one tool I found was EZAsm. Also, I just want to confirm that the asm keyword is only available in Protein applications for Cobalt - right? Unfortunately, I'm developing for Treo handsets which a

Re: globals & #defines & sections

2006-12-11 Thread Jeff Loucks
I don't mean to lecture, but please consider carefully what it is we're doing here. I presume we're trying to reduce data storage space, cut execution time and use less code segment. (I hope the formatting is readable) The two examples that've been passed around are not good choices for several re

Re: globals & #defines & sections

2006-12-11 Thread Michael
Thanks for the idea. I searched some more and didn't find anything on PC-Relative strings in PODs. I'm thinking more and more that I need to buy code warrior. Using the #define STRING "some string" void foo(){ const Char val[] = STRING; return StrLen(val); } works well, the only problem is it

Re: globals & #defines

2006-12-11 Thread James Lin
Michael wrote: > > Thanks for the heads up - I would have been banging my head > against a wall for awhile on that one. > > Now the next question: > Does anyone know how to set the equivalent of PC-Relative Strings > in PODS? I've been doing some searching and I've found a compiler > opt

Re: globals & #defines

2006-12-11 Thread Michael
Thanks for the heads up - I would have been banging my head against a wall for awhile on that one. Now the next question: Does anyone know how to set the equivalent of PC-Relative Strings in PODS? I've been doing some searching and I've found a compiler option mpcrel for the GNU C compiler but

Re: globals & #defines

2006-09-01 Thread Neil Whitworth
Thats true, but it depends on what the #define is for.. simple data types (Ints, longs chars etc) are o.k. #define SomeInt (0) void f ( ) { int i = SomeInt; } Will work, the compiler can make code that does not access globals #define SomeString "This is a string" void f ( ) {

Re: globals & #defines

2006-08-30 Thread Jeff Loucks
Ummm... #defines are used by the compiler (actually, the preprocessor) and are not relevant after preprocessing. On 8/30/06, Michael <[EMAIL PROTECTED]> wrote: When my app gets started without access to it's global variables (e.g. from a sysAppLaunch), does it still have access to all of it's

Re: Globals-am I right

2004-12-03 Thread Tam Hanna
Hi Ben, thanks for the detailled Info! Best Regards Tam Hanna Ben Combee wrote: >In my App, when I receive a launch code where globals are not accepted, I >cannot acess any variables defined outside of the function that is beeing >called. You cannot access any variables that aren't located on t

Re: Globals-am I right

2004-12-02 Thread Ben Combee
In my App, when I receive a launch code where globals are not accepted, I cannot acess any variables defined outside of the function that is beeing called. You cannot access any variables that aren't located on the stack. This includes global variables, static variables, and some kinds of consta

Re: Globals inside a CallBack?

2004-01-29 Thread Chris Tutty
From: "S L" <[EMAIL PROTECTED]> > I need to "process" some data at a non-normal launch code. Routines to > process this data are contained by static libraries that inevitably > lie outside the first memory segment. This bit of processing needs to > happen at a 'non normal launch code. Any idea how

Re: Globals inside a CallBack?

2004-01-29 Thread S L
Hi Regis, I apologize for the email .. didn't realize I'd sent it until I read your post & then checked my sent items :-) I need to "process" some data at a non-normal launch code. Routines to process this data are contained by static libraries that inevitably lie outside the first memory segment

Re: Globals inside a CallBack?

2004-01-29 Thread Regis St-Gelais
"S L" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > i have a multi segmented app which uses a few static libraries .. all of > which will be in segments other than segment 0. Now at a launch code other > than the Normal Launch Code, I need to carry out some bit of proce

Re: Globals inside a CallBack?

2004-01-29 Thread Regis St-Gelais
"Chris Tutty" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > Of course this > might be a callback which is only registered while > your app is up and running in which case you're > never going to get into dangerous territory. Exactly my case. The callback is called only

Re: Globals inside a CallBack?

2004-01-29 Thread S L
Hi, I'd posted this before but didn't get a reply .. perhaps someone here could help me out... i have a multi segmented app which uses a few static libraries .. all of which will be in segments other than segment 0. Now at a launch code other than the Normal Launch Code, I need to carry out some

Re: Globals inside a CallBack?

2004-01-28 Thread Chris Tutty
From: "Regis St-Gelais" <[EMAIL PROTECTED]> > My main code is in segment 1 and my callback is in segment 2. > And the callback was able to read and write the global variable. > > Note that this callback is not launched by a launch code. > It is called during the normal operation of my application

Re: Globals inside a CallBack?

2004-01-28 Thread Ron Nicholson
On Date: Wed, 28 Jan 2004 18:50:41, Regis St-Gelais writes: >I did the following test. > >My main code is in segment 1 and my callback is in segment 2. >And the callback was able to read and write the global variable. > >Note that this callback is not launched by a launch code. >It is called during

Re: Globals inside a CallBack?

2004-01-28 Thread Regis St-Gelais
I did the following test. My main code is in segment 1 and my callback is in segment 2. And the callback was able to read and write the global variable. Note that this callback is not launched by a launch code. It is called during the normal operation of my application by my application. -- Re

Re: Globals inside a CallBack?

2004-01-28 Thread Aaron Ardiri
> Not sure about globals but static didn't work for me. static variables use global memory space. that is, they are globals in disguse - beware *g* :) now, what would be cool is if the compiler would use FtrGet/FtrSet when static variables are used - then, we wouldn't have that problem.. hint: us

Re: Globals inside a CallBack?

2004-01-28 Thread Elvin Ng
Not sure about globals but static didn't work for me. elv "Regis St-Gelais" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In a multi segment application. Are the globals accessible from inside a > callback function? > > -- > Regis St-Gelais > www.laubrass.com > -- > > > -- For

Re: Globals inside a CallBack?

2004-01-28 Thread Manoel Teixeira
tt Graham <[EMAIL PROTECTED]> > Data: Wed, 28 Jan 2004 13:20:38 -0500 > Para: "Palm Developer Forum" <[EMAIL PROTECTED]> > Assunto: Re: Globals inside a CallBack? > > Regis St-Gelais wrote: > > > In a multi segment application. Are the globals accessible f

Re: Globals inside a CallBack?

2004-01-28 Thread Matt Graham
Regis St-Gelais wrote: In a multi segment application. Are the globals accessible from inside a callback function? they should be. I've never had problems with it, but I usually don't do anything too freaky that might make it not work. -- For information on using the Palm Developer Forums, or to

Re: Globals, StrPrintF, StrIToH

2003-10-15 Thread Brian Smith
On Wed, 15 Oct 2003, John Marshall wrote: > Brian Smith <[EMAIL PROTECTED]> wrote: > > [I'm using PRC-Tools 2.3 and it s]eems that a type cast from double > > to Int32 is what's causing the problem (adding about 3k of code and > > apparently a global or two). > > A conversion from double is involv

Re: Globals, StrPrintF, StrIToH

2003-10-15 Thread John Marshall
Brian Smith <[EMAIL PROTECTED]> wrote: > [I'm using PRC-Tools 2.3 and it s]eems that a type cast from double > to Int32 is what's causing the problem (adding about 3k of code and > apparently a global or two). A conversion from double is involved: no surprises there :-). See particularly

Re: Globals, StrPrintF, StrIToH

2003-10-14 Thread Ben Combee
At 09:31 PM 10/14/2003, Brian Smith wrote: On Tue, 14 Oct 2003, Ron Nicholson wrote: > If the numbers are in a reasonable range (approx 1 <= x < 2^31, etc.), > and you don't care about rounding accuracy, it's not hard to extract the > exponent and mantissa bits from an fp double and do a shift, an

Re: Globals, StrPrintF, StrIToH

2003-10-14 Thread Brian Smith
On Tue, 14 Oct 2003, Ron Nicholson wrote: > If the numbers are in a reasonable range (approx 1 <= x < 2^31, etc.), > and you don't care about rounding accuracy, it's not hard to extract the > exponent and mantissa bits from an fp double and do a shift, and with > much less than 3k of compiled code

Re: Globals, StrPrintF, StrIToH

2003-10-14 Thread Ron Nicholson
On Tue, 14 Oct 2003 15:15:22, Brian Smith wrote: >Found out what it is, and it's not what I first thought it to be. Seems >that a type cast from double to Int32 is what's causing the problem >(adding about 3k of code and apparently a global or two). What I don't >know is how to get around it. Id

Re: Globals, StrPrintF, StrIToH

2003-10-14 Thread Brian Smith
On Tue, 14 Oct 2003, Brian Smith wrote: > Found out what it is, and it's not what I first thought it to be. Seems > that a type cast from double to Int32 is what's causing the problem > (adding about 3k of code and apparently a global or two). What I don't > know is how to get around it. Ideas?

Re: Globals, StrPrintF, StrIToH

2003-10-14 Thread Brian Smith
On Tue, 14 Oct 2003, Brian Smith wrote: > I'm trying to write a bit of code that gets launched without globals (by > intention), and doesn't have any in my code, but it seems to be trying to > access some anyway. I've narrowed it down to calls to StrPrintF and > StrIToH... I take those out, and i

Re: globals and shared libs.

2001-06-09 Thread Dave Lippincott
eloper Forum" <[EMAIL PROTECTED]> Sent: Friday, June 08, 2001 8:44 PM Subject: Re: globals and shared libs. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/

Re: globals and shared libs.

2001-06-08 Thread Eric W. Sirko
> In your LibOpen routine, lock the global pointer and populate Var. Since > you know the data that must go into Var, its a simple matter of assigning > the values to the array. Its an extra step but it beats banging your head > against a wall trying to figure out constants in structures especia

Re: globals and shared libs.

2001-06-08 Thread Dave Lippincott
cess to global memory. - Original Message - From: "Eric W. Sirko" <[EMAIL PROTECTED]> Newsgroups: palm-dev-forum To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Friday, June 08, 2001 3:57 PM Subject: Re: globals and shared libs. > > You could try

Re: globals and shared libs.

2001-06-08 Thread Eric W. Sirko
> You could try allocating enough memory in the declaration of your 'global' > structure, then use the library initialization to populate the array. Populate it with what? He doesn't have the constant data to populate it with. What you want to do, Phillip, is have the constant data compiled int

Re: globals and shared libs.

2001-06-08 Thread Dave Lippincott
You could try allocating enough memory in the declaration of your 'global' structure, then use the library initialization to populate the array. - Original Message - From: "Phillip Streck" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Friday, June 08, 2001 11:16

RE: globals

2000-12-26 Thread Yu, Ken [IT]
> -- > From: Paul Nevai[SMTP:[EMAIL PROTECTED]] > Reply To: Palm Developer Forum > Sent: Sunday, December 24, 2000 11:47 PM > To: Palm Developer Forum > Subject: globals > > How can I acess the system globals? Is there a function or a trick for > that? > Thank

Re: Globals problem with Tbl callback in shared library

2000-11-14 Thread David Kendall
"Ken Krugler" <[EMAIL PROTECTED]> wrote in message news:30043@palm-dev-forum... > > > >I have a table with a custom draw procedure. When the draw procedure get's > >called (from TblDrawTable/TblRedrawTable), the globals are pooched. > > Any OS routine can use/modify/trash register A4, as long as

Re: Globals problem with Tbl callback in shared library

2000-11-14 Thread Ken Krugler
At 12:00am -0800 00-11-14, Palm Developer Forum digest wrote: >Subject: Globals problem with Tbl callback in shared library >From: "David Kendall" <[EMAIL PROTECTED]> >Date: Mon, 13 Nov 2000 12:24:44 -0400 >X-Message-Number: 70 > >I'm using the illustrious Mr. Krugler's techniques for global varia

Re: Globals in shared libraries and virtual drivers.

2000-11-06 Thread David Kendall
"Aaron Ardiri" <[EMAIL PROTECTED]> wrote in message news:15955@palm-dev-forum... > Official information states that 'real' globals canot be used in a shared > library. What I want to know is: Can I use globals in serial and virtual > drivers? > How? > > I'm also interested in using globals in sh

Re: globals where?

2000-09-29 Thread Ken Krugler
At 12:00am -0700 00-09-29, Palm Developer Forum digest wrote: >Subject: globals where? >From: Richard Bram <[EMAIL PROTECTED]> >Date: Thu, 28 Sep 2000 21:02:02 -0500 >X-Message-Number: 99 > >I've been writing hacks too long and I can't remember much about >globals. Using Metrowerks, do globals us

RE: Globals in shared libraries and virtual drivers.

2000-08-15 Thread Kevin O'Keefe
hat used the IR library) and I believe it did save us some work while creating only a few minor headaches. Kevin > -Original Message- > From: Richard Hartman [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 30, 2000 9:53 AM > To: Palm Developer Forum > Subject: Re: Globals in

RE: Globals in shared libraries and virtual drivers

2000-07-02 Thread Ken Krugler
Petrus, The code is at . As mentioned in Steve Mann's reply, the article in on his CD. As to responses from Aaron Ardiri and Richard Hartman, yes there are a variety of methods for implementing dynamic heap data storage that persists during the lifetime of a s

Re: Globals in Hacks

2000-06-30 Thread Richard Hartman
Stuart Nicholson wrote in message <16006@palm-dev-forum>... > >You can only really store 4 byte (UInt32) pieces of information in >Features (unless you want to write some extremely hokey storage scheme >that breaks structures down into 4 byte chunks ;) ). > Note that a "handle" is a 4 byte chunk

Re: Globals in shared libraries and virtual drivers.

2000-06-30 Thread Richard Hartman
Did you read the entire response, or stop after "you don't need ..."? What do you expect to get out of "real" globals that is not provided by the technique that Aaron suggested? -- -Richard M. Hartman [EMAIL PROTECTED] 186,000 mi/sec: not just a good idea, it's the LAW! Petrus Wrangö wrote i

Re: Globals in shared libraries and virtual drivers.

2000-06-30 Thread Steve Mann
>Anyone knows the whereabouts of this article?: >"PalmOS Shared-Library Globals," by Ken Krugler It's part of our Handheld Systems CD-ROM archives. You can get a copy at our web site (www.cdpubs.com). There's a nominal charge. I can also email anyone on this list a copy if they send me a privat

Re: Globals in Hacks

2000-06-30 Thread Roger Chaplin
"Thomas Ward" <[EMAIL PROTECTED]> wrote in message news:16005@palm-dev-forum... > I've seen various examples of hacks using either preferences or features to > store "global" data. Are there any reasons to pick one over the other? What > are their advantages/disadvantages? Features go away on a s

RE: Globals in Hacks

2000-06-30 Thread Stuart Nicholson
You can only really store 4 byte (UInt32) pieces of information in Features (unless you want to write some extremely hokey storage scheme that breaks structures down into 4 byte chunks ;) ). Preferences give you a much more flexible 'chunk of memory' to work with. They behave like resizeable reco

Re: Globals in shared libraries and virtual drivers.

2000-06-30 Thread Petrus Wrangö
> you dont need to use globals at ALL really. Sorry, I forgot to mention that I'm porting a rather large piece of code. And I really need the 'real' globals. Petrus -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support

Re: Globals in shared libraries and virtual drivers.

2000-06-30 Thread Aaron Ardiri
> Official information states that 'real' globals canot be used in a shared > library. What I want to know is: Can I use globals in serial and virtual > drivers? > How? > > I'm also interested in using globals in shared libs, despite official info. you dont need to use globals at ALL really.

Re: Globals or no Globals

2000-04-26 Thread Bob Ebert
At 10:35 PM +0200 04/25/00, Jason Simpkins wrote: >When I call DmResetRecordStates() on a Palm OS 3.5 its seems to work fine, >however same code no changes on a Palm V running the PalmVDebug Rom causes a >"bus error", WTFO? This is whats so friggin frustrating with this platform. David's respons

Re: Globals or no Globals

2000-04-26 Thread Michael Yam
Never mind. Just read David Fedor's response. --MIke Michael Yam <[EMAIL PROTECTED]> wrote in message news:9571@palm-dev-forum... > > Debug ROMs are more vigilant at catching problems than regular ROMs. Just > because a program ran fine doesn't mean a potential problem doesn't exist > :-). > >

Re: Globals or no Globals

2000-04-26 Thread Michael Yam
Debug ROMs are more vigilant at catching problems than regular ROMs. Just because a program ran fine doesn't mean a potential problem doesn't exist :-). -- Michael Yam www.ytechnology.com Jason Simpkins <[EMAIL PROTECTED]> wrote in message news:9489@palm-dev-forum... > > Heres another one of t

Re: Globals or no Globals

2000-04-25 Thread Jason Simpkins
OK, I got now, thank you very much for the information, and I do truly appreciate the technical expertise so easily accessible on this email list. Kudos! Jason David Fedor wrote: > >When I call DmResetRecordStates() on a Palm OS 3.5 its seems to work fine, > >however same code no changes on

Re: Globals or no Globals

2000-04-25 Thread David Fedor
>When I call DmResetRecordStates() on a Palm OS 3.5 its seems to work fine, >however same code no changes on a Palm V running the PalmVDebug Rom causes a >"bus error", WTFO? There was a bug in the OS, fixed in 3.5, such that calling this routine would nearly always cause a bus error. The only wa

Re: Globals or no Globals

2000-04-25 Thread Jason Simpkins
Heres another one of those freaky problems. When I call DmResetRecordStates() on a Palm OS 3.5 its seems to work fine, however same code no changes on a Palm V running the PalmVDebug Rom causes a "bus error", WTFO? This is whats so friggin frustrating with this platform. rant_mode=on; Hey Palm

Re: Globals or no Globals

2000-04-25 Thread Roger Chaplin
"Jason Simpkins" <[EMAIL PROTECTED]> wrote: > I am fighting weird freaky memory problems and it is driving me insane. > Currently if I have large > local char buffers in my functions, such as char buffer[1024], I am getting > a "tried to change the PC > to address 0x3FE0098address is niet

Re: Globals or no Globals

2000-04-25 Thread Ben Combee
You have a very small stack space for local variables, as low as 2.5K on some devices. A single "char buffer[1024]" uses up almost half of the available space. While you could declare the buffer as a global, now you have 1K permanently allocated to a buffer that is only used a brief periods of t