roozbeh gholizadeh wrote:
Hi,
lots of types in lcltypes are declared as packed,which i dont know why,
as far as i know lots of them are similar to types with almost exact name from windows unit,but as you look at windows unit,none of them are packed. also almost all of these records are by itself 2byte or 4byte aligned,ie removing packed will not influence them.

The problem is in wince, by using packed lots of things change,compiler now generates unaligned codes,and becouse it defaults packing to 1byte,packed variables might reside in odd number memory places. This doesnt make problem in program,becouse all accesses are done in one byte schema,but when sending these records to winapi,they all generate errors,which is really hard to find too!

I suggest removing all packed records when they are unessesary.

IMO, the LCL doesn't need packed records. It is only a penalty for nothing to have them. If they are used by the win32 interface to send them directly to the winapi, they have to be copied to proper win32 api formats in the win32 widgetset itself.

So removing things may break some code, but that IMO doen't mean that we shouldnt change.

Marc


_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to