noexcept
This commit is contained in:
parent
3b55b4ecfb
commit
7d0e52a27f
|
|
@ -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<std::string> 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{
|
||||||
|
^
|
||||||
|
|
@ -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);
|
outline = TTF_RenderText_Blended(font, str, SDL_strlen(str), co);
|
||||||
|
|
||||||
p->ensureFormat(outline, SDL_PIXELFORMAT_ABGR8888);
|
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_SetSurfaceBlendMode(txtSurf, SDL_BLENDMODE_BLEND);
|
||||||
SDL_BlitSurface(txtSurf, NULL, outline, &outRect);
|
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)
|
DEF_ATTR_RD_SIMPLE(Bitmap, Font, Font&, *p->font)
|
||||||
|
|
||||||
void Bitmap::setFont(Font &value){
|
void Bitmap::setFont(Font &value) {
|
||||||
*p->font = value;
|
*p->font = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bitmap::setInitFont(Font *value){
|
void Bitmap::setInitFont(Font *value) noexcept {
|
||||||
p->font = value;
|
p->font = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEXFBO &Bitmap::getGLTypes(){
|
TEXFBO &Bitmap::getGLTypes() {
|
||||||
return p->gl;
|
return p->gl;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Surface *Bitmap::megaSurface() const{
|
SDL_Surface *Bitmap::megaSurface() const {
|
||||||
return p->megaSurface;
|
return p->megaSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ public:
|
||||||
|
|
||||||
/* Sets initial reference without copying by value,
|
/* Sets initial reference without copying by value,
|
||||||
* use at construction */
|
* use at construction */
|
||||||
void setInitFont(Font *value);
|
void setInitFont(Font *value) noexcept;
|
||||||
|
|
||||||
/* <internal> */
|
/* <internal> */
|
||||||
TEXFBO &getGLTypes();
|
TEXFBO &getGLTypes();
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,11 @@ public:
|
||||||
return (iter != p.cend());
|
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));
|
p.insert(PairType(key, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void remove(const K &key){
|
inline void remove(const K &key) noexcept {
|
||||||
p.erase(key);
|
p.erase(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,15 +72,15 @@ public:
|
||||||
return iter->second;
|
return iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline V &operator[](const K &key){
|
inline V &operator[](const K &key) noexcept {
|
||||||
return p[key];
|
return p[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_iterator cbegin() const{
|
inline const_iterator cbegin() const noexcept{
|
||||||
return p.cbegin();
|
return p.cbegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_iterator cend() const{
|
inline const_iterator cend() const noexcept {
|
||||||
return p.cend();
|
return p.cend();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -100,19 +100,19 @@ public:
|
||||||
return (iter != p.cend());
|
return (iter != p.cend());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void insert(const K &key){
|
inline void insert(const K &key) noexcept {
|
||||||
p.insert(key);
|
p.insert(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void remove(const K &key){
|
inline void remove(const K &key) noexcept{
|
||||||
p.erase(key);
|
p.erase(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_iterator cbegin() const{
|
inline const_iterator cbegin() const noexcept{
|
||||||
return p.cbegin();
|
return p.cbegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_iterator cend() const{
|
inline const_iterator cend() const noexcept{
|
||||||
return p.cend();
|
return p.cend();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
class Debug{
|
class Debug{
|
||||||
public:
|
public:
|
||||||
explicit Debug(){
|
Debug() noexcept {
|
||||||
buf << std::boolalpha;
|
buf << std::boolalpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,11 @@
|
||||||
|
|
||||||
class Disposable{
|
class Disposable{
|
||||||
public:
|
public:
|
||||||
Disposable()
|
Disposable() : disposed(false), link(this){
|
||||||
: disposed(false),
|
|
||||||
link(this)
|
|
||||||
{
|
|
||||||
shState->graphics().addDisposable(this);
|
shState->graphics().addDisposable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Disposable(){
|
virtual ~Disposable() noexcept {
|
||||||
shState->graphics().remDisposable(this);
|
shState->graphics().remDisposable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +50,7 @@ public:
|
||||||
wasDisposed();
|
wasDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDisposed() const{
|
bool isDisposed() const noexcept {
|
||||||
return disposed;
|
return disposed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,7 @@ struct NormValue{
|
||||||
return unNorm == clamp(value, 0, 255);
|
return unNorm == clamp(value, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
operator int() const{
|
operator int() const noexcept {
|
||||||
return unNorm;
|
return unNorm;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ void Color::setAlpha(double value){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Serializable */
|
/* Serializable */
|
||||||
int Color::serialSize() const{
|
int Color::serialSize() const noexcept {
|
||||||
return 4 * 8;
|
return 4 * 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,7 +206,7 @@ void Tone::setGray(double value){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Serializable */
|
/* Serializable */
|
||||||
int Tone::serialSize() const{
|
int Tone::serialSize() const noexcept{
|
||||||
return 4 * 8;
|
return 4 * 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -337,7 +337,7 @@ void Rect::setHeight(int value){
|
||||||
valueChanged();
|
valueChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Rect::serialSize() const{
|
int Rect::serialSize() const noexcept {
|
||||||
return 4 * 4;
|
return 4 * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ struct Color : public Serializable{
|
||||||
double getAlpha() const { return alpha; }
|
double getAlpha() const { return alpha; }
|
||||||
|
|
||||||
/* Serializable */
|
/* Serializable */
|
||||||
int serialSize() const;
|
int serialSize() const noexcept ;
|
||||||
void serialize(char *buffer) const;
|
void serialize(char *buffer) const;
|
||||||
static Color *deserialize(const char *data, int len);
|
static Color *deserialize(const char *data, int len);
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ struct Tone : public Serializable{
|
||||||
double getGray() const { return gray; }
|
double getGray() const { return gray; }
|
||||||
|
|
||||||
/* Serializable */
|
/* Serializable */
|
||||||
int serialSize() const;
|
int serialSize() const noexcept;
|
||||||
void serialize(char *buffer) const;
|
void serialize(char *buffer) const;
|
||||||
static Tone *deserialize(const char *data, int len);
|
static Tone *deserialize(const char *data, int len);
|
||||||
|
|
||||||
|
|
@ -172,7 +172,7 @@ struct Rect : public Serializable{
|
||||||
int getHeight() const { return height; }
|
int getHeight() const { return height; }
|
||||||
|
|
||||||
/* Serializable */
|
/* Serializable */
|
||||||
int serialSize() const;
|
int serialSize() const noexcept;
|
||||||
void serialize(char *buffer) const;
|
void serialize(char *buffer) const;
|
||||||
static Rect *deserialize(const char *data, int len);
|
static Rect *deserialize(const char *data, int len);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ public:
|
||||||
size--;
|
size--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear(){
|
void clear() noexcept {
|
||||||
remove(root);
|
remove(root);
|
||||||
root.prev = &root;
|
root.prev = &root;
|
||||||
root.next = &root;
|
root.next = &root;
|
||||||
|
|
@ -114,19 +114,19 @@ public:
|
||||||
return node->data;
|
return node->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntruListLink<T> *begin(){
|
IntruListLink<T> *begin() noexcept {
|
||||||
return root.next;
|
return root.next;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntruListLink<T> *end(){
|
IntruListLink<T> *end() noexcept {
|
||||||
return &root;
|
return &root;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isEmpty() const{
|
bool isEmpty() const noexcept {
|
||||||
return root.next == &root;
|
return root.next == &root;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getSize() const{
|
int getSize() const noexcept {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ struct QuadArray{
|
||||||
draw(0, quadCount);
|
draw(0, quadCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t count() const{
|
size_t count() const noexcept {
|
||||||
return quadCount;
|
return quadCount;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ struct AtomicFlag{
|
||||||
SDL_SetAtomicInt(&atom, 0);
|
SDL_SetAtomicInt(&atom, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
operator bool() const{
|
operator bool() const {
|
||||||
return SDL_GetAtomicInt(&atom);
|
return SDL_GetAtomicInt(&atom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,11 +131,11 @@ public:
|
||||||
SDL_CloseIO(ops);
|
SDL_CloseIO(ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
operator bool() const{
|
operator bool() const noexcept {
|
||||||
return ops != 0;
|
return ops != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::istream &stream(){
|
std::istream &stream() noexcept {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,13 +132,13 @@ double AudioPlayback::getLengthNormalized() const {
|
||||||
void AudioPlayback::addTag(const std::string tagName) {
|
void AudioPlayback::addTag(const std::string tagName) {
|
||||||
if (!p_track)
|
if (!p_track)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MIX_TagTrack(p_track, tagName.data());
|
MIX_TagTrack(p_track, tagName.data());
|
||||||
}
|
}
|
||||||
void AudioPlayback::removeTag(const std::string tagName) {
|
void AudioPlayback::removeTag(const std::string tagName) {
|
||||||
if (!p_track)
|
if (!p_track)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MIX_UntagTrack(p_track, tagName.data());
|
MIX_UntagTrack(p_track, tagName.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ struct FlashMap{
|
||||||
dataCon.Disconnect();
|
dataCon.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
Table *getData() const{
|
Table *getData() const noexcept {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,7 +167,7 @@ struct FlashMap{
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setDirty(){
|
void setDirty() noexcept {
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue