GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: remove uid_t/gid_t casts · nodejs/node@9f2dd48

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_credentials.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_credentials.cc‎

Copy file name to clipboardExpand all lines: src/node_credentials.cc
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ static const char* name_by_gid(gid_t gid) {
215215

216216
static uid_t uid_by_name(Isolate* isolate, Local<Value> value) {
217217
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();
219220
} else {
220221
Utf8Value name(isolate, value);
221222
return uid_by_name(*name);
@@ -224,7 +225,8 @@ static uid_t uid_by_name(Isolate* isolate, Local<Value> value) {
224225

225226
static gid_t gid_by_name(Isolate* isolate, Local<Value> value) {
226227
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();
228230
} else {
229231
Utf8Value name(isolate, value);
230232
return gid_by_name(*name);

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.