Mercurial > public > ostc_companion
diff crcmodel.h @ 11:6fba58c4964b
Minor changes done by automatic style checker
| author | Ideenmodellierer |
|---|---|
| date | Mon, 12 Jan 2026 13:57:24 +0000 |
| parents | 115cfa4a3239 |
| children |
line wrap: on
line diff
--- a/crcmodel.h Mon Jan 12 13:55:38 2026 +0000 +++ b/crcmodel.h Mon Jan 12 13:57:24 2026 +0000 @@ -101,12 +101,9 @@ /* */ /******************************************************************************/ - - #ifndef CRC_MODEL_H #define CRC_MODEL_H - #ifdef __cplusplus extern "C" { #endif @@ -120,12 +117,12 @@ #include <stdbool.h> -typedef unsigned long ulong; -typedef unsigned char * p_ubyte_; +typedef unsigned long ulong; +typedef unsigned char *p_ubyte_; #ifndef TRUE #define FALSE 0 -#define TRUE 1 +#define TRUE 1 #endif /* Change to the second definition if you don't have prototypes. */ @@ -145,16 +142,16 @@ /* model algorithm. Most of the fields are model parameters which must be */ /* set before the first initializing call to cm_ini. */ typedef struct - { - int cm_width; /* Parameter: Width in bits [8,32]. */ - ulong cm_poly; /* Parameter: The algorithm's polynomial. */ - ulong cm_init; /* Parameter: Initial register value. */ - bool cm_refin; /* Parameter: Reflect input bytes? */ - bool cm_refot; /* Parameter: Reflect output CRC? */ - ulong cm_xorot; /* Parameter: XOR this to output CRC. */ +{ + int cm_width; /* Parameter: Width in bits [8,32]. */ + ulong cm_poly; /* Parameter: The algorithm's polynomial. */ + ulong cm_init; /* Parameter: Initial register value. */ + bool cm_refin; /* Parameter: Reflect input bytes? */ + bool cm_refot; /* Parameter: Reflect output CRC? */ + ulong cm_xorot; /* Parameter: XOR this to output CRC. */ - ulong cm_reg; /* Context: Context during execution. */ - } cm_t; + ulong cm_reg; /* Context: Context during execution. */ +} cm_t; typedef cm_t *p_cm_t; /******************************************************************************/ @@ -167,10 +164,10 @@ /* Initializes the argument CRC model instance. */ /* All parameter fields must be set before calling this. */ -void cm_nxt P_((p_cm_t p_cm,int ch)); +void cm_nxt P_((p_cm_t p_cm, int ch)); /* Processes a single message byte [0,255]. */ -void cm_blk P_((p_cm_t p_cm,p_ubyte_ blk_adr,ulong blk_len)); +void cm_blk P_((p_cm_t p_cm, p_ubyte_ blk_adr, ulong blk_len)); /* Processes a block of message bytes. */ ulong cm_crc P_((p_cm_t p_cm)); @@ -183,7 +180,7 @@ /* The following function can be used to calculate a CRC lookup table. */ /* It can also be used at run-time to create or check static tables. */ -ulong cm_tab P_((p_cm_t p_cm,int index)); +ulong cm_tab P_((p_cm_t p_cm, int index)); /* Returns the i'th entry for the lookup table for the specified algorithm. */ /* The function examines the fields cm_width, cm_poly, cm_refin, and the */ /* argument table index in the range [0,255] and returns the table entry in */
