Skip to content

Commit 48d19e9

Browse files
committed
Format: do not allow one-line-functions
1 parent 76f55e0 commit 48d19e9

29 files changed

+242
-66
lines changed

_clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AllowShortBlocksOnASingleLine: false
1111
AllowShortCaseLabelsOnASingleLine: false
1212
AllowShortIfStatementsOnASingleLine: false
1313
AllowShortLoopsOnASingleLine: false
14-
AllowShortFunctionsOnASingleLine: All
14+
AllowShortFunctionsOnASingleLine: Inline
1515
AlwaysBreakAfterDefinitionReturnType: false
1616
AlwaysBreakTemplateDeclarations: true
1717
AlwaysBreakBeforeMultilineStrings: true

adoom_src/am_map.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,10 @@ void AM_Ticker(void)
920920
//
921921
// Clear automap frame buffer.
922922
//
923-
void AM_clearFB(int color) { memset(fb, color, f_w * f_h); }
923+
void AM_clearFB(int color)
924+
{
925+
memset(fb, color, f_w * f_h);
926+
}
924927
//
925928
// Automap clipping of lines.
926929
//

adoom_src/amiga_ipx.c

+21-6
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ UWORD IPXOpenSocket(UWORD socketid)
234234
}
235235

236236
/**********************************************************************/
237-
void IPXCloseSocket(UWORD socketid) { the_socket = 0; }
237+
void IPXCloseSocket(UWORD socketid)
238+
{
239+
the_socket = 0;
240+
}
238241
/**********************************************************************/
239242
int IPXGetLocalTarget(struct IPXAddress *request, UBYTE reply[6])
240243
{
@@ -320,7 +323,9 @@ int IPXListenForPacket(struct IPXECB *ecb)
320323
}
321324

322325
/**********************************************************************/
323-
void ScheduleIPXEvent(struct IPXECB *ecb, int ticks) {}
326+
void ScheduleIPXEvent(struct IPXECB *ecb, int ticks)
327+
{
328+
}
324329
/**********************************************************************/
325330
int IPXCancelEvent(struct IPXECB *ecb)
326331
{
@@ -346,7 +351,9 @@ int IPXGetIntervalMarker(void)
346351
}
347352

348353
/**********************************************************************/
349-
void IPXGetInternetworkAddress(struct IPXInternetworkAddress *reply) {}
354+
void IPXGetInternetworkAddress(struct IPXInternetworkAddress *reply)
355+
{
356+
}
350357
/**********************************************************************/
351358
void IPXRelinquishControl(void)
352359
{
@@ -358,9 +365,17 @@ void IPXRelinquishControl(void)
358365
}
359366

360367
/**********************************************************************/
361-
void IPXDisconnectFromTarget(struct IPXAddress *request) {}
368+
void IPXDisconnectFromTarget(struct IPXAddress *request)
369+
{
370+
}
362371
/**********************************************************************/
363-
void IPXGetLocalAddr(struct IPXAddress *reply) { memcpy(reply, &localaddress, sizeof(struct IPXAddress)); }
372+
void IPXGetLocalAddr(struct IPXAddress *reply)
373+
{
374+
memcpy(reply, &localaddress, sizeof(struct IPXAddress));
375+
}
364376
/**********************************************************************/
365-
void _STDcleanupIPX(void) { Shutdown_IPX(); }
377+
void _STDcleanupIPX(void)
378+
{
379+
Shutdown_IPX();
380+
}
366381
/**********************************************************************/

adoom_src/amiga_sound.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
#include <graphics/gfxbase.h>
1313

14-
#include "z_zone.h"
14+
#include "doomdef.h"
1515
#include "i_sound.h"
1616
#include "i_system.h"
1717
#include "m_argv.h"
1818
#include "m_misc.h"
1919
#include "w_wad.h"
20-
#include "doomdef.h"
20+
#include "z_zone.h"
2121

2222
//#include "doomsound.h"
2323
#include "DoomSnd.h"
@@ -250,7 +250,9 @@ void I_InitSound(void)
250250

251251
/**********************************************************************/
252252
// ... update sound buffer and audio device at runtime...
253-
void I_UpdateSound(void) { /* fprintf (stderr, "I_UpdateSound()\n"); */ }
253+
void I_UpdateSound(void)
254+
{ /* fprintf (stderr, "I_UpdateSound()\n"); */
255+
}
254256
/**********************************************************************/
255257
// ... update sound buffer and audio device at runtime...
256258
void I_SubmitSound(void)
@@ -314,7 +316,9 @@ void I_ShutdownSound(void)
314316

315317
/**********************************************************************/
316318
// Initialize number of channels
317-
void I_SetChannels(void) {}
319+
void I_SetChannels(void)
320+
{
321+
}
318322
/**********************************************************************/
319323
// Get raw data lump index for sound descriptor.
320324
int I_GetSfxLumpNum(sfxinfo_t *sfx)

adoom_src/amiga_system.c

