Commit cb5fb036 authored by rswindell's avatar rswindell

Fixed use of GNU 'packed' attribute (docs on gnu.org are wrong).

parent bb5be11f
......@@ -53,7 +53,7 @@
#pragma pack(1)
#endif
typedef struct {
typedef struct _PACK {
WORD length; /* This field included when using TCP only */
WORD id;
WORD bitfields;
......@@ -61,19 +61,19 @@ typedef struct {
WORD ancount;
WORD nscount;
WORD arcount;
} dns_msghdr_t _PACK;
} dns_msghdr_t;
typedef struct {
typedef struct _PACK {
WORD type;
WORD class;
} dns_query_t _PACK;
} dns_query_t;
typedef struct {
typedef struct _PACK {
WORD type;
WORD class;
DWORD ttl;
WORD length;
} dns_rr_t _PACK;
} dns_rr_t;
#ifdef _WIN32
#pragma pack(pop) /* original packing */
......
......@@ -110,7 +110,7 @@ enum { /* Node Action */
#define SIZEOF_NODE_T 15 /* Must == sizeof(node_t) */
typedef struct { /* Node information kept in node.dab */
typedef struct _PACK { /* Node information kept in node.dab */
uchar status, /* Current Status of Node */
errors, /* Number of Critical Errors */
action; /* Action User is doing on Node */
......@@ -119,7 +119,7 @@ typedef struct { /* Node information kept in node.dab */
misc, /* Miscellaneous bits for node */
aux; /* Auxillary word for node */
ulong extaux; /* Extended aux dword for node */
} node_t _PACK;
} node_t;
#ifdef _WIN32
#pragma pack(pop) /* original packing */
......
......@@ -377,19 +377,19 @@ enum {
#define _PACK
#endif
#ifdef _WIN32 /* necessary for compatibility with SBBS v2 */
#pragma pack(push)
#ifdef _WIN32
#pragma pack(push) /* Disk image structures must be packed */
#pragma pack(1)
#endif
typedef struct { // Time with time-zone
typedef struct _PACK { // Time with time-zone
ulong time; // Local time (unix format)
short zone; // Time zone
} when_t _PACK;
} when_t;
typedef struct { // Index record
typedef struct _PACK { // Index record
ushort to; // 16-bit CRC of recipient name (lower case)
ushort from; // 16-bit CRC of sender name (lower case)
......@@ -399,17 +399,17 @@ typedef struct { // Index record
ulong number; // number of message (1 based)
ulong time; // time/date message was imported/posted
} idxrec_t _PACK;
} idxrec_t;
typedef struct { // Message base header (fixed portion)
typedef struct _PACK { // Message base header (fixed portion)
uchar id[4]; // text or binary unique hdr ID
ushort version; // version number (initially 100h for 1.00)
ushort length; // length including this struct
} smbhdr_t _PACK;
} smbhdr_t;
typedef struct { // Message base status header
typedef struct _PACK { // Message base status header
ulong last_msg; // last message number
ulong total_msgs; // total messages
......@@ -419,9 +419,9 @@ typedef struct { // Message base status header
ushort max_age; // Maximum age of message to keep in sub (in days)
ushort attr; // Attributes for this message base (SMB_HYPER,etc)
} smbstatus_t _PACK;
} smbstatus_t;
typedef struct { // Message header
typedef struct _PACK { // Message header
uchar id[4]; // SHD<^Z>
ushort type; // Message type (normally 0)
......@@ -441,38 +441,42 @@ typedef struct { // Message header
ulong offset; // Offset for buffer into data file (0 or mod 256)
ushort total_dfields; // Total number of data fields
} msghdr_t _PACK;
} msghdr_t;
typedef struct { // Data field
typedef struct _PACK { // Data field
ushort type; // Type of data field
ulong offset; // Offset into buffer
ulong length; // Length of data field
} dfield_t _PACK;
} dfield_t;
typedef struct { // Header field
typedef struct _PACK { // Header field
ushort type;
ushort length; // Length of buffer
} hfield_t _PACK;
} hfield_t;
typedef struct { // FidoNet address (zone:net/node.point)
typedef struct _PACK { // FidoNet address (zone:net/node.point)
ushort zone;
ushort net;
ushort node;
ushort point;
} fidoaddr_t _PACK;
} fidoaddr_t;
typedef struct { // Network (type and address)
typedef struct _PACK { // Network (type and address)
ushort type;
void *addr;
} net_t _PACK;
} net_t;
#ifdef _WIN32
#pragma pack(pop) /* original packing */
#endif
typedef struct { // Message
......@@ -499,7 +503,7 @@ typedef struct { // Message
uchar forwarded; // Forwarded from agent to another
when_t expiration; // Message will exipre on this day (if >0)
} smbmsg_t _PACK;
} smbmsg_t;
typedef struct { // Message base
......@@ -514,10 +518,6 @@ typedef struct { // Message base
char shd_buf[SHD_BLOCK_LEN]; // File I/O buffer for header file
char last_error[128]; // Last error message
} smb_t _PACK;
#ifdef _WIN32
#pragma pack(pop) /* original packing */
#endif
} smb_t;
#endif /* Don't add anything after this #endif statement */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment