Cosmetic improvements to public headers.

PiperOrigin-RevId: 521415262
Change-Id: Iee5d6baec78242f5a033c8b5cdd285af4a0895fa
This commit is contained in:
Yuval Tassa
2023-04-03 03:48:41 -07:00
committed by Copybara-Service
parent 5f132af625
commit 64229c089a
7 changed files with 64 additions and 69 deletions
+2 -4
View File
@@ -1853,10 +1853,8 @@ int mj_makeEmptyFileVFS(mjVFS* vfs, const char* filename, int filesize);
int mj_findFileVFS(const mjVFS* vfs, const char* filename); int mj_findFileVFS(const mjVFS* vfs, const char* filename);
int mj_deleteFileVFS(mjVFS* vfs, const char* filename); int mj_deleteFileVFS(mjVFS* vfs, const char* filename);
void mj_deleteVFS(mjVFS* vfs); void mj_deleteVFS(mjVFS* vfs);
mjModel* mj_loadXML(const char* filename, const mjVFS* vfs, mjModel* mj_loadXML(const char* filename, const mjVFS* vfs, char* error, int error_sz);
char* error, int error_sz); int mj_saveLastXML(const char* filename, const mjModel* m, char* error, int error_sz);
int mj_saveLastXML(const char* filename, const mjModel* m,
char* error, int error_sz);
void mj_freeLastXML(void); void mj_freeLastXML(void);
int mj_printSchema(const char* filename, char* buffer, int buffer_sz, int mj_printSchema(const char* filename, char* buffer, int buffer_sz,
int flg_html, int flg_pad); int flg_html, int flg_pad);
+16 -16
View File
@@ -66,27 +66,27 @@ typedef struct mjpPlugin_ mjpPlugin;
#if defined(__has_attribute) #if defined(__has_attribute)
#if __has_attribute(constructor) #if __has_attribute(constructor)
#define mjPLUGIN_DYNAMIC_LIBRARY_INIT \ #define mjPLUGIN_DYNAMIC_LIBRARY_INIT \
__attribute__((constructor)) static void _mjplugin_init(void) __attribute__((constructor)) static void _mjplugin_init(void)
#endif #endif // __has_attribute(constructor)
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#ifndef mjDLLMAIN #ifndef mjDLLMAIN
#define mjDLLMAIN DllMain #define mjDLLMAIN DllMain
#endif #endif
#if !defined(mjEXTERNC) #if !defined(mjEXTERNC)
#if defined(__cplusplus) #if defined(__cplusplus)
#define mjEXTERNC extern "C" #define mjEXTERNC extern "C"
#else #else
#define mjEXTERNC #define mjEXTERNC
#endif // defined(__cplusplus) #endif // defined(__cplusplus)
#endif // !defined(mjEXTERNC) #endif // !defined(mjEXTERNC)
// NOLINTBEGIN(runtime/int) // NOLINTBEGIN(runtime/int)
#define mjPLUGIN_DYNAMIC_LIBRARY_INIT \ #define mjPLUGIN_DYNAMIC_LIBRARY_INIT \
static void _mjplugin_dllmain(void); \ static void _mjplugin_dllmain(void); \
mjEXTERNC int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \ mjEXTERNC int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \
if (reason == 1) { \ if (reason == 1) { \
@@ -95,7 +95,7 @@ typedef struct mjpPlugin_ mjpPlugin;
return 1; \ return 1; \
} \ } \
static void _mjplugin_dllmain(void) static void _mjplugin_dllmain(void)
// NOLINTEND(runtime/int) // NOLINTEND(runtime/int)
#endif // defined(_MSC_VER) #endif // defined(_MSC_VER)
-1
View File
@@ -15,7 +15,6 @@
#ifndef MUJOCO_MJRENDER_H_ #ifndef MUJOCO_MJRENDER_H_
#define MUJOCO_MJRENDER_H_ #define MUJOCO_MJRENDER_H_
#include <mujoco/mjmodel.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
+1 -1
View File
@@ -16,7 +16,7 @@
#define MUJOCO_MJVISUALIZE_H_ #define MUJOCO_MJVISUALIZE_H_
#include <mujoco/mjtnum.h> #include <mujoco/mjtnum.h>
#include <mujoco/mjmodel.h>
#define mjNGROUP 6 // number of geom, site, joint, skin groups with visflags #define mjNGROUP 6 // number of geom, site, joint, skin groups with visflags
#define mjMAXLIGHT 100 // maximum number of lights in a scene #define mjMAXLIGHT 100 // maximum number of lights in a scene
+4 -6
View File
@@ -114,13 +114,11 @@ MJAPI void mj_deleteVFS(mjVFS* vfs);
// Parse XML file in MJCF or URDF format, compile it, return low-level model. // Parse XML file in MJCF or URDF format, compile it, return low-level model.
// If vfs is not NULL, look up files in vfs before reading from disk. // If vfs is not NULL, look up files in vfs before reading from disk.
// If error is not NULL, it must have size error_sz. // If error is not NULL, it must have size error_sz.
MJAPI mjModel* mj_loadXML(const char* filename, const mjVFS* vfs, MJAPI mjModel* mj_loadXML(const char* filename, const mjVFS* vfs, char* error, int error_sz);
char* error, int error_sz);
// Update XML data structures with info from low-level model, save as MJCF. // Update XML data structures with info from low-level model, save as MJCF.
// If error is not NULL, it must have size error_sz. // If error is not NULL, it must have size error_sz.
MJAPI int mj_saveLastXML(const char* filename, const mjModel* m, MJAPI int mj_saveLastXML(const char* filename, const mjModel* m, char* error, int error_sz);
char* error, int error_sz);
// Free last XML model if loaded. Called internally at each load. // Free last XML model if loaded. Called internally at each load.
MJAPI void mj_freeLastXML(void); MJAPI void mj_freeLastXML(void);
@@ -786,8 +784,8 @@ MJAPI void mj_deactivate(void);
//---------------------------------- Standard math ------------------------------------------------- //---------------------------------- Standard math -------------------------------------------------
#define mjMAX(a,b) (((a) > (b)) ? (a) : (b)) #define mjMAX(a, b) (((a) > (b)) ? (a) : (b))
#define mjMIN(a,b) (((a) < (b)) ? (a) : (b)) #define mjMIN(a, b) (((a) < (b)) ? (a) : (b))
#ifdef mjUSEDOUBLE #ifdef mjUSEDOUBLE
#define mju_sqrt sqrt #define mju_sqrt sqrt