Skip to content

Commit

Permalink
reorder structs, alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Aug 14, 2020
1 parent eb1db52 commit e399a2f
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 56 deletions.
17 changes: 9 additions & 8 deletions core_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@

RETRO_BEGIN_DECLS

enum core_info_list_qsort_type
{
CORE_INFO_LIST_SORT_PATH = 0,
CORE_INFO_LIST_SORT_DISPLAY_NAME,
CORE_INFO_LIST_SORT_CORE_NAME,
CORE_INFO_LIST_SORT_SYSTEM_NAME
};


typedef struct
{
char *path;
Expand Down Expand Up @@ -121,14 +130,6 @@ typedef struct core_info_ctx_find
const char *path;
} core_info_ctx_find_t;

enum core_info_list_qsort_type
{
CORE_INFO_LIST_SORT_PATH = 0,
CORE_INFO_LIST_SORT_DISPLAY_NAME,
CORE_INFO_LIST_SORT_CORE_NAME,
CORE_INFO_LIST_SORT_SYSTEM_NAME
};

struct core_info_state
{
#ifdef HAVE_COMPRESSION
Expand Down
4 changes: 2 additions & 2 deletions core_updater_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ typedef struct
char *display_name;
char *description;
struct string_list *licenses_list;
bool is_experimental;
core_updater_list_date_t date; /* unsigned alignment */
uint32_t crc;
core_updater_list_date_t date;
bool is_experimental;
} core_updater_list_entry_t;

/* Prevent direct access to core_updater_list_t
Expand Down
2 changes: 1 addition & 1 deletion gfx/video_coord_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ typedef struct video_mut_coords
float *color;
float *tex_coord;
float *lut_tex_coord;
unsigned vertices;
unsigned *index;
unsigned vertices;
unsigned indexes;
} video_mut_coords_t;

Expand Down
2 changes: 1 addition & 1 deletion menu/drivers/materialui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ enum materialui_entry_value_type
typedef struct
{
font_data_t *font;
video_font_raster_block_t raster_block;
video_font_raster_block_t raster_block; /* ptr alignment */
unsigned glyph_width;
int line_height;
int line_ascender;
Expand Down
37 changes: 19 additions & 18 deletions playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct content_playlist

struct playlist_entry *entries;

playlist_config_t config;
playlist_config_t config; /* size_t alignment */

enum playlist_label_display_mode label_display_mode;
enum playlist_thumbnail_mode right_thumbnail_mode;
Expand All @@ -75,18 +75,6 @@ struct content_playlist

typedef struct
{
bool in_items;
bool in_subsystem_roms;
bool capacity_exceeded;
bool out_of_memory;

unsigned array_depth;
unsigned object_depth;

JSON_Parser parser;
JSON_Writer writer;
intfstream_t *file;
playlist_t *playlist;
struct playlist_entry *current_entry;
char *current_meta_string;
char *current_items_string;
Expand All @@ -98,6 +86,19 @@ typedef struct
enum playlist_label_display_mode *current_meta_label_display_mode_val;
enum playlist_thumbnail_mode *current_meta_thumbnail_mode_val;
enum playlist_sort_mode *current_meta_sort_mode_val;
intfstream_t *file;
playlist_t *playlist;

unsigned array_depth;
unsigned object_depth;

bool in_items;
bool in_subsystem_roms;
bool capacity_exceeded;
bool out_of_memory;

JSON_Parser parser;
JSON_Writer writer;
} JSONContext;

/* TODO/FIXME - global state - perhaps move outside this file */
Expand Down Expand Up @@ -195,15 +196,15 @@ static void path_replace_base_path_and_convert_to_local_file_system(
strlen(in_path) - in_oldrefpath_length + 1);

#ifdef USING_WINDOWS_FILE_SYSTEM
/* If we are running under a win fs, '/' characters
* are not allowed anywhere. we replace with '\' and
* hope for the best... */
/* If we are running under a Windows filesystem,
* '/' characters are not allowed anywhere.
* We replace with '\' and hope for the best... */
string_replace_all_chars(out_path,
POSIX_PATH_DELIMITER, WINDOWS_PATH_DELIMITER);
#endif

