antirez / antirez/sds

why not use macro to get the address of sdshdr?

Aperta
#40 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
5.6k
Fork
510
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I find that almost in every function, you write "struct sdshdr _sh = (void_)(s - sizeof *sh);" to get the address of sdshdr, I wonder why don't you make it macro?
Like this :
#define SDS_ADDR(s) (void *)((s) - sizeof(struct sdshdr))
struct sdshdr *sh = SDS_ADDR(s);

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.