Skip to content

Commit

Permalink
Merge pull request #1512 from turol/extern-common
Browse files Browse the repository at this point in the history
Clean up extern, some common bits
  • Loading branch information
fragglet committed Sep 28, 2022
2 parents c1eab24 + e633e8e commit bbc6c36
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 57 deletions.
8 changes: 8 additions & 0 deletions src/d_loop.h
Expand Up @@ -20,6 +20,8 @@
#define __D_LOOP__

#include "net_defs.h"
#include "m_fixed.h"


// Callback function invoked while waiting for the netgame to start.
// The callback is invoked when new players are ready. The callback
Expand Down Expand Up @@ -84,5 +86,11 @@ boolean D_NonVanillaRecord(boolean conditional, const char *feature);
boolean D_NonVanillaPlayback(boolean conditional, int lumpnum,
const char *feature);

void D_ReceiveTic(ticcmd_t *ticcmds, boolean *playeringame);


extern fixed_t offsetms;


#endif

21 changes: 21 additions & 0 deletions src/deh_defs.h
Expand Up @@ -58,6 +58,27 @@ struct deh_section_s
extern deh_section_t *deh_section_types[];
extern const char *deh_signatures[];

// deh_ammo.c:
extern deh_section_t deh_section_ammo;
// deh_cheat.c:
extern deh_section_t deh_section_cheat;
// deh_frame.c:
extern deh_section_t deh_section_frame;
// deh_misc.c:
extern deh_section_t deh_section_misc;
// deh_ptr.c:
extern deh_section_t deh_section_pointer;
// deh_sound.c
extern deh_section_t deh_section_sound;
// deh_text.c:
extern deh_section_t deh_section_text;
// deh_thing.c:
extern deh_section_t deh_section_thing;
// deh_weapon.c:
extern deh_section_t deh_section_weapon;
// deh_bexstr.c:
extern deh_section_t deh_section_bexstr;


#endif /* #ifndef DEH_DEFS_H */

Expand Down
20 changes: 0 additions & 20 deletions src/doom/deh_doom.c
Expand Up @@ -26,26 +26,6 @@ const char *deh_signatures[] =
NULL
};

// deh_ammo.c:
extern deh_section_t deh_section_ammo;
// deh_cheat.c:
extern deh_section_t deh_section_cheat;
// deh_frame.c:
extern deh_section_t deh_section_frame;
// deh_misc.c:
extern deh_section_t deh_section_misc;
// deh_ptr.c:
extern deh_section_t deh_section_pointer;
// deh_sound.c
extern deh_section_t deh_section_sound;
// deh_text.c:
extern deh_section_t deh_section_text;
// deh_thing.c:
extern deh_section_t deh_section_thing;
// deh_weapon.c:
extern deh_section_t deh_section_weapon;
// deh_bexstr.c:
extern deh_section_t deh_section_bexstr;

//
// List of section types:
Expand Down
1 change: 0 additions & 1 deletion src/doom/m_menu.c
Expand Up @@ -1899,7 +1899,6 @@ void M_StartControlPanel (void)

