![]() The difference of A and B is added on the active Layer. Shapes belonging to group B are deleted, if it still exists unmodified in the current cell. The exor of A and B is added on the active Layer. Shapes belonging to group A are deleted, if it still exists unmodified in the current cell. Shapes belonging to group A and group B are deleted, if it still exists unmodified in the current cell. ![]() ![]() The source shapes may remain in the design or will be deleted depending on the called boolean operation.ฤก layout-> drawing-> currentCell-> fSelect( rect1) 2 layout-> booleanTool-> setA() 3 layout-> drawing-> currentCell-> fSelect( rect2) 4 layout-> booleanTool-> setB() 5 layout-> drawing-> activeLayer= 1 6 layout-> booleanTool-> aPlusB() After any boolean operation the two sets of shapes will be reset. The result of the boolean operation is added to the currentCell in the drawing to the active layer unless otherwise specified. All operation between two set of shapes can be performed. Via this class it is possible to access the boolean utility. boolOnLayer(int layerA,int layerB,int layerResult,string operation,int nx=0,int ny=0, int borderMerge=0).So in the end to get rid of this issue we just defined our own bool_t so it is standardized within our entire platform. Modules that ran perfectly on one compiler had issues on another and one of the big mischiefs was the boolean operator (and programmers that did not comply 100% to the rules). In our company we use platforms with many compilers from 6 vendors and many divers microcontrollers and we had a lot of problems with this bool issue. If your compiler supports C99 it probably will be OK (always check and doublecheck), and values other than 0 will probably be stored as a true or 1. There are numerous of other ways to do that but it all depends on the compiler in the end, if they are truly boolean logic in the end. This can be done by a typedef enum forcing the bool to be false or true but then make sure you cast each logical decision, and thus forcing the outcome in any of the two possibilities. So if you make a logic decision, you have to make sure there are only two logical possibilities. Yes the whole point is that there are compilers that put bools into for instance an unsigned char which per definition can have any 8 bit value. C's implicit boolean semantics - just if(x) rather than if(x = true) - just works. ![]() It works just fine if you do it right, but will confuse the shit out of somebody who misunderstands it, and certainly is not compatible with pre-C99 code that defined itself a bool type. I don't particularly like that they changed the comparison semantics for bool. Comparison of int with true doesn't just magically work because true is not a _Bool. If you forced it to store a 2 in there with something along the lines of *(int*)&x = 2 it would not compare that properly. +2 0x22 20: 80 e0 ldi r24, 0x00 0 22: 8c 83 std Y+4, r24 0x04 Comparing y = true - true is not itself a _Bool, so this is just equivalent to (y = 1)! So, two gotchas: - Comparison of bool with true is done by changing the way the data is stored, which means never ever ever alias a bool as an int.
0 Comments
Leave a Reply. |