cleanup function definitions

This commit is contained in:
Denis Pauk 2024-01-01 17:36:53 +02:00
parent 13466185e6
commit 7372623056
23 changed files with 230 additions and 274 deletions

View file

@ -28,6 +28,7 @@
#include <string.h>
#include "../../common/header/shared.h"
#include "../../common/header/common.h"
#if defined(__linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
#include <unistd.h> // readlink(), amongst others

View file

@ -71,7 +71,7 @@ char *multicast_interface = NULL;
int NET_Socket(char *net_interface, int port, netsrc_t type, int family);
char *NET_ErrorString(void);
void
static void
NetadrToSockadr(netadr_t *a, struct sockaddr_storage *s)
{
struct sockaddr_in6 *s6;
@ -152,7 +152,7 @@ NetadrToSockadr(netadr_t *a, struct sockaddr_storage *s)
}
}
void
static void
SockadrToNetadr(struct sockaddr_storage *s, netadr_t *a)
{
struct sockaddr_in6 *s6;
@ -272,7 +272,7 @@ NET_CompareBaseAdr(netadr_t a, netadr_t b)
return false;
}
char *
static char *
NET_BaseAdrToString(netadr_t a)
{
static char s[64];
@ -369,7 +369,7 @@ NET_AdrToString(netadr_t a)
return s;
}
qboolean
static qboolean
NET_StringToSockaddr(const char *s, struct sockaddr_storage *sadr)
{
char copy[128];
@ -469,7 +469,7 @@ NET_IsLocalAddress(netadr_t adr)
return NET_CompareAdr(adr, net_local_adr);
}
qboolean
static qboolean
NET_GetLoopPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
{
int i;
@ -496,7 +496,7 @@ NET_GetLoopPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
return true;
}
void
static void
NET_SendLoopPacket(netsrc_t sock, int length, void *data, netadr_t to)
{
int i;
@ -734,7 +734,7 @@ NET_SendPacket(netsrc_t sock, int length, void *data, netadr_t to)
}
}
void
static void
NET_OpenIP(void)
{
cvar_t *port, *ip;

View file

@ -33,7 +33,7 @@
#if defined(HAVE_EXECINFO)
#include <execinfo.h>
void
static void
printBacktrace(int sig)
{
void *array[15];
@ -62,7 +62,7 @@ printBacktrace(int sig)
#else
void
static void
printBacktrace(int sig)
{
printf("Product: Yamagi Quake II\n");
@ -77,7 +77,7 @@ printBacktrace(int sig)
#endif
void
static void
signalhandler(int sig)
{
printf("\n=======================================================\n");
@ -117,7 +117,7 @@ signalhandler(int sig)
extern qboolean quitnextframe;
void
static void
terminate(int sig)
{
quitnextframe = true;

View file

@ -63,7 +63,7 @@ static WSADATA winsockdata;
/* ============================================================================= */
void
static void
NetadrToSockadr(netadr_t *a, struct sockaddr_storage *s)
{
struct sockaddr_in6 *s6;
@ -150,7 +150,7 @@ NetadrToSockadr(netadr_t *a, struct sockaddr_storage *s)
}
}
void
static void
SockadrToNetadr(struct sockaddr_storage *s, netadr_t *a)
{
struct sockaddr_in6 *s6;
@ -277,7 +277,7 @@ NET_CompareBaseAdr(netadr_t a, netadr_t b)
return false;
}
char *
static char *
NET_BaseAdrToString(netadr_t a)
{
static char s[64];
@ -382,7 +382,7 @@ NET_AdrToString(netadr_t a)
* 192.246.40.70
* 192.246.40.70:28000
*/
qboolean
static qboolean
NET_StringToSockaddr(const char *s, struct sockaddr_storage *sadr)
{
char copy[128];
@ -492,7 +492,7 @@ NET_IsLocalAddress(netadr_t adr)
/* ============================================================================= */
qboolean
static qboolean
NET_GetLoopPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
{
int i;
@ -520,7 +520,7 @@ NET_GetLoopPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
return true;
}
void
static void
NET_SendLoopPacket(netsrc_t sock, int length, void *data, netadr_t to)
{
int i;
@ -968,7 +968,7 @@ NET_IPSocket(char *net_interface, int port, netsrc_t type, int family)
return newsocket;
}
void
static void
NET_OpenIP(void)
{
cvar_t *ip;
@ -1100,7 +1100,7 @@ NET_IPXSocket(int port)
return newsocket;
}
void
static void
NET_OpenIPX(void)
{
int port;

View file

@ -69,10 +69,10 @@ This library provides several interfaces to load, demux and decode MPEG video
and audio data. A high-level API combines the demuxer, video & audio decoders
in an easy to use wrapper.
Lower-level APIs for accessing the demuxer, video decoder and audio decoder,
Lower-level APIs for accessing the demuxer, video decoder and audio decoder,
as well as providing different data sources are also available.
Interfaces are written in an object oriented style, meaning you create object
Interfaces are written in an object oriented style, meaning you create object
instances via various different constructor functions (plm_*create()),
do some work on them and later dispose them via plm_*destroy().
@ -90,7 +90,7 @@ With the high-level interface you have two options to decode video & audio:
plm_set_{video|audio}_decode_callback()) any number of times.
2. Use plm_decode_video() and plm_decode_audio() to decode exactly one
frame of video or audio data at a time. How you handle the synchronization
frame of video or audio data at a time. How you handle the synchronization
of both streams is up to you.
If you only want to decode video *or* audio through these functions, you should
@ -109,7 +109,7 @@ mat4 bt601 = mat4(
gl_FragColor = vec4(y, cb, cr, 1.0) * bt601;
Audio data is decoded into a struct with either one single float array with the
samples for the left and right channel interleaved, or if the
samples for the left and right channel interleaved, or if the
PLM_AUDIO_SEPARATE_CHANNELS is defined *before* including this library, into
two separate float arrays - one for each channel.
@ -117,7 +117,7 @@ two separate float arrays - one for each channel.
Data can be supplied to the high level interface, the demuxer and the decoders
in three different ways:
1. Using plm_create_from_filename() or with a file handle with
1. Using plm_create_from_filename() or with a file handle with
plm_create_from_file().
2. Using plm_create_with_memory() and supplying a pointer to memory that
@ -126,10 +126,10 @@ in three different ways:
3. Using plm_create_with_buffer(), supplying your own plm_buffer_t instance and
periodically writing to this buffer.
When using your own plm_buffer_t instance, you can fill this buffer using
plm_buffer_write(). You can either monitor plm_buffer_get_remaining() and push
data when appropriate, or install a callback on the buffer with
plm_buffer_set_load_callback() that gets called whenever the buffer needs more
When using your own plm_buffer_t instance, you can fill this buffer using
plm_buffer_write(). You can either monitor plm_buffer_get_remaining() and push
data when appropriate, or install a callback on the buffer with
plm_buffer_set_load_callback() that gets called whenever the buffer needs more
data.
A buffer created with plm_buffer_create_with_capacity() is treated as a ring
@ -138,19 +138,19 @@ contrast, a buffer created with plm_buffer_create_for_appending() will keep all
data written to it in memory. This enables seeking in the already loaded data.
There should be no need to use the lower level plm_demux_*, plm_video_* and
There should be no need to use the lower level plm_demux_*, plm_video_* and
plm_audio_* functions, if all you want to do is read/decode an MPEG-PS file.
However, if you get raw mpeg1video data or raw mp2 audio data from a different
source, these functions can be used to decode the raw data directly. Similarly,
source, these functions can be used to decode the raw data directly. Similarly,
if you only want to analyze an MPEG-PS file or extract raw video or audio
packets from it, you can use the plm_demux_* functions.
This library uses malloc(), realloc() and free() to manage memory. Typically
This library uses malloc(), realloc() and free() to manage memory. Typically
all allocation happens up-front when creating the interface. However, the
default buffer size may be too small for certain inputs. In these cases plmpeg
will realloc() the buffer with a larger size whenever needed. You can configure
the default buffer size by defining PLM_BUFFER_DEFAULT_SIZE *before*
the default buffer size by defining PLM_BUFFER_DEFAULT_SIZE *before*
including this library.
You can also define PLM_MALLOC, PLM_REALLOC and PLM_FREE to provide your own
@ -201,11 +201,11 @@ typedef struct {
} plm_packet_t;
// Decoded Video Plane
// Decoded Video Plane
// The byte length of the data is width * height. Note that different planes
// have different sizes: the Luma plane (Y) is double the size of each of
// have different sizes: the Luma plane (Y) is double the size of each of
// the two Chroma planes (Cr, Cb) - i.e. 4 times the byte length.
// Also note that the size of the plane does *not* denote the size of the
// Also note that the size of the plane does *not* denote the size of the
// displayed frame. The sizes of planes are always rounded up to the nearest
// macroblock (16px).
@ -288,8 +288,8 @@ plm_t *plm_create_with_file(FILE *fh, int close_when_done);
// Create a plmpeg instance with a pointer to memory as source. This assumes the
// whole file is in memory. The memory is not copied. Pass TRUE to
// free_when_done to let plmpeg call free() on the pointer when plm_destroy()
// whole file is in memory. The memory is not copied. Pass TRUE to
// free_when_done to let plmpeg call free() on the pointer when plm_destroy()
// is called.
plm_t *plm_create_with_memory(uint8_t *bytes, size_t length, int free_when_done);
@ -395,14 +395,14 @@ void plm_set_loop(plm_t *self, int loop);
int plm_has_ended(plm_t *self);
// Set the callback for decoded video frames used with plm_decode(). If no
// Set the callback for decoded video frames used with plm_decode(). If no
// callback is set, video data will be ignored and not be decoded. The *user
// Parameter will be passed to your callback.
void plm_set_video_decode_callback(plm_t *self, plm_video_decode_callback fp, void *user);
// Set the callback for decoded audio samples used with plm_decode(). If no
// Set the callback for decoded audio samples used with plm_decode(). If no
// callback is set, audio data will be ignored and not be decoded. The *user
// Parameter will be passed to your callback.
@ -418,16 +418,16 @@ void plm_decode(plm_t *self, double seconds);
// Decode and return one video frame. Returns NULL if no frame could be decoded
// (either because the source ended or data is corrupt). If you only want to
// (either because the source ended or data is corrupt). If you only want to
// decode video, you should disable audio via plm_set_audio_enabled().
// The returned plm_frame_t is valid until the next call to plm_decode_video()
// The returned plm_frame_t is valid until the next call to plm_decode_video()
// or until plm_destroy() is called.
plm_frame_t *plm_decode_video(plm_t *self);
// Decode and return one audio frame. Returns NULL if no frame could be decoded
// (either because the source ended or data is corrupt). If you only want to
// (either because the source ended or data is corrupt). If you only want to
// decode audio, you should disable video via plm_set_video_enabled().
// The returned plm_samples_t is valid until the next call to plm_decode_audio()
// or until plm_destroy() is called.
@ -435,14 +435,14 @@ plm_frame_t *plm_decode_video(plm_t *self);
plm_samples_t *plm_decode_audio(plm_t *self);
// Seek to the specified time, clamped between 0 -- duration. This can only be
// used when the underlying plm_buffer is seekable, i.e. for files, fixed
// memory buffers or _for_appending buffers.
// If seek_exact is TRUE this will seek to the exact time, otherwise it will
// seek to the last intra frame just before the desired time. Exact seeking can
// Seek to the specified time, clamped between 0 -- duration. This can only be
// used when the underlying plm_buffer is seekable, i.e. for files, fixed
// memory buffers or _for_appending buffers.
// If seek_exact is TRUE this will seek to the exact time, otherwise it will
// seek to the last intra frame just before the desired time. Exact seeking can
// be slow, because all frames up to the seeked one have to be decoded on top of
// the previous intra frame.
// If seeking succeeds, this function will call the video_decode_callback
// If seeking succeeds, this function will call the video_decode_callback
// exactly once with the target frame. If audio is enabled, it will also call
// the audio_decode_callback any number of times, until the audio_lead_time is
// satisfied.
@ -484,8 +484,8 @@ plm_buffer_t *plm_buffer_create_with_file(FILE *fh, int close_when_done);
// Create a buffer instance with a pointer to memory as source. This assumes
// the whole file is in memory. The bytes are not copied. Pass 1 to
// free_when_done to let plmpeg call free() on the pointer when plm_destroy()
// the whole file is in memory. The bytes are not copied. Pass 1 to
// free_when_done to let plmpeg call free() on the pointer when plm_destroy()
// is called.
plm_buffer_t *plm_buffer_create_with_memory(uint8_t *bytes, size_t length, int free_when_done);
@ -499,7 +499,7 @@ plm_buffer_t *plm_buffer_create_with_capacity(size_t capacity);
// Create an empty buffer with an initial capacity. The buffer will grow
// as needed. Decoded data will *not* be discarded. This can be used when
// loading a file over the network, without needing to throttle the download.
// loading a file over the network, without needing to throttle the download.
// It also allows for seeking in the already loaded data.
plm_buffer_t *plm_buffer_create_for_appending(size_t initial_capacity);
@ -510,8 +510,8 @@ plm_buffer_t *plm_buffer_create_for_appending(size_t initial_capacity);
void plm_buffer_destroy(plm_buffer_t *self);
// Copy data into the buffer. If the data to be written is larger than the
// available space, the buffer will realloc() with a larger capacity.
// Copy data into the buffer. If the data to be written is larger than the
// available space, the buffer will realloc() with a larger capacity.
// Returns the number of bytes written. This will always be the same as the
// passed in length, except when the buffer was created _with_memory() for
// which _write() is forbidden.
@ -519,7 +519,7 @@ void plm_buffer_destroy(plm_buffer_t *self);
size_t plm_buffer_write(plm_buffer_t *self, uint8_t *bytes, size_t length);
// Mark the current byte length as the end of this buffer and signal that no
// Mark the current byte length as the end of this buffer and signal that no
// more data is expected to be written to it. This function should be called
// just after the last plm_buffer_write().
// For _with_capacity buffers, this is cleared on a plm_buffer_rewind().
@ -538,7 +538,7 @@ void plm_buffer_set_load_callback(plm_buffer_t *self, plm_buffer_load_callback f
void plm_buffer_rewind(plm_buffer_t *self);
// Get the total size. For files, this returns the file size. For all other
// Get the total size. For files, this returns the file size. For all other
// types it returns the number of bytes currently in the buffer.
size_t plm_buffer_get_size(plm_buffer_t *self);
@ -550,7 +550,7 @@ size_t plm_buffer_get_size(plm_buffer_t *self);
size_t plm_buffer_get_remaining(plm_buffer_t *self);
// Get whether the read position of the buffer is at the end and no more data
// Get whether the read position of the buffer is at the end and no more data
// is expected.
int plm_buffer_has_ended(plm_buffer_t *self);
@ -612,9 +612,9 @@ int plm_demux_has_ended(plm_demux_t *self);
// Seek to a packet of the specified type with a PTS just before specified time.
// If force_intra is TRUE, only packets containing an intra frame will be
// If force_intra is TRUE, only packets containing an intra frame will be
// considered - this only makes sense when the type is PLM_DEMUX_PACKET_VIDEO_1.
// Note that the specified time is considered 0-based, regardless of the first
// Note that the specified time is considered 0-based, regardless of the first
// PTS in the data source.
plm_packet_t *plm_demux_seek(plm_demux_t *self, double time, int type, int force_intra);
@ -701,7 +701,7 @@ void plm_video_rewind(plm_video_t *self);
int plm_video_has_ended(plm_video_t *self);
// Decode and return one frame of video and advance the internal time by
// Decode and return one frame of video and advance the internal time by
// 1/framerate seconds. The returned frame_t is valid until the next call of
// plm_video_decode() or until the video decoder is destroyed.
@ -710,7 +710,7 @@ plm_frame_t *plm_video_decode(plm_video_t *self);
// Convert the YCrCb data of a frame into interleaved R G B data. The stride
// specifies the width in bytes of the destination buffer. I.e. the number of
// bytes from one line to the next. The stride must be at least
// bytes from one line to the next. The stride must be at least
// (frame->width * bytes_per_pixel). The buffer pointed to by *dest must have a
// size of at least (stride * frame->height).
// Note that the alpha component of the dest buffer is always left untouched.
@ -771,8 +771,8 @@ void plm_audio_rewind(plm_audio_t *self);
int plm_audio_has_ended(plm_audio_t *self);
// Decode and return one "frame" of audio and advance the internal time by
// (PLM_AUDIO_SAMPLES_PER_FRAME/samplerate) seconds. The returned samples_t
// Decode and return one "frame" of audio and advance the internal time by
// (PLM_AUDIO_SAMPLES_PER_FRAME/samplerate) seconds. The returned samples_t
// is valid until the next call of plm_audio_decode() or until the audio
// decoder is destroyed.
@ -935,7 +935,7 @@ int plm_has_headers(plm_t *self) {
if (!plm_demux_has_headers(self->demux)) {
return FALSE;
}
if (!plm_init_decoders(self)) {
return FALSE;
}
@ -1095,7 +1095,7 @@ void plm_decode(plm_t *self, double tick) {
do {
did_decode = FALSE;
if (decode_video && plm_video_get_time(self->video_decoder) < video_target_time) {
plm_frame_t *frame = plm_video_decode(self->video_decoder);
if (frame) {
@ -1118,10 +1118,10 @@ void plm_decode(plm_t *self, double tick) {
}
}
} while (did_decode);
// Did all sources we wanted to decode fail and the demuxer is at the end?
if (
(!decode_video || decode_video_failed) &&
(!decode_video || decode_video_failed) &&
(!decode_audio || decode_audio_failed) &&
plm_demux_has_ended(self->demux)
) {
@ -1236,7 +1236,7 @@ plm_frame_t *plm_seek_frame(plm_t *self, double time, int seek_exact) {
else if (time > duration) {
time = duration;
}
plm_packet_t *packet = plm_demux_seek(self->demux, time, type, TRUE);
if (!packet) {
return NULL;
@ -1250,7 +1250,7 @@ plm_frame_t *plm_seek_frame(plm_t *self, double time, int seek_exact) {
plm_video_rewind(self->video_decoder);
plm_video_set_time(self->video_decoder, packet->pts - start_time);
plm_buffer_write(self->video_buffer, packet->data, packet->length);
plm_frame_t *frame = plm_video_decode(self->video_decoder);
plm_frame_t *frame = plm_video_decode(self->video_decoder);
// If we want to seek to an exact frame, we have to decode all frames
// on top of the intra frame we just jumped to.
@ -1273,13 +1273,13 @@ plm_frame_t *plm_seek_frame(plm_t *self, double time, int seek_exact) {
int plm_seek(plm_t *self, double time, int seek_exact) {
plm_frame_t *frame = plm_seek_frame(self, time, seek_exact);
if (!frame) {
return FALSE;
}
if (self->video_decode_callback) {
self->video_decode_callback(self, frame, self->video_decode_callback_user_data);
self->video_decode_callback(self, frame, self->video_decode_callback_user_data);
}
// If audio is not enabled we are done here.
@ -1308,8 +1308,8 @@ int plm_seek(plm_t *self, double time, int seek_exact) {
plm_decode(self, 0);
break;
}
}
}
return TRUE;
}
@ -1382,7 +1382,7 @@ plm_buffer_t *plm_buffer_create_with_file(FILE *fh, int close_when_done) {
self->close_when_done = close_when_done;
self->mode = PLM_BUFFER_MODE_FILE;
self->discard_read_bytes = TRUE;
fseek(self->fh, 0, SEEK_END);
self->total_size = ftell(self->fh);
fseek(self->fh, 0, SEEK_SET);
@ -1448,8 +1448,8 @@ size_t plm_buffer_write(plm_buffer_t *self, uint8_t *bytes, size_t length) {
}
if (self->discard_read_bytes) {
// This should be a ring buffer, but instead it just shifts all unread
// data to the beginning of the buffer and appends new data at the end.
// This should be a ring buffer, but instead it just shifts all unread
// data to the beginning of the buffer and appends new data at the end.
// Seems to be good enough.
plm_buffer_discard_read_bytes(self);
@ -1499,7 +1499,7 @@ void plm_buffer_seek(plm_buffer_t *self, size_t pos) {
else if (self->mode == PLM_BUFFER_MODE_RING) {
if (pos != 0) {
// Seeking to non-0 is forbidden for dynamic-mem buffers
return;
return;
}
self->bit_index = 0;
self->length = 0;
@ -1531,7 +1531,7 @@ void plm_buffer_discard_read_bytes(plm_buffer_t *self) {
void plm_buffer_load_file_callback(plm_buffer_t *self, void *user) {
PLM_UNUSED(user);
if (self->discard_read_bytes) {
plm_buffer_discard_read_bytes(self);
}
@ -1556,12 +1556,12 @@ int plm_buffer_has(plm_buffer_t *self, size_t count) {
if (self->load_callback) {
self->load_callback(self, self->load_callback_user_data);
if (((self->length << 3) - self->bit_index) >= count) {
return TRUE;
}
}
}
if (self->total_size != 0 && self->length == self->total_size) {
self->has_ended = TRUE;
}
@ -1640,10 +1640,10 @@ int plm_buffer_find_start_code(plm_buffer_t *self, int code) {
return -1;
}
int plm_buffer_has_start_code(plm_buffer_t *self, int code) {
static int plm_buffer_has_start_code(plm_buffer_t *self, int code) {
size_t previous_bit_index = self->bit_index;
int previous_discard_read_bytes = self->discard_read_bytes;
self->discard_read_bytes = FALSE;
int current = plm_buffer_find_start_code(self, code);
@ -1652,7 +1652,7 @@ int plm_buffer_has_start_code(plm_buffer_t *self, int code) {
return current;
}
int plm_buffer_peek_non_zero(plm_buffer_t *self, int bit_count) {
static int plm_buffer_peek_non_zero(plm_buffer_t *self, int bit_count) {
if (!plm_buffer_has(self, bit_count)) {
return FALSE;
}
@ -1831,7 +1831,7 @@ double plm_demux_get_start_time(plm_demux_t *self, int type) {
int previous_pos = plm_buffer_tell(self->buffer);
int previous_start_code = self->start_code;
// Find first video PTS
plm_demux_rewind(self);
do {
@ -1861,8 +1861,8 @@ double plm_demux_get_duration(plm_demux_t *self, int type) {
size_t previous_pos = plm_buffer_tell(self->buffer);
int previous_start_code = self->start_code;
// Find last video PTS. Start searching 64kb from the end and go further
// Find last video PTS. Start searching 64kb from the end and go further
// back if needed.
long start_range = 64 * 1024;
long max_range = 4096 * 1024;
@ -1901,7 +1901,7 @@ plm_packet_t *plm_demux_seek(plm_demux_t *self, double seek_time, int type, int
// Using the current time, current byte position and the average bytes per
// second for this file, try to jump to a byte position that hopefully has
// packets containing timestamps within one second before to the desired
// packets containing timestamps within one second before to the desired
// seek_time.
// If we hit close to the seek_time scan through all packets to find the
@ -1910,7 +1910,7 @@ plm_packet_t *plm_demux_seek(plm_demux_t *self, double seek_time, int type, int
// per second for the jumped range and jump again.
// The number of retries here is hard-limited to a generous amount. Usually
// the correct range is found after 1--5 jumps, even for files with very
// the correct range is found after 1--5 jumps, even for files with very
// variable bitrates. If significantly more jumps are needed, there's
// probably something wrong with the file and we just avoid getting into an
// infinite loop. 32 retries should be enough for anybody.
@ -1963,7 +1963,7 @@ plm_packet_t *plm_demux_seek(plm_demux_t *self, double seek_time, int type, int
// Bail scanning through packets if we hit one that is outside
// seek_time - scan_span.
// We also adjust the cur_time and byterate values here so the next
// We also adjust the cur_time and byterate values here so the next
// iteration can be a bit more precise.
if (packet->pts > seek_time || packet->pts < seek_time - scan_span) {
found_packet_with_pts = TRUE;
@ -1983,7 +1983,7 @@ plm_packet_t *plm_demux_seek(plm_demux_t *self, double seek_time, int type, int
}
// Check if this is an intra frame packet. If so, record the buffer
// position of the start of this packet. We want to jump back to it
// position of the start of this packet. We want to jump back to it
// later, when we know it's the last intra frame before desired
// seek time.
if (force_intra) {
@ -1995,7 +1995,7 @@ plm_packet_t *plm_demux_seek(plm_demux_t *self, double seek_time, int type, int
packet->data[i + 2] == 0x01 &&
packet->data[i + 3] == 0x00
) {
// Bits 11--13 in the picture header contain the frame
// Bits 11--13 in the picture header contain the frame
// type, where 1=Intra
if ((packet->data[i + 5] & 0x38) == 8) {
last_valid_packet_start = packet_start;
@ -2064,9 +2064,9 @@ plm_packet_t *plm_demux_decode(plm_demux_t *self) {
do {
self->start_code = plm_buffer_next_start_code(self->buffer);
if (
self->start_code == PLM_DEMUX_PACKET_VIDEO_1 ||
self->start_code == PLM_DEMUX_PACKET_VIDEO_1 ||
self->start_code == PLM_DEMUX_PACKET_PRIVATE || (
self->start_code >= PLM_DEMUX_PACKET_AUDIO_1 &&
self->start_code >= PLM_DEMUX_PACKET_AUDIO_1 &&
self->start_code <= PLM_DEMUX_PACKET_AUDIO_4
)
) {
@ -2124,7 +2124,7 @@ plm_packet_t *plm_demux_decode_packet(plm_demux_t *self, int type) {
else {
return NULL; // invalid
}
return plm_demux_get_packet(self);
}
@ -2147,7 +2147,7 @@ plm_packet_t *plm_demux_get_packet(plm_demux_t *self) {
// -----------------------------------------------------------------------------
// plm_video implementation
// Inspired by Java MPEG-1 Video Decoder and Player by Zoltan Korandi
// Inspired by Java MPEG-1 Video Decoder and Player by Zoltan Korandi
// https://sourceforge.net/projects/javampeg1video/
static const int PLM_VIDEO_PICTURE_TYPE_INTRA = 1;
@ -2635,7 +2635,7 @@ void plm_video_idct(int *block);
plm_video_t * plm_video_create_with_buffer(plm_buffer_t *buffer, int destroy_when_done) {
plm_video_t *self = (plm_video_t *)PLM_MALLOC(sizeof(plm_video_t));
memset(self, 0, sizeof(plm_video_t));
self->buffer = buffer;
self->destroy_buffer_when_done = destroy_when_done;
@ -2706,12 +2706,12 @@ plm_frame_t *plm_video_decode(plm_video_t *self) {
if (!plm_video_has_header(self)) {
return NULL;
}
plm_frame_t *frame = NULL;
do {
if (self->start_code != PLM_START_PICTURE) {
self->start_code = plm_buffer_find_start_code(self->buffer, PLM_START_PICTURE);
if (self->start_code == -1) {
// If we reached the end of the file and the previously decoded
// frame was a reference frame, we still have to return it.
@ -2744,7 +2744,7 @@ plm_frame_t *plm_video_decode(plm_video_t *self) {
return NULL;
}
plm_buffer_discard_read_bytes(self->buffer);
plm_video_decode_picture(self);
if (self->assume_no_b_frames) {
@ -2760,11 +2760,11 @@ plm_frame_t *plm_video_decode(plm_video_t *self) {
self->has_reference_frame = TRUE;
}
} while (!frame);
frame->time = self->time;
self->frames_decoded++;
self->time = (double)self->frames_decoded / self->framerate;
return frame;
}
@ -2779,7 +2779,7 @@ int plm_video_has_header(plm_video_t *self) {
if (self->start_code == -1) {
return FALSE;
}
if (!plm_video_decode_sequence_header(self)) {
return FALSE;
}
@ -2809,7 +2809,7 @@ int plm_video_decode_sequence_header(plm_video_t *self) {
plm_buffer_skip(self->buffer, 18 + 1 + 10 + 1);
// Load custom intra quant matrix?
if (plm_buffer_read(self->buffer, 1)) {
if (plm_buffer_read(self->buffer, 1)) {
for (int i = 0; i < 64; i++) {
int idx = PLM_VIDEO_ZIG_ZAG[i];
self->intra_quant_matrix[idx] = plm_buffer_read(self->buffer, 8);
@ -2820,7 +2820,7 @@ int plm_video_decode_sequence_header(plm_video_t *self) {
}
// Load custom non intra quant matrix?
if (plm_buffer_read(self->buffer, 1)) {
if (plm_buffer_read(self->buffer, 1)) {
for (int i = 0; i < 64; i++) {
int idx = PLM_VIDEO_ZIG_ZAG[i];
self->non_intra_quant_matrix[idx] = plm_buffer_read(self->buffer, 8);
@ -2922,7 +2922,7 @@ void plm_video_decode_picture(plm_video_t *self) {
do {
self->start_code = plm_buffer_next_start_code(self->buffer);
} while (
self->start_code == PLM_START_EXTENSION ||
self->start_code == PLM_START_EXTENSION ||
self->start_code == PLM_START_USER_DATA
);
@ -3192,7 +3192,7 @@ void plm_video_process_macroblock(
unsigned int si = ((self->mb_row * block_size) + vp) * dw + (self->mb_col * block_size) + hp;
unsigned int di = (self->mb_row * dw + self->mb_col) * block_size;
unsigned int max_address = (dw * (self->mb_height * block_size - block_size + 1) - block_size);
if (si > max_address || di > max_address) {
return; // corrupt video
@ -3705,7 +3705,7 @@ struct plm_audio_t {
int v_pos;
int next_frame_data_size;
int has_header;
plm_buffer_t *buffer;
int destroy_buffer_when_done;
@ -3724,7 +3724,7 @@ int plm_audio_find_frame_sync(plm_audio_t *self);
int plm_audio_decode_header(plm_audio_t *self);
void plm_audio_decode_frame(plm_audio_t *self);
const plm_quantizer_spec_t *plm_audio_read_allocation(plm_audio_t *self, int sb, int tab3);
void plm_audio_read_samples(plm_audio_t *self, int ch, int sb, int part);
void plm_audio_read_samples(plm_audio_t *self, int ch, int sb, int part);
void plm_audio_idct36(int s[32][3], int ss, float *d, int dp);
plm_audio_t *plm_audio_create_with_buffer(plm_buffer_t *buffer, int destroy_when_done) {
@ -3756,7 +3756,7 @@ int plm_audio_has_header(plm_audio_t *self) {
if (self->has_header) {
return TRUE;
}
self->next_frame_data_size = plm_audio_decode_header(self);
return self->has_header;
}
@ -3772,7 +3772,7 @@ double plm_audio_get_time(plm_audio_t *self) {
}
void plm_audio_set_time(plm_audio_t *self, double time) {
self->samples_decoded = time *
self->samples_decoded = time *
(double)PLM_AUDIO_SAMPLE_RATE[self->samplerate_index];
self->time = time;
}
@ -3806,13 +3806,13 @@ plm_samples_t *plm_audio_decode(plm_audio_t *self) {
plm_audio_decode_frame(self);
self->next_frame_data_size = 0;
self->samples.time = self->time;
self->samples_decoded += PLM_AUDIO_SAMPLES_PER_FRAME;
self->time = (double)self->samples_decoded /
self->time = (double)self->samples_decoded /
(double)PLM_AUDIO_SAMPLE_RATE[self->samplerate_index];
return &self->samples;
}
@ -3840,10 +3840,10 @@ int plm_audio_decode_header(plm_audio_t *self) {
int sync = plm_buffer_read(self->buffer, 11);
// Attempt to resync if no syncword was found. This sucks balls. The MP2
// Attempt to resync if no syncword was found. This sucks balls. The MP2
// stream contains a syncword just before every frame (11 bits set to 1).
// However, this syncword is not guaranteed to not occur elsewhere in the
// stream. So, if we have to resync, we also have to check if the header
// stream. So, if we have to resync, we also have to check if the header
// (samplerate, bitrate) differs from the one we had before. This all
// may still lead to garbage data being decoded :/
@ -3920,7 +3920,7 @@ void plm_audio_decode_frame(plm_audio_t *self) {
// Prepare the quantizer table lookups
int tab3 = 0;
int sblimit = 0;
int tab1 = (self->mode == PLM_AUDIO_MODE_MONO) ? 0 : 1;
int tab2 = PLM_AUDIO_QUANT_LUT_STEP_1[tab1][self->bitrate_index];
tab3 = QUANT_LUT_STEP_2[tab2][self->samplerate_index];
@ -3968,18 +3968,18 @@ void plm_audio_decode_frame(plm_audio_t *self) {
sf[2] = plm_buffer_read(self->buffer, 6);
break;
case 1:
sf[0] =
sf[0] =
sf[1] = plm_buffer_read(self->buffer, 6);
sf[2] = plm_buffer_read(self->buffer, 6);
break;
case 2:
sf[0] =
sf[1] =
sf[0] =
sf[1] =
sf[2] = plm_buffer_read(self->buffer, 6);
break;
case 3:
sf[0] = plm_buffer_read(self->buffer, 6);
sf[1] =
sf[1] =
sf[2] = plm_buffer_read(self->buffer, 6);
break;
}
@ -4060,7 +4060,7 @@ void plm_audio_decode_frame(plm_audio_t *self) {
}
#else
for (int j = 0; j < 32; j++) {
self->samples.interleaved[((out_pos + j) << 1) + ch] =
self->samples.interleaved[((out_pos + j) << 1) + ch] =
self->U[j] / 2147418112.0f;
}
#endif

View file

@ -124,7 +124,7 @@ Con_ToggleConsole_f(void)
}
}
void
static void
Con_ToggleChat_f(void)
{
Key_ClearTyping();
@ -154,7 +154,7 @@ Con_Clear_f(void)
/*
* Save the console contents out to a file
*/
void
static void
Con_Dump_f(void)
{
int l, x;
@ -249,14 +249,14 @@ Con_ClearNotify(void)
}
}
void
static void
Con_MessageMode_f(void)
{
chat_team = false;
cls.key_dest = key_message;
}
void
static void
Con_MessageMode2_f(void)
{
chat_team = true;
@ -356,7 +356,7 @@ Con_Init(void)
con.initialized = true;
}
void
static void
Con_Linefeed(void)
{
con.x = 0;
@ -465,7 +465,7 @@ Con_Print(char *txt)
* The input line scrolls horizontally if
* typing goes beyond the right edge
*/
void
static void
Con_DrawInput(void)
{
int i;

View file

@ -62,5 +62,6 @@ void Con_Clear_f (void);
void Con_DrawNotify (void);
void Con_ClearNotify (void);
void Con_ToggleConsole_f (void);
void Key_ClearTyping(void);
#endif

View file

@ -31,6 +31,7 @@
#include <ctype.h>
#include "../header/client.h"
#include "../header/console.h"
#include "../sound/header/local.h"
#include "header/qmenu.h"
@ -2267,8 +2268,6 @@ EnableOGGMusic(void *unused)
}
}
extern void Key_ClearTyping(void);
static void
ConsoleFunc(void *unused)
{

View file

@ -669,7 +669,7 @@ OGG_HelpMsg(void)
/*
* The 'ogg' cmd. Gives some control and information about the playback state.
*/
void
static void
OGG_Cmd(void)
{
if (Cmd_Argc() < 2)

View file

@ -7,6 +7,7 @@
*/
#include <inttypes.h>
#include "header/common.h"
#define ROTATELEFT32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))

View file

@ -836,21 +836,6 @@ Cmd_InvUse_f(edict_t *ent)
it->use(ent, it);
}
void
Cmd_LastWeap_f(edict_t *ent)
{
gclient_t *cl;
cl = ent->client;
if (!cl->pers.weapon || !cl->pers.lastweapon)
{
return;
}
cl->pers.lastweapon->use(ent, cl->pers.lastweapon);
}
void
Cmd_WeapPrev_f(edict_t *ent)
{

View file

@ -239,14 +239,6 @@ static char *tnames[] = {
NULL
};
void
stuffcmd(edict_t *ent, char *s)
{
gi.WriteByte(11);
gi.WriteString(s);
gi.unicast(ent, true);
}
/*--------------------------------------------------------------------------*/
/*
@ -437,7 +429,7 @@ CTFOtherTeamName(int team)
return "UNKNOWN";
}
int
static int
CTFOtherTeam(int team)
{
switch (team)
@ -916,7 +908,7 @@ CTFResetFlag(int ctf_team)
}
}
void
static void
CTFResetFlags(void)
{
CTFResetFlag(CTF_TEAM1);
@ -1658,7 +1650,7 @@ CTFResetGrapple(edict_t *self)
}
}
void
static void
CTFGrappleTouch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
float volume = 1.0;
@ -1725,7 +1717,7 @@ CTFGrappleTouch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf
/*
* Draw beam between grapple and self
*/
void
static void
CTFGrappleDrawCable(edict_t *self)
{
vec3_t offset, start, end, f, r;
@ -1865,7 +1857,7 @@ CTFGrapplePull(edict_t *self)
}
}
void
static void
CTFFireGrapple(edict_t *self, vec3_t start, vec3_t dir,
int damage, int speed, int effect)
{
@ -1902,7 +1894,7 @@ CTFFireGrapple(edict_t *self, vec3_t start, vec3_t dir,
}
}
void
static void
CTFGrappleFire(edict_t *ent, vec3_t g_offset, int damage, int effect)
{
vec3_t forward, right;
@ -1934,7 +1926,7 @@ CTFGrappleFire(edict_t *ent, vec3_t g_offset, int damage, int effect)
PlayerNoise(ent, start, PNOISE_WEAPON);
}
void
static void
CTFWeapon_Grapple_Fire(edict_t *ent)
{
int damage;
@ -2298,7 +2290,7 @@ CTFScoreboardMessage(edict_t *ent, edict_t *killer)
/* TECH */
/*------------------------------------------------------------------------*/
void
static void
CTFHasTech(edict_t *who)
{
if (level.time - who->client->ctf_lasttechmsg > 2)
@ -3344,7 +3336,7 @@ SetLevelName(pmenu_t *p)
/* ELECTIONS */
qboolean
static qboolean
CTFBeginElection(edict_t *ent, elect_t type, char *msg)
{
int i;
@ -3402,7 +3394,7 @@ CTFBeginElection(edict_t *ent, elect_t type, char *msg)
void DoRespawn(edict_t *ent);
void
static void
CTFResetAllPlayers(void)
{
int i;
@ -3457,7 +3449,7 @@ CTFResetAllPlayers(void)
}
}
void
static void
CTFAssignGhost(edict_t *ent)
{
int ghost, i;
@ -3509,7 +3501,7 @@ CTFAssignGhost(edict_t *ent)
}
/* start a match */
void
static void
CTFStartMatch(void)
{
int i;
@ -3560,7 +3552,7 @@ CTFStartMatch(void)
}
}
void
static void
CTFEndMatch(void)
{
ctfgame.match = MATCH_POST;
@ -3614,7 +3606,7 @@ CTFNextMap(void)
return false;
}
void
static void
CTFWinElection(void)
{
switch (ctfgame.election)
@ -3955,7 +3947,7 @@ pmenu_t nochasemenu[] = {
{"Return to Main Menu", PMENU_ALIGN_LEFT, CTFReturnToMain}
};
void
static void
CTFJoinTeam(edict_t *ent, int desired_team)
{
char *s;
@ -4054,7 +4046,7 @@ CTFReturnToMain(edict_t *ent, pmenuhnd_t *p)
CTFOpenJoinMenu(ent);
}
void
static void
CTFRequestMatch(edict_t *ent, pmenuhnd_t *p)
{
char text[1024];
@ -4066,9 +4058,7 @@ CTFRequestMatch(edict_t *ent, pmenuhnd_t *p)
CTFBeginElection(ent, ELECT_MATCH, text);
}
void DeathmatchScoreboard(edict_t *ent);
void
static void
CTFShowScores(edict_t *ent, pmenu_t *p)
{
PMenu_Close(ent);
@ -4078,7 +4068,7 @@ CTFShowScores(edict_t *ent, pmenu_t *p)
DeathmatchScoreboard(ent);
}
int
static int
CTFUpdateJoinMenu(edict_t *ent)
{
static char team1players[32];
@ -4546,10 +4536,10 @@ typedef struct admin_settings_s
#define SETMENU_SIZE (7 + 5)
void CTFAdmin_UpdateSettings(edict_t *ent, pmenuhnd_t *setmenu);
static void CTFAdmin_UpdateSettings(edict_t *ent, pmenuhnd_t *setmenu);
void CTFOpenAdminMenu(edict_t *ent);
void
static void
CTFAdmin_SettingsApply(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4683,14 +4673,14 @@ CTFAdmin_SettingsApply(edict_t *ent, pmenuhnd_t *p)
CTFOpenAdminMenu(ent);
}
void
static void
CTFAdmin_SettingsCancel(edict_t *ent, pmenuhnd_t *p)
{
PMenu_Close(ent);
CTFOpenAdminMenu(ent);
}
void
static void
CTFAdmin_ChangeMatchLen(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4705,7 +4695,7 @@ CTFAdmin_ChangeMatchLen(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeMatchSetupLen(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4720,7 +4710,7 @@ CTFAdmin_ChangeMatchSetupLen(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeMatchStartLen(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4735,7 +4725,7 @@ CTFAdmin_ChangeMatchStartLen(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeWeapStay(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4744,7 +4734,7 @@ CTFAdmin_ChangeWeapStay(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeInstantItems(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4753,7 +4743,7 @@ CTFAdmin_ChangeInstantItems(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeQuadDrop(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4762,7 +4752,7 @@ CTFAdmin_ChangeQuadDrop(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeInstantWeap(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4771,7 +4761,7 @@ CTFAdmin_ChangeInstantWeap(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_ChangeMatchLock(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings = p->arg;
@ -4780,7 +4770,7 @@ CTFAdmin_ChangeMatchLock(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, p);
}
void
static void
CTFAdmin_UpdateSettings(edict_t *ent, pmenuhnd_t *setmenu)
{
int i = 2;
@ -4846,7 +4836,7 @@ pmenu_t def_setmenu[] = {
{"Cancel", PMENU_ALIGN_LEFT, CTFAdmin_SettingsCancel}
};
void
static void
CTFAdmin_Settings(edict_t *ent, pmenuhnd_t *p)
{
admin_settings_t *settings;
@ -4872,7 +4862,7 @@ CTFAdmin_Settings(edict_t *ent, pmenuhnd_t *p)
CTFAdmin_UpdateSettings(ent, menu);
}
void
static void
CTFAdmin_MatchSet(edict_t *ent, pmenuhnd_t *p)
{
PMenu_Close(ent);
@ -4897,7 +4887,7 @@ CTFAdmin_MatchSet(edict_t *ent, pmenuhnd_t *p)
}
}
void
static void
CTFAdmin_MatchMode(edict_t *ent, pmenuhnd_t *p)
{
PMenu_Close(ent);
@ -4914,7 +4904,7 @@ CTFAdmin_MatchMode(edict_t *ent, pmenuhnd_t *p)
}
}
void
static void
CTFAdmin_Reset(edict_t *ent, pmenuhnd_t *p)
{
PMenu_Close(ent);
@ -4926,7 +4916,7 @@ CTFAdmin_Reset(edict_t *ent, pmenuhnd_t *p)
CTFResetAllPlayers();
}
void
static void
CTFAdmin_Cancel(edict_t *ent, pmenuhnd_t *p)
{
PMenu_Close(ent);

View file

@ -1728,6 +1728,7 @@ void SP_trigger_teleport(edict_t *ent);
void SP_info_teleport_destination(edict_t *ent);
void CTFSetPowerUpEffect(edict_t *ent, int def);
void DeathmatchScoreboard(edict_t *ent);
/*
* Uncomment for check that exported functions declarations are same as in

View file

@ -82,25 +82,6 @@ ChasecamStart(edict_t *ent)
CheckChasecam_Viewent(ent);
}
/* ent = chasecam */
void
ChasecamRestart(edict_t *ent)
{
/* Keep thinking this function to check all the time whether the
* player is out of the water */
/* If the player is dead, the camera is not wanted... Kill me and stop
* the function. (return;) */
if (ent->owner->health <= 0)
{
G_FreeEdict(ent);
return;
}
// Put camera back
ChasecamStart(ent->owner);
// Remove this temporary ent
G_FreeEdict(ent);
}
/* Here, the "ent" is referring to the client, the player that owns the
* chasecam, and the "opt" integer is telling the function whether to
* totally get rid of the camera, or to put it into the background while

View file

@ -241,7 +241,8 @@ void SV_Nextserver(void);
void SV_ExecuteClientMessage(client_t *cl);
void SV_ReadLevelFile(void);
void SV_Status_f(void);
char *SV_StatusString(void);
void SV_ConnectionlessPacket(void);
void SV_WriteFrameToClient(client_t *client, sizebuf_t *msg);
void SV_RecordDemoMessage(void);

View file

@ -31,7 +31,7 @@
/*
* Specify a list of master servers
*/
void
static void
SV_SetMaster_f(void)
{
int i, slot;
@ -86,7 +86,7 @@ SV_SetMaster_f(void)
/*
* Sets sv_client and sv_player to the player with idnum Cmd_Argv(1)
*/
qboolean
static qboolean
SV_SetPlayer(void)
{
client_t *cl;
@ -147,7 +147,7 @@ SV_SetPlayer(void)
/*
* Puts the server in demo mode on a specific map/cinematic
*/
void
static void
SV_DemoMap_f(void)
{
if (Cmd_Argc() != 2)
@ -172,7 +172,7 @@ SV_DemoMap_f(void)
* Clears the archived maps, plays the inter.cin cinematic, then
* goes to map jail.bsp.
*/
void
static void
SV_GameMap_f(void)
{
char *map;
@ -278,7 +278,7 @@ SV_GameMap_f(void)
* Goes directly to a given map without any savegame archiving.
* For development work
*/
void
static void
SV_Map_f(void)
{
char *map;
@ -312,7 +312,8 @@ SV_Map_f(void)
/*
* Lists available maps for user to load.
*/
void SV_ListMaps_f(void)
static void
SV_ListMaps_f(void)
{
char **userMapNames;
int nUserMaps = 0;
@ -346,7 +347,7 @@ void SV_ListMaps_f(void)
/*
* Kick a user off of the server
*/
void
static void
SV_Kick_f(void)
{
if (!svs.initialized)
@ -378,7 +379,7 @@ SV_Kick_f(void)
sv_client->lastmessage = svs.realtime; /* min case there is a funny zombie */
}
void
static void
SV_Status_f(void)
{
int i, j, l;
@ -448,7 +449,7 @@ SV_Status_f(void)
Com_Printf("\n");
}
void
static void
SV_ConSay_f(void)
{
client_t *client;
@ -489,7 +490,7 @@ SV_ConSay_f(void)
}
}
void
static void
SV_Heartbeat_f(void)
{
svs.last_heartbeat = -9999999;
@ -498,7 +499,7 @@ SV_Heartbeat_f(void)
/*
* Examine or change the serverinfo string
*/
void
static void
SV_Serverinfo_f(void)
{
Com_Printf("Server info settings:\n");
@ -508,7 +509,7 @@ SV_Serverinfo_f(void)
/*
* Examine all a users info strings
*/
void
static void
SV_DumpUser_f(void)
{
if (!svs.initialized)
@ -537,7 +538,7 @@ SV_DumpUser_f(void)
* Begins server demo recording. Every entity and every message will be
* recorded, but no playerinfo will be stored. Primarily for demo merging.
*/
void
static void
SV_ServerRecord_f(void)
{
char name[MAX_OSPATH];
@ -634,7 +635,7 @@ SV_ServerRecord_f(void)
/*
* Ends server demo recording
*/
void
static void
SV_ServerStop_f(void)
{
if (!svs.demofile)
@ -651,7 +652,7 @@ SV_ServerStop_f(void)
/*
* Kick everyone off, possibly in preparation for a new game
*/
void
static void
SV_KillServer_f(void)
{
if (!svs.initialized)
@ -666,7 +667,7 @@ SV_KillServer_f(void)
/*
* Let the game dll handle a command
*/
void
static void
SV_ServerCommand_f(void)
{
if (!ge)
@ -678,7 +679,7 @@ SV_ServerCommand_f(void)
ge->ServerCommand();
}
void
static void
SV_Gamemode_f(void)
{
int none;

View file

@ -28,18 +28,17 @@
extern cvar_t *hostname;
extern cvar_t *rcon_password;
char *SV_StatusString(void);
/*
* Responds with all the info that qplug or qspy can see
*/
void
static void
SVC_Status(void)
{
Netchan_OutOfBandPrint(NS_SERVER, net_from, "print\n%s", SV_StatusString());
}
void
static void
SVC_Ack(void)
{
Com_Printf("Ping acknowledge from %s\n", NET_AdrToString(net_from));
@ -49,7 +48,7 @@ SVC_Ack(void)
* Responds with short info for broadcast scans
* The second parameter should be the current protocol version number.
*/
void
static void
SVC_Info(void)
{
char string[64];
@ -91,7 +90,7 @@ SVC_Info(void)
/*
* SVC_Ping
*/
void
static void
SVC_Ping(void)
{
Netchan_OutOfBandPrint(NS_SERVER, net_from, "ack");
@ -104,7 +103,7 @@ SVC_Ping(void)
* flood the server with invalid connection IPs. With a
* challenge, they must give a valid IP address.
*/
void
static void
SVC_GetChallenge(void)
{
int i;
@ -146,7 +145,7 @@ SVC_GetChallenge(void)
/*
* A connection request that did not come from the master
*/
void
static void
SVC_DirectConnect(void)
{
char userinfo[MAX_INFO_STRING];
@ -321,7 +320,7 @@ gotnewcl:
newcl->lastconnect = svs.realtime;
}
int
static int
Rcon_Validate(void)
{
if (!strlen(rcon_password->string))
@ -342,7 +341,7 @@ Rcon_Validate(void)
* Shift down the remaining args
* Redirect all printfs
*/
void
static void
SVC_RemoteCommand(void)
{
int i;

View file

@ -36,7 +36,7 @@ static YQ2_ALIGNAS_TYPE(int32_t) byte fatpvs[65536 / 8];
/*
* Writes a delta update of an entity_state_t list to the message.
*/
void
static void
SV_EmitPacketEntities(client_frame_t *from, client_frame_t *to, sizebuf_t *msg)
{
entity_state_t *oldent, *newent;
@ -146,7 +146,7 @@ SV_EmitPacketEntities(client_frame_t *from, client_frame_t *to, sizebuf_t *msg)
MSG_WriteShort(msg, 0);
}
void
static void
SV_WritePlayerstateToClient(client_frame_t *from, client_frame_t *to,
sizebuf_t *msg)
{
@ -439,7 +439,7 @@ SV_WriteFrameToClient(client_t *client, sizebuf_t *msg)
* The client will interpolate the view position,
* so we can't use a single PVS point
*/
void
static void
SV_FatPVS(vec3_t org)
{
int leafs[64];

View file

@ -52,9 +52,6 @@ cvar_t *public_server; /* should heartbeats be sent */
cvar_t *sv_entfile; /* External entity files. */
cvar_t *sv_downloadserver; /* Download server. */
void Master_Shutdown(void);
void SV_ConnectionlessPacket(void);
/*
* Called when the player is totally leaving the server, either willingly
* or unwillingly. This is NOT called if the entire server is quiting
@ -126,7 +123,7 @@ SV_StatusString(void)
/*
* Updates the cl->ping variables
*/
void
static void
SV_CalcPings(void)
{
int i, j;
@ -172,7 +169,7 @@ SV_CalcPings(void)
* Every few frames, gives all clients an allotment of milliseconds
* for their command moves. If they exceed it, assume cheating.
*/
void
static void
SV_GiveMsec(void)
{
int i;
@ -196,7 +193,7 @@ SV_GiveMsec(void)
}
}
void
static void
SV_ReadPackets(void)
{
int i;
@ -239,7 +236,7 @@ SV_ReadPackets(void)
if (cl->netchan.remote_address.port != net_from.port)
{
Com_Printf("SV_ReadPackets: fixing up a translated port\n");
Com_Printf("%s: fixing up a translated port\n", __func__);
cl->netchan.remote_address.port = net_from.port;
}
@ -276,7 +273,7 @@ SV_ReadPackets(void)
* for a few seconds to make sure any final reliable message gets resent
* if necessary
*/
void
static void
SV_CheckTimeouts(void)
{
int i;
@ -331,7 +328,7 @@ SV_PrepWorldFrame(void)
}
}
void
static void
SV_RunGameFrame(void)
{
#ifndef DEDICATED_ONLY
@ -489,7 +486,7 @@ Master_Heartbeat(void)
/*
* Informs all masters that this server is going down
*/
void
static void
Master_Shutdown(void)
{
int i;

View file

@ -71,7 +71,7 @@ SV_WipeSavegame(char *savename)
Sys_FindClose();
}
void
static void
CopyFile(char *src, char *dst)
{
FILE *f1, *f2;
@ -327,7 +327,7 @@ SV_WriteServerFile(qboolean autosave)
Sys_SetWorkDir(workdir);
}
void
static void
SV_ReadServerFile(void)
{
fileHandle_t f;

View file

@ -428,7 +428,7 @@ SV_StartSound(vec3_t origin, edict_t *entity, int channel, int soundindex,
}
}
qboolean
static qboolean
SV_SendClientDatagram(client_t *client)
{
byte msg_buf[MAX_MSGLEN];
@ -490,7 +490,7 @@ SV_DemoCompleted(void)
* Returns true if the client is over its current
* bandwidth estimation and should not be sent another packet
*/
qboolean
static qboolean
SV_RateDrop(client_t *c)
{
int total;

View file

@ -30,7 +30,7 @@
edict_t *sv_player;
void
static void
SV_BeginDemoserver(void)
{
char name[MAX_OSPATH];
@ -48,7 +48,7 @@ SV_BeginDemoserver(void)
* Sends the first message from the server to a connected client.
* This will be sent on the initial connection and upon each server load.
*/
void
static void
SV_New_f(void)
{
static char *gamedir;
@ -111,7 +111,7 @@ SV_New_f(void)
}
}
void
static void
SV_Configstrings_f(void)
{
int start;
@ -164,7 +164,7 @@ SV_Configstrings_f(void)
}
}
void
static void
SV_Baselines_f(void)
{
int start;
@ -222,7 +222,7 @@ SV_Baselines_f(void)
}
}
void
static void
SV_Begin_f(void)
{
Com_DPrintf("Begin() from %s\n", sv_client->name);
@ -243,7 +243,7 @@ SV_Begin_f(void)
Cbuf_InsertFromDefer();
}
void
static void
SV_NextDownload_f(void)
{
int r;
@ -287,7 +287,7 @@ SV_NextDownload_f(void)
sv_client->download = NULL;
}
void
static void
SV_BeginDownload_f(void)
{
char *name;
@ -366,7 +366,7 @@ SV_BeginDownload_f(void)
/*
* The client is going to disconnect, so remove the connection immediately
*/
void
static void
SV_Disconnect_f(void)
{
SV_DropClient(sv_client);
@ -375,7 +375,7 @@ SV_Disconnect_f(void)
/*
* Dumps the serverinfo info string
*/
void
static void
SV_ShowServerinfo_f(void)
{
Info_Print(Cvar_Serverinfo());
@ -413,7 +413,7 @@ SV_Nextserver(void)
* A cinematic has completed or been aborted by a client, so move
* to the next server,
*/
void
static void
SV_Nextserver_f(void)
{
if ((int)strtol(Cmd_Argv(1), (char **)NULL, 10) != svs.spawncount)
@ -477,9 +477,8 @@ SV_ExecuteUserCommand(char *s)
}
}
void
static void
SV_ClientThink(client_t *cl, usercmd_t *cmd)
{
cl->commandMsec -= cmd->msec;

View file

@ -50,23 +50,23 @@ edict_t **area_list;
int area_count, area_maxcount;
int area_type;
int SV_HullForEntity(edict_t *ent);
static int SV_HullForEntity(edict_t *ent);
/* ClearLink is used for new headnodes */
void
static void
ClearLink(link_t *l)
{
l->prev = l->next = l;
}
void
static void
RemoveLink(link_t *l)
{
l->next->prev = l->prev;
l->prev->next = l->next;
}
void
static void
InsertLinkBefore(link_t *l, link_t *before)
{
l->next = before;
@ -78,7 +78,7 @@ InsertLinkBefore(link_t *l, link_t *before)
/*
* Builds a uniformly subdivided tree for the given world size
*/
areanode_t *
static areanode_t *
SV_CreateAreaNode(int depth, vec3_t mins, vec3_t maxs)
{
areanode_t *anode;
@ -403,7 +403,7 @@ SV_LinkEdict(edict_t *ent)
}
}
void
static void
SV_AreaEdicts_r(areanode_t *node)
{
link_t *l, *next, *start;
@ -534,7 +534,7 @@ typedef struct
* adjustment that must be added to the testing object's origin
* to get a point to use with the returned hull.
*/
int
static int
SV_HullForEntity(edict_t *ent)
{
/* decide which clipping hull to use, based on the size */
@ -557,7 +557,7 @@ SV_HullForEntity(edict_t *ent)
return CM_HeadnodeForBox(ent->mins, ent->maxs);
}
void
static void
SV_ClipMoveToEntities(moveclip_t *clip)
{
int i, num;
@ -649,7 +649,7 @@ SV_ClipMoveToEntities(moveclip_t *clip)
}
}
void
static void
SV_TraceBounds(vec3_t start, vec3_t mins, vec3_t maxs,
vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
{