From 33c1f18d3871fc756f381d1a3aee1fdac2ff077e Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 3 Jun 2008 20:47:41 +0000 Subject: Fix a few things picked up by the Compaq C Compiler (on my Alpha) git-svn-id: svn://mattst88.com/svn/glpong/trunk@16 449aeecc-241a-0410-943f-e2f883e2d7a2 --- Makefile | 2 +- ball.c | 6 +++--- ball.h | 4 ++-- fps.c | 5 ++--- fps.h | 6 ++++-- glpong.c | 4 ++-- glpong.h | 1 + text.c | 4 ++-- text.h | 4 ++-- 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 5de936c..c809dfc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CC=gcc STRIP=strip -WARN=-Wall -W -ansi -pedantic +WARN=-Wall -W -pedantic DEFINES=-DINLINE=__inline__ -DDEBUG=1 CFLAGS=-Os -pipe -std=c99 -g ${DEFINES} ${WARN} LDFLAGS=-Wl,-O1 diff --git a/ball.c b/ball.c index 914804c..1ae80fe 100644 --- a/ball.c +++ b/ball.c @@ -3,8 +3,8 @@ #include "SDL.h" #include "SDL_opengl.h" -#include "glpong.h" #include "ball.h" +#include "glpong.h" static GLuint ball; static GLfloat ball_width; @@ -22,7 +22,7 @@ length(Ball_t * balls) { #endif void -GLPong_BallInit() { +GLPong_BallInit(void) { ball_width = 20.0f; ball_height = 20.0f; @@ -38,7 +38,7 @@ GLPong_BallInit() { } void -GLPong_BallDeinit() { +GLPong_BallDeinit(void) { glDeleteLists(ball, 1); } diff --git a/ball.h b/ball.h index db3ee12..2ff0221 100644 --- a/ball.h +++ b/ball.h @@ -13,8 +13,8 @@ typedef struct Ball_t { GLubyte r, g, b, a; /* red, green, blue, alpha components; 1 byte ea. */ } Ball_t; -void GLPong_BallInit(); -void GLPong_BallDeinit(); +void GLPong_BallInit(void); +void GLPong_BallDeinit(void); void GLPong_BallAdd(Ball_t ** balls); void GLPong_BallDelete(Ball_t * from, Ball_t * ball); void GLPong_BallDeleteAll(Ball_t * list); diff --git a/fps.c b/fps.c index ca2787a..307a4c3 100644 --- a/fps.c +++ b/fps.c @@ -3,19 +3,18 @@ #include "SDL.h" #include "SDL_opengl.h" -#include "text.h" #include "fps.h" static clock_t start; static GLfloat fps; void -GLPong_FPSInit() { +GLPong_FPSInit(void) { start = SDL_GetTicks(); } INLINE GLfloat -GLPong_FPSCount() { +GLPong_FPSCount(void) { /* 10.0f is the number of frames we let draw before calculating FPS */ fps = 10.0f / (SDL_GetTicks() - start) * 1000; /* 1 sec / 1 millisec == 1000 */ start = SDL_GetTicks(); diff --git a/fps.h b/fps.h index ef16ed8..1f0008c 100644 --- a/fps.h +++ b/fps.h @@ -1,8 +1,10 @@ #ifndef FPS_H #define FPS_H -void GLPong_FPSInit(); -INLINE GLfloat GLPong_FPSCount(); +#include "glpong.h" + +void GLPong_FPSInit(void); +INLINE GLfloat GLPong_FPSCount(void); #endif diff --git a/glpong.c b/glpong.c index a7c7c7e..921420a 100644 --- a/glpong.c +++ b/glpong.c @@ -13,7 +13,7 @@ static int GLPong_Init(GLPong_t * GLPong); static void GLPong_Deinit(GLPong_t * GLPong); -static int GLPong_HandleEvents(); +static int GLPong_HandleEvents(void); static INLINE unsigned int NextPow2(unsigned int value); static GLuint SDL_GL_SurfaceToTexture(SDL_Surface * surface); static GLuint SDL_GL_NPOTSurfaceToTexture(SDL_Surface * surface, GLfloat * wratio, GLfloat * hratio); @@ -160,7 +160,7 @@ GLPong_Deinit(GLPong_t * GLPong) { } static int -GLPong_HandleEvents() { +GLPong_HandleEvents(void) { SDL_Event Event; if (SDL_PollEvent(&Event) != 0) { diff --git a/glpong.h b/glpong.h index 6bbde04..b665ffa 100644 --- a/glpong.h +++ b/glpong.h @@ -35,3 +35,4 @@ typedef struct { } GLPong_t; #endif + diff --git a/text.c b/text.c index 06254c3..60d6e4c 100644 --- a/text.c +++ b/text.c @@ -7,7 +7,7 @@ static GLuint font; int -GLPong_TextInit() { +GLPong_TextInit(void) { #ifdef DEBUG int count, i; #endif @@ -42,7 +42,7 @@ GLPong_TextInit() { } void -GLPong_TextDeinit() { +GLPong_TextDeinit(void) { glcDeleteFont(font); } diff --git a/text.h b/text.h index 456fb8b..8891fc7 100644 --- a/text.h +++ b/text.h @@ -1,8 +1,8 @@ #ifndef TEXT_H #define TEXT_H -int GLPong_TextInit(); -void GLPong_TextDeinit(); +int GLPong_TextInit(void); +void GLPong_TextDeinit(void); void GLPong_TextDrawFPS(GLfloat fps); #endif -- cgit v1.2.3