mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 08:25:27 +00:00
Change default error_code ctor to a 'named ctor' so it's more self-documenting.
Unify default construction of error_code uses on this idiom so that users don't feel compelled to make static globals for naming convenience. (unfortunately I couldn't make the original ctor private as some APIs don't return their result, instead using an out parameter (that makes sense to default construct) - which is a bit of a pity. I did, however, find/fix some cases of unnecessary default construction of error_code before I hit the unfixable cases) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -67,7 +67,7 @@ public:
|
||||
if (Filename == "-") {
|
||||
Fd = 0;
|
||||
sys::Program::ChangeStdinToBinary();
|
||||
return error_code();
|
||||
return error_code::success();
|
||||
}
|
||||
|
||||
int OpenFlags = O_RDONLY;
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
Fd = ::open(Filename.c_str(), OpenFlags);
|
||||
if (Fd == -1)
|
||||
return error_code(errno, posix_category());
|
||||
return error_code();
|
||||
return error_code::success();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user