| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8c69da8 commit 9f2dd48
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -215,7 +215,8 @@ static const char* name_by_gid(gid_t gid) { | |||
| 215 | 215 | ||
| 216 | 216 | static uid_t uid_by_name(Isolate* isolate, Local<Value> value) { | |
| 217 | 217 | if (value->IsUint32()) { | |
| 218 | - return static_cast<uid_t>(value.As<Uint32>()->Value()); | ||
| 218 | + static_assert(std::is_same<uid_t, uint32_t>::value); | ||
| 219 | + return value.As<Uint32>()->Value(); | ||
| 219 | 220 | } else { | |
| 220 | 221 | Utf8Value name(isolate, value); | |
| 221 | 222 | return uid_by_name(*name); | |
@@ -224,7 +225,8 @@ static uid_t uid_by_name(Isolate* isolate, Local<Value> value) { | |||
| 224 | 225 | ||
| 225 | 226 | static gid_t gid_by_name(Isolate* isolate, Local<Value> value) { | |
| 226 | 227 | if (value->IsUint32()) { | |
| 227 | - return static_cast<gid_t>(value.As<Uint32>()->Value()); | ||
| 228 | + static_assert(std::is_same<gid_t, uint32_t>::value); | ||
| 229 | + return value.As<Uint32>()->Value(); | ||
| 228 | 230 | } else { | |
| 229 | 231 | Utf8Value name(isolate, value); | |
| 230 | 232 | return gid_by_name(*name); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments