Closed Gamerfiend closed 5 years ago
Just throw another line of code to test something and this:
printf("Position literal == Position: %s\n", if(strcmp("Position", keys[0]) == 0) then "true" else "false");
Produces true, so I'm not sure where the mix up is happening.
I'm not seeing this, can you confirm that you're on the latest master?
ben ~/Dev/test$ kitc --run test.kit
[2018-12-18 16:00:06.045720] ===> parsing and building module graph
[2018-12-18 16:00:06.077737] ===> processing C includes
[2018-12-18 16:00:06.205697] ===> expanding macros
[2018-12-18 16:00:06.206061] ===> resolving module types
[2018-12-18 16:00:06.261386] ===> typing module content
[2018-12-18 16:00:06.864864] ===> generating intermediate representation
[2018-12-18 16:00:06.908372] ===> generating code
[2018-12-18 16:00:06.925372] ===> compiling
[2018-12-18 16:00:06.994895] ===> linking
[2018-12-18 16:00:07.012427] ===> finished; total time: 0.967077475s
[2018-12-18 16:00:07.012913] ===> running
myMap has PositionComponent: true
myMap has PositionComponent: true
myMap has PositionComponent: true
Describe the problem. What did you see? What did you expect to see?
When comparing a CString literal to a stored CString variable using the == operator, comparison is false even when value of CString is the same.
If this is a code issue, provide a minimal code example:
Which outputs:
However all three should be true.