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

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <danielgarcia@gmail.com>2015-02-09 17:42:42 +0300
committerDaniel Garcia <danielgarcia@gmail.com>2015-02-09 17:42:42 +0300
commit5a8ea5fdc7bb371c92fe7236c307ef00ebb17307 (patch)
tree0c9db64fceef6a1df3fa501fc12461739a5afd02 /noise.cpp
parentde83ca911a5d6584455f90df56505e9a5061f85b (diff)
Fix compilation errors surrounding namespace - also rename the namespace, having FastLED::FastLED was proving too ambiguous for teh compiler.
Diffstat (limited to 'noise.cpp')
-rw-r--r--noise.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/noise.cpp b/noise.cpp
index d377f10d..51b46ad0 100644
--- a/noise.cpp
+++ b/noise.cpp
@@ -6,7 +6,7 @@
#define USE_PROGMEM
#endif
-FASTLED_USING_NAMESPACE
+FASTLED_NAMESPACE_BEGIN
// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734
#ifdef FASTLED_AVR
@@ -117,9 +117,9 @@ static int8_t inline __attribute__((always_inline)) selectBasedOnHashBit(uint8_t
"sbrs %[hash],%[bitnumber] \n\t"
"mov %[result],%[b] \n\t"
: [result] "=r" (result)
- : [hash] "r" (hash),
+ : [hash] "r" (hash),
[bitnumber] "M" (bitnumber),
- [a] "r" (a),
+ [a] "r" (a),
[b] "r" (b)
);
#endif
@@ -158,7 +158,7 @@ static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t
v = hash<4?y:hash==12||hash==14?x:z;
#else
// Verbose version for analysis; generates idenitical code.
- if( hash < 4) { // 00 01 02 03
+ if( hash < 4) { // 00 01 02 03
v = y;
} else {
if( hash==12 || hash==14) { // 0C 0E
@@ -176,17 +176,17 @@ static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t
#endif
}
-static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x, int8_t y)
+static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x, int8_t y)
{
- // since the tests below can be done bit-wise on the bottom
+ // since the tests below can be done bit-wise on the bottom
// three bits, there's no need to mask off the higher bits
// hash = hash & 7;
int8_t u,v;
if( hash & 4) {
- u = y; v = x;
+ u = y; v = x;
} else {
- u = x; v = y;
+ u = x; v = y;
}
if(hash&1) { u = -u; }
@@ -195,20 +195,20 @@ static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x
return avg7(u,v);
}
-static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x)
+static int8_t inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x)
{
- // since the tests below can be done bit-wise on the bottom
+ // since the tests below can be done bit-wise on the bottom
// four bits, there's no need to mask off the higher bits
// hash = hash & 15;
int8_t u,v;
- if(hash & 8) {
- u=x; v=x;
+ if(hash & 8) {
+ u=x; v=x;
} else {
- if(hash & 4) {
- u=1; v=x;
- } else {
- u=x; v=1;
+ if(hash & 4) {
+ u=1; v=x;
+ } else {
+ u=x; v=1;
}
}
@@ -759,3 +759,5 @@ void fill_2dnoise16(CRGB *leds, int width, int height, bool serpentine,
}
}
}
+
+FASTLED_NAMESPACE_END