Skip to content

Conversation

@dgeelen
Copy link
Contributor

@dgeelen dgeelen commented Apr 21, 2018

No description provided.

uint16_t addr;
char name[64];
} trace;
if(4 != sscanf(argv[pi], "%63[^=]=%63[^@]@0x%hx/0x%hhx", &trace.name[0], &trace.kind[0], &trace.addr, &trace.mask)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use if( -- also -- please don't use Yoda notation for conditions.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and wrap super-long lines!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please clarify? By "Yoda notation" you probably mean to have if(sscanf(...) != 4), but I don't understand the first part, "please use if( -- also --"?

Copy link
Owner

@buserror buserror May 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry github ate my less-than greather-than tag... I mean please use if+space+parenthesis -- in general also use spaces in expressions like if (pe + 1 >= argc) { ... and yes Yoda notation is reversed if conditions... that was super handy trick in 1985 ;-)

@buserror buserror merged commit 9669491 into buserror:master May 24, 2018
@buserror
Copy link
Owner

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants