clang-format: Various fixes to comments alignment from clang-format 13

All reviewed manually and occasionally rewritten to avoid bad auto formatting.
This commit is contained in:
Rémi Verschelde
2021-10-28 14:15:02 +02:00
parent 42d385b312
commit 1b65550ec7
45 changed files with 417 additions and 666 deletions

View File

@@ -82,46 +82,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
namespace FBXDocParser {
//enum Flag
//{
// e_unknown_0 = 1 << 0,
// e_unknown_1 = 1 << 1,
// e_unknown_2 = 1 << 2,
// e_unknown_3 = 1 << 3,
// e_unknown_4 = 1 << 4,
// e_unknown_5 = 1 << 5,
// e_unknown_6 = 1 << 6,
// e_unknown_7 = 1 << 7,
// e_unknown_8 = 1 << 8,
// e_unknown_9 = 1 << 9,
// e_unknown_10 = 1 << 10,
// e_unknown_11 = 1 << 11,
// e_unknown_12 = 1 << 12,
// e_unknown_13 = 1 << 13,
// e_unknown_14 = 1 << 14,
// e_unknown_15 = 1 << 15,
// e_unknown_16 = 1 << 16,
// e_unknown_17 = 1 << 17,
// e_unknown_18 = 1 << 18,
// e_unknown_19 = 1 << 19,
// e_unknown_20 = 1 << 20,
// e_unknown_21 = 1 << 21,
// e_unknown_22 = 1 << 22,
// e_unknown_23 = 1 << 23,
// e_flag_field_size_64_bit = 1 << 24, // Not sure what is
// e_unknown_25 = 1 << 25,
// e_unknown_26 = 1 << 26,
// e_unknown_27 = 1 << 27,
// e_unknown_28 = 1 << 28,
// e_unknown_29 = 1 << 29,
// e_unknown_30 = 1 << 30,
// e_unknown_31 = 1 << 31
//};
//
//bool check_flag(uint32_t flags, Flag to_check)
//{
// return (flags & to_check) != 0;
//}
// ------------------------------------------------------------------------------------------------
Token::Token(const char *sbegin, const char *send, TokenType type, size_t offset) :
sbegin(sbegin),
@@ -438,12 +398,6 @@ void TokenizeBinary(TokenList &output_tokens, const char *input, size_t length)
//TokenizeError("file is too short",0);
}
//uint32_t offset = 0x15;
/* const char* cursor = input + 0x15;
const uint32_t flags = ReadWord(input, cursor, input + length);
const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused
const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused*/
if (strncmp(input, "Kaydara FBX Binary", 18)) {
TokenizeError("magic bytes not found", 0);
}

View File

@@ -70,8 +70,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @file FBXCommon.h
* Some useful constants and enums for dealing with FBX files.
*/
* Some useful constants and enums for dealing with FBX files.
*/
#ifndef FBX_COMMON_H
#define FBX_COMMON_H

View File

