Convert mju_error and mju_warning to variadic functions, supporting printf-like arguments. The functions mju_error_i, mju_error_s, mju_warning_i, and mju_warning_s are now deprecated.
PiperOrigin-RevId: 515431052 Change-Id: I440de0cb417ce216b6d636a5d86dc9ef6cc1fc06
This commit is contained in:
committed by
Copybara-Service
parent
2e6a37e8c5
commit
d3d789cf7d
@@ -206,7 +206,7 @@ void mjCComposite::SetDefault(void) {
|
||||
break;
|
||||
default:
|
||||
// SHOULD NOT OCCUR
|
||||
mju_error_i("Invalid composite type: %d", type);
|
||||
mju_error("Invalid composite type: %d", type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -543,7 +543,7 @@ bool mjCComposite::MakeCable(mjCModel* model, mjCBody* body, char* error, int er
|
||||
break;
|
||||
default:
|
||||
// SHOULD NOT OCCUR
|
||||
mju_error_i("Invalid composite shape: %d", curve[k]);
|
||||
mju_error("Invalid composite shape: %d", curve[k]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2697,7 +2697,7 @@ void mjCModel::TryCompile(mjModel*& m, mjData*& d, const mjVFS* vfs) {
|
||||
for (int i = 0; i < nplugin; ++i) {
|
||||
const mjpPlugin* plugin = mjp_getPluginAtSlot(m->plugin[i]);
|
||||
if (!plugin->nstate) {
|
||||
mju_error_i("`nstate` is null for plugin at slot %d", m->plugin[i]);
|
||||
mju_error("`nstate` is null for plugin at slot %d", m->plugin[i]);
|
||||
}
|
||||
int nstate = plugin->nstate(m, i);
|
||||
m->plugin_stateadr[i] = stateadr;
|
||||
@@ -2706,7 +2706,7 @@ void mjCModel::TryCompile(mjModel*& m, mjData*& d, const mjVFS* vfs) {
|
||||
if (plugin->capabilityflags & mjPLUGIN_SENSOR) {
|
||||
for (int sensor_id : plugin_to_sensors[i]) {
|
||||
if (!plugin->nsensordata) {
|
||||
mju_error_i("`nsensordata` is null for plugin at slot %d", m->plugin[i]);
|
||||
mju_error("`nsensordata` is null for plugin at slot %d", m->plugin[i]);
|
||||
}
|
||||
int nsensordata = plugin->nsensordata(m, i, sensor_id);
|
||||
sensors[sensor_id]->dim = nsensordata;
|
||||
|
||||
Reference in New Issue
Block a user