--- In [email protected], "entropyreduction" <[EMAIL PROTECTED]> wrote: > > --- In [email protected], "swzoh" <seanzoh@> wrote: > > > > > > It seems that there is a problem with (u)char type, or I > misunderstand it. > > > > local _1_=esc(?"\x01",?"\") > > local t=dll.create_struct("i o c c c c",1,1,1,1,1,1) > > win.debug(t[1],t[2],t[3],t[4],t[5],t[6]) > > > > The results is: > > 1 0x31310001 0x31313131 0x313131 0x3131 0x31 > > > > If neglecting the stack alignment problem (:is it correct name?), > > Yes. I too not entirely sure how stack alignmoent is mean to work, > but so far on results plugin seems to be doing the right thing as far > as api is concerned. > > 1/0 > > is correctly assigned, i.e., 0x01/0x00, for integer and short types, > > whereas is incorrectly assigned, i.e., their ascii values 0x31/0x30, > > for char types. So, have to use _1_/"" instead with char types. > > help 11.1.4.1: > > "char: If you specify any of the single-byte types (char, c, byte, > uchar) and the value passed in is one character long, that character > will be assigned to the argument or struct member. So "1" is passed > in as \x31, not \x01. If you want \x01, specify "01"." > > Have you tried "01"? >
I see. However, it's confusing, especially working in conjunction with long and short types. IMHO, 2) is simpler and convenient to use than 1), so better be changed, or at least introduce an option to switch, in its behavior if it doesn't require much work. What do you think? 1) current behavior, assigns ascii value: if want to assign pure numeric value 1, then have to use "\x01" or esc(?"\x01",?"\"), and "" for numeric 0 2) char assigns pure numerical value Ox00 ~ 0xFF: if want to assign literal (ascii) "1", then simply use 0x31 Sean ------------------------ Yahoo! Groups Sponsor --------------------~--> Great things are happening at Yahoo! Groups. See the new email design. http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/JV_rlB/TM --------------------------------------------------------------------~-> Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
