From 12308b7248ca2b1677c16ea8bb1686842647861d Mon Sep 17 00:00:00 2001 From: Nick Christofides <118103879+NicChr@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:58:36 +0100 Subject: [PATCH] Fix compiler warnings. --- src/scalars.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scalars.cpp b/src/scalars.cpp index db5ffd4..3ececbf 100644 --- a/src/scalars.cpp +++ b/src/scalars.cpp @@ -149,10 +149,9 @@ SEXP cpp_val_replace(SEXP x, SEXP value, SEXP replace, bool recursive){ bool any_eq = false; bool eq = false; - SEXP out; + SEXP out = Rf_protect(R_NilValue); ++NP; switch ( TYPEOF(x) ){ case NILSXP: { - out = Rf_protect(R_NilValue); ++NP; break; } case LGLSXP: