Add TODO/FIXME comments
This commit is contained in:
parent
a3cce404b6
commit
9fda2bdebd
|
@ -55,6 +55,8 @@
|
||||||
#include "../tasks/tasks_internal.h"
|
#include "../tasks/tasks_internal.h"
|
||||||
#include "../file_path_special.h"
|
#include "../file_path_special.h"
|
||||||
|
|
||||||
|
#define CDN_URL "https://cdn.discordapp.com/avatars"
|
||||||
|
|
||||||
/* The discord API specifies these variables:
|
/* The discord API specifies these variables:
|
||||||
- userId --------- char[24] - the userId of the player asking to join
|
- userId --------- char[24] - the userId of the player asking to join
|
||||||
- username ------- char[344] - the username of the player asking to join
|
- username ------- char[344] - the username of the player asking to join
|
||||||
|
@ -89,8 +91,6 @@ typedef struct discord_state discord_state_t;
|
||||||
/* TODO/FIXME - static public global variables */
|
/* TODO/FIXME - static public global variables */
|
||||||
static discord_state_t discord_st;
|
static discord_state_t discord_st;
|
||||||
|
|
||||||
#define CDN_URL "https://cdn.discordapp.com/avatars"
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
#if defined(__cplusplus) && !defined(CXX_BUILD)
|
#if defined(__cplusplus) && !defined(CXX_BUILD)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
|
|
||||||
#include "net_http_special.h"
|
#include "net_http_special.h"
|
||||||
|
|
||||||
int net_http_get(const char **result, size_t *size, const char *url, retro_time_t *timeout)
|
int net_http_get(const char **result, size_t *size,
|
||||||
|
const char *url, retro_time_t *timeout)
|
||||||
{
|
{
|
||||||
size_t length;
|
size_t length;
|
||||||
uint8_t* data = NULL;
|
uint8_t* data = NULL;
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#error "An UDP port for the PC logging server was not set in the Makefile, cannot continue."
|
#error "An UDP port for the PC logging server was not set in the Makefile, cannot continue."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* TODO/FIXME - static global variables */
|
||||||
static int g_sid;
|
static int g_sid;
|
||||||
static struct sockaddr_in target;
|
static struct sockaddr_in target;
|
||||||
|
|
||||||
|
|
|
@ -76,11 +76,13 @@ bool netplay_delta_frame_ready(netplay_t *netplay, struct delta_frame *delta,
|
||||||
*
|
*
|
||||||
* Get the CRC for the serialization of this frame.
|
* Get the CRC for the serialization of this frame.
|
||||||
*/
|
*/
|
||||||
uint32_t netplay_delta_frame_crc(netplay_t *netplay, struct delta_frame *delta)
|
uint32_t netplay_delta_frame_crc(netplay_t *netplay,
|
||||||
|
struct delta_frame *delta)
|
||||||
{
|
{
|
||||||
if (!netplay->state_size)
|
if (!netplay->state_size)
|
||||||
return 0;
|
return 0;
|
||||||
return encoding_crc32(0L, (const unsigned char*)delta->state, netplay->state_size);
|
return encoding_crc32(0L, (const unsigned char*)delta->state,
|
||||||
|
netplay->state_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -127,8 +129,10 @@ void netplay_delta_frame_free(struct delta_frame *delta)
|
||||||
*
|
*
|
||||||
* Get an input state for a particular client
|
* Get an input state for a particular client
|
||||||
*/
|
*/
|
||||||
netplay_input_state_t netplay_input_state_for(netplay_input_state_t *list,
|
netplay_input_state_t netplay_input_state_for(
|
||||||
uint32_t client_num, size_t size, bool must_create, bool must_not_create)
|
netplay_input_state_t *list,
|
||||||
|
uint32_t client_num, size_t size,
|
||||||
|
bool must_create, bool must_not_create)
|
||||||
{
|
{
|
||||||
netplay_input_state_t ret;
|
netplay_input_state_t ret;
|
||||||
while (*list)
|
while (*list)
|
||||||
|
|
|
@ -64,13 +64,14 @@ static unsigned server_port_deferred = 0;
|
||||||
static int reannounce = 0;
|
static int reannounce = 0;
|
||||||
static bool is_mitm = false;
|
static bool is_mitm = false;
|
||||||
|
|
||||||
static bool netplay_disconnect(netplay_t *netplay);
|
|
||||||
|
|
||||||
#ifdef HAVE_DISCORD
|
#ifdef HAVE_DISCORD
|
||||||
/* TODO/FIXME - global */
|
/* TODO/FIXME - global */
|
||||||
extern bool discord_is_inited;
|
extern bool discord_is_inited;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Forward declaration */
|
||||||
|
static bool netplay_disconnect(netplay_t *netplay);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* netplay_is_alive:
|
* netplay_is_alive:
|
||||||
* @netplay : pointer to netplay object
|
* @netplay : pointer to netplay object
|
||||||
|
|
|
@ -66,10 +66,10 @@ struct info_buf_s
|
||||||
} \
|
} \
|
||||||
else if (recvd < 0)
|
else if (recvd < 0)
|
||||||
|
|
||||||
|
#define NETPLAY_MAGIC 0x52414E50 /* RANP */
|
||||||
|
|
||||||
|
/* TODO/FIXME - static global variables */
|
||||||
static netplay_t *handshake_password_netplay = NULL;
|
static netplay_t *handshake_password_netplay = NULL;
|
||||||
|
|
||||||
const uint32_t netplay_magic = 0x52414E50; /* RANP */
|
|
||||||
|
|
||||||
static unsigned long simple_rand_next = 1;
|
static unsigned long simple_rand_next = 1;
|
||||||
|
|
||||||
/* TODO/FIXME - replace netplay_log_connection with calls
|
/* TODO/FIXME - replace netplay_log_connection with calls
|
||||||
|
@ -236,7 +236,7 @@ bool netplay_handshake_init_send(netplay_t *netplay,
|
||||||
unsigned conn_salt = 0;
|
unsigned conn_salt = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
header[0] = htonl(netplay_magic);
|
header[0] = htonl(NETPLAY_MAGIC);
|
||||||
header[1] = htonl(netplay_platform_magic());
|
header[1] = htonl(netplay_platform_magic());
|
||||||
header[2] = htonl(NETPLAY_COMPRESSION_SUPPORTED);
|
header[2] = htonl(NETPLAY_COMPRESSION_SUPPORTED);
|
||||||
header[3] = 0;
|
header[3] = 0;
|
||||||
|
@ -322,7 +322,7 @@ bool netplay_handshake_init(netplay_t *netplay,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ntohl(header[0]) != netplay_magic)
|
if (ntohl(header[0]) != NETPLAY_MAGIC)
|
||||||
{
|
{
|
||||||
dmsg = msg_hash_to_str(MSG_NETPLAY_NOT_RETROARCH);
|
dmsg = msg_hash_to_str(MSG_NETPLAY_NOT_RETROARCH);
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -28,7 +28,7 @@ const uint16_t netplay_key_ntoh_mapping[] = {
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool mapping_defined = false;
|
/* TODO/FIXME - static global variables */
|
||||||
static uint16_t mapping[RETROK_LAST];
|
static uint16_t mapping[RETROK_LAST];
|
||||||
|
|
||||||
/* The mapping of keys from libretro (host) to netplay (network) */
|
/* The mapping of keys from libretro (host) to netplay (network) */
|
||||||
|
@ -43,6 +43,8 @@ uint32_t netplay_key_hton(unsigned key)
|
||||||
* netplay_key_hton */
|
* netplay_key_hton */
|
||||||
void netplay_key_hton_init(void)
|
void netplay_key_hton_init(void)
|
||||||
{
|
{
|
||||||
|
static bool mapping_defined = false;
|
||||||
|
|
||||||
if (!mapping_defined)
|
if (!mapping_defined)
|
||||||
{
|
{
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
|
|
|
@ -49,6 +49,7 @@ typedef struct tag_Context
|
||||||
void *cur_member;
|
void *cur_member;
|
||||||
} Context;
|
} Context;
|
||||||
|
|
||||||
|
/* TODO/FIXME - static global variable */
|
||||||
static struct netplay_rooms *netplay_rooms_data;
|
static struct netplay_rooms *netplay_rooms_data;
|
||||||
|
|
||||||
static void parse_context_init(Context* pCtx)
|
static void parse_context_init(Context* pCtx)
|
||||||
|
|
|
@ -183,8 +183,6 @@ struct content_information_ctx
|
||||||
struct string_list *temporary_content;
|
struct string_list *temporary_content;
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool _launched_from_cli = true;
|
|
||||||
|
|
||||||
typedef struct content_state
|
typedef struct content_state
|
||||||
{
|
{
|
||||||
bool is_inited;
|
bool is_inited;
|
||||||
|
@ -207,6 +205,7 @@ typedef struct content_state
|
||||||
} content_state_t;
|
} content_state_t;
|
||||||
|
|
||||||
/* TODO/FIXME - global state - perhaps move outside this file */
|
/* TODO/FIXME - global state - perhaps move outside this file */
|
||||||
|
static bool _launched_from_cli = true;
|
||||||
static content_state_t content_st;
|
static content_state_t content_st;
|
||||||
|
|
||||||
#ifdef HAVE_CDROM
|
#ifdef HAVE_CDROM
|
||||||
|
|
|
@ -73,27 +73,20 @@ typedef struct db_handle
|
||||||
database_state_handle_t state;
|
database_state_handle_t state;
|
||||||
} db_handle_t;
|
} db_handle_t;
|
||||||
|
|
||||||
|
/* Forward declarations */
|
||||||
int cue_find_track(const char *cue_path, bool first,
|
int cue_find_track(const char *cue_path, bool first,
|
||||||
uint64_t *offset, uint64_t *size,
|
uint64_t *offset, uint64_t *size,
|
||||||
char *track_path, uint64_t max_len);
|
char *track_path, uint64_t max_len);
|
||||||
|
|
||||||
bool cue_next_file(intfstream_t *fd, const char *cue_path,
|
bool cue_next_file(intfstream_t *fd, const char *cue_path,
|
||||||
char *path, uint64_t max_len);
|
char *path, uint64_t max_len);
|
||||||
|
|
||||||
int gdi_find_track(const char *gdi_path, bool first,
|
int gdi_find_track(const char *gdi_path, bool first,
|
||||||
char *track_path, uint64_t max_len);
|
char *track_path, uint64_t max_len);
|
||||||
|
|
||||||
bool gdi_next_file(intfstream_t *fd, const char *gdi_path,
|
bool gdi_next_file(intfstream_t *fd, const char *gdi_path,
|
||||||
char *path, uint64_t max_len);
|
char *path, uint64_t max_len);
|
||||||
|
|
||||||
int detect_system(intfstream_t *fd, const char** system_name);
|
int detect_system(intfstream_t *fd, const char** system_name);
|
||||||
|
|
||||||
int detect_ps1_game(intfstream_t *fd, char *game_id);
|
int detect_ps1_game(intfstream_t *fd, char *game_id);
|
||||||
|
|
||||||
int detect_psp_game(intfstream_t *fd, char *game_id);
|
int detect_psp_game(intfstream_t *fd, char *game_id);
|
||||||
|
|
||||||
int detect_gc_game(intfstream_t *fd, char *game_id);
|
int detect_gc_game(intfstream_t *fd, char *game_id);
|
||||||
|
|
||||||
int detect_serial_ascii_game(intfstream_t *fd, char *game_id);
|
int detect_serial_ascii_game(intfstream_t *fd, char *game_id);
|
||||||
|
|
||||||
static void database_info_set_type(
|
static void database_info_set_type(
|
||||||
|
@ -158,7 +151,9 @@ static int task_database_iterate_start(retro_task_t *task,
|
||||||
task_free_title(task);
|
task_free_title(task);
|
||||||
task_set_title(task, strdup(msg));
|
task_set_title(task, strdup(msg));
|
||||||
if (db->list->size != 0)
|
if (db->list->size != 0)
|
||||||
task_set_progress(task, roundf((float)db->list_ptr / ((float)db->list->size / 100.0f)));
|
task_set_progress(task,
|
||||||
|
roundf((float)db->list_ptr /
|
||||||
|
((float)db->list->size / 100.0f)));
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "msg: %s\n", msg);
|
fprintf(stderr, "msg: %s\n", msg);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,9 +61,6 @@
|
||||||
#define SAVE_STATE_CHUNK 4096
|
#define SAVE_STATE_CHUNK 4096
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool save_state_in_background = false;
|
|
||||||
static struct string_list *task_save_files = NULL;
|
|
||||||
|
|
||||||
struct ram_type
|
struct ram_type
|
||||||
{
|
{
|
||||||
const char *path;
|
const char *path;
|
||||||
|
@ -145,7 +142,13 @@ static struct save_state_buf undo_load_buf;
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
/* TODO/FIXME - global state - perhaps move outside this file */
|
/* TODO/FIXME - global state - perhaps move outside this file */
|
||||||
static struct autosave_st autosave_state;
|
static struct autosave_st autosave_state;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* TODO/FIXME - global state - perhaps move outside this file */
|
||||||
|
static bool save_state_in_background = false;
|
||||||
|
static struct string_list *task_save_files = NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
/**
|
/**
|
||||||
* autosave_thread:
|
* autosave_thread:
|
||||||
* @data : pointer to autosave object
|
* @data : pointer to autosave object
|
||||||
|
|
Loading…
Reference in New Issue