From 1bacceddf05bc4cdadb138311a91f0b738b12f18 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Wed, 1 Jan 2014 12:56:45 +0100 Subject: [PATCH] Spacing --- binding-mri/binding-mri.cpp | 1 + binding-mri/binding-util.cpp | 5 +++++ binding-mri/table-binding.cpp | 3 +++ binding-mruby/binding-mruby.cpp | 1 + binding-mruby/mrb-ext/file.cpp | 3 +++ binding-mruby/mrb-ext/marshal.cpp | 4 ++++ binding-mruby/table-binding.cpp | 3 +++ src/audio.cpp | 1 + src/eventthread.cpp | 11 +++++++++++ src/filesystem.cpp | 1 + src/tilemap.cpp | 2 +- 11 files changed, 34 insertions(+), 1 deletion(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 1cffac1..025886e 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -256,6 +256,7 @@ static void runRMXPScripts() i, RSTRING_PTR(scriptName)); showMsg(buffer); + break; } diff --git a/binding-mri/binding-util.cpp b/binding-mri/binding-util.cpp index d2d924a..8fb2a3f 100644 --- a/binding-mri/binding-util.cpp +++ b/binding-mri/binding-util.cpp @@ -118,6 +118,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...) // FIXME print num of needed args vs provided if (argc <= argI && !opt) rb_raise(rb_eArgError, "wrong number of arguments"); + break; } @@ -135,6 +136,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...) *obj = *arg++; ++argI; + break; } @@ -151,6 +153,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...) *str = tmp; ++argI; + break; } @@ -170,6 +173,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...) *s = RSTRING_PTR(tmp); *len = RSTRING_LEN(tmp); ++argI; + break; } @@ -187,6 +191,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...) *s = RSTRING_PTR(tmp); ++argI; + break; } diff --git a/binding-mri/table-binding.cpp b/binding-mri/table-binding.cpp index 4fa41d4..fea1111 100644 --- a/binding-mri/table-binding.cpp +++ b/binding-mri/table-binding.cpp @@ -119,17 +119,20 @@ RB_METHOD(tableSetAt) case 2 : x = rb_fix2int(argv[0]); value = rb_fix2int(argv[1]); + break; case 3 : x = rb_fix2int(argv[0]); y = rb_fix2int(argv[1]); value = rb_fix2int(argv[2]); + break; case 4 : x = rb_fix2int(argv[0]); y = rb_fix2int(argv[1]); z = rb_fix2int(argv[2]); value = rb_fix2int(argv[3]); + break; } diff --git a/binding-mruby/binding-mruby.cpp b/binding-mruby/binding-mruby.cpp index cac342a..31e9b85 100644 --- a/binding-mruby/binding-mruby.cpp +++ b/binding-mruby/binding-mruby.cpp @@ -332,6 +332,7 @@ runRMXPScripts(mrb_state *mrb, mrbc_context *ctx) i, RSTRING_PTR(scriptName)); showError(buffer); + break; } diff --git a/binding-mruby/mrb-ext/file.cpp b/binding-mruby/mrb-ext/file.cpp index a9b937e..845817e 100644 --- a/binding-mruby/mrb-ext/file.cpp +++ b/binding-mruby/mrb-ext/file.cpp @@ -347,6 +347,7 @@ MRB_METHOD(fileEachLine) while (feof(f) == 0) { GUARD_ERRNO( readLine(f, buffer); ) + if (buffer.empty() && feof(f) != 0) break; @@ -373,6 +374,7 @@ MRB_METHOD(fileEachByte) while (feof(f) == 0) { mrb_int byte = fgetc(f); + if (byte == -1) break; @@ -473,6 +475,7 @@ MRB_METHOD(fileReadLines) while (feof(f) == 0) { GUARD_ERRNO( readLine(f, buffer); ) + if (buffer.empty() && feof(f) != 0) break; diff --git a/binding-mruby/mrb-ext/marshal.cpp b/binding-mruby/mrb-ext/marshal.cpp index 378813a..385a22f 100644 --- a/binding-mruby/mrb-ext/marshal.cpp +++ b/binding-mruby/mrb-ext/marshal.cpp @@ -793,23 +793,27 @@ write_value(MarshalContext *ctx, mrb_value value) ctx->writeByte(TYPE_FALSE); else ctx->writeByte(TYPE_NIL); + break; case MRB_TT_FIXNUM : ctx->writeByte(TYPE_FIXNUM); write_fixnum(ctx, mrb_fixnum(value)); + break; case MRB_TT_FLOAT : ctx->writeByte(TYPE_FLOAT); write_float(ctx, mrb_float(value)); ctx->objects.add(value); + break; case MRB_TT_STRING : ctx->objects.add(value); ctx->writeByte(TYPE_STRING); write_string_value(ctx, value); + break; case MRB_TT_ARRAY : diff --git a/binding-mruby/table-binding.cpp b/binding-mruby/table-binding.cpp index 0419672..e81bd17 100644 --- a/binding-mruby/table-binding.cpp +++ b/binding-mruby/table-binding.cpp @@ -118,17 +118,20 @@ MRB_METHOD(tableSetAt) case 2 : x = fix(argv[0]); value = fix(argv[1]); + break; case 3 : x = fix(argv[0]); y = fix(argv[1]); value = fix(argv[2]); + break; case 4 : x = fix(argv[0]); y = fix(argv[1]); z = fix(argv[2]); value = fix(argv[3]); + break; } diff --git a/src/audio.cpp b/src/audio.cpp index 5ed65d9..2d64e0c 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -1287,6 +1287,7 @@ struct AudioStream throw e; } } + break; } diff --git a/src/eventthread.cpp b/src/eventthread.cpp index 4617cb0..d2bd6f8 100644 --- a/src/eventthread.cpp +++ b/src/eventthread.cpp @@ -113,26 +113,31 @@ void EventThread::process(RGSSThreadData &rtData) case SDL_WINDOWEVENT_ENTER : cursorInWindow = true; updateCursorState(cursorInWindow && windowFocused); + break; case SDL_WINDOWEVENT_LEAVE : cursorInWindow = false; updateCursorState(cursorInWindow && windowFocused); + break; case SDL_WINDOWEVENT_CLOSE : terminate = true; + break; case SDL_WINDOWEVENT_FOCUS_GAINED : windowFocused = true; updateCursorState(cursorInWindow && windowFocused); + break; case SDL_WINDOWEVENT_FOCUS_LOST : windowFocused = false; updateCursorState(cursorInWindow && windowFocused); resetInputStates(); + break; } break; @@ -141,6 +146,7 @@ void EventThread::process(RGSSThreadData &rtData) case REQUEST_TERMINATION : terminate = true; Debug() << "EventThread termination requested"; + break; case SDL_KEYDOWN : @@ -175,6 +181,7 @@ void EventThread::process(RGSSThreadData &rtData) strncpy(pendingTitle, rtData.config.game.title.c_str(), sizeof(pendingTitle)); havePendingTitle = true; + break; } @@ -204,11 +211,13 @@ void EventThread::process(RGSSThreadData &rtData) (const char*) event.user.data1, win); free(event.user.data1); msgBoxDone = true; + break; case REQUEST_SETCURSORVISIBLE : showCursor = event.user.code; updateCursorState(cursorInWindow); + break; case UPDATE_FPS : @@ -224,6 +233,7 @@ void EventThread::process(RGSSThreadData &rtData) { strncpy(pendingTitle, buffer, sizeof(pendingTitle)); havePendingTitle = true; + break; } @@ -272,6 +282,7 @@ void EventThread::process(RGSSThreadData &rtData) case SDL_MOUSEMOTION : mouseState.x = event.motion.x; mouseState.y = event.motion.y; + break; } diff --git a/src/filesystem.cpp b/src/filesystem.cpp index cb59bcd..59459e9 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -316,6 +316,7 @@ RGSS_openArchive(PHYSFS_Io *io, const char *, int forWrite) /* Read filename length, * if nothing was read, no files remain */ uint32_t nameLen; + if (!readUint32(io, nameLen)) break; diff --git a/src/tilemap.cpp b/src/tilemap.cpp index cb87df0..e6b7fd1 100644 --- a/src/tilemap.cpp +++ b/src/tilemap.cpp @@ -874,7 +874,7 @@ struct TilemapPrivate continue; VBO::uploadSubData(k*quadDataSize(bufferFrameQuadCount) + quadDataSize(scanrowBases[i]), - quadDataSize(scanrowSize(i)), &scanrowVert[i].v[k][0]); + quadDataSize(scanrowSize(i)), &scanrowVert[i].v[k][0]); } }