Liu, It is difficult without the entire source tree to look at specific lines and understand the issues.
In frame802154-changed.c line 84, you have changed the parameter "mode" to be a pointer to an unsigned 8-bit integer type, but is it a pointer, or is it the mode? Is the caller passing the variable by value or by reference (address). It is unclear to me why you are (in line 124) getting dest_addr_len using addr_len( &(fcf->dest_addr_mode ) instead of "p->fcf.dest_addr_mode & 3" In the line above, the pointer "p" is still in use. Is there a reason you changed the semantics of access to the fcf structure from access through the pointer p, to access via an & override of fcf as a pointer when fcf is a structure? You have not provided an example of the code that calls addr_len, so it is hard to determine the nature of "mode". If it is a pointer, I don 't know why you added the * in line 87 ? I dont see any evidence that mode is a pointer to a pointer. If you want help, you will have to choose a specific issue, provide the code, and an example of code that calls the code, as well as definitions of the variables in use. I wish I could help you more. Douglas On May 31, 2011, at 6:22 AM, Liu Ming wrote: > Hello everyone, > > Anyone can help me? I am working on contiki on cc2530 chip using SDCC. > > But so many problems which I don't know why make me crazy. > > Like the example in attachment, frame-802154.c is the original one in Contiki > git, frame-802154-changed.c is my version to make it can work. > > Sorry, I don't know why the "fixing" can work, I just list it for all of you: > > 1) line 81 of frame-802154-changed.c make veriable flen to be static. > 2) line 85 of frame-802154-changed.c make param of addr_len to be pointer > 3) line 121 of frame-802154.c, the & operation stop the normal running. so I > cut it out. > 4) line 235 of frame-802154-changed.c, src_addr_len is changed from 8 to 7 in > SOMEWHERE. so I can just using /2 and *2... > > And some other problem like > 1)the pointer of pointer param make function crash(**point). > 2)if you use same pointer in function following anther, the pointer address > will change. > example: > A(&pointer); //Ok > B(&pointer); //pointer changed. > > I don't know why, And I need to know. Maybe some problem is funny and not > right. But anyone can give me some cue? > > Luke Liu > <frame802154-changed.c><frame802154.c>------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev_______________________________________________ > Sdcc-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sdcc-user ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
