diff options
author | 2012-08-23 18:09:54 +0000 | |
---|---|---|
committer | 2012-08-23 18:09:54 +0000 | |
commit | fbfcd5602128ec010c82cb733c9cdc0a3254f9f3 (patch) | |
tree | d8b4815d15946c32ee9d254e932411e93be942bb /forth | |
parent | 2abed834789bb64c7da740df4c47efc142b7311a (diff) |
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6485054
git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'forth')
-rw-r--r-- | forth/Forth.cpp | 10 | ||||
-rw-r--r-- | forth/ForthTests.cpp | 6 | ||||
-rw-r--r-- | forth/SampleForth.cpp | 32 | ||||
-rw-r--r-- | forth/StdWords.cpp | 4 |
4 files changed, 26 insertions, 26 deletions
diff --git a/forth/Forth.cpp b/forth/Forth.cpp index be366fcf4e..be240e3285 100644 --- a/forth/Forth.cpp +++ b/forth/Forth.cpp @@ -101,12 +101,12 @@ void ForthWord::call(ForthCallBlock* block) { /* reading an initial 32bit value from the code stream: - + xxxxxxxx xxxxxxxx xxxxxxxx xxxxxx00 - + Those last two bits are always 0 for a word, so we set those bits for other opcodes - + 00 -- execute this word 01 -- push (value & ~3) on the data stack 10 -- push value >> 2 on the data stack (sign extended) @@ -143,7 +143,7 @@ public: static unsigned MakeCode(Code code) { return (code << kCodeShift) | kCodeShift2_Bits; } - + void appendInt(int32_t); void appendWord(ForthWord*); void appendIF(); @@ -159,7 +159,7 @@ public: this->done(); return fData.begin(); } - + static void Exec(const intptr_t*, ForthEngine*); private: diff --git a/forth/ForthTests.cpp b/forth/ForthTests.cpp index 7b9dd5b7fe..08ab7f30ba 100644 --- a/forth/ForthTests.cpp +++ b/forth/ForthTests.cpp @@ -16,7 +16,7 @@ public: void reportFailure(const char expression[], const char file[], int line); void reportFailure(const char msg[]); }; - + typedef void (*ForthWordTestProc)(ForthWord*, ForthEngine*, Reporter*); #define FORTH_ASSERT(reporter, expression) \ @@ -385,7 +385,7 @@ void Forth_test_stdwords(bool verbose) { for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) { ForthEngine engine(NULL); - + ForthWord* word = env.findWord(gRecs[i].fName); if (NULL == word) { SkString str; @@ -398,7 +398,7 @@ void Forth_test_stdwords(bool verbose) { gRecs[i].fProc(word, &engine, &reporter); } } - + if (0 == reporter.fFailureCount) { SkDebugf("--- success!\n"); } else { diff --git a/forth/SampleForth.cpp b/forth/SampleForth.cpp index df4110db6e..8fa6a4f7ea 100644 --- a/forth/SampleForth.cpp +++ b/forth/SampleForth.cpp @@ -36,9 +36,9 @@ public: class SkForthCtx_FW : public ForthWord { public: SkForthCtx_FW() : fCtx(NULL) {} - + void setCtx(SkForthCtx* ctx) { fCtx = ctx; } - + SkCanvas* canvas() const { return &fCtx->fCanvas; } SkPaint* paint() const { return &fCtx->fPaint; } @@ -51,7 +51,7 @@ public: virtual void exec(ForthEngine* fe) { paint()->setColor(fe->pop()); } - + static SkForthCtx_FW* New() { return new setColor_FW; } }; @@ -60,7 +60,7 @@ public: virtual void exec(ForthEngine* fe) { paint()->setStyle((SkPaint::Style)fe->pop()); } - + static SkForthCtx_FW* New() { return new setStyle_FW; } }; @@ -69,7 +69,7 @@ public: virtual void exec(ForthEngine* fe) { paint()->setStrokeWidth(fe->fpop()); } - + static SkForthCtx_FW* New() { return new setStrokeWidth_FW; } }; @@ -80,7 +80,7 @@ public: SkScalar dx = fe->fpop(); canvas()->translate(dx, dy); } - + static SkForthCtx_FW* New() { return new translate_FW; } }; @@ -89,7 +89,7 @@ public: virtual void exec(ForthEngine* fe) { canvas()->drawColor(fe->pop()); } - + static SkForthCtx_FW* New() { return new drawColor_FW; } }; @@ -103,7 +103,7 @@ public: r.fLeft = fe->fpop(); canvas()->drawRect(r, *paint()); } - + static SkForthCtx_FW* New() { return new drawRect_FW; } }; @@ -115,7 +115,7 @@ public: SkScalar x = fe->fpop(); canvas()->drawCircle(x, y, radius, *paint()); } - + static SkForthCtx_FW* New() { return new drawCircle_FW; } }; @@ -129,7 +129,7 @@ public: x0 = fe->fpop(); canvas()->drawLine(x0, y0, x1, y1, *paint()); } - + static SkForthCtx_FW* New() { return new drawLine_FW; } }; @@ -166,7 +166,7 @@ class ForthView : public SkView { SkBitmap fBM; SkForthCtx fContext; public: - ForthView() { + ForthView() { Forth_test_stdwords(false); load_words(&fEnv, &fContext); @@ -194,7 +194,7 @@ public: ); #endif } - + virtual ~ForthView() { } @@ -207,11 +207,11 @@ protected: } return this->INHERITED::onQuery(evt); } - + void drawBG(SkCanvas* canvas) { canvas->drawColor(0xFFDDDDDD); } - + void test_onClick(ForthEnv* env) { ForthWord* word = env->findWord("view.onClick"); if (word) { @@ -229,7 +229,7 @@ protected: SkDebugf("------ view.onClick not found\n"); } } - + virtual void onDraw(SkCanvas* canvas) { drawBG(canvas); canvas->drawBitmap(fBM, 0, 0, NULL); @@ -238,7 +238,7 @@ protected: virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { return fOnClickWord ? new Click(this) : NULL; } - + virtual bool onClick(Click* click) { intptr_t idata[2] = { f2i_bits(click->fCurr.fX), f2i_bits(click->fCurr.fY) diff --git a/forth/StdWords.cpp b/forth/StdWords.cpp index fe75342e2a..8a781f8d4f 100644 --- a/forth/StdWords.cpp +++ b/forth/StdWords.cpp @@ -408,7 +408,7 @@ void ForthParser::addStdWords() { ADD_LITERAL_WORD("2DUP", dup2); ADD_LITERAL_WORD("2OVER", over2); ADD_LITERAL_WORD("2DROP", drop2); - + ADD_LITERAL_WORD("+", add); ADD_LITERAL_WORD("-", sub); ADD_LITERAL_WORD("*", mul); @@ -451,7 +451,7 @@ void ForthParser::addStdWords() { ADD_LITERAL_WORD("0>", gt0); ADD_LITERAL_WORD("0<=", le0); ADD_LITERAL_WORD("0>=", ge0); - + this->add("f=", 2, new feq_ForthWord); this->add("f<>", 3, new fneq_ForthWord); this->add("f<", 2, new flt_ForthWord); |