Skip to content

Commit

Permalink
Merge pull request #7 from hartwork/fix-compile-warnings
Browse files Browse the repository at this point in the history
Address G++ compile warnings
  • Loading branch information
mpcomplete committed Oct 4, 2015
2 parents 3f1227b + a6837b0 commit 1ba049e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions libgfx/src/raster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ FloatRaster::FloatRaster(const FloatRaster &img)



static char *img_names[] = {"PPM", "PNG", "TIFF", "JPEG"};
static char *img_ext[] = {"ppm", "png", "tif", "jpg"};
static const char *img_names[] = {"PPM", "PNG", "TIFF", "JPEG"};
static const char *img_ext[] = {"ppm", "png", "tif", "jpg"};

const char *image_type_name(int type)
{ return type>=IMG_LIMIT ? NULL : img_names[type]; }
Expand Down
4 changes: 0 additions & 4 deletions src/canvas_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ int CanvasBase::loop()
int remain, ret;
last_tick = get_ms();

int first_tick = get_ms();

while (true) {
if ((remain = tick()) > 0) // time left till tick: sleep
delay(remain);
if ((ret = handle_events()) > 0) // wants us to quit
return ret;
// if (last_tick - first_tick > 10000)
// return ret;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/canvas_sdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using namespace std;

CanvasSDL::CanvasSDL(Scene *s, bool fs, int m, char *t, char *c)
CanvasSDL::CanvasSDL(Scene *s, bool fs, int m, const char *t, const char *c)
: CanvasBase(s, fs, m), wm_title(t), wm_class(c)
{
surface = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/canvas_sdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
class CanvasSDL : public CanvasBase {
protected:
SDL_Surface *surface;
char *wm_title;
char *wm_class;
const char *wm_title;
const char *wm_class;

// create the window (either SDL or GLX)
virtual int create_window();
public:
CanvasSDL(Scene *s, bool full_screen, int mspf, char *wm_title, char *wm_class);
CanvasSDL(Scene *s, bool full_screen, int mspf, const char *wm_title, const char *wm_class);
virtual ~CanvasSDL() {}

// resize the viewport and apply frustum transformation
Expand Down
4 changes: 2 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
CanvasBase *canvas;
Scene scene;

enum {CANVAS_SDL, CANVAS_GLX} canvas_type = CANVAS_SDL;
static enum {CANVAS_SDL, CANVAS_GLX} canvas_type = CANVAS_SDL;
int window_id = 0;
int mspf = 1000/30;
bool full_screen = false;
Expand Down Expand Up @@ -187,7 +187,7 @@ int argp_parse(struct argp *argp_s, int argc, char *argv[], int, int *, void *)
#define OPT_FPS 2
#define OPT_FASTFORWARD 3

char *mode_help =
const char * const mode_help =
"\n"
"Per-swarm modes and their default probabilities:\n"
" 1: normal p=20\n"
Expand Down
11 changes: 10 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#ifndef _MAIN_H
#define _MAIN_H

#include "../config.h"

#include <gfx/config.h> // libgfx is retarded

// Suppress re-definition warnings
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION

#include "../config.h"

#include <GL/gl.h>

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion src/vroot.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ VirtualRootWindowOfScreen(screen) Screen *screen;
if (screen != save_screen) {
Display *dpy = DisplayOfScreen(screen);
Atom __SWM_VROOT = None;
int i;
unsigned int i;
Window rootReturn, parentReturn, *children;
unsigned int numChildren;

Expand Down

0 comments on commit 1ba049e

Please sign in to comment.