From 1e322d49228c062c4aa46b54ed80683448bf713b Mon Sep 17 00:00:00 2001 From: kobalicek Date: Tue, 8 Dec 2015 13:30:44 +0100 Subject: [PATCH] Coding style. --- src/asmjit/asmjit.h | 2 +- src/asmjit/base.h | 2 +- src/asmjit/base/utils.h | 18 +++++++++--------- src/asmjit/x86/x86compiler.cpp | 2 +- src/asmjit/x86/x86compiler.h | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/asmjit/asmjit.h b/src/asmjit/asmjit.h index df8ec15..7cdc7bd 100644 --- a/src/asmjit/asmjit.h +++ b/src/asmjit/asmjit.h @@ -78,7 +78,7 @@ //! //! Code-Generation and Operands //! ---------------------------- -//! +//! //! List of the most useful code-generation and operand classes: //! - \ref asmjit::Assembler - Low-level code-generation. //! - \ref asmjit::CodeGen - Astract code-generation that serializes to `Assembler`: diff --git a/src/asmjit/base.h b/src/asmjit/base.h index 774fa8c..315899d 100644 --- a/src/asmjit/base.h +++ b/src/asmjit/base.h @@ -25,9 +25,9 @@ #include "./base/zone.h" #if !defined(ASMJIT_DISABLE_COMPILER) -#include "./base/hlstream.h" #include "./base/compiler.h" #include "./base/compilerfunc.h" +#include "./base/hlstream.h" #endif // !ASMJIT_DISABLE_COMPILER // [Guard] diff --git a/src/asmjit/base/utils.h b/src/asmjit/base/utils.h index f9d26a1..87ce726 100644 --- a/src/asmjit/base/utils.h +++ b/src/asmjit/base/utils.h @@ -337,15 +337,15 @@ struct Utils { //! Generate a bit-mask that has `x` most significant bits set. static ASMJIT_INLINE uint32_t bits(uint32_t x) { - // Shifting more bits that the type has has undefined behavior. Everything - // we need is that application shouldn't crash because of that, but the - // content of register after shift is not defined. So in case that the - // requested shift is too large for the type we correct this undefined - // behavior by setting all bits to ones (this is why we generate an overflow - // mask). - uint32_t overflow = static_cast( - -static_cast(x >= sizeof(uint32_t) * 8)); - + // Shifting more bits that the type has has undefined behavior. Everything + // we need is that application shouldn't crash because of that, but the + // content of register after shift is not defined. So in case that the + // requested shift is too large for the type we correct this undefined + // behavior by setting all bits to ones (this is why we generate an overflow + // mask). + uint32_t overflow = static_cast( + -static_cast(x >= sizeof(uint32_t) * 8)); + return ((static_cast(1) << x) - 1U) | overflow; } diff --git a/src/asmjit/x86/x86compiler.cpp b/src/asmjit/x86/x86compiler.cpp index 435977c..9a154a3 100644 --- a/src/asmjit/x86/x86compiler.cpp +++ b/src/asmjit/x86/x86compiler.cpp @@ -666,7 +666,7 @@ HLSentinel* X86Compiler::endFunc() { // Add local constant pool at the end of the function (if exist). setCursor(func->getExitNode()); - + if (_localConstPoolLabel.isInitialized()) { embedConstPool(_localConstPoolLabel, _localConstPool); _localConstPoolLabel.reset(); diff --git a/src/asmjit/x86/x86compiler.h b/src/asmjit/x86/x86compiler.h index 1edb5fa..eebdc60 100644 --- a/src/asmjit/x86/x86compiler.h +++ b/src/asmjit/x86/x86compiler.h @@ -444,7 +444,7 @@ struct X86CallNode : public HLCall { //! MyFunc func = asmjit_cast(a.make()); //! ~~~ //! -//! The snippet uses methods to create variables, to associate them with +//! The snippet uses methods to create variables, to associate them with //! function arguments, and to use them to return from the generated function. //! //! When a variable is created, the initial state is `kVarStateNone`, when @@ -521,7 +521,7 @@ struct X86CallNode : public HLCall { //! generate in some cases a block at the end of the function that changes //! the state of one branch. Usually the "taken" branch is embedded directly //! before the jump, and "not-taken" branch has the separate code block. -//! +//! //! The next example shows to the extra code block generated for a state change: //! //! ~~~ @@ -1041,7 +1041,7 @@ struct ASMJIT_VIRTAPI X86Compiler : public Compiler { _newVar(&var, typeId, NULL, NULL); \ return var; \ } -#endif +#endif ASMJIT_NEW_VAR_TYPE(newGpVar , X86GpVar , _kVarTypeIntStart , _kVarTypeIntEnd ) ASMJIT_NEW_VAR_TYPE(newMmVar , X86MmVar , _kX86VarTypeMmStart , _kX86VarTypeMmEnd )