#ifdef USING_POSIX_FILE_SYSTEM
/* Under posix fs, we replace '\' characters with '/' */
/* Under POSIX filesystem, we replace '\' characters with '/' */
string_replace_all_chars(out_path,
WINDOWS_PATH_DELIMITER, POSIX_PATH_DELIMITER);
#endif
Expand Down Expand Up @@ -233,7 +234,7 @@ static bool playlist_path_equal(const char *real_path,
entry_real_path[0] = '\0';

/* Sanity check */
if (string_is_empty(real_path) ||
if (string_is_empty(real_path) ||
string_is_empty(entry_path) ||
!config)
return false;
Expand Down
8 changes: 4 additions & 4 deletions tasks/task_audio_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@

struct audio_mixer_userdata
{
unsigned slot_selection_idx;
enum audio_mixer_stream_type stream_type;
enum audio_mixer_slot_selection_type slot_selection_type;
unsigned slot_selection_idx;
};

struct audio_mixer_handle
{
nbio_buf_t *buffer;
bool copy_data_over;
bool is_finished;
retro_task_callback_t cb;
enum audio_mixer_type type;
char path[4095];
retro_task_callback_t cb;
bool copy_data_over;
bool is_finished;
};

static void task_audio_mixer_load_free(retro_task_t *task)
Expand Down
39 changes: 19 additions & 20 deletions tasks/task_core_updater.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ enum core_updater_list_status
CORE_UPDATER_LIST_END
};

typedef struct core_updater_list_handle
{
core_updater_list_t* core_list;
bool refresh_menu;
retro_task_t *http_task;
bool http_task_finished;
bool http_task_complete;
bool http_task_success;
http_transfer_data_t *http_data;
enum core_updater_list_status status;
} core_updater_list_handle_t;

/* Download core */
enum core_updater_download_status
{
Expand All @@ -85,47 +73,58 @@ enum update_installed_cores_status
UPDATE_INSTALLED_CORES_END
};

typedef struct core_updater_list_handle
{
core_updater_list_t* core_list;
retro_task_t *http_task;
http_transfer_data_t *http_data;
enum core_updater_list_status status;
bool refresh_menu;
bool http_task_finished;
bool http_task_complete;
bool http_task_success;
} core_updater_list_handle_t;

typedef struct core_updater_download_handle
{
bool auto_backup;
size_t auto_backup_history_size;
char *path_dir_libretro;
char *path_dir_core_assets;
char *remote_filename;
char *remote_core_path;
char *local_download_path;
char *local_core_path;
char *display_name;
retro_task_t *http_task;
retro_task_t *decompress_task;
retro_task_t *backup_task;
size_t auto_backup_history_size;
uint32_t local_crc;
uint32_t remote_crc;
enum core_updater_download_status status;
bool crc_match;
retro_task_t *http_task;
bool http_task_finished;
bool http_task_complete;
retro_task_t *decompress_task;
bool auto_backup;
bool decompress_task_finished;
bool decompress_task_complete;
bool backup_enabled;
retro_task_t *backup_task;
enum core_updater_download_status status;
} core_updater_download_handle_t;

typedef struct update_installed_cores_handle
{
bool auto_backup;
size_t auto_backup_history_size;
char *path_dir_libretro;
char *path_dir_core_assets;
core_updater_list_t* core_list;
retro_task_t *list_task;
retro_task_t *download_task;
size_t auto_backup_history_size;
size_t list_size;
size_t list_index;
size_t installed_index;
unsigned num_updated;
unsigned num_locked;
enum update_installed_cores_status status;
bool auto_backup;
} update_installed_cores_handle_t;

/*********************/
Expand Down
2 changes: 1 addition & 1 deletion tasks/task_powerstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ typedef struct powerstate powerstate_t;

struct powerstate
{
enum frontend_powerstate state;
int percent;
enum frontend_powerstate state;
};

/* TODO/FIXME - global state - perhaps move outside this file */
Expand Down
2 changes: 1 addition & 1 deletion tasks/tasks_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ RETRO_BEGIN_DECLS
typedef struct nbio_buf
{
void *buf;
unsigned bufsize;
char *path;
unsigned bufsize;
} nbio_buf_t;

#ifdef HAVE_NETWORKING
Expand Down

0 comments on commit e399a2f

Please sign in to comment.