From 0295d972cb55f3e9edc78d8ec04af91fbcda381d Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Thu, 20 Apr 2023 15:38:31 -0700 Subject: [PATCH] Improve comments in `mjplugin.h`, align to header standard (column 35). PiperOrigin-RevId: 525868504 Change-Id: I8edfcea737e6e94458015a0e4fa6522cf89a1230 --- doc/includes/references.h | 22 +++++++++++----------- include/mujoco/mjplugin.h | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/doc/includes/references.h b/doc/includes/references.h index f4884fe6..9949fa28 100644 --- a/doc/includes/references.h +++ b/doc/includes/references.h @@ -1198,26 +1198,26 @@ struct mjModel_ { }; typedef struct mjModel_ mjModel; struct mjpResourceProvider_ { - const char* prefix; // prefix for match against a resource name - mjfOpenResource open; // opening callback - mjfReadResource read; // reading callback - mjfCloseResource close; // closing callback - void* data; // opaque data pointer (resource invariant) + const char* prefix; // prefix for match against a resource name + mjfOpenResource open; // opening callback + mjfReadResource read; // reading callback + mjfCloseResource close; // closing callback + void* data; // opaque data pointer (resource invariant) }; typedef struct mjpResourceProvider_ mjpResourceProvider; typedef enum mjtPluginCapabilityBit_ { - mjPLUGIN_ACTUATOR = 1<<0, - mjPLUGIN_SENSOR = 1<<1, - mjPLUGIN_PASSIVE = 1<<2, + mjPLUGIN_ACTUATOR = 1<<0, // actuator forces + mjPLUGIN_SENSOR = 1<<1, // sensor measurements + mjPLUGIN_PASSIVE = 1<<2, // passive forces } mjtPluginCapabilityBit; struct mjpPlugin_ { - const char* name; // globally unique name identifying the plugin + const char* name; // globally unique name identifying the plugin int nattribute; // number of configuration attributes const char* const* attributes; // name of configuration attributes - int capabilityflags; // bitfield of mjtPluginCapabilityBit specifying plugin capabilities - int needstage; // an mjtStage enum value specifying the sensor computation stage + int capabilityflags; // plugin capabilities: bitfield of mjtPluginCapabilityBit + int needstage; // sensor computation stage (mjtStage) // number of mjtNums needed to store the state of a plugin instance (required) int (*nstate)(const mjModel* m, int instance); diff --git a/include/mujoco/mjplugin.h b/include/mujoco/mjplugin.h index 6b1ab576..3216e184 100644 --- a/include/mujoco/mjplugin.h +++ b/include/mujoco/mjplugin.h @@ -36,11 +36,11 @@ typedef void (*mjfCloseResource)(mjResource* resource); // struct describing a single resource provider struct mjpResourceProvider_ { - const char* prefix; // prefix for match against a resource name - mjfOpenResource open; // opening callback - mjfReadResource read; // reading callback - mjfCloseResource close; // closing callback - void* data; // opaque data pointer (resource invariant) + const char* prefix; // prefix for match against a resource name + mjfOpenResource open; // opening callback + mjfReadResource read; // reading callback + mjfCloseResource close; // closing callback + void* data; // opaque data pointer (resource invariant) }; typedef struct mjpResourceProvider_ mjpResourceProvider; @@ -48,19 +48,19 @@ typedef struct mjpResourceProvider_ mjpResourceProvider; //---------------------------------- Plugins ------------------------------------------------------- typedef enum mjtPluginCapabilityBit_ { - mjPLUGIN_ACTUATOR = 1<<0, - mjPLUGIN_SENSOR = 1<<1, - mjPLUGIN_PASSIVE = 1<<2, + mjPLUGIN_ACTUATOR = 1<<0, // actuator forces + mjPLUGIN_SENSOR = 1<<1, // sensor measurements + mjPLUGIN_PASSIVE = 1<<2, // passive forces } mjtPluginCapabilityBit; struct mjpPlugin_ { - const char* name; // globally unique name identifying the plugin + const char* name; // globally unique name identifying the plugin int nattribute; // number of configuration attributes const char* const* attributes; // name of configuration attributes - int capabilityflags; // bitfield of mjtPluginCapabilityBit specifying plugin capabilities - int needstage; // an mjtStage enum value specifying the sensor computation stage + int capabilityflags; // plugin capabilities: bitfield of mjtPluginCapabilityBit + int needstage; // sensor computation stage (mjtStage) // number of mjtNums needed to store the state of a plugin instance (required) int (*nstate)(const mjModel* m, int instance); @@ -112,7 +112,7 @@ typedef struct mjpPlugin_ mjpPlugin; #endif // !defined(mjEXTERNC) // NOLINTBEGIN(runtime/int) - #define mjPLUGIN_LIB_INIT \ + #define mjPLUGIN_LIB_INIT \ static void _mjplugin_dllmain(void); \ mjEXTERNC int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \ if (reason == 1) { \