+11-3
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,19 @@ int I_GetTime(void)
110110
// are performed here (joystick reading).
111111
// Can call D_PostEvent.
112112
//
113-
void I_StartFrame(void) { amiga_getevents(); }
113+
void I_StartFrame(void)
114+
{
115+
amiga_getevents();
116+
}
114117
/**********************************************************************/
115118
//
116119
// Called by D_DoomLoop,
117120
// called before processing each tic in a frame.
118121
// Quick syncronous operations are performed here.
119122
// Can call D_PostEvent.
120-
void I_StartTic(void) {}
123+
void I_StartTic(void)
124+
{
125+
}
121126
/**********************************************************************/
122127
// Asynchronous interrupt functions should maintain private queues
123128
// that are read by the synchronous functions
@@ -128,7 +133,10 @@ void I_StartTic(void) {}
128133
// This ticcmd will then be modified by the gameloop
129134
// for normal input.
130135
ticcmd_t emptycmd;
131-
ticcmd_t *I_BaseTiccmd(void) { return &emptycmd; }
136+
ticcmd_t *I_BaseTiccmd(void)
137+
{
138+
return &emptycmd;
139+
}
132140
/**********************************************************************/
133141
// Called by M_Responder when quit is selected.
134142
// Clean exit, displays sell blurb.

adoom_src/amiga_video.c

+13-4
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ static unsigned int lock_time = 0;
298298
static unsigned int total_frames = 0;
299299

300300
/****************************************************************************/
301-
static __inline void start_timer(void) { ReadEClock(&start_time); }
301+
static __inline void start_timer(void)
302+
{
303+
ReadEClock(&start_time);
304+
}
302305
/****************************************************************************/
303306
static __inline unsigned int end_timer(void)
304307
{
@@ -1310,7 +1313,9 @@ void I_StartUpdate(void)
13101313
}
13111314

13121315
/**********************************************************************/
1313-
void I_UpdateNoBlit(void) {}
1316+
void I_UpdateNoBlit(void)
1317+
{
1318+
}
13141319
/**********************************************************************/
13151320
void I_FinishUpdate(void)
13161321
/* This needs optimising to copy just the parts that changed,
@@ -1538,9 +1543,13 @@ void I_ReadScreen(byte *scr)
15381543
}
15391544

15401545
/**********************************************************************/
1541-
void I_BeginRead(void) {}
1546+
void I_BeginRead(void)
1547+
{
1548+
}
15421549
/**********************************************************************/
1543-
void I_EndRead(void) {}
1550+
void I_EndRead(void)
1551+
{
1552+
}
15441553
/**********************************************************************/
15451554
int xlate_key(UWORD rawkey, UWORD qualifier, APTR eventptr)
15461555
{

adoom_src/d_main.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,18 @@ void D_PageTicker(void)
409409
//
410410
// D_PageDrawer
411411
//
412-
void D_PageDrawer(void) { V_DrawPatchInDirect(0, 0, 0, W_CacheLumpName(pagename, PU_CACHE)); }
412+
void D_PageDrawer(void)
413+
{
414+
V_DrawPatchInDirect(0, 0, 0, W_CacheLumpName(pagename, PU_CACHE));
415+
}
413416
//
414417
// D_AdvanceDemo
415418
// Called after each demo or intro demosequence finishes
416419
//
417-
void D_AdvanceDemo(void) { advancedemo = true; }
420+
void D_AdvanceDemo(void)
421+
{
422+
advancedemo = true;
423+
}
418424
//
419425
// This cycles through the demo sequences.
420426
// FIXME - version dependend demo numbers?

adoom_src/d_net.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ static int use_pcchecksum = 0;
9191
//
9292
//
9393
//
94-
int NetbufferSize(void) { return (int)&(((doomdata_t *)0)->cmds[netbuffer->numtics]); }
94+
int NetbufferSize(void)
95+
{
96+
return (int)&(((doomdata_t *)0)->cmds[netbuffer->numtics]);
97+
}
9598
//
9699
// Checksum
97100
//

adoom_src/f_wipe.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ int wipe_doColorXForm(int width, int height, int ticks)
102102
return !changed;
103103
}
104104

105-
int wipe_exitColorXForm(int width, int height, int ticks) { return 0; }
105+
int wipe_exitColorXForm(int width, int height, int ticks)
106+
{
107+
return 0;
108+
}
106109
static int* y;
107110

108111
int wipe_initMelt(int width, int height, int ticks)

adoom_src/g_game.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,10 @@ void G_DoReborn(int playernum)
863863
}
864864
}
865865

