mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
syntax sugar
This commit is contained in:
parent
a6c50d7de2
commit
20e9931b63
2 changed files with 27 additions and 36 deletions
|
@ -47,8 +47,7 @@ static const poly_t pzero = PZERO;
|
|||
|
||||
/* Definitions */
|
||||
|
||||
void
|
||||
mcpy(model_t *dest, const model_t *src) {
|
||||
void mcpy(model_t *dest, const model_t *src) {
|
||||
/* Copies the parameters of src to dest.
|
||||
* dest must be an initialised model.
|
||||
*/
|
||||
|
@ -63,8 +62,7 @@ mcpy(model_t *dest, const model_t *src) {
|
|||
dest->name = src->name;
|
||||
}
|
||||
|
||||
void
|
||||
mfree(model_t *model) {
|
||||
void mfree(model_t *model) {
|
||||
/* Frees the parameters of model. */
|
||||
if (!model) return;
|
||||
pfree(&model->spoly);
|
||||
|
@ -76,8 +74,7 @@ mfree(model_t *model) {
|
|||
/* not model either, it might point to an array! */
|
||||
}
|
||||
|
||||
int
|
||||
mcmp(const model_t *a, const model_t *b) {
|
||||
int mcmp(const model_t *a, const model_t *b) {
|
||||
/* Compares a and b for identical effect, i.e. disregarding
|
||||
* trailing zeroes in parameter polys.
|
||||
* Intended for bsearch().
|
||||
|
@ -93,8 +90,7 @@ mcmp(const model_t *a, const model_t *b) {
|
|||
return (psncmp(&a->xorout, &b->xorout));
|
||||
}
|
||||
|
||||
char *
|
||||
mtostr(const model_t *model) {
|
||||
char * mtostr(const model_t *model) {
|
||||
/* Returns a malloc()-ed string containing a Williams model
|
||||
* record representing the input model.
|
||||
* mcanon() should be called on the argument before printing.
|
||||
|
@ -154,8 +150,7 @@ mtostr(const model_t *model) {
|
|||
return(string);
|
||||
}
|
||||
|
||||
void
|
||||
mcanon(model_t *model) {
|
||||
void mcanon(model_t *model) {
|
||||
/* canonicalise a model */
|
||||
unsigned long dlen;
|
||||
|
||||
|
@ -181,8 +176,7 @@ mcanon(model_t *model) {
|
|||
mcheck(model);
|
||||
}
|
||||
|
||||
void
|
||||
mcheck(model_t *model) {
|
||||
void mcheck(model_t *model) {
|
||||
/* calculate a check for the model */
|
||||
poly_t checkstr, check, xorout, magic;
|
||||
|
||||
|
@ -215,8 +209,7 @@ mcheck(model_t *model) {
|
|||
model->magic = magic;
|
||||
}
|
||||
|
||||
void
|
||||
mrev(model_t *model) {
|
||||
void mrev(model_t *model) {
|
||||
/* reverse the model to calculate reversed CRCs */
|
||||
/* Here we invert RefIn and RefOut so that the user need only
|
||||
* reverse the order of characters in the arguments, not the
|
||||
|
@ -246,8 +239,7 @@ mrev(model_t *model) {
|
|||
mnovel(model);
|
||||
}
|
||||
|
||||
void
|
||||
mnovel(model_t *model) {
|
||||
void mnovel(model_t *model) {
|
||||
/* remove name and check string from modified model */
|
||||
model->name = NULL;
|
||||
pfree(&model->check);
|
||||
|
|
|
@ -1012,8 +1012,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|||
s->compressed_len += 7; /* align on byte boundary */
|
||||
#endif
|
||||
}
|
||||
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
|
||||
s->compressed_len-7*last));
|
||||
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3, s->compressed_len - 7 * last));
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue