Skip to content

Commit 5e7c6a2

Browse files
committed
housekeeping: clang-format
1 parent 79522c0 commit 5e7c6a2

33 files changed

+911
-905
lines changed

.clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ KeepEmptyLinesAtTheStartOfBlocks: true
3939
MacroBlockBegin: ''
4040
MacroBlockEnd: ''
4141
MaxEmptyLinesToKeep: 1
42-
NamespaceIndentation: None
42+
NamespaceIndentation: Inner
4343
ObjCBlockIndentWidth: 2
4444
ObjCSpaceAfterProperty: false
4545
ObjCSpaceBeforeProtocolList: true

src/ldp-out/hitachi.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
// The 9550 uses a regular modem cable, NOT a null modem cable
3939
// Original command set by Robert DiNapoli
4040

41-
#include "../timer/timer.h"
42-
#include "../io/serial.h"
43-
#include "../io/conout.h"
44-
#include "../hypseus.h" // for get_quitflag
45-
#include "../game/game.h" // to get game FPS
4641
#include "hitachi.h"
42+
#include "../game/game.h" // to get game FPS
43+
#include "../hypseus.h" // for get_quitflag
44+
#include "../io/conout.h"
45+
#include "../io/serial.h"
46+
#include "../timer/timer.h"
4747

4848
// constructor
4949
hitachi::hitachi()
@@ -179,10 +179,9 @@ bool hitachi::skip_forward(Uint16 frames_to_skip, Uint16 target_frame)
179179
if (g_game->get_disc_fpks() != 29970) {
180180
printline("Hitachi: Disc is not standard 29.97 and therefore we must "
181181
"convert the skip parameter");
182-
frames_to_skip =
183-
(Uint16)((1.25 * frames_to_skip) + 0.5); // to float multiplication
184-
// and add 0.5 to round to
185-
// the nearest whole number
182+
// to float multiplication and add 0.5 to round to the nearest whole
183+
// number
184+
frames_to_skip = (Uint16)((1.25 * frames_to_skip) + 0.5);
186185
}
187186

188187
framenum_to_frame(frames_to_skip, frame);

src/ldp-out/ld-v6000.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
// File to control the Pioneer LD-V6000 series of players
2424
// written by Matt Ownby
2525

26-
#include <string.h>
27-
#include <stdio.h>
28-
#include <plog/Log.h>
29-
#include "../io/serial.h"
30-
#include "../timer/timer.h"
31-
#include "../io/conout.h"
26+
#include "ld-v6000.h"
3227
#include "../hypseus.h"
28+
#include "../io/conout.h"
3329
#include "../io/input.h"
34-
#include "ld-v6000.h"
30+
#include "../io/serial.h"
31+
#include "../timer/timer.h"
32+
#include <plog/Log.h>
33+
#include <stdio.h>
34+
#include <string.h>
3535

3636
// two-character codes that represent the digits 0 to 9
3737
const char *ldv6000_digits[10] = {"3F", "0F", "8F", "4F", "2F",

src/ldp-out/ldp-combo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
// a combo laserdisc player class that controls both smpeg and a real laserdisc
2727
// player
2828

29-
#include "../timer/timer.h"
3029
#include "ldp-combo.h"
30+
#include "../timer/timer.h"
3131

3232
combo::combo()
3333
{

src/ldp-out/ldp-combo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// ldp-combo.h
2424
// by Matt Ownby
2525

26+
#include "ldp-vldp.h"
2627
#include "ldp.h"
2728
#include "sony.h"
28-
#include "ldp-vldp.h"
2929

3030
class combo : public ldp
3131
{

src/ldp-out/ldp-vldp-audio.cpp

+13-18
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
//(such as NTFS mounted from linux)
3131
#endif
3232

33-
#include "../timer/timer.h"
33+
#include "ldp-vldp.h"
3434
#include "../io/conout.h"
3535
#include "../io/mpo_fileio.h"
3636
#include "../sound/sound.h"
37-
#include "ldp-vldp.h"
37+
#include "../timer/timer.h"
3838

3939
#ifdef DEBUG
4040
#include <assert.h> // this may include an extra .DLL in windows that I don't want to rely on
4141
#endif
4242

4343
#include <stdlib.h>
4444
#include <string.h>
45-
#include <sys/types.h>
4645
#include <sys/stat.h>
46+
#include <sys/types.h>
4747

4848
#include <vorbis/codec.h> // OGG VORBIS specific headers
4949
#include <vorbis/vorbisfile.h>
@@ -100,8 +100,8 @@ void mmreset()
100100
size_t mmread(void *ptr, size_t size, size_t nmemb, void *datasource)
101101
{
102102
size_t bytes_to_read = size * nmemb; // how many bytes to be read
103-
Uint8 *src = ((Uint8 *)datasource) + g_audio_filepos; // where to get the
104-
// data from
103+
// where to get the data from
104+
Uint8 *src = ((Uint8 *)datasource) + g_audio_filepos;
105105

106106
// printf("mmread being called.. size is %d, nmemb is %d, bytes_to_read is
107107
//%d\n", size, nmemb, bytes_to_read);
@@ -195,7 +195,7 @@ int mmclose(void *datasource)
195195
long mmtell(void *datasource)
196196
{
197197
// printf("mmtell being called, filepos is %x\n", (Uint32)
198-
//g_audio_filepos);
198+
// g_audio_filepos);
199199

200200
if (datasource) {
201201
}
@@ -522,7 +522,7 @@ void ldp_vldp_audio_callback(Uint8 *stream, int len, int unused)
522522
unsigned int uFloodTimer = (GET_TICKS() - g_uCallbackDbgTimer) / 1000;
523523
if (uFloodTimer != g_uCallbackFloodTimer) {
524524
g_uCallbackFloodTimer = uFloodTimer;
525-
string s = "audio callback frequency is: " +
525+
string s = "audio callback frequency is: " +
526526
numstr::ToStr((g_u64CallbackByteCount / uFloodTimer) >> 2);
527527
printline(s.c_str());
528528
}
@@ -618,22 +618,17 @@ void ldp_vldp_audio_callback(Uint8 *stream, int len, int unused)
618618
unsigned int cur_time = g_ldp->get_elapsed_ms_since_play();
619619
// if our timer is set to the current time or some previous time
620620
if (g_playing_timer < cur_time) {
621-
static const Uint64 uBYTES_PER_S =
622-
sound::FREQ * sound::BYTES_PER_SAMPLE; // needs to be uint64
623-
// to prevent overflow
624-
// from subsequent math
621+
// needs to be uint64 to prevent overflow from subsequent math
622+
static const Uint64 uBYTES_PER_S = sound::FREQ * sound::BYTES_PER_SAMPLE;
623+
// how many samples should have played 176.4 = 44.1 samples per
624+
// millisecond * 2 for stereo * 2 for 16-bit
625625
correct_samples =
626626
(unsigned int)((uBYTES_PER_S * (cur_time - g_playing_timer)) / 1000);
627-
// how many samples should have played
628-
// 176.4 = 44.1 samples per millisecond * 2 for stereo * 2 for
629-
// 16-bit
630627
}
631628
// our timer is set to some time in the future (used with skipping)
632-
// so we actually
633-
// should not have played any samples at this point
629+
// so we actually should not have played any samples at this point
634630
else {
635-
// fprintf(stderr, "LDP-VLDP-AUDIO : Timer is in the
636-
//future\n");
631+
// fprintf(stderr, "LDP-VLDP-AUDIO : Timer is in the future\n");
637632
correct_samples = 0;
638633
}
639634

0 commit comments

Comments
 (0)