866-
void G_ScreenShot(void) { gameaction = ga_screenshot; }
866+
void G_ScreenShot(void)
867+
{
868+
gameaction = ga_screenshot;
869+
}
867870
// DOOM Par Times
868871
int pars[4][10] = {{0},
869872
{0, 30, 75, 120, 90, 165, 180, 180, 30, 165},

adoom_src/hu_lib.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ static const char rcsid[] = "$Id: hu_lib.c,v 1.3 1997/01/26 07:44:58 b1 Exp $";
4040
extern boolean automapactive; // in AM_map.c
4141
extern int maponhu; // checkparm of -maponhu
4242

43-
void HUlib_init(void) {}
43+
void HUlib_init(void)
44+
{
45+
}
4446
void HUlib_clearTextLine(hu_textline_t* t)
4547
{
4648
t->len = 0;

adoom_src/hu_stuff.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ char frenchKeyMap[128] = {
210210
'X', 'Y', 'W', '^', '\\', '$', '^', '_', '@', 'Q', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', ',',
211211
'N', 'O', 'P', 'A', 'R', 'S', 'T', 'U', 'V', 'Z', 'X', 'Y', 'W', '^', '\\', '$', '^', 127};
212212

213-
char ForeignTranslation(unsigned char ch) { return ch < 128 ? frenchKeyMap[ch] : ch; }
213+
char ForeignTranslation(unsigned char ch)
214+
{
215+
return ch < 128 ? frenchKeyMap[ch] : ch;
216+
}
214217
void HU_Init(void)
215218
{
216219
int i;
@@ -230,7 +233,10 @@ void HU_Init(void)
230233
}
231234
}
232235

233-
void HU_Stop(void) { headsupactive = false; }
236+
void HU_Stop(void)
237+
{
238+
headsupactive = false;
239+
}
234240
void HU_Start(void)
235241
{
236242
int i;

adoom_src/i_sound.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,12 @@ void I_InitSound()
729729
// Still no music done.
730730
// Remains. Dummies.
731731
//
732-
void I_InitMusic(void) {}
733-
void I_ShutdownMusic(void) {}
732+
void I_InitMusic(void)
733+
{
734+
}
735+
void I_ShutdownMusic(void)
736+
{
737+
}
734738
static int looping = 0;
735739
static int musicdies = -1;
736740

adoom_src/i_system.c

+14-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ void I_Tactile(int on, int off, int total)
5252
}
5353

5454
ticcmd_t emptycmd;
55-
ticcmd_t *I_BaseTiccmd(void) { return &emptycmd; }
56-
int I_GetHeapSize(void) { return mb_used * 1024 * 1024; }
55+
ticcmd_t *I_BaseTiccmd(void)
56+
{
57+
return &emptycmd;
58+
}
59+
int I_GetHeapSize(void)
60+
{
61+
return mb_used * 1024 * 1024;
62+
}
5763
byte *I_ZoneBase(int *size)
5864
{
5965
*size = mb_used * 1024 * 1024;
@@ -113,8 +119,12 @@ void I_WaitVBL(int count)
113119
#endif
114120
}
115121

116-
void I_BeginRead(void) {}
117-
void I_EndRead(void) {}
122+
void I_BeginRead(void)
123+
{
124+
}
125+
void I_EndRead(void)
126+
{
127+
}
118128
byte *I_AllocLow(int length)
119129
{
120130
byte *mem;

adoom_src/i_video.c

+18-4
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ void I_UpdateNoBlit(void)
361361
//
362362
// I_StartUpdate
363363
//
364-
void I_StartUpdate(void) {}
364+
void I_StartUpdate(void)
365+
{
366+
}
365367
//
366368
// I_FinishUpdate
367369
//
@@ -501,7 +503,10 @@ void I_FinishUpdate(void)
501503
//
502504
// I_ReadScreen
503505
//
504-
void I_ReadScreen(byte *scr) { memcpy(scr, screens[0], SCREENWIDTH * SCREENHEIGHT); }
506+
void I_ReadScreen(byte *scr)
507+
{
508+
memcpy(scr, screens[0], SCREENWIDTH * SCREENHEIGHT);
509+
}
505510
//
506511
// Palette stuff.
507512
//
@@ -546,11 +551,16 @@ void UploadNewPalette(Colormap cmap, byte *palette)
546551
//
547552
// I_RecalcPalettes
548553
//
549-
void I_RecalcPalettes(void) {}
554+
void I_RecalcPalettes(void)
555+
{
556+
}
550557
//
551558
// I_SetPalette
552559
//
553-
void I_SetPalette(byte *palette) { UploadNewPalette(X_cmap, palette); }
560+
void I_SetPalette(byte *palette)
561+
{
562+
UploadNewPalette(X_cmap, palette);
563+
}
554564
//
555565
// I_MarkRect() Called by anything that renders to screens[0] (except 3D view)
556566
//
@@ -669,8 +679,12 @@ void I_InitGraphics(void)
669679
return;
670680
firsttime = 0;
671681

682+
DEBUGSTEP();
683+
672684
signal(SIGINT, (void (*)(int))I_Quit);
673685

686+
DEBUGSTEP();
687+
674688
if (M_CheckParm("-2"))
675689
multiply = 2;
676690

adoom_src/m_fixed.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ static const char rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
3535

3636
// Fixme. __USE_C_FIXED__ or something.
3737

38-
fixed_t FixedMul(fixed_t a, fixed_t b) { return ((long long)a * (long long)b) >> FRACBITS; }
38+
fixed_t FixedMul(fixed_t a, fixed_t b)
39+
{
40+
return ((long long)a * (long long)b) >> FRACBITS;
41+
}
3942
//
4043
// FixedDiv, C version.
4144
//

0 commit comments

Comments
 (0)