static void M_DrawOPLDev(void)
{
extern void I_OPL_DevMessages(char *, size_t);
char debug[1024];
char *curr, *p;
int line;
Expand Down
12 changes: 0 additions & 12 deletions src/heretic/deh_htic.c
Expand Up @@ -41,20 +41,8 @@ static const char *hhe_versions[] =

deh_hhe_version_t deh_hhe_version = deh_hhe_1_0;

// deh_ammo.c:
extern deh_section_t deh_section_ammo;
// deh_frame.c:
extern deh_section_t deh_section_frame;
// deh_ptr.c:
extern deh_section_t deh_section_pointer;
// deh_sound.c
extern deh_section_t deh_section_sound;
// deh_htext.c:
extern deh_section_t deh_section_heretic_text;
// deh_thing.c:
extern deh_section_t deh_section_thing;
// deh_weapon.c:
extern deh_section_t deh_section_weapon;

//
// List of section types:
Expand Down
7 changes: 7 additions & 0 deletions src/i_input.h
Expand Up @@ -22,6 +22,9 @@

#include "doomtype.h"

#include "SDL.h"


#define MAX_MOUSE_BUTTONS 8

extern float mouse_acceleration;
Expand All @@ -39,4 +42,8 @@ void I_StartTextInput(int x1, int y1, int x2, int y2);
// (if one is used).
void I_StopTextInput(void);

void I_HandleKeyboardEvent(SDL_Event *sdlevent);
void I_HandleMouseEvent(SDL_Event *sdlevent);


#endif
2 changes: 2 additions & 0 deletions src/i_sound.h
Expand Up @@ -248,6 +248,8 @@ typedef enum {
} opl_driver_ver_t;

void I_SetOPLDriverVer(opl_driver_ver_t ver);
void I_OPL_DevMessages(char *, size_t);


#ifdef _WIN32
extern char *winmm_midi_device;
Expand Down
2 changes: 0 additions & 2 deletions src/i_video.c
Expand Up @@ -415,8 +415,6 @@ static void I_ToggleFullScreen(void)

void I_GetEvent(void)
{
extern void I_HandleKeyboardEvent(SDL_Event *sdlevent);
extern void I_HandleMouseEvent(SDL_Event *sdlevent);
SDL_Event sdlevent;

SDL_PumpEvents();
Expand Down
5 changes: 5 additions & 0 deletions src/i_video.h
Expand Up @@ -95,10 +95,15 @@ extern int integer_scaling;
extern int vga_porch_flash;
extern int force_software_renderer;

extern int png_screenshots;

extern char *window_position;
void I_GetWindowPosition(int *x, int *y, int w, int h);

// Joystic/gamepad hysteresis
extern unsigned int joywait;

extern int usemouse;


#endif
3 changes: 1 addition & 2 deletions src/net_client.c
Expand Up @@ -23,6 +23,7 @@
#include "doomtype.h"
#include "deh_main.h"
#include "deh_str.h"
#include "d_loop.h"
#include "i_system.h"
#include "i_timer.h"
#include "m_argv.h"
Expand All @@ -42,7 +43,6 @@
#include "w_checksum.h"
#include "w_wad.h"

extern void D_ReceiveTic(ticcmd_t *ticcmds, boolean *playeringame);

typedef enum
{
Expand Down Expand Up @@ -99,7 +99,6 @@ typedef struct
net_ticdiff_t cmd;
} net_server_send_t;

extern fixed_t offsetms;

static net_connection_t client_connection;
static net_clientstate_t client_state;
Expand Down
18 changes: 0 additions & 18 deletions src/strife/deh_strife.c
Expand Up @@ -26,24 +26,6 @@ const char *deh_signatures[] =
NULL
};

// deh_ammo.c:
extern deh_section_t deh_section_ammo;
// deh_cheat.c:
extern deh_section_t deh_section_cheat;
// deh_frame.c:
extern deh_section_t deh_section_frame;
// deh_misc.c:
extern deh_section_t deh_section_misc;
// deh_ptr.c:
extern deh_section_t deh_section_pointer;
// deh_sound.c
extern deh_section_t deh_section_sound;
// deh_text.c:
extern deh_section_t deh_section_text;
// deh_thing.c:
extern deh_section_t deh_section_thing;
// deh_weapon.c:
extern deh_section_t deh_section_weapon;

//
// List of section types:
Expand Down
2 changes: 0 additions & 2 deletions src/v_video.c
Expand Up @@ -841,7 +841,6 @@ void V_ScreenShot(const char *format)
// find a file name to save it to

#ifdef HAVE_LIBPNG
extern int png_screenshots;
if (png_screenshots)
{
ext = "png";
Expand Down Expand Up @@ -986,7 +985,6 @@ static void DrawNonAcceleratingBox(int speed)

void V_DrawMouseSpeedBox(int speed)
{
extern int usemouse;
int bgcolor, bordercolor, black;

// If the mouse is turned off, don't draw the box at all.
Expand Down

0 comments on commit bbc6c36

Please sign in to comment.