Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2020-11-30 19:14:29 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-11-30 19:14:29 +0300
commit1f578f76ea2d42e51ed7d440568370e6f36e60b7 (patch)
tree61bc3f07be9fe6af1b3f73d71cfc8b36977f827b /src/GCodes/GCodeBuffer
parent053e1ab2190bb0171c99393dc13c00ea62c25849 (diff)
Reworked use of optimisation attributes
Diffstat (limited to 'src/GCodes/GCodeBuffer')
-rw-r--r--src/GCodes/GCodeBuffer/BinaryParser.h10
-rw-r--r--src/GCodes/GCodeBuffer/GCodeBuffer.h10
-rw-r--r--src/GCodes/GCodeBuffer/StringParser.h12
3 files changed, 16 insertions, 16 deletions
diff --git a/src/GCodes/GCodeBuffer/BinaryParser.h b/src/GCodes/GCodeBuffer/BinaryParser.h
index 6948381b..2f480388 100644
--- a/src/GCodes/GCodeBuffer/BinaryParser.h
+++ b/src/GCodes/GCodeBuffer/BinaryParser.h
@@ -27,7 +27,7 @@ public:
void Init() noexcept; // Set it up to parse another G-code
void Put(const uint32_t *data, size_t len) noexcept; // Add an entire binary code, overwriting any existing content
void DecodeCommand() noexcept; // Print the buffer content in debug mode and prepare for execution
- bool Seen(char c) noexcept __attribute__((hot)); // Is a character present?
+ bool Seen(char c) noexcept SPEED_CRITICAL; // Is a character present?
char GetCommandLetter() const noexcept;
bool HasCommandNumber() const noexcept;
@@ -35,8 +35,8 @@ public:
int8_t GetCommandFraction() const noexcept;
bool ContainsExpression() const noexcept;
- float GetFValue() THROWS(GCodeException) __attribute__((hot)); // Get a float after a key letter
- int32_t GetIValue() THROWS(GCodeException) __attribute__((hot)); // Get an integer after a key letter
+ float GetFValue() THROWS(GCodeException) SPEED_CRITICAL; // Get a float after a key letter
+ int32_t GetIValue() THROWS(GCodeException) SPEED_CRITICAL; // Get an integer after a key letter
uint32_t GetUIValue() THROWS(GCodeException); // Get an unsigned integer value
DriverId GetDriverId() THROWS(GCodeException); // Get a driver ID
void GetIPAddress(IPAddress& returnedIp) THROWS(GCodeException); // Get an IP address quad after a key letter
@@ -46,7 +46,7 @@ public:
void GetQuotedString(const StringRef& str) THROWS(GCodeException); // Get and copy a quoted string
void GetPossiblyQuotedString(const StringRef& str, bool allowEmpty = false) THROWS(GCodeException); // Get and copy a string which may or may not be quoted
void GetReducedString(const StringRef& str) THROWS(GCodeException); // Get and copy a quoted string, removing certain characters
- void GetFloatArray(float arr[], size_t& length, bool doPad) THROWS(GCodeException) __attribute__((hot)); // Get a colon-separated list of floats after a key letter
+ void GetFloatArray(float arr[], size_t& length, bool doPad) THROWS(GCodeException) SPEED_CRITICAL; // Get a colon-separated list of floats after a key letter
void GetIntArray(int32_t arr[], size_t& length, bool doPad) THROWS(GCodeException); // Get a :-separated list of ints after a key letter
void GetUnsignedArray(uint32_t arr[], size_t& length, bool doPad) THROWS(GCodeException); // Get a :-separated list of unsigned ints after a key letter
void GetDriverIdArray(DriverId arr[], size_t& length) THROWS(GCodeException); // Get a :-separated list of drivers after a key letter
@@ -71,7 +71,7 @@ private:
GCodeException ConstructParseException(const char *str, uint32_t param) const noexcept;
size_t AddPadding(size_t bytesRead) const noexcept { return (bytesRead + 3u) & (~3u); }
- template<typename T> void GetArray(T arr[], size_t& length, bool doPad) THROWS(GCodeException) __attribute__((hot));
+ template<typename T> void GetArray(T arr[], size_t& length, bool doPad) THROWS(GCodeException) SPEED_CRITICAL;
void WriteParameters(const StringRef& s, bool quoteStrings) const noexcept;
size_t bufferLength;
diff --git a/src/GCodes/GCodeBuffer/GCodeBuffer.h b/src/GCodes/GCodeBuffer/GCodeBuffer.h
index 83d7fb79..99b9ce81 100644
--- a/src/GCodes/GCodeBuffer/GCodeBuffer.h
+++ b/src/GCodes/GCodeBuffer/GCodeBuffer.h
@@ -49,7 +49,7 @@ public:
void Init() noexcept; // Set it up to parse another G-code
void Diagnostics(MessageType mtype) noexcept; // Write some debug info
- bool Put(char c) noexcept __attribute__((hot)); // Add a character to the end
+ bool Put(char c) noexcept SPEED_CRITICAL; // Add a character to the end
#if HAS_LINUX_INTERFACE
void PutBinary(const uint32_t *data, size_t len) noexcept; // Add an entire binary G-Code, overwriting any existing content
#endif
@@ -71,12 +71,12 @@ public:
GCodeResult GetLastResult() const noexcept { return lastResult; }
void SetLastResult(GCodeResult r) noexcept { lastResult = r; }
- bool Seen(char c) noexcept __attribute__((hot)); // Is a character present?
+ bool Seen(char c) noexcept SPEED_CRITICAL; // Is a character present?
void MustSee(char c) THROWS(GCodeException); // Test for character present, throw error if not
- float GetFValue() THROWS(GCodeException) __attribute__((hot)); // Get a float after a key letter
+ float GetFValue() THROWS(GCodeException) SPEED_CRITICAL; // Get a float after a key letter
float GetDistance() THROWS(GCodeException); // Get a distance or coordinate and convert it from inches to mm if necessary
- int32_t GetIValue() THROWS(GCodeException) __attribute__((hot)); // Get an integer after a key letter
+ int32_t GetIValue() THROWS(GCodeException) SPEED_CRITICAL; // Get an integer after a key letter
int32_t GetLimitedIValue(char c, int32_t minValue, int32_t maxValue) THROWS(GCodeException)
post(minValue <= result; result <= maxValue); // Get an integer after a key letter
uint32_t GetUIValue() THROWS(GCodeException); // Get an unsigned integer value
@@ -92,7 +92,7 @@ public:
void GetQuotedString(const StringRef& str) THROWS(GCodeException); // Get and copy a quoted string
void GetPossiblyQuotedString(const StringRef& str) THROWS(GCodeException); // Get and copy a string which may or may not be quoted
void GetReducedString(const StringRef& str) THROWS(GCodeException); // Get and copy a quoted string, removing certain characters
- void GetFloatArray(float arr[], size_t& length, bool doPad) THROWS(GCodeException) __attribute__((hot)); // Get a colon-separated list of floats after a key letter
+ void GetFloatArray(float arr[], size_t& length, bool doPad) THROWS(GCodeException) SPEED_CRITICAL; // Get a colon-separated list of floats after a key letter
void GetIntArray(int32_t arr[], size_t& length, bool doPad) THROWS(GCodeException); // Get a :-separated list of ints after a key letter
void GetUnsignedArray(uint32_t arr[], size_t& length, bool doPad) THROWS(GCodeException); // Get a :-separated list of unsigned ints after a key letter
void GetDriverIdArray(DriverId arr[], size_t& length) THROWS(GCodeException); // Get a :-separated list of drivers after a key letter
diff --git a/src/GCodes/GCodeBuffer/StringParser.h b/src/GCodes/GCodeBuffer/StringParser.h
index 958cf6c5..28045528 100644
--- a/src/GCodes/GCodeBuffer/StringParser.h
+++ b/src/GCodes/GCodeBuffer/StringParser.h
@@ -27,7 +27,7 @@ public:
StringParser(GCodeBuffer& gcodeBuffer) noexcept;
void Init() noexcept; // Set it up to parse another G-code
void Diagnostics(MessageType mtype) noexcept; // Write some debug info
- bool Put(char c) noexcept __attribute__((hot)); // Add a character to the end
+ bool Put(char c) noexcept SPEED_CRITICAL; // Add a character to the end
void PutCommand(const char *str) noexcept; // Put a complete command but don't decode it
void DecodeCommand() noexcept; // Decode the next command in the line
void PutAndDecode(const char *str, size_t len) noexcept; // Add an entire string, overwriting any existing content
@@ -44,10 +44,10 @@ public:
bool IsLastCommand() const noexcept;
bool ContainsExpression() const noexcept { return seenExpression; }
- bool Seen(char c) noexcept __attribute__((hot)); // Is a character present?
- float GetFValue() THROWS(GCodeException) __attribute__((hot)); // Get a float after a key letter
- float GetDistance() THROWS(GCodeException); // Get a distance or coordinate and convert it from inches to mm if necessary
- int32_t GetIValue() THROWS(GCodeException) __attribute__((hot)); // Get an integer after a key letter
+ bool Seen(char c) noexcept SPEED_CRITICAL; // Is a character present?
+ float GetFValue() THROWS(GCodeException) SPEED_CRITICAL; // Get a float after a key letter
+ float GetDistance() THROWS(GCodeException) SPEED_CRITICAL; // Get a distance or coordinate and convert it from inches to mm if necessary
+ int32_t GetIValue() THROWS(GCodeException) SPEED_CRITICAL; // Get an integer after a key letter
uint32_t GetUIValue() THROWS(GCodeException); // Get an unsigned integer value
DriverId GetDriverId() THROWS(GCodeException); // Get a driver ID
void GetIPAddress(IPAddress& returnedIp) THROWS(GCodeException); // Get an IP address quad after a key letter
@@ -57,7 +57,7 @@ public:
void GetQuotedString(const StringRef& str, bool allowEmpty = false) THROWS(GCodeException); // Get and copy a quoted string
void GetPossiblyQuotedString(const StringRef& str, bool allowEmpty = false) THROWS(GCodeException); // Get and copy a string which may or may not be quoted
void GetReducedString(const StringRef& str) THROWS(GCodeException); // Get and copy a quoted string, removing certain characters
- void GetFloatArray(float arr[], size_t& length, bool doPad) THROWS(GCodeException) __attribute__((hot)); // Get a colon-separated list of floats after a key letter
+ void GetFloatArray(float arr[], size_t& length, bool doPad) THROWS(GCodeException) SPEED_CRITICAL; // Get a colon-separated list of floats after a key letter
void GetIntArray(int32_t arr[], size_t& length, bool doPad) THROWS(GCodeException); // Get a :-separated list of ints after a key letter
void GetUnsignedArray(uint32_t arr[], size_t& length, bool doPad) THROWS(GCodeException); // Get a :-separated list of unsigned ints after a key letter
void GetDriverIdArray(DriverId arr[], size_t& length) THROWS(GCodeException); // Get a :-separated list of drivers after a key letter