about summary refs log tree commit diff
path: root/third_party/nix/src/libmain
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libmain')
-rw-r--r--third_party/nix/src/libmain/shared.cc2
-rw-r--r--third_party/nix/src/libmain/stack.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/third_party/nix/src/libmain/shared.cc b/third_party/nix/src/libmain/shared.cc
index b04bd279b95a..348b91ab55e9 100644
--- a/third_party/nix/src/libmain/shared.cc
+++ b/third_party/nix/src/libmain/shared.cc
@@ -327,7 +327,7 @@ RunPager::RunPager() {
   if (pager == nullptr) {
     pager = getenv("PAGER");
   }
-  if (pager && ((std::string)pager == "" || (std::string)pager == "cat")) {
+  if (pager && (std::string(pager) == "" || std::string(pager) == "cat")) {
     return;
   }
 
diff --git a/third_party/nix/src/libmain/stack.cc b/third_party/nix/src/libmain/stack.cc
index c7744f69c82c..628b6313a89c 100644
--- a/third_party/nix/src/libmain/stack.cc
+++ b/third_party/nix/src/libmain/stack.cc
@@ -16,7 +16,7 @@ static void sigsegvHandler(int signo, siginfo_t* info, void* ctx) {
   bool haveSP = true;
   char* sp = nullptr;
 #if defined(__x86_64__) && defined(REG_RSP)
-  sp = (char*)((ucontext_t*)ctx)->uc_mcontext.gregs[REG_RSP];
+  sp = (char*)(static_cast<ucontext_t*>(ctx))->uc_mcontext.gregs[REG_RSP];
 #elif defined(REG_ESP)
   sp = (char*)((ucontext_t*)ctx)->uc_mcontext.gregs[REG_ESP];
 #else
@@ -24,7 +24,7 @@ static void sigsegvHandler(int signo, siginfo_t* info, void* ctx) {
 #endif
 
   if (haveSP) {
-    ptrdiff_t diff = (char*)info->si_addr - sp;
+    ptrdiff_t diff = static_cast<char*>(info->si_addr) - sp;
     if (diff < 0) {
       diff = -diff;
     }