To: | |
---|---|
Subject: | Re: [ts-7000] PLD registers, still not getting access to memory regs |
From: | "Don W. Carr" <> |
Date: | Fri, 1 Sep 2006 08:38:18 -0500 |
You proplem is this line: if ((int)pld_regs=-1) { should be: if ((int)pld_regs == -1) { Your line asignes -1 to pld regs (overwriting the pointer you recieved), then, anything non-zero is true in C. But, better yet, and more readable: if ((MAP_FAILED == pld_regs) { Never do dangerous casts that you might not understand if you do not have to. Also, put the constant always on the left, that way if you put = instead of ==, the compiler will complain about asigning to a constant. Take the time to write good, readable code. You will spend less time in the long run and end up with a more reliable product. Hope this helps. Don. On 9/1/06, mattsaintdev <> wrote:
|
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [ts-7000] PLD registers, still not getting access to memory regs, mattsaintdev |
---|---|
Next by Date: | Re: [ts-7000] Re: rtai ts9 patches, sjanisch |
Previous by Thread: | [ts-7000] PLD registers, still not getting access to memory regs, mattsaintdev |
Next by Thread: | Re: [ts-7000] PLD registers, still not getting access to memory regs, Curtis Monroe |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU