... "M teacher, our dynamic perceived function has problems, press the mouse, the system is Down." Seeing M always came to me, I quickly reported the bug founded. "... When the mouse moves, it is judged whether or not any key of the mouse is pressed. If we don't press and we will enable dynamic perception." M always thought about it. This is not simple, I want. So the brush is written as follows:
// ... IF ((...) && (NFLAGS & (MK_LB_RB_RB_RB_MBUTTON | MK_RB_RBUTTON) == 0)) {// ... Enable dynamic perception}
"Is this right?" I haven't waited for me to write, and M will always send it. Looking back, oh, oh, the priority is wrong, less parentheses. So, I didn't hesitate to add a parentheses:
// ... if ((...) && (NFLAGS & (MK_LB_RB_RB_RB_RB_RB_RB / RBUTTON) == 0)) {// ... Enable dynamic perception}
I thought: I really don't want it.
"Are you easy to read like this? Why don't you declare a variable 'Guide'?" M always spoke.
Take a very familiar vocabulary, I have heard M always say N-multilateral. The so-called guide, refers to the return value of a function, first declares that the variable is acquired, then the variable is operated; or if the condition is determined, if the conditions are very complicated, the variable is declared to obtain an expression. Conditional value.
So, rework again:
Uint nbtstate = nflags & (mk_lbutton | mk_mbutton | mk_rbutton); if ((...) && (nbtstate == 0)) {// ... Enable dynamic perception}
"This is easy to read, and it will reduce the error rate. It is also convenient to debug." Mm-speaking focused, "The following sentence is also guided, can you guarantee that it is not null?" Suddenly, he pointed to the following sentence.
// ... m_popmgr-> getCurrentoperator () -> Capture (); // ...
So changed, guide it, huh, huh. "This will not affect the efficiency of the execution, but will increase the security of the code, especially the case of the pointer, must pay attention to ..." I changed, M always said.
In fact, this guide has heard many times, but it is not too popular. However, after this time, I have to remember it.
Guide the sky, the guide is not possible, huh, huh.