Standardize exit codes for samples.
Fixes #909 #910 PiperOrigin-RevId: 782951003 Change-Id: I093c0032f665bf34fecf71a75012b2b0c4c22aba
This commit is contained in:
committed by
Copybara-Service
parent
9a41d385c1
commit
5187a712be
+3
-2
@@ -13,6 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
@@ -104,7 +105,7 @@ int main(int argc, const char** argv) {
|
|||||||
// check command-line arguments
|
// check command-line arguments
|
||||||
if (argc!=2) {
|
if (argc!=2) {
|
||||||
std::printf(" USAGE: basic modelfile\n");
|
std::printf(" USAGE: basic modelfile\n");
|
||||||
return 0;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// load and compile model
|
// load and compile model
|
||||||
@@ -186,5 +187,5 @@ int main(int argc, const char** argv) {
|
|||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 1;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -16,6 +16,7 @@
|
|||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ int finish(const char* msg = 0, mjModel* m = 0) {
|
|||||||
std::cout << msg << std::endl;
|
std::cout << msg << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -219,7 +219,7 @@ int main(int argc, const char** argv) {
|
|||||||
// check command-line arguments
|
// check command-line arguments
|
||||||
if (argc < 5 || argc > 6) {
|
if (argc < 5 || argc > 6) {
|
||||||
std::printf(" USAGE: record modelfile duration fps rgbfile [adddepth]\n");
|
std::printf(" USAGE: record modelfile duration fps rgbfile [adddepth]\n");
|
||||||
return 0;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse numeric arguments
|
// parse numeric arguments
|
||||||
@@ -321,5 +321,5 @@ int main(int argc, const char** argv) {
|
|||||||
closeMuJoCo();
|
closeMuJoCo();
|
||||||
closeOpenGL();
|
closeOpenGL();
|
||||||
|
|
||||||
return 1;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ratio>
|
#include <ratio>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -56,7 +57,7 @@ int finish(const char* msg = NULL, mjModel* m = NULL) {
|
|||||||
std::printf("%s\n", msg);
|
std::printf("%s\n", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<mjtNum> CtrlNoise(const mjModel* m, int nsteps, mjtNum ctrlnoise) {
|
std::vector<mjtNum> CtrlNoise(const mjModel* m, int nsteps, mjtNum ctrlnoise) {
|
||||||
|
|||||||
Reference in New Issue
Block a user