|
From: Big P. <big...@gm...> - 2005-03-11 01:50:55
|
Hi, just minor questions, but qould be great help for me to solve: 1) I use hungarian keyboard layout and cannot enter ';' in the IDE. I'd use AltGr+=E9 (the US key ';' writes '=E9' on HU) to get the ';' but in the IDE, it does not do anything. I've noticed this kind of behaviour with other programs as well (rhide had much bigger problems with handling this, and also programs compiled with DJGPP by me, too). I use WIN XP, on 98 I don't get this kind of error. Is there a workaround for this ? (changing to US eases this problem, but I'm used to HU layout very much, and can't afford going back to US which I'd used years ago...) 2) is there a way to turn auto-indent on, but tell it not to mess with unindenting on '}' ??? I find this annoying, but also stuck to my coding onventions... I have turned auto-indent completely off, but that's just not the best... can I make this a suggestion to the authors? I'd be happy to contribute also, as long as it's C stuff... (which I think it is not :) 3) is there a way to have my #define things in the resource window? anyway, what can I get in that window? I have resource.h and resource.rc added to my project, but still, resource window is empty. am I wrong when I suppose it should show me the defined variables ? tia, tom --=20 Coupe Quattro '89 Typ81 custom '84 |
|
From: tichy <ti...@po...> - 2005-03-12 10:45:00
|
Big Playah wrote: > Hi, > > just minor questions, but qould be great help for me to solve: > 1) I use hungarian keyboard layout I use Polish with the same system- without any problems. Set the right keyboard and key mappings at settongs for languages and text services > 2) try to lower tabulator size > 3) is there a way to have my #define things in the resource window? I don't understand what you mean by resource window - this one on tab where debbuger, compilation log etc. is? If so, I think it shows only errors at resource files. I had such error msg when I used styles without including <windows.h> in resource file. Andrzej Krynski http:\\tichy.fm.interia.pl --- avast! antywirus: Wychodzace wiadomosc czysta. Baza sygnatur wirusow (VPS): 0510-1, 2005-03-11 Przetestowano na: 2005-03-12 11:44:43 avast! - Copyright (c) 2000-2004 ALWIL Software. http://www.avast.com ---------------------------------------------------------------------- Portal z najlepsza wyszukiwarka! >>> http://link.interia.pl/f1861 |
|
From: The_Eu <th...@ig...> - 2005-03-12 21:51:09
|
Hi! =0D
I have a problem with "sizeof"! =0D
look in this struct... =0D
struct Face { =0D
char numVert; ->1 byte =0D
short unsigned int v1,v2,v3,v4; ->4*2 bytes =3D 8bytes =0D
float nx,ny,nz; ->3*4bytes =3D 12bytes =0D
short unsigned int matIndex; ->2bytes =0D
}; =0D
The total is 23Bytes, but sizeof(Face) indicate 28bytes!!! =0D
My declaration "short unsigned int", makes a "int" of 4 bytes, not 2 byte=
s!=20
=0D
=0D
I'm use Dev C++ 4.9.9.2! =0D
Whati is this! =0D
Help!!! |
|
From: Per W. <pw...@ia...> - 2005-03-12 21:58:37
|
No, sizeof() does not return the wrong value. What you are forgetting is
that most compilers adds padding when creating structures. Real-life
processors don't like unaligned data because it might require filling of
multiple cache-lines to get access to the data.
Most probably, the compiler created:
0: char numVert;
1: char padding1;
2: unsigned short v1,v2,v3,v4;
10: char padding2[2];
12: float nx,ny,nz;
24: unsigned short matIndex
26: char padding3[2];
The last padding is there to make the complete struct be an even multiples
of 4 bytes, since the largest elemnt in the struct is float, and
sizeof(float)=4.
By making the struct size n*4, the declaration:
struct Face myfaces[10];
will have all 10 structs properly aligned for the float access.
/Per W
On Sat, 12 Mar 2005, The_Eu wrote:
> Hi!
> I have a problem with "sizeof"!
> look in this struct...
> struct Face {
> char numVert; ->1 byte
> short unsigned int v1,v2,v3,v4; ->4*2 bytes = 8bytes
> float nx,ny,nz; ->3*4bytes = 12bytes
> short unsigned int matIndex; ->2bytes
> };
> The total is 23Bytes, but sizeof(Face) indicate 28bytes!!!
> My declaration "short unsigned int", makes a "int" of 4 bytes, not 2 bytes!
>
>
> I'm use Dev C++ 4.9.9.2!
> Whati is this!
> Help!!!
|
|
From: Per W. <pw...@ia...> - 2005-03-12 22:01:30
|
Footnote: Try placing numVert last in the struct. Then all items in the
struct will be correctly aligned, and a single pad byte at the end should
suffice to make the struct 24 bytes large.
/Per W
On Sat, 12 Mar 2005, Per Westermark wrote:
> No, sizeof() does not return the wrong value. What you are forgetting is
> that most compilers adds padding when creating structures. Real-life
> processors don't like unaligned data because it might require filling of
> multiple cache-lines to get access to the data.
>
> Most probably, the compiler created:
>
> 0: char numVert;
> 1: char padding1;
> 2: unsigned short v1,v2,v3,v4;
> 10: char padding2[2];
> 12: float nx,ny,nz;
> 24: unsigned short matIndex
> 26: char padding3[2];
>
> The last padding is there to make the complete struct be an even multiples
> of 4 bytes, since the largest elemnt in the struct is float, and
> sizeof(float)=4.
>
> By making the struct size n*4, the declaration:
> struct Face myfaces[10];
> will have all 10 structs properly aligned for the float access.
>
> /Per W
>
> On Sat, 12 Mar 2005, The_Eu wrote:
>
> > Hi!
> > I have a problem with "sizeof"!
> > look in this struct...
> > struct Face {
> > char numVert; ->1 byte
> > short unsigned int v1,v2,v3,v4; ->4*2 bytes = 8bytes
> > float nx,ny,nz; ->3*4bytes = 12bytes
> > short unsigned int matIndex; ->2bytes
> > };
> > The total is 23Bytes, but sizeof(Face) indicate 28bytes!!!
> > My declaration "short unsigned int", makes a "int" of 4 bytes, not 2 bytes!
> >
> >
> > I'm use Dev C++ 4.9.9.2!
> > Whati is this!
> > Help!!!
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|