Skip to content

Commit

Permalink
Struct reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Aug 14, 2020
1 parent 1aceac6 commit 87c0fb6
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 58 deletions.
4 changes: 2 additions & 2 deletions tasks/task_manual_content_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ enum manual_scan_status
typedef struct manual_scan_handle
{
manual_content_scan_task_config_t *task_config;
playlist_config_t playlist_config;
playlist_t *playlist;
struct string_list *content_list;
logiqx_dat_t *dat_file;
struct string_list *m3u_list;
playlist_config_t playlist_config; /* size_t alignment */
size_t list_size;
size_t list_index;
struct string_list *m3u_list;
size_t m3u_index;
enum manual_scan_status status;
} manual_scan_handle_t;
Expand Down
8 changes: 4 additions & 4 deletions tasks/task_netplay_find_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@

typedef struct
{
char content_crc[PATH_MAX_LENGTH];
char content_path[PATH_MAX_LENGTH];
struct string_list *lpl_list;
playlist_config_t playlist_config; /* size_t alignment */
char hostname[512];
char subsystem_name[512];
char content_crc[PATH_MAX_LENGTH];
char content_path[PATH_MAX_LENGTH];
char core_name[PATH_MAX_LENGTH];
char core_path[PATH_MAX_LENGTH];
char core_extensions[PATH_MAX_LENGTH];
bool found;
bool current;
bool contentless;
struct string_list *lpl_list;
playlist_config_t playlist_config;
} netplay_crc_handle_t;

static void netplay_crc_scan_callback(retro_task_t *task,
Expand Down
21 changes: 11 additions & 10 deletions tasks/task_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,27 @@ typedef struct overlay_loader overlay_loader_t;

struct overlay_loader
{
bool driver_rgba_support;
bool overlay_enable;
bool overlay_hide_in_menu;

enum overlay_status state;
enum overlay_image_transfer_status loading_status;
config_file_t *conf;
char *overlay_path;
struct overlay *overlays;
struct overlay *active;

size_t resolve_pos;
unsigned size;
unsigned pos;
unsigned pos_increment;

float overlay_opacity;
float overlay_scale;
float overlay_center_x;
float overlay_center_y;

config_file_t *conf;
char *overlay_path;
struct overlay *overlays;
struct overlay *active;
enum overlay_status state;
enum overlay_image_transfer_status loading_status;

bool driver_rgba_support;
bool overlay_enable;
bool overlay_hide_in_menu;
};

static void task_overlay_image_done(struct overlay *overlay)
Expand Down
12 changes: 6 additions & 6 deletions tasks/task_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ enum patch_error

struct bps_data
{
const uint8_t *modify_data;
const uint8_t *source_data;
uint8_t *target_data;
size_t modify_length;
size_t source_length;
size_t target_length;
Expand All @@ -72,13 +75,13 @@ struct bps_data
uint32_t modify_checksum;
uint32_t source_checksum;
uint32_t target_checksum;
const uint8_t *modify_data;
const uint8_t *source_data;
uint8_t *target_data;
};

struct ups_data
{
const uint8_t *patch_data;
const uint8_t *source_data;
uint8_t *target_data;
unsigned patch_length;
unsigned source_length;
unsigned target_length;
Expand All @@ -88,9 +91,6 @@ struct ups_data
unsigned patch_checksum;
unsigned source_checksum;
unsigned target_checksum;
const uint8_t *patch_data;
const uint8_t *source_data;
uint8_t *target_data;
};

typedef enum patch_error (*patch_func_t)(const uint8_t*, uint64_t,
Expand Down
26 changes: 14 additions & 12 deletions tasks/task_pl_thumbnail_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,31 @@ enum pl_thumb_status

typedef struct pl_thumb_handle
{
bool overwrite;
bool right_thumbnail_exists;
bool left_thumbnail_exists;
bool http_task_complete;
enum pl_thumb_status status;

size_t list_size;
size_t list_index;
unsigned type_idx;

char *system;
char *playlist_path;
char *dir_thumbnails;
playlist_t *playlist;
playlist_config_t playlist_config;
gfx_thumbnail_path_data_t *thumbnail_path_data;
retro_task_t *http_task;

playlist_config_t playlist_config; /* size_t alignment */

size_t list_size;
size_t list_index;
unsigned type_idx;

enum pl_thumb_status status;

bool overwrite;
bool right_thumbnail_exists;
bool left_thumbnail_exists;
bool http_task_complete;
} pl_thumb_handle_t;

typedef struct pl_entry_id
{
size_t idx;
char *playlist_path;
size_t idx;
} pl_entry_id_t;

/*********************/
Expand Down
10 changes: 5 additions & 5 deletions tasks/task_playlist_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ enum pl_manager_status

typedef struct pl_manager_handle
{
enum pl_manager_status status;
size_t list_size;
size_t list_index;
struct string_list *m3u_list;
size_t m3u_index;
char *playlist_name;
playlist_config_t playlist_config;
playlist_t *playlist;
size_t list_size;
size_t list_index;
size_t m3u_index;
playlist_config_t playlist_config; /* size_t alignment */
enum pl_manager_status status;
} pl_manager_handle_t;

/*********************/
Expand Down
16 changes: 8 additions & 8 deletions tasks/task_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,33 @@ struct ram_type
struct save_state_buf
{
void* data;
char path[PATH_MAX_LENGTH];
size_t size;
char path[PATH_MAX_LENGTH];
};

struct sram_block
{
unsigned type;
void *data;
size_t size;
unsigned type;
};

typedef struct
{
intfstream_t *file;
char path[PATH_MAX_LENGTH];
void *data;
void *undo_data;
ssize_t size;
ssize_t undo_size;
ssize_t written;
ssize_t bytes_read;
int state_slot;
char path[PATH_MAX_LENGTH];
bool load_to_backup_buffer;
bool autoload;
bool autosave;
bool undo_save;
bool mute;
int state_slot;
bool thumbnail_enable;
bool has_valid_framebuffer;
bool compress_files;
Expand All @@ -117,17 +117,17 @@ struct autosave_st

struct autosave
{
volatile bool quit;
size_t bufsize;
unsigned interval;
bool compress_files;
void *buffer;
const void *retro_buffer;
const char *path;
slock_t *lock;
slock_t *cond_lock;
scond_t *cond;
sthread_t *thread;
size_t bufsize;
unsigned interval;
volatile bool quit;
bool compress_files;
};
#endif

Expand Down
21 changes: 10 additions & 11 deletions tasks/task_screenshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ typedef struct screenshot_task_state screenshot_task_state_t;

struct screenshot_task_state
{
bool bgr24;
bool silence;
bool is_idle;
bool is_paused;
bool history_list_enable;
bool widgets_ready;
struct scaler_ctx scaler;
uint8_t *out_buffer;
const void *frame;
void *userbuf;

int pitch;
unsigned width;
Expand All @@ -76,11 +74,12 @@ struct screenshot_task_state
char filename[PATH_MAX_LENGTH];
char shotname[256];

struct scaler_ctx scaler;

uint8_t *out_buffer;
const void *frame;
void *userbuf;
bool bgr24;
bool silence;
bool is_idle;
bool is_paused;
bool history_list_enable;
bool widgets_ready;
};

static bool screenshot_dump_direct(screenshot_task_state_t *state)
Expand Down

0 comments on commit 87c0fb6

Please sign in to comment.