solosky / pixl.js

An emulator for Amiibo!
GNU General Public License v2.0
575 stars 110 forks source link

Update amiibolink_view.h: a clean solution for forward declaration ... #183

Closed fishybow closed 8 months ago

fishybow commented 8 months ago

Update amiibolink_view.h: a clean solution for forward declaration and circular reference.

netlify[bot] commented 8 months ago

Deploy Preview for aquamarine-heliotrope-f610d4 failed.

Name Link
Latest commit d8bd406625f22a9d6b7946c4dc3d3bac764d94ac
Latest deploy log https://app.netlify.com/sites/aquamarine-heliotrope-f610d4/deploys/658dd232a386e50008b5387e
solosky commented 8 months ago

Hi, would you please explain more why do your solution is better ?

struct XXX_s;

//more defination with struct XXX_s;

typedef struct XXX_s{
....
} XXX_t;

comparing to

struct XXX_s;
typedef struct XXX_s XXX_t;

//more defination with XXX_t

struct XXX_s{
...
}
fishybow commented 8 months ago

My solution is a more common practice for forward declaration. Also, I was running into strange compilation errors with the original approach when I was playing with the code locally.