Add TODO/FIXME comments

This commit is contained in:
twinaphex 2020-06-04 14:09:45 +02:00
parent a3cce404b6
commit 9fda2bdebd
11 changed files with 40 additions and 33 deletions

View File

@ -55,6 +55,8 @@
#include "../tasks/tasks_internal.h"
#include "../file_path_special.h"
#define CDN_URL "https://cdn.discordapp.com/avatars"
/* The discord API specifies these variables:
- userId --------- char[24] - the userId 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 */
static discord_state_t discord_st;
#define CDN_URL "https://cdn.discordapp.com/avatars"
/* Forward declarations */
#if defined(__cplusplus) && !defined(CXX_BUILD)
extern "C" {

View File

@ -22,7 +22,8 @@
#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;
uint8_t* data = NULL;

View File

@ -37,10 +37,11 @@
#error "An UDP port for the PC logging server was not set in the Makefile, cannot continue."
#endif
/* TODO/FIXME - static global variables */
static int g_sid;
static struct sockaddr_in target;
void logger_init (void)
void logger_init(void)
{
socket_target_t in_target;
const char *server = PC_DEVELOPMENT_IP_ADDRESS;
@ -65,7 +66,7 @@ void logger_init (void)
socket_set_target(&target, &in_target);
}
void logger_shutdown (void)
void logger_shutdown(void)
{
if (socket_close(g_sid) < 0)
printf("Could not close socket.\n");

View File

@ -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.
*/
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)
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
*/
netplay_input_state_t netplay_input_state_for(netplay_input_state_t *list,
uint32_t client_num, size_t size, bool must_create, bool must_not_create)
netplay_input_state_t netplay_input_state_for(
netplay_input_state_t *list,
uint32_t client_num, size_t size,
bool must_create, bool must_not_create)
{
netplay_input_state_t ret;
while (*list)

View File

@ -64,13 +64,14 @@ static unsigned server_port_deferred = 0;
static int reannounce = 0;
static bool is_mitm = false;
static bool netplay_disconnect(netplay_t *netplay);
#ifdef HAVE_DISCORD
/* TODO/FIXME - global */
extern bool discord_is_inited;
#endif
/* Forward declaration */
static bool netplay_disconnect(netplay_t *netplay);
/**
* netplay_is_alive:
* @netplay : pointer to netplay object

View File

@ -66,11 +66,11 @@ struct info_buf_s
} \
else if (recvd < 0)
#define NETPLAY_MAGIC 0x52414E50 /* RANP */
/* TODO/FIXME - static global variables */
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
* to inet_ntop_compat and move runloop message queue pushing
@ -205,7 +205,7 @@ static bool netplay_endian_mismatch(uint32_t pma, uint32_t pmb)
static int simple_rand(void)
{
simple_rand_next = simple_rand_next * 1103515245 + 12345;
return((unsigned)(simple_rand_next/65536) % 32768);
return((unsigned)(simple_rand_next / 65536) % 32768);
}
static void simple_srand(unsigned int seed)
@ -236,7 +236,7 @@ bool netplay_handshake_init_send(netplay_t *netplay,
unsigned conn_salt = 0;
settings_t *settings = config_get_ptr();
header[0] = htonl(netplay_magic);
header[0] = htonl(NETPLAY_MAGIC);
header[1] = htonl(netplay_platform_magic());
header[2] = htonl(NETPLAY_COMPRESSION_SUPPORTED);
header[3] = 0;
@ -322,7 +322,7 @@ bool netplay_handshake_init(netplay_t *netplay,
goto error;
}
if (ntohl(header[0]) != netplay_magic)
if (ntohl(header[0]) != NETPLAY_MAGIC)
{
dmsg = msg_hash_to_str(MSG_NETPLAY_NOT_RETROARCH);
goto error;

View File

@ -28,7 +28,7 @@ const uint16_t netplay_key_ntoh_mapping[] = {
0
};
static bool mapping_defined = false;
/* TODO/FIXME - static global variables */
static uint16_t mapping[RETROK_LAST];
/* The mapping of keys from libretro (host) to netplay (network) */
@ -43,6 +43,8 @@ uint32_t netplay_key_hton(unsigned key)
* netplay_key_hton */
void netplay_key_hton_init(void)
{
static bool mapping_defined = false;
if (!mapping_defined)
{
uint16_t i;

View File

@ -49,6 +49,7 @@ typedef struct tag_Context
void *cur_member;
} Context;
/* TODO/FIXME - static global variable */
static struct netplay_rooms *netplay_rooms_data;
static void parse_context_init(Context* pCtx)

View File

@ -183,8 +183,6 @@ struct content_information_ctx
struct string_list *temporary_content;
};
static bool _launched_from_cli = true;
typedef struct content_state
{
bool is_inited;
@ -207,6 +205,7 @@ typedef struct content_state
} content_state_t;
/* TODO/FIXME - global state - perhaps move outside this file */
static bool _launched_from_cli = true;
static content_state_t content_st;
#ifdef HAVE_CDROM

View File

@ -73,27 +73,20 @@ typedef struct db_handle
database_state_handle_t state;
} db_handle_t;
/* Forward declarations */
int cue_find_track(const char *cue_path, bool first,
uint64_t *offset, uint64_t *size,
char *track_path, uint64_t max_len);
bool cue_next_file(intfstream_t *fd, const char *cue_path,
char *path, uint64_t max_len);
int gdi_find_track(const char *gdi_path, bool first,
char *track_path, uint64_t max_len);
bool gdi_next_file(intfstream_t *fd, const char *gdi_path,
char *path, uint64_t max_len);
int detect_system(intfstream_t *fd, const char** system_name);
int detect_ps1_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_serial_ascii_game(intfstream_t *fd, char *game_id);
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_set_title(task, strdup(msg));
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
fprintf(stderr, "msg: %s\n", msg);
#endif

View File

@ -61,9 +61,6 @@
#define SAVE_STATE_CHUNK 4096
#endif
static bool save_state_in_background = false;
static struct string_list *task_save_files = NULL;
struct ram_type
{
const char *path;
@ -145,7 +142,13 @@ static struct save_state_buf undo_load_buf;
#ifdef HAVE_THREADS
/* TODO/FIXME - global state - perhaps move outside this file */
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:
* @data : pointer to autosave object