diff --git a/log.txt b/log.txt new file mode 100644 index 0000000..1a4bcc2 --- /dev/null +++ b/log.txt @@ -0,0 +1,78 @@ +binding-mri/audioplayback-binding.cpp:71:29: error: Uninitialized variable: c_str [uninitvar] + rb_get_args(argc, argv, c_str RB_ARG_END); + ^ +binding-mri/audioplayback-binding.cpp:80:29: error: Uninitialized variable: c_str [uninitvar] + rb_get_args(argc, argv, c_str RB_ARG_END); + ^ +binding-mri/modloader-binding.cpp:12:43: performance: Function parameter 'vec' should be passed by const reference. [passedByValue] +VALUE meow(const std::vector vec){ + ^ +src/global-ibo.h:41:3: performance: Variable 'ibo' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] + ibo = IBO::gen(); + ^ +src/quadarray.h:49:3: performance: Variable 'vbo' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] + vbo = VBO::gen(); + ^ +src/etc.h:208:71: performance: Function parameter 'color' should be passed by const reference. [passedByValue] + LightSource(float x, float y, float power, float radius, const Color color) + ^ +src/config.cpp:40:13: performance: Range variable 'item' should be declared as const reference. [iterateByValue] + for (auto item : vec){ + ^ +src/define.h:19:3: error: Failed to parse #define, bad macro syntax [syntaxError] + #define 3ds 1 + ^ +src/filesystem.cpp:319:3: performance: Variable 'nfd2nfc' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] + nfd2nfc = iconv_open("utf-8", "utf-8-mac"); + ^ +src/font.cpp:359:37: performance: Passing the result of c_str() to a function that takes std::string as argument no. 1 is slow and redundant. [stlcstrParam] + p->sdlFont = shState->fontState().getFont(p->name.c_str(), p->size); + ^ +src/keybindings.cpp:267:3: error: Resource leak: f [resourceLeak] + return false; + ^ +src/keybindings.cpp:270:3: error: Resource leak: f [resourceLeak] + return false; + ^ +src/lightmap.cpp:199:55: performance: Function parameter 'source' should be passed by const reference. [passedByValue] +void LightMap::addStaticLightSource(const LightSource source){ + ^ +src/lightmap.cpp:202:56: performance: Function parameter 'source' should be passed by const reference. [passedByValue] +void LightMap::addDynamicLightSource(const LightSource source){ + ^ +src/modloader.cpp:27:52: performance: Function parameter 'data' should be passed by const reference. [passedByValue] +static void modloader_add_to_log(const std::string data){ + ^ +src/pipe.h:22:3: performance: Variable 'handle' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] + handle = NULL; + ^ +src/shader.cpp:92:2: performance: Variable 'vertShader' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] + vertShader = gl.CreateShader(GL_VERTEX_SHADER); + ^ +src/sound/audioplayback.cpp:174:12: error: Reference to temporary returned. [returnTempReference] + return ""; + ^ +src/sound/audioplayback.cpp:132:46: performance: Function parameter 'tagName' should be passed by const reference. [passedByValue] +void AudioPlayback::addTag(const std::string tagName) { + ^ +src/sound/audioplayback.cpp:138:49: performance: Function parameter 'tagName' should be passed by const reference. [passedByValue] +void AudioPlayback::removeTag(const std::string tagName) { + ^ +journal/SDL/debugwriter.h:35:1: error: The one definition rule is violated, different classes/structs have the same name 'Debug' [ctuOneDefinitionRuleViolation] +class Debug{ +^ +src/debugwriter.h:39:1: note: The one definition rule is violated, different classes/structs have the same name 'Debug' +class Debug{ +^ +journal/SDL/debugwriter.h:35:1: note: The one definition rule is violated, different classes/structs have the same name 'Debug' +class Debug{ +^ +src/input.cpp:49:1: error: The one definition rule is violated, different classes/structs have the same name 'KbBindingData' [ctuOneDefinitionRuleViolation] +struct KbBindingData{ +^ +src/keybindings.cpp:29:1: note: The one definition rule is violated, different classes/structs have the same name 'KbBindingData' +struct KbBindingData{ +^ +src/input.cpp:49:1: note: The one definition rule is violated, different classes/structs have the same name 'KbBindingData' +struct KbBindingData{ +^ diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 4d279bc..d83fc43 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -984,7 +984,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align){ outline = TTF_RenderText_Blended(font, str, SDL_strlen(str), co); p->ensureFormat(outline, SDL_PIXELFORMAT_ABGR8888); - SDL_Rect outRect = {OUTLINE_SIZE, OUTLINE_SIZE, txtSurf->w, txtSurf->h}; + SDL_Rect outRect = {OUTLINE_SIZE, OUTLINE_SIZE, txtSurf->w, txtSurf->h}; SDL_SetSurfaceBlendMode(txtSurf, SDL_BLENDMODE_BLEND); SDL_BlitSurface(txtSurf, NULL, outline, &outRect); @@ -1201,19 +1201,19 @@ IntRect Bitmap::textSize(const char *str){ DEF_ATTR_RD_SIMPLE(Bitmap, Font, Font&, *p->font) -void Bitmap::setFont(Font &value){ +void Bitmap::setFont(Font &value) { *p->font = value; } -void Bitmap::setInitFont(Font *value){ +void Bitmap::setInitFont(Font *value) noexcept { p->font = value; } -TEXFBO &Bitmap::getGLTypes(){ +TEXFBO &Bitmap::getGLTypes() { return p->gl; } -SDL_Surface *Bitmap::megaSurface() const{ +SDL_Surface *Bitmap::megaSurface() const { return p->megaSurface; } diff --git a/src/bitmap.h b/src/bitmap.h index 02f2dff..e2eb175 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -94,7 +94,7 @@ public: /* Sets initial reference without copying by value, * use at construction */ - void setInitFont(Font *value); + void setInitFont(Font *value) noexcept; /* */ TEXFBO &getGLTypes(); diff --git a/src/boost-hash.h b/src/boost-hash.h index 244ad9d..f2dcdd9 100644 --- a/src/boost-hash.h +++ b/src/boost-hash.h @@ -46,11 +46,11 @@ public: return (iter != p.cend()); } - inline void insert(const K &key, const V &value){ + inline void insert(const K &key, const V &value) noexcept { p.insert(PairType(key, value)); } - inline void remove(const K &key){ + inline void remove(const K &key) noexcept { p.erase(key); } @@ -72,15 +72,15 @@ public: return iter->second; } - inline V &operator[](const K &key){ + inline V &operator[](const K &key) noexcept { return p[key]; } - inline const_iterator cbegin() const{ + inline const_iterator cbegin() const noexcept{ return p.cbegin(); } - inline const_iterator cend() const{ + inline const_iterator cend() const noexcept { return p.cend(); } }; @@ -100,19 +100,19 @@ public: return (iter != p.cend()); } - inline void insert(const K &key){ + inline void insert(const K &key) noexcept { p.insert(key); } - inline void remove(const K &key){ + inline void remove(const K &key) noexcept{ p.erase(key); } - inline const_iterator cbegin() const{ + inline const_iterator cbegin() const noexcept{ return p.cbegin(); } - inline const_iterator cend() const{ + inline const_iterator cend() const noexcept{ return p.cend(); } }; diff --git a/src/debugwriter.h b/src/debugwriter.h index 897b5c3..6ed39d7 100644 --- a/src/debugwriter.h +++ b/src/debugwriter.h @@ -38,7 +38,7 @@ class Debug{ public: - explicit Debug(){ + Debug() noexcept { buf << std::boolalpha; } diff --git a/src/disposable.h b/src/disposable.h index f05bc05..a1c008b 100644 --- a/src/disposable.h +++ b/src/disposable.h @@ -33,14 +33,11 @@ class Disposable{ public: - Disposable() - : disposed(false), - link(this) - { + Disposable() : disposed(false), link(this){ shState->graphics().addDisposable(this); } - virtual ~Disposable(){ + virtual ~Disposable() noexcept { shState->graphics().remDisposable(this); } @@ -53,7 +50,7 @@ public: wasDisposed(); } - bool isDisposed() const{ + bool isDisposed() const noexcept { return disposed; } diff --git a/src/etc-internal.h b/src/etc-internal.h index d7d6d00..5a09eba 100644 --- a/src/etc-internal.h +++ b/src/etc-internal.h @@ -273,7 +273,7 @@ struct NormValue{ return unNorm == clamp(value, 0, 255); } - operator int() const{ + operator int() const noexcept { return unNorm; } }; diff --git a/src/etc.cpp b/src/etc.cpp index 127457b..0e06aed 100644 --- a/src/etc.cpp +++ b/src/etc.cpp @@ -87,7 +87,7 @@ void Color::setAlpha(double value){ } /* Serializable */ -int Color::serialSize() const{ +int Color::serialSize() const noexcept { return 4 * 8; } @@ -206,7 +206,7 @@ void Tone::setGray(double value){ } /* Serializable */ -int Tone::serialSize() const{ +int Tone::serialSize() const noexcept{ return 4 * 8; } @@ -337,7 +337,7 @@ void Rect::setHeight(int value){ valueChanged(); } -int Rect::serialSize() const{ +int Rect::serialSize() const noexcept { return 4 * 4; } diff --git a/src/etc.h b/src/etc.h index 6059016..1281641 100644 --- a/src/etc.h +++ b/src/etc.h @@ -65,7 +65,7 @@ struct Color : public Serializable{ double getAlpha() const { return alpha; } /* Serializable */ - int serialSize() const; + int serialSize() const noexcept ; void serialize(char *buffer) const; static Color *deserialize(const char *data, int len); @@ -115,7 +115,7 @@ struct Tone : public Serializable{ double getGray() const { return gray; } /* Serializable */ - int serialSize() const; + int serialSize() const noexcept; void serialize(char *buffer) const; static Tone *deserialize(const char *data, int len); @@ -172,7 +172,7 @@ struct Rect : public Serializable{ int getHeight() const { return height; } /* Serializable */ - int serialSize() const; + int serialSize() const noexcept; void serialize(char *buffer) const; static Rect *deserialize(const char *data, int len); diff --git a/src/intrulist.h b/src/intrulist.h index 09b59f8..72f154e 100644 --- a/src/intrulist.h +++ b/src/intrulist.h @@ -98,7 +98,7 @@ public: size--; } - void clear(){ + void clear() noexcept { remove(root); root.prev = &root; root.next = &root; @@ -114,19 +114,19 @@ public: return node->data; } - IntruListLink *begin(){ + IntruListLink *begin() noexcept { return root.next; } - IntruListLink *end(){ + IntruListLink *end() noexcept { return &root; } - bool isEmpty() const{ + bool isEmpty() const noexcept { return root.next == &root; } - int getSize() const{ + int getSize() const noexcept { return size; } }; diff --git a/src/quadarray.h b/src/quadarray.h index 628fc73..204b4fd 100644 --- a/src/quadarray.h +++ b/src/quadarray.h @@ -106,7 +106,7 @@ struct QuadArray{ draw(0, quadCount); } - size_t count() const{ + size_t count() const noexcept { return quadCount; } }; diff --git a/src/sdl-util.h b/src/sdl-util.h index 08d61f5..c25b14a 100644 --- a/src/sdl-util.h +++ b/src/sdl-util.h @@ -25,7 +25,7 @@ struct AtomicFlag{ SDL_SetAtomicInt(&atom, 0); } - operator bool() const{ + operator bool() const { return SDL_GetAtomicInt(&atom); } @@ -131,11 +131,11 @@ public: SDL_CloseIO(ops); } - operator bool() const{ + operator bool() const noexcept { return ops != 0; } - std::istream &stream(){ + std::istream &stream() noexcept { return s; } diff --git a/src/sound/audioplayback.cpp b/src/sound/audioplayback.cpp index 2a79694..191875f 100644 --- a/src/sound/audioplayback.cpp +++ b/src/sound/audioplayback.cpp @@ -132,13 +132,13 @@ double AudioPlayback::getLengthNormalized() const { void AudioPlayback::addTag(const std::string tagName) { if (!p_track) return; - + MIX_TagTrack(p_track, tagName.data()); } void AudioPlayback::removeTag(const std::string tagName) { if (!p_track) return; - + MIX_UntagTrack(p_track, tagName.data()); } diff --git a/src/tilemap-common.h b/src/tilemap-common.h index b4a5a5b..30e56b7 100644 --- a/src/tilemap-common.h +++ b/src/tilemap-common.h @@ -113,7 +113,7 @@ struct FlashMap{ dataCon.Disconnect(); } - Table *getData() const{ + Table *getData() const noexcept { return data; } @@ -167,7 +167,7 @@ struct FlashMap{ } private: - void setDirty(){ + void setDirty() noexcept { dirty = true; }