@@ -740,13 +740,13 @@ public:
virtual ~AnimationCurve();
/** get list of keyframe positions (time).
* Invariant: |GetKeys()| > 0 */
* Invariant: |GetKeys()| > 0 */
const KeyTimeList &GetKeys() const {
return keys;
}
/** get list of keyframe values.
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
const KeyValueList &GetValues() const {
return values;
}
@@ -784,8 +784,8 @@ typedef std::weak_ptr<AnimationCurveNode> AnimationCurveNodeWeakPtr;
class AnimationCurveNode : public Object {
public:
/* the optional white list specifies a list of property names for which the caller
wants animations for. If the curve node does not match one of these, std::range_error
will be thrown. */
wants animations for. If the curve node does not match one of these, std::range_error
will be thrown. */
AnimationCurveNode(uint64_t id, const ElementPtr element, const std::string &name, const Document &doc,
const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0);
@@ -798,8 +798,8 @@ public:
const AnimationMap &Curves() const;
/** Object the curve is assigned to, this can be NULL if the
* target object has no DOM representation or could not
* be read for other reasons.*/
* target object has no DOM representation or could not
* be read for other reasons.*/
Object *Target() const {
return target;
}
@@ -843,8 +843,8 @@ public:
}
/* the optional white list specifies a list of property names for which the caller
wants animations for. Curves not matching this list will not be added to the
animation layer. */
wants animations for. Curves not matching this list will not be added to the
animation layer. */
const AnimationCurveNodeList Nodes(const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0) const;
private:
@@ -952,15 +952,15 @@ public:
virtual ~Cluster();
/** get the list of deformer weights associated with this cluster.
* Use #GetIndices() to get the associated vertices. Both arrays
* have the same size (and may also be empty). */
* Use #GetIndices() to get the associated vertices. Both arrays
* have the same size (and may also be empty). */
const std::vector<float> &GetWeights() const {
return weights;
}
/** get indices into the vertex data of the geometry associated
* with this cluster. Use #GetWeights() to get the associated weights.
* Both arrays have the same size (and may also be empty). */
* with this cluster. Use #GetWeights() to get the associated weights.
* Both arrays have the same size (and may also be empty). */
const std::vector<unsigned int> &GetIndices() const {
return indices;
}
@@ -1059,7 +1059,7 @@ public:
LazyObject *LazyDestinationObject() const;
/** return the name of the property the connection is attached to.
* this is an empty string for object to object (OO) connections. */
* this is an empty string for object to object (OO) connections. */
const std::string &PropertyName() const {
return prop;
}

View File

@@ -86,30 +86,30 @@ struct ImportSettings {
}
/** enable strict mode:
* - only accept fbx 2012, 2013 files
* - on the slightest error, give up.
*
* Basically, strict mode means that the fbx file will actually
* be validated. Strict mode is off by default. */
* - only accept fbx 2012, 2013 files
* - on the slightest error, give up.
*
* Basically, strict mode means that the fbx file will actually
* be validated. Strict mode is off by default. */
bool strictMode;
/** specifies whether all geometry layers are read and scanned for
* usable data channels. The FBX spec indicates that many readers
* will only read the first channel and that this is in some way
* the recommended way- in reality, however, it happens a lot that
* vertex data is spread among multiple layers. The default
* value for this option is true.*/
* usable data channels. The FBX spec indicates that many readers
* will only read the first channel and that this is in some way
* the recommended way- in reality, however, it happens a lot that
* vertex data is spread among multiple layers. The default
* value for this option is true.*/
bool readAllLayers;
/** specifies whether all materials are read, or only those that
* are referenced by at least one mesh. Reading all materials
* may make FBX reading a lot slower since all objects
* need to be processed .
* This bit is ignored unless readMaterials=true*/
* are referenced by at least one mesh. Reading all materials
* may make FBX reading a lot slower since all objects
* need to be processed .
* This bit is ignored unless readMaterials=true*/
bool readAllMaterials;
/** import materials (true) or skip them and assign a default
* material. The default value is true.*/
* material. The default value is true.*/
bool readMaterials;
/** import embedded textures? Default value is true.*/
@@ -122,50 +122,50 @@ struct ImportSettings {
bool readLights;
/** import animations (i.e. animation curves, the node
* skeleton is always imported). Default value is true. */
* skeleton is always imported). Default value is true. */
bool readAnimations;
/** read bones (vertex weights and deform info).
* Default value is true. */
* Default value is true. */
bool readWeights;
/** preserve transformation pivots and offsets. Since these can
* not directly be represented in assimp, additional dummy
* nodes will be generated. Note that settings this to false
* can make animation import a lot slower. The default value
* is true.
*
* The naming scheme for the generated nodes is:
* <OriginalName>_$AssimpFbx$_<TransformName>
*
* where <TransformName> is one of
* RotationPivot
* RotationOffset
* PreRotation
* PostRotation
* ScalingPivot
* ScalingOffset
* Translation
* Scaling
* Rotation
**/
* not directly be represented in assimp, additional dummy
* nodes will be generated. Note that settings this to false
* can make animation import a lot slower. The default value
* is true.
*
* The naming scheme for the generated nodes is:
* <OriginalName>_$AssimpFbx$_<TransformName>
*
* where <TransformName> is one of
* RotationPivot
* RotationOffset
* PreRotation
* PostRotation
* ScalingPivot
* ScalingOffset
* Translation
* Scaling
* Rotation
**/
bool preservePivots;
/** do not import animation curves that specify a constant
* values matching the corresponding node transformation.
* The default value is true. */
* values matching the corresponding node transformation.
* The default value is true. */
bool optimizeEmptyAnimationCurves;
/** use legacy naming for embedded textures eg: (*0, *1, *2)
*/
*/
bool useLegacyEmbeddedTextureNaming;
/** Empty bones shall be removed
*/
*/
bool removeEmptyBones;
/** Set to true to perform a conversion from cm to meter after the import
*/
*/
bool convertToMeters;
};

