]> Pileus Git - ~andy/sunrise/blob - games-arcade/snake/files/snake-0.5.1-qa-warnings.patch
dc71967682c7f7dc129aff32bfa56b0eaee089b0
[~andy/sunrise] / games-arcade / snake / files / snake-0.5.1-qa-warnings.patch
1  src/config.cpp |   12 +++++++-----
2  src/config.h   |   10 +++++-----
3  src/snake.cpp  |    2 +-
4  3 files changed, 13 insertions(+), 11 deletions(-)
5
6 diff --git a/src/config.cpp b/src/config.cpp
7 index 815414b..cb66599 100644
8 --- a/src/config.cpp
9 +++ b/src/config.cpp
10 @@ -153,17 +153,19 @@ void config::save()
11         configfile.close();
12  }
13  
14 -const unsigned int config::get_feldbreite() const
15 +/* In this case a copy of an unsigned int is returned and not a reference or a pointer
16 + * so no side effect (so "const unsigned int" doesn't make sense) */
17 +unsigned int config::get_feldbreite() const
18  {
19                 return feldbreite;
20  }
21  
22 -const unsigned int config::get_feldhohe() const
23 +unsigned int config::get_feldhohe() const
24  {
25                 return feldhohe;
26  }
27  
28 -const unsigned int config::get_feldgrose() const
29 +unsigned int config::get_feldgrose() const
30  {
31         return feldbreite * feldhohe;
32  }
33 @@ -173,7 +175,7 @@ const std::string & config::get_datapath() const
34         return datapath;
35  }
36  
37 -const unsigned int config::get_quadsize() const
38 +unsigned int config::get_quadsize() const
39  {
40         return quadsize;
41  }
42 @@ -188,7 +190,7 @@ const std::string & config::get_version() const
43         return version;
44  }
45  
46 -const unsigned int config::get_maxplayer() const
47 +unsigned int config::get_maxplayer() const
48  {
49         return maxplayer;
50  }
51 diff --git a/src/config.h b/src/config.h
52 index 71bb76e..4a93c83 100644
53 --- a/src/config.h
54 +++ b/src/config.h
55 @@ -37,13 +37,13 @@ class config
56  public:
57         config();
58         ~config();
59 -       const unsigned int get_feldbreite() const; //const für den Rückgabetyp entfernen (gcc 4 ungrad warnt)
60 -       const unsigned int get_feldhohe() const;
61 -       const unsigned int get_feldgrose() const;
62 +       unsigned int get_feldbreite() const; //const für den Rückgabetyp entfernen (gcc 4 ungrad warnt)
63 +       unsigned int get_feldhohe() const;
64 +       unsigned int get_feldgrose() const;
65         const std::string & get_datapath() const; 
66 -       const unsigned int get_quadsize() const;
67 +       unsigned int get_quadsize() const;
68         const std::string & get_version() const;
69 -       const unsigned int get_maxplayer() const;
70 +       unsigned int get_maxplayer() const;
71         config_player *get_player(int);  // Variablenname
72         std::string get_filepath(std::string);
73         void save(); // hier const
74 diff --git a/src/snake.cpp b/src/snake.cpp
75 index d7d3f91..d930a30 100644
76 --- a/src/snake.cpp
77 +++ b/src/snake.cpp
78 @@ -174,7 +174,7 @@ int snake::step()
79                                 SDL_Surface *font_src = 0;\r
80                                 char titel[256];\r
81                                 sprintf(titel, "Punkte: %d", punkte);\r
82 -                               SDL_Color color = {255,255,255};\r
83 +                               SDL_Color color = {255,255,255, 255};\r
84                                 font_src = TTF_RenderText_Solid(pFont, titel, color);  // hat irgendwie ein bug\r
85                                 // font_src = TTF_RenderText_Blended(pFont, titel, color);  // drum den workaround\r
86                                 if (font_src == 0)\r