linksplatform / Data.Triplets.Kernel

LinksPlatform's Platform.Data.Triplets.Kernel native library.
https://nuget.org/packages/Platform.Data.Triplets.Kernel
The Unlicense
1 stars 4 forks source link

Change error status code #12

Open poul250 opened 3 years ago

poul250 commented 3 years ago

Here is: https://github.com/Tynkute/Data.Triplets.Kernel/blob/17346c056451118a2b2df1a96458b6fc6c941795/Platform.Data.Triplets.Kernel/Common.h#L56-L59

#define SUCCESS_RESULT 1
#define succeeded(x) (SUCCESS_RESULT == (x))
#define ERROR_RESULT 0
#define failed(x) SUCCESS_RESULT != (x)

ERROR_RESULT equals to zero, but usually zero means no errors. We need to swap the numbers and make sure nothing breaks

poul250 commented 3 years ago

We also need to think about whether this is really a problem, in some cases it looks better. like:

if (!open("<filename>")) {
// ...
}