mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
* Use strlcat instead of strcat
* Silence implicit conversion warnings detected in Xcode
This commit is contained in:
parent
5872b357e6
commit
adee2dbe72
@ -1929,12 +1929,14 @@ bool gl3_filter_chain::init_feedback()
|
||||
|
||||
bool gl3_filter_chain::init_alias()
|
||||
{
|
||||
unsigned i, j;
|
||||
int i;
|
||||
|
||||
common.texture_semantic_map.clear();
|
||||
common.texture_semantic_uniform_map.clear();
|
||||
|
||||
for (i = 0; i < passes.size(); i++)
|
||||
{
|
||||
unsigned j;
|
||||
const std::string name = passes[i]->get_name();
|
||||
if (name.empty())
|
||||
continue;
|
||||
@ -1963,7 +1965,7 @@ bool gl3_filter_chain::init_alias()
|
||||
|
||||
for (i = 0; i < common.luts.size(); i++)
|
||||
{
|
||||
j = &common.luts[i] - common.luts.data();
|
||||
unsigned j = &common.luts[i] - common.luts.data();
|
||||
if (!slang_set_unique_map(common.texture_semantic_map,
|
||||
common.luts[i]->get_id(),
|
||||
slang_texture_semantic_map{ SLANG_TEXTURE_SEMANTIC_USER, j }))
|
||||
|
@ -2635,13 +2635,13 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
static char cc2[] = {"ㅗㅏㅘ ㅗㅐㅙ ㅗㅣㅚ ㅜㅓㅝ ㅜㅔㅞ ㅜㅣㅟ ㅡㅣㅢ"};
|
||||
static char cc3[] = {"ㄱㄱㄲ ㄱㅅㄳ ㄴㅈㄵ ㄴㅎㄶ ㄹㄱㄺ ㄹㅁㄻ ㄹㅂㄼ ㄹㅅㄽ ㄹㅌㄾ ㄹㅍㄿ ㄹㅎㅀ ㅂㅅㅄ ㅅㅅㅆ"};
|
||||
static char s1[] = {"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣㆍㄱㄲㄳㄴㄵㄶㄷㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅄㅅㅆㅇㅈㅊㅋㅌㅍㅎ"};
|
||||
char *tmp1;
|
||||
char *tmp2;
|
||||
char *tmp1 = NULL;
|
||||
char *tmp2 = NULL;
|
||||
int c1 = -1;
|
||||
int c2 = -1;
|
||||
int c3 = 0;
|
||||
int nv = -1;
|
||||
char utf8[8] = {0,};
|
||||
char utf8[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
unsigned ret = *((unsigned*)pcur);
|
||||
|
||||
/* check korean */
|
||||
@ -2650,9 +2650,9 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
if (!padd[0] || !padd[1] || !padd[2] || padd[3])
|
||||
return ret;
|
||||
if ((tmp1 = strstr(s1, pcur)))
|
||||
c1 = (tmp1 - s1) / 3;
|
||||
c1 = (int)((tmp1 - s1) / 3);
|
||||
if ((tmp1 = strstr(s1, padd)))
|
||||
nv = (tmp1 - s1) / 3;
|
||||
nv = (int)((tmp1 - s1) / 3);
|
||||
if (nv == -1 || nv >= 19 + 21)
|
||||
return ret;
|
||||
|
||||
@ -2692,13 +2692,13 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
|
||||
if (c1 == -1 && c2 == -1 && c3 == 0)
|
||||
return ret;
|
||||
|
||||
if (c2 == -1 && c3 == 0)
|
||||
{
|
||||
/* 2nd element attach */
|
||||
if (nv < 19)
|
||||
return ret;
|
||||
c2 = nv-19;
|
||||
ret = 0;
|
||||
c2 = nv - 19;
|
||||
}
|
||||
else
|
||||
if (c2 >= 0 && c3 == 0)
|
||||
@ -2708,7 +2708,7 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
/* 3rd element attach */
|
||||
if (!(tmp1 = strstr(s1 + (19 + 21) * 3, padd)))
|
||||
return ret;
|
||||
c3 = (tmp1-s1)/3 - 19 - 21;
|
||||
c3 = (int)((tmp1 - s1) / 3 - 19 - 21);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2722,7 +2722,7 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
utf8[3] = 0;
|
||||
if (!(tmp1 = strstr(s1 + (19) * 3, utf8)))
|
||||
return ret;
|
||||
c2 = (tmp1 - s1) / 3 - 19;
|
||||
c2 = (int)((tmp1 - s1) / 3 - 19);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2733,7 +2733,7 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
if (nv < 19)
|
||||
{
|
||||
/* 3rd element transform */
|
||||
strcat(utf8,padd);
|
||||
strlcat(utf8, padd, sizeof(utf8));
|
||||
if ( !(tmp2 = strstr(cc3, utf8))
|
||||
|| (tmp2 >= cc3 + sizeof(cc3) - 10))
|
||||
return ret;
|
||||
@ -2741,40 +2741,39 @@ static unsigned get_kr_composition( char* pcur, char* padd)
|
||||
utf8[3] = 0;
|
||||
if (!(tmp1 = strstr(s1 + (19 + 21) * 3, utf8)))
|
||||
return ret;
|
||||
c3 = (tmp1-s1)/3 -19-21;
|
||||
c3 = (int)((tmp1 - s1) / 3 - 19 - 21);
|
||||
}
|
||||
else
|
||||
{
|
||||
int tv = 0;
|
||||
if ((tmp2 = strstr(cc3, utf8)))
|
||||
tv = (tmp2-cc3)%10;
|
||||
tv = (tmp2 - cc3) % 10;
|
||||
if (tv==6)
|
||||
{
|
||||
/* complex 3rd element -> disassemble */
|
||||
strlcpy(utf8, tmp2 - 3, 4);
|
||||
if (!(tmp1 = strstr(s1, utf8)))
|
||||
return ret;
|
||||
tv = (tmp1 - s1) / 3;
|
||||
tv = (int)((tmp1 - s1) / 3);
|
||||
strlcpy(utf8, tmp2 - 6, 4);
|
||||
if (!(tmp1 = strstr(s1 + (19 + 21) * 3, utf8)))
|
||||
return ret;
|
||||
c3 = (tmp1 - s1) / 3 - 19 - 21;
|
||||
c3 = (int)((tmp1 - s1) / 3 - 19 - 21);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(tmp1 = strstr(s1, utf8)) || (tmp1 - s1) >= 19 * 3)
|
||||
return ret;
|
||||
tv = (tmp1-s1)/3;
|
||||
tv = (int)((tmp1 - s1) / 3);
|
||||
c3 = 0;
|
||||
}
|
||||
*((unsigned*)padd) = get_kr_utf8(tv,nv-19,0);
|
||||
ret = get_kr_utf8(c1,c2,c3);
|
||||
return ret;
|
||||
*((unsigned*)padd) = get_kr_utf8(tv, nv - 19, 0);
|
||||
return get_kr_utf8(c1, c2, c3);
|
||||
}
|
||||
}
|
||||
else
|
||||
return ret;
|
||||
*((unsigned*)padd) = get_kr_utf8(c1,c2,c3);
|
||||
*((unsigned*)padd) = get_kr_utf8(c1, c2, c3);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -2835,7 +2834,7 @@ static bool input_keyboard_line_event(
|
||||
word = state->buffer;
|
||||
if (character)
|
||||
input_keyboard_line_append( state, (char*)&character, strlen((char*)&character));
|
||||
word = state->buffer;
|
||||
word = state->buffer;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -5092,7 +5092,7 @@ static void rgui_render(
|
||||
unsigned new_ptr;
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &old_start);
|
||||
|
||||
/* Note: It's okay for this to go out of range
|
||||
/* NOTE: It's okay for this to go out of range
|
||||
* (limits are checked in rgui_pointer_up()) */
|
||||
new_ptr = (unsigned)((rgui->pointer.y - rgui->term_layout.start_y) / rgui->font_height_stride) + old_start;
|
||||
|
||||
|
@ -741,7 +741,7 @@ explore_state_t *menu_explore_build_list(const char *directory_playlist,
|
||||
|
||||
if (src->entry_index == (uint32_t)-1)
|
||||
{
|
||||
src->entry_index = RBUF_LEN(state->entries);
|
||||
src->entry_index = (uint32_t)RBUF_LEN(state->entries);
|
||||
RBUF_RESIZE(state->entries, src->entry_index + 1);
|
||||
}
|
||||
e = &state->entries[src->entry_index];
|
||||
@ -1166,10 +1166,8 @@ static void explore_load_view(explore_state_t *state, const char* path)
|
||||
state->view_levels = 0;
|
||||
state->view_search[0] = '\0';
|
||||
|
||||
file = intfstream_open_file(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (!file)
|
||||
if (!(file = intfstream_open_file(path,
|
||||
RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE)))
|
||||
return;
|
||||
|
||||
json = rjson_open_stream(file);
|
||||
@ -1244,10 +1242,11 @@ static void explore_load_view(explore_state_t *state, const char* path)
|
||||
for (i = 0, ifrom = 0, ito = imax, cmp = 1; ito && cmp;)
|
||||
{
|
||||
size_t remain = ito % 2;
|
||||
ito = ito / 2;
|
||||
i = ifrom + ito;
|
||||
cmp = compare_func(&evalue, &entries[i]);
|
||||
ifrom = (cmp < 0 ? ifrom : (i + remain));
|
||||
ito = ito / 2;
|
||||
i = ifrom + ito;
|
||||
cmp = compare_func(&evalue, &entries[i]);
|
||||
if (cmp >= 0)
|
||||
ifrom = (uint32_t)(i + remain);
|
||||
}
|
||||
|
||||
if (op == EXPLORE_OP_EQUAL && !cmp)
|
||||
@ -1661,7 +1660,7 @@ SKIP_ENTRY:;
|
||||
* and information screen think we're viewing via playlist */
|
||||
menu_displaylist_info_init(&info);
|
||||
playlist_set_cached_external(pl);
|
||||
menu->rpl_entry_selection_ptr = (pl_entry - pl_first);
|
||||
menu->rpl_entry_selection_ptr = (unsigned)(pl_entry - pl_first);
|
||||
strlcpy(menu->deferred_path,
|
||||
pl_entry->path, sizeof(menu->deferred_path));
|
||||
info.list = list;
|
||||
|
Loading…
x
Reference in New Issue
Block a user