View File

@@ -226,7 +226,7 @@ public:
const std::vector<Vector3> &GetVertices() const;
/** Get a list of all vertex normals or an empty array if
* no normals are specified. */
* no normals are specified. */
const std::vector<Vector3> &GetNormals() const;
/** Return list of vertex indices. */
@@ -238,8 +238,8 @@ private:
std::vector<unsigned int> m_indices;
};
/**
* DOM class for FBX geometry of type "Line"
*/
* DOM class for FBX geometry of type "Line"
*/
class LineGeometry : public Geometry {
public:
/** The class constructor */

View File

@@ -642,13 +642,6 @@ void ParseVectorDataArray(std::vector<Vector3> &out, const ElementPtr el) {
static_cast<real_t>(d[1]),
static_cast<real_t>(d[2])));
}
// for debugging
/*for ( size_t i = 0; i < out.size(); i++ ) {
aiVector3D vec3( out[ i ] );
std::stringstream stream;
stream << " vec3.x = " << vec3.x << " vec3.y = " << vec3.y << " vec3.z = " << vec3.z << std::endl;
DefaultLogger::get()->info( stream.str() );
}*/
} else if (type == 'f') {
const float *f = reinterpret_cast<const float *>(&buff[0]);
for (unsigned int i = 0; i < count3; ++i, f += 3) {

View File

@@ -187,7 +187,7 @@ private:
class Parser {
public:
/** Parse given a token list. Does not take ownership of the tokens -
* the objects must persist during the entire parser lifetime */
* the objects must persist during the entire parser lifetime */
Parser(const TokenList &tokens, bool is_binary);
~Parser();

View File

@@ -169,10 +169,10 @@ char EncodeBase64(char byte) {
}
/** Encodes a block of 4 bytes to base64 encoding
* @param bytes Bytes to encode.
* @param out_string String to write encoded values to.
* @param string_pos Position in out_string.
*/
* @param bytes Bytes to encode.
* @param out_string String to write encoded values to.
* @param string_pos Position in out_string.
*/
void EncodeByteBlock(const char *bytes, std::string &out_string, size_t string_pos) {
char b0 = (bytes[0] & 0xFC) >> 2;
char b1 = (bytes[0] & 0x03) << 4 | ((bytes[1] & 0xF0) >> 4);

View File

@@ -87,34 +87,34 @@ namespace Util {
const char *TokenTypeString(TokenType t);
/** Decode a single Base64-encoded character.
*
* @param ch Character to decode (from base64 to binary).
* @return decoded byte value*/
*
* @param ch Character to decode (from base64 to binary).
* @return decoded byte value*/
uint8_t DecodeBase64(char ch);
/** Compute decoded size of a Base64-encoded string
*
* @param in Characters to decode.
* @param inLength Number of characters to decode.
* @return size of the decoded data (number of bytes)*/
*
* @param in Characters to decode.
* @param inLength Number of characters to decode.
* @return size of the decoded data (number of bytes)*/
size_t ComputeDecodedSizeBase64(const char *in, size_t inLength);
/** Decode a Base64-encoded string
*
* @param in Characters to decode.
* @param inLength Number of characters to decode.
* @param out Pointer where we will store the decoded data.
* @param maxOutLength Size of output buffer.
* @return size of the decoded data (number of bytes)*/
*
* @param in Characters to decode.
* @param inLength Number of characters to decode.
* @param out Pointer where we will store the decoded data.
* @param maxOutLength Size of output buffer.
* @return size of the decoded data (number of bytes)*/
size_t DecodeBase64(const char *in, size_t inLength, uint8_t *out, size_t maxOutLength);
char EncodeBase64(char byte);
/** Encode bytes in base64-encoding
*
* @param data Binary data to encode.
* @param inLength Number of bytes to encode.
* @return base64-encoded string*/
*
* @param data Binary data to encode.
* @param inLength Number of bytes to encode.
* @return base64-encoded string*/
std::string EncodeBase64(const char *data, size_t length);
} // namespace Util

View File

@@ -43,7 +43,7 @@
/**
* Import Utils
* Conversion tools / glue code to convert from FBX to Godot
*/
*/
class ImportUtils {
public:
/// Convert a vector from degrees to radians.
@@ -201,7 +201,7 @@ public:
};
/** Get fbx fps for time mode meta data
*/
*/
static float get_fbx_fps(int32_t time_mode) {
switch (time_mode) {
case AssetImportFbx::TIME_MODE_DEFAULT:
@@ -258,13 +258,13 @@ public:
}
/**
* Find hardcoded textures from assimp which could be in many different directories
*/
* Find hardcoded textures from assimp which could be in many different directories
*/
/**
* set_texture_mapping_mode
* Helper to check the mapping mode of the texture (repeat, clamp and mirror)
*/
* set_texture_mapping_mode
* Helper to check the mapping mode of the texture (repeat, clamp and mirror)
*/
// static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
// ERR_FAIL_COND(texture.is_null());
// ERR_FAIL_COND(map_mode == NULL);
@@ -282,9 +282,9 @@ public:
// }
/**
* Load or load from cache image :)
* We need to upgrade this in the later version :) should not be hard
*/
* Load or load from cache image :)
* We need to upgrade this in the later version :) should not be hard
*/
//static Ref<Image> load_image(ImportState &state, const aiScene *p_scene, String p_path){
// Map<String, Ref<Image> >::Element *match = state.path_to_image_cache.find(p_path);

View File

@@ -352,13 +352,6 @@ Error PluginScript::reload(bool p_keep_state) {
}
}
#ifdef TOOLS_ENABLED
/*for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) {
_update_placeholder(E->get());
}*/
#endif
FREE_SCRIPT_MANIFEST(manifest);
return OK;
#undef FREE_SCRIPT_MANIFEST

View File

@@ -358,21 +358,21 @@ struct Command {
namespace TextDocumentSyncKind {
/**
* Documents should not be synced at all.
*/
* Documents should not be synced at all.
*/
static const int None = 0;
/**
* Documents are synced by always sending the full content
* of the document.
*/
* Documents are synced by always sending the full content
* of the document.
*/
static const int Full = 1;
/**
* Documents are synced by sending the full content on open.
* After that only incremental updates to the document are
* send.
*/
* Documents are synced by sending the full content on open.
* After that only incremental updates to the document are
* send.
*/
static const int Incremental = 2;
}; // namespace TextDocumentSyncKind
@@ -667,20 +667,20 @@ struct TextDocumentContentChangeEvent {
// Use namespace instead of enumeration to follow the LSP specifications
namespace DiagnosticSeverity {
/**
* Reports an error.
*/
* Reports an error.
*/
static const int Error = 1;
/**
* Reports a warning.
*/
* Reports a warning.
*/
static const int Warning = 2;
/**
* Reports an information.
*/
* Reports an information.
*/
static const int Information = 3;
/**
* Reports a hint.
*/
* Reports a hint.
*/
static const int Hint = 4;
}; // namespace DiagnosticSeverity
@@ -871,18 +871,18 @@ static const int TypeParameter = 25;
*/
namespace InsertTextFormat {
/**
* The primary text to be inserted is treated as a plain string.
*/
* The primary text to be inserted is treated as a plain string.
*/
static const int PlainText = 1;
/**
* The primary text to be inserted is treated as a snippet.
*
* A snippet can define tab stops and placeholders with `$1`, `$2`
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
* the end of the snippet. Placeholders with equal identifiers are linked,
* that is typing in one will update others too.
*/
* The primary text to be inserted is treated as a snippet.
*
* A snippet can define tab stops and placeholders with `$1`, `$2`
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
* the end of the snippet. Placeholders with equal identifiers are linked,
* that is typing in one will update others too.
*/
static const int Snippet = 2;
}; // namespace InsertTextFormat
@@ -1359,16 +1359,16 @@ struct NativeSymbolInspectParams {
*/
namespace FoldingRangeKind {
/**
* Folding range for a comment
*/
* Folding range for a comment
*/
static const String Comment = "comment";
/**
* Folding range for a imports or includes
*/
* Folding range for a imports or includes
*/
static const String Imports = "imports";
/**
* Folding range for a region (e.g. `#region`)
*/
* Folding range for a region (e.g. `#region`)
*/
static const String Region = "region";
} // namespace FoldingRangeKind
@@ -1419,20 +1419,20 @@ struct FoldingRange {
*/
namespace CompletionTriggerKind {
/**
* Completion was triggered by typing an identifier (24x7 code
* complete), manual invocation (e.g Ctrl+Space) or via API.
*/
* Completion was triggered by typing an identifier (24x7 code
* complete), manual invocation (e.g Ctrl+Space) or via API.
*/
static const int Invoked = 1;
/**
* Completion was triggered by a trigger character specified by
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
*/
* Completion was triggered by a trigger character specified by
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
*/
static const int TriggerCharacter = 2;
/**
* Completion was re-triggered as the current completion list is incomplete.
*/
* Completion was re-triggered as the current completion list is incomplete.
*/
static const int TriggerForIncompleteCompletions = 3;
} // namespace CompletionTriggerKind
@@ -1441,8 +1441,8 @@ static const int TriggerForIncompleteCompletions = 3;
*/
struct CompletionContext {
/**
* How the completion was triggered.
*/
* How the completion was triggered.
*/
int triggerKind = CompletionTriggerKind::TriggerCharacter;
/**
@@ -1906,7 +1906,7 @@ struct GodotNativeClassInfo {
struct GodotCapabilities {
/**
* Native class list
*/
*/
List<GodotNativeClassInfo> native_classes;
Dictionary to_json() {

View File

@@ -2435,7 +2435,6 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
const StringName *f = _call_stack[l].function;
ERR_FAIL_COND(!_call_stack[l].instance->functions.has(*f));
//VisualScriptInstance::Function *func = &_call_stack[l].instance->functions[*f];
VisualScriptNodeInstance *node = _call_stack[l].instance->instances[*_call_stack[l].current_id];
ERR_FAIL_COND(!node);
@@ -2481,23 +2480,8 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
p_locals->push_back("working_mem/mem_" + itos(i));
p_values->push_back((*_call_stack[l].work_mem)[i]);
}
/*
ERR_FAIL_INDEX(p_level,_debug_call_stack_pos);
VisualFunction *f = _call_stack[l].function;
List<Pair<StringName,int> > locals;
f->debug_get_stack_member_state(*_call_stack[l].line,&locals);
for( List<Pair<StringName,int> >::Element *E = locals.front();E;E=E->next() ) {
p_locals->push_back(E->get().first);
p_values->push_back(_call_stack[l].stack[E->get().second]);
}
*/
}
void VisualScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
if (_debug_parse_err_node >= 0) {
return;