Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/27/06 14:59
Read: times


 
#121166 - fixed size struct?
I have a paged memory this makes accssing all related to a givn sign on the bus occupy a page very efficient (the struct is much larger). I am using the struct below (SDfill added for illustration) with no problems except the addressing does not 'look good'
typedef struct h
{
  U8    SDser[8]  ; // serial number
  U8    SDaddr    ; // address assigned to sign
  U8    SDdips    ; // dipswitch setting
  U8    SDtype    ; // type of sign
  U8    SDwidt    ; // width
  U8    SDhgth    ; // height
  U8    SDfill[256-14] ;  // fill struct to be 256 long
  
    // put this one last
  U8    SDerno    ; // here store error number if FRAM match/update failed.
} SIGN_DESC;

Now, if the [256-14] could be calculated, I could go through the signs by
for (num = min; num < max; num++)
{
  xxx[num]
  ...
}
instead of 'pointer manipulation'.

Again, I do not ask, how to make it work, IT DOES, it would just be more readable if I could automatically make the struct always 256 long and simply use pointer increment. I have evaluated all methods to do this with the struct less than 256, and have chosen one that works.

Erik

List of 15 messages in thread
TopicAuthorDate
fixed size struct?            01/01/70 00:00      
   Not quite clear            01/01/70 00:00      
      thx, but            01/01/70 00:00      
         Confused!            01/01/70 00:00      
            the original question is \"can you define a struct            01/01/70 00:00      
               Possible in theory, but the code looks strange            01/01/70 00:00      
                  figured the dummy out myself but that is the road            01/01/70 00:00      
                  Doesn\'t have to look strange            01/01/70 00:00      
                     got it, thanks            01/01/70 00:00      
                        Aside - structure addressing            01/01/70 00:00      
                           which is the case in one of the instances            01/01/70 00:00      
                              nameless struct member            01/01/70 00:00      
   union of structs            01/01/70 00:00      
      same as Andy            01/01/70 00:00      
         Pascal            01/01/70 00:00      

Back to Subject List