Click here to Skip to main content
15,886,788 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMemory leakages Pin
Anonymous30-Aug-02 0:56
Anonymous30-Aug-02 0:56 
GeneralRe: Memory leakages Pin
Tomasz Sowinski30-Aug-02 1:09
Tomasz Sowinski30-Aug-02 1:09 
GeneralRe: Memory leakages Pin
pépé30-Aug-02 4:11
pépé30-Aug-02 4:11 
GeneralRe: Memory leakages Pin
Anders Molin30-Aug-02 12:40
professionalAnders Molin30-Aug-02 12:40 
GeneralTCP header checksum calculation Pin
AIDS30-Aug-02 0:56
AIDS30-Aug-02 0:56 
GeneralRe: TCP header checksum calculation Pin
Koep30-Aug-02 1:02
Koep30-Aug-02 1:02 
GeneralRe: TCP header checksum calculation Pin
AIDS30-Aug-02 1:40
AIDS30-Aug-02 1:40 
GeneralRe: TCP header checksum calculation Pin
Stephen C. Steel30-Aug-02 12:30
Stephen C. Steel30-Aug-02 12:30 

It may not be the problem, but you should be suspicous of any cross platform code using bitfields to pick out bits like this. The C standard does not define whether bitfields are allocated starting from the most or least significant bits of the variable. Different compilers may interpret this code differently!

<br />
UCHAR HeaderLength :4; // Header length in 32-bit words<br />


Some compilers will use the high nibble, others the lower nibble. Its much safer to use masks and shifts:

Either

HeaderLength = (uchar_var & 0xF0) >> 4

or

HeaderLength = (uchar_var & 0x0F)

as appropriate.


Stephen C. Steel
Kerr Vayne Systems Ltd.


GeneralProblems with CArray Updated Pin
Koep30-Aug-02 0:50
Koep30-Aug-02 0:50 
GeneralRe: Problems with CArray Updated Pin
Tomasz Sowinski30-Aug-02 0:56
Tomasz Sowinski30-Aug-02 0:56 
GeneralRe: Problems with CArray Updated Pin
Koep30-Aug-02 1:00
Koep30-Aug-02 1:00 
GeneralRe: Problems with CArray Updated Pin
Tomasz Sowinski30-Aug-02 1:12
Tomasz Sowinski30-Aug-02 1:12 
GeneralRe: Problems with CArray Updated Pin
jhwurmbach30-Aug-02 3:20
jhwurmbach30-Aug-02 3:20 
GeneralRe: Problems with CArray Updated Pin
Tomasz Sowinski30-Aug-02 3:21
Tomasz Sowinski30-Aug-02 3:21 
GeneralRe: Problems with CArray Updated Pin
jhwurmbach30-Aug-02 3:48
jhwurmbach30-Aug-02 3:48 
GeneralProblems with CArray Pin
Koep30-Aug-02 0:48
Koep30-Aug-02 0:48 
GeneralRe: Problems with CArray Pin
mishgun30-Aug-02 1:35
mishgun30-Aug-02 1:35 
GeneralRe: Problems with CArray Pin
Koep30-Aug-02 1:43
Koep30-Aug-02 1:43 
GeneralCPrintDialog problem Pin
Wouter Dhondt29-Aug-02 23:58
Wouter Dhondt29-Aug-02 23:58 
GeneralRecompiler Engine Pin
Joel Holdsworth29-Aug-02 23:55
Joel Holdsworth29-Aug-02 23:55 
GeneralRe: Recompiler Engine Pin
Tomasz Sowinski30-Aug-02 0:03
Tomasz Sowinski30-Aug-02 0:03 
GeneralRe: Recompiler Engine Pin
Joel Holdsworth30-Aug-02 0:26
Joel Holdsworth30-Aug-02 0:26 
GeneralRe: Recompiler Engine Pin
Tomasz Sowinski30-Aug-02 0:37
Tomasz Sowinski30-Aug-02 0:37 
Generalload file in buffer Pin
Brakanjan29-Aug-02 22:44
Brakanjan29-Aug-02 22:44 
GeneralRe: load file in buffer Pin
jmkhael29-Aug-02 23:31
jmkhael29-Aug-02 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.