Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Jan 14, 2024
1 parent 0b1792e commit 6cbf02d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rxode2et (development version)

* Fix formatting issues identified by m1mac, as requested by CRAN

# rxode2et 2.0.11

* Make the stacking more flexible to help rxode2 have more types of plots
Expand Down
7 changes: 1 addition & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
## Updates

- This is an update to support the new release of rxode2parse

- This update supports StanHeaders upcoming release

- This update also uses C++17

- Fixes formatting that is flagged as unsafe by m1mac, as requested by CRAN
20 changes: 10 additions & 10 deletions src/et.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ RObject etUpdate(RObject obj,
(strncmp((as<std::string>(nm[i])).c_str(), sarg.c_str(), slen) == 0 ) &&
(dexact != 1 || (dexact == 1 && slen == slen2))){
if (dexact == -1){
Rf_warningcall(R_NilValue, _("partial match of '%s' to '%s'"),sarg.c_str(), (as<std::string>(nm[i])).c_str());
Rf_warningcall(R_NilValue, "partial match of '%s' to '%s'", sarg.c_str(), (as<std::string>(nm[i])).c_str());

Check warning on line 226 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L226

Added line #L226 was not covered by tests
}
return lst[i];
}
Expand Down Expand Up @@ -526,7 +526,7 @@ List etSimulate(List curEt){
}
}
if (!recalcTime){
Rf_warningcall(R_NilValue, _("event table was not updated (no dose/sampling windows)"));
Rf_warningcall(R_NilValue, "%s", _("event table was not updated (no dose/sampling windows)"));
return curEt;
} else {
lst.attr("class") = cls;
Expand Down Expand Up @@ -1037,7 +1037,7 @@ List etImportEventTable(List inData, bool warnings = true){
evidCol = mdvCol;
oldEvid=asIv(inData[evidCol], "inData[evidCol]");
if (methodCol != -1 && warnings){
Rf_warningcall(R_NilValue, _("using 'mdv' instead of 'method'"));
Rf_warningcall(R_NilValue, "%s", _("using 'mdv' instead of 'method'"));

Check warning on line 1040 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L1040

Added line #L1040 was not covered by tests
}
} else if (methodCol != -1){
oldEvid = convertMethod(inData[methodCol]);
Expand All @@ -1047,7 +1047,7 @@ List etImportEventTable(List inData, bool warnings = true){
}
} else {
if (mdvCol != -1 && warnings){
Rf_warningcall(R_NilValue, _("using 'evid' instead of 'mdv'"));
Rf_warningcall(R_NilValue, "%s", _("using 'evid' instead of 'mdv'"));

Check warning on line 1050 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L1050

Added line #L1050 was not covered by tests
}
oldEvid=asIv(inData[evidCol], "inData[evidCol]");
}
Expand Down Expand Up @@ -2633,11 +2633,11 @@ RObject et_(List input, List et__){
return as<RObject>(ret);
}
} else {
Rf_warningcall(R_NilValue, _("nothing done"));
Rf_warningcall(R_NilValue, "%s", _("nothing done"));

Check warning on line 2636 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L2636

Added line #L2636 was not covered by tests
return asList(curEt, "curEt");
}
} else {
Rf_warningcall(R_NilValue, _("nothing done"));
Rf_warningcall(R_NilValue, "%s", _("nothing done"));

Check warning on line 2640 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L2640

Added line #L2640 was not covered by tests
return asList(curEt, "curEt");
}
} else {
Expand Down Expand Up @@ -2768,7 +2768,7 @@ RObject et_(List input, List et__){
} else if (evid[0] == 2 || evid[0] == 3) {
if (amtIx == -1){
if (amt[0] != 0 && NumericVector::is_na(amt[0])){
Rf_warningcall(R_NilValue, _("'%s' is ignored when '%s'=2 or '%s'=3"), amtChar,
Rf_warningcall(R_NilValue, "'%s' is ignored when '%s'=2 or '%s'=3", amtChar,

Check warning on line 2771 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L2771

Added line #L2771 was not covered by tests
evidChar, evidChar);
}
}
Expand Down Expand Up @@ -3068,7 +3068,7 @@ RObject et_(List input, List et__){
if (doUpdateObj && ii[0] == 24){
ii[0]=0;
} else {
Rf_warningcall(R_NilValue, _("'%s' requires non zero additional doses ('%s') or steady state dosing ('%s': %f, '%s': %d; '%s': %d), reset '%s' to zero."), iiChar, addlChar, iiChar, ii[0], ssChar, ss[0], addlChar, addl[0],
Rf_warningcall(R_NilValue, "'%s' requires non zero additional doses ('%s') or steady state dosing ('%s': %f, '%s': %d; '%s': %d), reset '%s' to zero", iiChar, addlChar, iiChar, ii[0], ssChar, ss[0], addlChar, addl[0],
iiChar);
ii[0]=0;
}
Expand Down Expand Up @@ -3342,7 +3342,7 @@ List etSeq_(List ets, int handleSamples=0, int waitType = 0,
firstDoseOfEt = false;
} else if (curEvid[j] != 0 && curEvid[j] != 2 && curEvid[j] != 3) {
if (!rbind && i != 0 && trueLastIi == 0 && firstDoseOfEt && curTime[j] < defaultIi){
Rf_warningcall(R_NilValue, _("assumed a dose interval of %.1f between event tables; use 'ii' to adjust"), defaultIi);
Rf_warningcall(R_NilValue, "assumed a dose interval of %.1f between event tables; use 'ii' to adjust", defaultIi);

Check warning on line 3345 in src/et.cpp

View check run for this annotation

Codecov / codecov/patch

src/et.cpp#L3345

Added line #L3345 was not covered by tests
maxTime += defaultIi;
timeDelta += defaultIi;
}
Expand Down Expand Up @@ -3371,7 +3371,7 @@ List etSeq_(List ets, int handleSamples=0, int waitType = 0,
if (tmp > maxTime) maxTime = tmp;
} else if (curEvid[j] != 0 && curEvid[j] != 2 && curEvid[j] != 3){
if (!rbind && i != 0 && trueLastIi == 0 && firstDoseOfEt && curTime[j] < defaultIi){
Rf_warningcall(R_NilValue, ("assumed a dose interval of %.1f between event tables; use 'ii' to adjust"), defaultIi);
Rf_warningcall(R_NilValue, "assumed a dose interval of %.1f between event tables; use 'ii' to adjust", defaultIi);
maxTime += defaultIi;
timeDelta += defaultIi;
}
Expand Down

0 comments on commit 6cbf02d

Please sign in to comment.